diff --git a/dist/index-FuldNPo7.cjs b/dist/index-OVNlT4CO.cjs similarity index 99% rename from dist/index-FuldNPo7.cjs rename to dist/index-OVNlT4CO.cjs index 01346f3..db48bf0 100644 --- a/dist/index-FuldNPo7.cjs +++ b/dist/index-OVNlT4CO.cjs @@ -12,6 +12,7 @@ var node_net = require('node:net'); var node_fs = require('node:fs'); require('node:path'); require('os'); +require('crypto'); require('fs'); require('path'); require('http'); @@ -35,12 +36,12 @@ require('url'); require('zlib'); require('string_decoder'); require('diagnostics_channel'); -require('crypto'); +require('child_process'); +require('timers'); require('fs/promises'); require('process'); require('http2'); require('dns'); -require('child_process'); require('node:crypto'); /** @@ -5466,7 +5467,7 @@ class Body { return formData; } - const {toFormData} = await Promise.resolve().then(function () { return require('./multipart-parser-B35i9fHP.cjs'); }); + const {toFormData} = await Promise.resolve().then(function () { return require('./multipart-parser-ygdoCU12.cjs'); }); return toFormData(this.body, ct); } @@ -7266,4 +7267,4 @@ exports.Request = Request; exports.Response = Response; exports.default = fetch; exports.isRedirect = isRedirect; -//# sourceMappingURL=index-FuldNPo7.cjs.map +//# sourceMappingURL=index-OVNlT4CO.cjs.map diff --git a/dist/index-FuldNPo7.cjs.map b/dist/index-OVNlT4CO.cjs.map similarity index 61% rename from dist/index-FuldNPo7.cjs.map rename to dist/index-OVNlT4CO.cjs.map index 9dfc8d5..a737e4f 100644 --- a/dist/index-FuldNPo7.cjs.map +++ b/dist/index-OVNlT4CO.cjs.map @@ -1 +1 @@ -{"version":3,"file":"index-FuldNPo7.cjs","sources":["../node_modules/data-uri-to-buffer/dist/index.js","../node_modules/web-streams-polyfill/dist/ponyfill.es2018.js","../node_modules/fetch-blob/streams.cjs","../node_modules/fetch-blob/index.js","../node_modules/fetch-blob/file.js","../node_modules/formdata-polyfill/esm.min.js","../node_modules/node-fetch/src/errors/base.js","../node_modules/node-fetch/src/errors/fetch-error.js","../node_modules/node-fetch/src/utils/is.js","../node_modules/node-fetch/src/body.js","../node_modules/node-fetch/src/headers.js","../node_modules/node-fetch/src/utils/is-redirect.js","../node_modules/node-fetch/src/response.js","../node_modules/node-fetch/src/utils/get-search.js","../node_modules/node-fetch/src/utils/referrer.js","../node_modules/node-fetch/src/request.js","../node_modules/node-fetch/src/errors/abort-error.js","../node_modules/node-domexception/index.js","../node_modules/fetch-blob/from.js","../node_modules/node-fetch/src/index.js"],"sourcesContent":["/**\n * Returns a `Buffer` instance from the given data URI `uri`.\n *\n * @param {String} uri Data URI to turn into a Buffer instance\n * @returns {Buffer} Buffer instance from Data URI\n * @api public\n */\nexport function dataUriToBuffer(uri) {\n if (!/^data:/i.test(uri)) {\n throw new TypeError('`uri` does not appear to be a Data URI (must begin with \"data:\")');\n }\n // strip newlines\n uri = uri.replace(/\\r?\\n/g, '');\n // split the URI up into the \"metadata\" and the \"data\" portions\n const firstComma = uri.indexOf(',');\n if (firstComma === -1 || firstComma <= 4) {\n throw new TypeError('malformed data: URI');\n }\n // remove the \"data:\" scheme and parse the metadata\n const meta = uri.substring(5, firstComma).split(';');\n let charset = '';\n let base64 = false;\n const type = meta[0] || 'text/plain';\n let typeFull = type;\n for (let i = 1; i < meta.length; i++) {\n if (meta[i] === 'base64') {\n base64 = true;\n }\n else if (meta[i]) {\n typeFull += `;${meta[i]}`;\n if (meta[i].indexOf('charset=') === 0) {\n charset = meta[i].substring(8);\n }\n }\n }\n // defaults to US-ASCII only if type is not provided\n if (!meta[0] && !charset.length) {\n typeFull += ';charset=US-ASCII';\n charset = 'US-ASCII';\n }\n // get the encoded data portion and decode URI-encoded chars\n const encoding = base64 ? 'base64' : 'ascii';\n const data = unescape(uri.substring(firstComma + 1));\n const buffer = Buffer.from(data, encoding);\n // set `.type` and `.typeFull` properties to MIME type\n buffer.type = type;\n buffer.typeFull = typeFull;\n // set the `.charset` property\n buffer.charset = charset;\n return buffer;\n}\nexport default dataUriToBuffer;\n//# sourceMappingURL=index.js.map","/**\n * @license\n * web-streams-polyfill v3.3.3\n * Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.\n * This code is released under the MIT license.\n * SPDX-License-Identifier: MIT\n */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.WebStreamsPolyfill = {}));\n})(this, (function (exports) { 'use strict';\n\n function noop() {\n return undefined;\n }\n\n function typeIsObject(x) {\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\n }\n const rethrowAssertionErrorRejection = noop;\n function setFunctionName(fn, name) {\n try {\n Object.defineProperty(fn, 'name', {\n value: name,\n configurable: true\n });\n }\n catch (_a) {\n // This property is non-configurable in older browsers, so ignore if this throws.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#browser_compatibility\n }\n }\n\n const originalPromise = Promise;\n const originalPromiseThen = Promise.prototype.then;\n const originalPromiseReject = Promise.reject.bind(originalPromise);\n // https://webidl.spec.whatwg.org/#a-new-promise\n function newPromise(executor) {\n return new originalPromise(executor);\n }\n // https://webidl.spec.whatwg.org/#a-promise-resolved-with\n function promiseResolvedWith(value) {\n return newPromise(resolve => resolve(value));\n }\n // https://webidl.spec.whatwg.org/#a-promise-rejected-with\n function promiseRejectedWith(reason) {\n return originalPromiseReject(reason);\n }\n function PerformPromiseThen(promise, onFulfilled, onRejected) {\n // There doesn't appear to be any way to correctly emulate the behaviour from JavaScript, so this is just an\n // approximation.\n return originalPromiseThen.call(promise, onFulfilled, onRejected);\n }\n // Bluebird logs a warning when a promise is created within a fulfillment handler, but then isn't returned\n // from that handler. To prevent this, return null instead of void from all handlers.\n // http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-created-in-a-handler-but-was-not-returned-from-it\n function uponPromise(promise, onFulfilled, onRejected) {\n PerformPromiseThen(PerformPromiseThen(promise, onFulfilled, onRejected), undefined, rethrowAssertionErrorRejection);\n }\n function uponFulfillment(promise, onFulfilled) {\n uponPromise(promise, onFulfilled);\n }\n function uponRejection(promise, onRejected) {\n uponPromise(promise, undefined, onRejected);\n }\n function transformPromiseWith(promise, fulfillmentHandler, rejectionHandler) {\n return PerformPromiseThen(promise, fulfillmentHandler, rejectionHandler);\n }\n function setPromiseIsHandledToTrue(promise) {\n PerformPromiseThen(promise, undefined, rethrowAssertionErrorRejection);\n }\n let _queueMicrotask = callback => {\n if (typeof queueMicrotask === 'function') {\n _queueMicrotask = queueMicrotask;\n }\n else {\n const resolvedPromise = promiseResolvedWith(undefined);\n _queueMicrotask = cb => PerformPromiseThen(resolvedPromise, cb);\n }\n return _queueMicrotask(callback);\n };\n function reflectCall(F, V, args) {\n if (typeof F !== 'function') {\n throw new TypeError('Argument is not a function');\n }\n return Function.prototype.apply.call(F, V, args);\n }\n function promiseCall(F, V, args) {\n try {\n return promiseResolvedWith(reflectCall(F, V, args));\n }\n catch (value) {\n return promiseRejectedWith(value);\n }\n }\n\n // Original from Chromium\n // https://chromium.googlesource.com/chromium/src/+/0aee4434a4dba42a42abaea9bfbc0cd196a63bc1/third_party/blink/renderer/core/streams/SimpleQueue.js\n const QUEUE_MAX_ARRAY_SIZE = 16384;\n /**\n * Simple queue structure.\n *\n * Avoids scalability issues with using a packed array directly by using\n * multiple arrays in a linked list and keeping the array size bounded.\n */\n class SimpleQueue {\n constructor() {\n this._cursor = 0;\n this._size = 0;\n // _front and _back are always defined.\n this._front = {\n _elements: [],\n _next: undefined\n };\n this._back = this._front;\n // The cursor is used to avoid calling Array.shift().\n // It contains the index of the front element of the array inside the\n // front-most node. It is always in the range [0, QUEUE_MAX_ARRAY_SIZE).\n this._cursor = 0;\n // When there is only one node, size === elements.length - cursor.\n this._size = 0;\n }\n get length() {\n return this._size;\n }\n // For exception safety, this method is structured in order:\n // 1. Read state\n // 2. Calculate required state mutations\n // 3. Perform state mutations\n push(element) {\n const oldBack = this._back;\n let newBack = oldBack;\n if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) {\n newBack = {\n _elements: [],\n _next: undefined\n };\n }\n // push() is the mutation most likely to throw an exception, so it\n // goes first.\n oldBack._elements.push(element);\n if (newBack !== oldBack) {\n this._back = newBack;\n oldBack._next = newBack;\n }\n ++this._size;\n }\n // Like push(), shift() follows the read -> calculate -> mutate pattern for\n // exception safety.\n shift() { // must not be called on an empty queue\n const oldFront = this._front;\n let newFront = oldFront;\n const oldCursor = this._cursor;\n let newCursor = oldCursor + 1;\n const elements = oldFront._elements;\n const element = elements[oldCursor];\n if (newCursor === QUEUE_MAX_ARRAY_SIZE) {\n newFront = oldFront._next;\n newCursor = 0;\n }\n // No mutations before this point.\n --this._size;\n this._cursor = newCursor;\n if (oldFront !== newFront) {\n this._front = newFront;\n }\n // Permit shifted element to be garbage collected.\n elements[oldCursor] = undefined;\n return element;\n }\n // The tricky thing about forEach() is that it can be called\n // re-entrantly. The queue may be mutated inside the callback. It is easy to\n // see that push() within the callback has no negative effects since the end\n // of the queue is checked for on every iteration. If shift() is called\n // repeatedly within the callback then the next iteration may return an\n // element that has been removed. In this case the callback will be called\n // with undefined values until we either \"catch up\" with elements that still\n // exist or reach the back of the queue.\n forEach(callback) {\n let i = this._cursor;\n let node = this._front;\n let elements = node._elements;\n while (i !== elements.length || node._next !== undefined) {\n if (i === elements.length) {\n node = node._next;\n elements = node._elements;\n i = 0;\n if (elements.length === 0) {\n break;\n }\n }\n callback(elements[i]);\n ++i;\n }\n }\n // Return the element that would be returned if shift() was called now,\n // without modifying the queue.\n peek() { // must not be called on an empty queue\n const front = this._front;\n const cursor = this._cursor;\n return front._elements[cursor];\n }\n }\n\n const AbortSteps = Symbol('[[AbortSteps]]');\n const ErrorSteps = Symbol('[[ErrorSteps]]');\n const CancelSteps = Symbol('[[CancelSteps]]');\n const PullSteps = Symbol('[[PullSteps]]');\n const ReleaseSteps = Symbol('[[ReleaseSteps]]');\n\n function ReadableStreamReaderGenericInitialize(reader, stream) {\n reader._ownerReadableStream = stream;\n stream._reader = reader;\n if (stream._state === 'readable') {\n defaultReaderClosedPromiseInitialize(reader);\n }\n else if (stream._state === 'closed') {\n defaultReaderClosedPromiseInitializeAsResolved(reader);\n }\n else {\n defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError);\n }\n }\n // A client of ReadableStreamDefaultReader and ReadableStreamBYOBReader may use these functions directly to bypass state\n // check.\n function ReadableStreamReaderGenericCancel(reader, reason) {\n const stream = reader._ownerReadableStream;\n return ReadableStreamCancel(stream, reason);\n }\n function ReadableStreamReaderGenericRelease(reader) {\n const stream = reader._ownerReadableStream;\n if (stream._state === 'readable') {\n defaultReaderClosedPromiseReject(reader, new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`));\n }\n else {\n defaultReaderClosedPromiseResetToRejected(reader, new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`));\n }\n stream._readableStreamController[ReleaseSteps]();\n stream._reader = undefined;\n reader._ownerReadableStream = undefined;\n }\n // Helper functions for the readers.\n function readerLockException(name) {\n return new TypeError('Cannot ' + name + ' a stream using a released reader');\n }\n // Helper functions for the ReadableStreamDefaultReader.\n function defaultReaderClosedPromiseInitialize(reader) {\n reader._closedPromise = newPromise((resolve, reject) => {\n reader._closedPromise_resolve = resolve;\n reader._closedPromise_reject = reject;\n });\n }\n function defaultReaderClosedPromiseInitializeAsRejected(reader, reason) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseReject(reader, reason);\n }\n function defaultReaderClosedPromiseInitializeAsResolved(reader) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseResolve(reader);\n }\n function defaultReaderClosedPromiseReject(reader, reason) {\n if (reader._closedPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(reader._closedPromise);\n reader._closedPromise_reject(reason);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n }\n function defaultReaderClosedPromiseResetToRejected(reader, reason) {\n defaultReaderClosedPromiseInitializeAsRejected(reader, reason);\n }\n function defaultReaderClosedPromiseResolve(reader) {\n if (reader._closedPromise_resolve === undefined) {\n return;\n }\n reader._closedPromise_resolve(undefined);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n }\n\n /// \n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill\n const NumberIsFinite = Number.isFinite || function (x) {\n return typeof x === 'number' && isFinite(x);\n };\n\n /// \n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc#Polyfill\n const MathTrunc = Math.trunc || function (v) {\n return v < 0 ? Math.ceil(v) : Math.floor(v);\n };\n\n // https://heycam.github.io/webidl/#idl-dictionaries\n function isDictionary(x) {\n return typeof x === 'object' || typeof x === 'function';\n }\n function assertDictionary(obj, context) {\n if (obj !== undefined && !isDictionary(obj)) {\n throw new TypeError(`${context} is not an object.`);\n }\n }\n // https://heycam.github.io/webidl/#idl-callback-functions\n function assertFunction(x, context) {\n if (typeof x !== 'function') {\n throw new TypeError(`${context} is not a function.`);\n }\n }\n // https://heycam.github.io/webidl/#idl-object\n function isObject(x) {\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\n }\n function assertObject(x, context) {\n if (!isObject(x)) {\n throw new TypeError(`${context} is not an object.`);\n }\n }\n function assertRequiredArgument(x, position, context) {\n if (x === undefined) {\n throw new TypeError(`Parameter ${position} is required in '${context}'.`);\n }\n }\n function assertRequiredField(x, field, context) {\n if (x === undefined) {\n throw new TypeError(`${field} is required in '${context}'.`);\n }\n }\n // https://heycam.github.io/webidl/#idl-unrestricted-double\n function convertUnrestrictedDouble(value) {\n return Number(value);\n }\n function censorNegativeZero(x) {\n return x === 0 ? 0 : x;\n }\n function integerPart(x) {\n return censorNegativeZero(MathTrunc(x));\n }\n // https://heycam.github.io/webidl/#idl-unsigned-long-long\n function convertUnsignedLongLongWithEnforceRange(value, context) {\n const lowerBound = 0;\n const upperBound = Number.MAX_SAFE_INTEGER;\n let x = Number(value);\n x = censorNegativeZero(x);\n if (!NumberIsFinite(x)) {\n throw new TypeError(`${context} is not a finite number`);\n }\n x = integerPart(x);\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(`${context} is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`);\n }\n if (!NumberIsFinite(x) || x === 0) {\n return 0;\n }\n // TODO Use BigInt if supported?\n // let xBigInt = BigInt(integerPart(x));\n // xBigInt = BigInt.asUintN(64, xBigInt);\n // return Number(xBigInt);\n return x;\n }\n\n function assertReadableStream(x, context) {\n if (!IsReadableStream(x)) {\n throw new TypeError(`${context} is not a ReadableStream.`);\n }\n }\n\n // Abstract operations for the ReadableStream.\n function AcquireReadableStreamDefaultReader(stream) {\n return new ReadableStreamDefaultReader(stream);\n }\n // ReadableStream API exposed for controllers.\n function ReadableStreamAddReadRequest(stream, readRequest) {\n stream._reader._readRequests.push(readRequest);\n }\n function ReadableStreamFulfillReadRequest(stream, chunk, done) {\n const reader = stream._reader;\n const readRequest = reader._readRequests.shift();\n if (done) {\n readRequest._closeSteps();\n }\n else {\n readRequest._chunkSteps(chunk);\n }\n }\n function ReadableStreamGetNumReadRequests(stream) {\n return stream._reader._readRequests.length;\n }\n function ReadableStreamHasDefaultReader(stream) {\n const reader = stream._reader;\n if (reader === undefined) {\n return false;\n }\n if (!IsReadableStreamDefaultReader(reader)) {\n return false;\n }\n return true;\n }\n /**\n * A default reader vended by a {@link ReadableStream}.\n *\n * @public\n */\n class ReadableStreamDefaultReader {\n constructor(stream) {\n assertRequiredArgument(stream, 1, 'ReadableStreamDefaultReader');\n assertReadableStream(stream, 'First parameter');\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\n }\n ReadableStreamReaderGenericInitialize(this, stream);\n this._readRequests = new SimpleQueue();\n }\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed,\n * or rejected if the stream ever errors or the reader's lock is released before the stream finishes closing.\n */\n get closed() {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('closed'));\n }\n return this._closedPromise;\n }\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n cancel(reason = undefined) {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('cancel'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('cancel'));\n }\n return ReadableStreamReaderGenericCancel(this, reason);\n }\n /**\n * Returns a promise that allows access to the next chunk from the stream's internal queue, if available.\n *\n * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.\n */\n read() {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('read'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('read from'));\n }\n let resolvePromise;\n let rejectPromise;\n const promise = newPromise((resolve, reject) => {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readRequest = {\n _chunkSteps: chunk => resolvePromise({ value: chunk, done: false }),\n _closeSteps: () => resolvePromise({ value: undefined, done: true }),\n _errorSteps: e => rejectPromise(e)\n };\n ReadableStreamDefaultReaderRead(this, readRequest);\n return promise;\n }\n /**\n * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader's {@link ReadableStreamDefaultReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n releaseLock() {\n if (!IsReadableStreamDefaultReader(this)) {\n throw defaultReaderBrandCheckException('releaseLock');\n }\n if (this._ownerReadableStream === undefined) {\n return;\n }\n ReadableStreamDefaultReaderRelease(this);\n }\n }\n Object.defineProperties(ReadableStreamDefaultReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n });\n setFunctionName(ReadableStreamDefaultReader.prototype.cancel, 'cancel');\n setFunctionName(ReadableStreamDefaultReader.prototype.read, 'read');\n setFunctionName(ReadableStreamDefaultReader.prototype.releaseLock, 'releaseLock');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamDefaultReader.prototype, Symbol.toStringTag, {\n value: 'ReadableStreamDefaultReader',\n configurable: true\n });\n }\n // Abstract operations for the readers.\n function IsReadableStreamDefaultReader(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readRequests')) {\n return false;\n }\n return x instanceof ReadableStreamDefaultReader;\n }\n function ReadableStreamDefaultReaderRead(reader, readRequest) {\n const stream = reader._ownerReadableStream;\n stream._disturbed = true;\n if (stream._state === 'closed') {\n readRequest._closeSteps();\n }\n else if (stream._state === 'errored') {\n readRequest._errorSteps(stream._storedError);\n }\n else {\n stream._readableStreamController[PullSteps](readRequest);\n }\n }\n function ReadableStreamDefaultReaderRelease(reader) {\n ReadableStreamReaderGenericRelease(reader);\n const e = new TypeError('Reader was released');\n ReadableStreamDefaultReaderErrorReadRequests(reader, e);\n }\n function ReadableStreamDefaultReaderErrorReadRequests(reader, e) {\n const readRequests = reader._readRequests;\n reader._readRequests = new SimpleQueue();\n readRequests.forEach(readRequest => {\n readRequest._errorSteps(e);\n });\n }\n // Helper functions for the ReadableStreamDefaultReader.\n function defaultReaderBrandCheckException(name) {\n return new TypeError(`ReadableStreamDefaultReader.prototype.${name} can only be used on a ReadableStreamDefaultReader`);\n }\n\n /// \n /* eslint-disable @typescript-eslint/no-empty-function */\n const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () { }).prototype);\n\n /// \n class ReadableStreamAsyncIteratorImpl {\n constructor(reader, preventCancel) {\n this._ongoingPromise = undefined;\n this._isFinished = false;\n this._reader = reader;\n this._preventCancel = preventCancel;\n }\n next() {\n const nextSteps = () => this._nextSteps();\n this._ongoingPromise = this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, nextSteps, nextSteps) :\n nextSteps();\n return this._ongoingPromise;\n }\n return(value) {\n const returnSteps = () => this._returnSteps(value);\n return this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, returnSteps, returnSteps) :\n returnSteps();\n }\n _nextSteps() {\n if (this._isFinished) {\n return Promise.resolve({ value: undefined, done: true });\n }\n const reader = this._reader;\n let resolvePromise;\n let rejectPromise;\n const promise = newPromise((resolve, reject) => {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readRequest = {\n _chunkSteps: chunk => {\n this._ongoingPromise = undefined;\n // This needs to be delayed by one microtask, otherwise we stop pulling too early which breaks a test.\n // FIXME Is this a bug in the specification, or in the test?\n _queueMicrotask(() => resolvePromise({ value: chunk, done: false }));\n },\n _closeSteps: () => {\n this._ongoingPromise = undefined;\n this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n resolvePromise({ value: undefined, done: true });\n },\n _errorSteps: reason => {\n this._ongoingPromise = undefined;\n this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n rejectPromise(reason);\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n return promise;\n }\n _returnSteps(value) {\n if (this._isFinished) {\n return Promise.resolve({ value, done: true });\n }\n this._isFinished = true;\n const reader = this._reader;\n if (!this._preventCancel) {\n const result = ReadableStreamReaderGenericCancel(reader, value);\n ReadableStreamReaderGenericRelease(reader);\n return transformPromiseWith(result, () => ({ value, done: true }));\n }\n ReadableStreamReaderGenericRelease(reader);\n return promiseResolvedWith({ value, done: true });\n }\n }\n const ReadableStreamAsyncIteratorPrototype = {\n next() {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('next'));\n }\n return this._asyncIteratorImpl.next();\n },\n return(value) {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('return'));\n }\n return this._asyncIteratorImpl.return(value);\n }\n };\n Object.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype);\n // Abstract operations for the ReadableStream.\n function AcquireReadableStreamAsyncIterator(stream, preventCancel) {\n const reader = AcquireReadableStreamDefaultReader(stream);\n const impl = new ReadableStreamAsyncIteratorImpl(reader, preventCancel);\n const iterator = Object.create(ReadableStreamAsyncIteratorPrototype);\n iterator._asyncIteratorImpl = impl;\n return iterator;\n }\n function IsReadableStreamAsyncIterator(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_asyncIteratorImpl')) {\n return false;\n }\n try {\n // noinspection SuspiciousTypeOfGuard\n return x._asyncIteratorImpl instanceof\n ReadableStreamAsyncIteratorImpl;\n }\n catch (_a) {\n return false;\n }\n }\n // Helper functions for the ReadableStream.\n function streamAsyncIteratorBrandCheckException(name) {\n return new TypeError(`ReadableStreamAsyncIterator.${name} can only be used on a ReadableSteamAsyncIterator`);\n }\n\n /// \n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN#Polyfill\n const NumberIsNaN = Number.isNaN || function (x) {\n // eslint-disable-next-line no-self-compare\n return x !== x;\n };\n\n var _a, _b, _c;\n function CreateArrayFromList(elements) {\n // We use arrays to represent lists, so this is basically a no-op.\n // Do a slice though just in case we happen to depend on the unique-ness.\n return elements.slice();\n }\n function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n) {\n new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset);\n }\n let TransferArrayBuffer = (O) => {\n if (typeof O.transfer === 'function') {\n TransferArrayBuffer = buffer => buffer.transfer();\n }\n else if (typeof structuredClone === 'function') {\n TransferArrayBuffer = buffer => structuredClone(buffer, { transfer: [buffer] });\n }\n else {\n // Not implemented correctly\n TransferArrayBuffer = buffer => buffer;\n }\n return TransferArrayBuffer(O);\n };\n let IsDetachedBuffer = (O) => {\n if (typeof O.detached === 'boolean') {\n IsDetachedBuffer = buffer => buffer.detached;\n }\n else {\n // Not implemented correctly\n IsDetachedBuffer = buffer => buffer.byteLength === 0;\n }\n return IsDetachedBuffer(O);\n };\n function ArrayBufferSlice(buffer, begin, end) {\n // ArrayBuffer.prototype.slice is not available on IE10\n // https://www.caniuse.com/mdn-javascript_builtins_arraybuffer_slice\n if (buffer.slice) {\n return buffer.slice(begin, end);\n }\n const length = end - begin;\n const slice = new ArrayBuffer(length);\n CopyDataBlockBytes(slice, 0, buffer, begin, length);\n return slice;\n }\n function GetMethod(receiver, prop) {\n const func = receiver[prop];\n if (func === undefined || func === null) {\n return undefined;\n }\n if (typeof func !== 'function') {\n throw new TypeError(`${String(prop)} is not a function`);\n }\n return func;\n }\n function CreateAsyncFromSyncIterator(syncIteratorRecord) {\n // Instead of re-implementing CreateAsyncFromSyncIterator and %AsyncFromSyncIteratorPrototype%,\n // we use yield* inside an async generator function to achieve the same result.\n // Wrap the sync iterator inside a sync iterable, so we can use it with yield*.\n const syncIterable = {\n [Symbol.iterator]: () => syncIteratorRecord.iterator\n };\n // Create an async generator function and immediately invoke it.\n const asyncIterator = (async function* () {\n return yield* syncIterable;\n }());\n // Return as an async iterator record.\n const nextMethod = asyncIterator.next;\n return { iterator: asyncIterator, nextMethod, done: false };\n }\n // Aligns with core-js/modules/es.symbol.async-iterator.js\n const SymbolAsyncIterator = (_c = (_a = Symbol.asyncIterator) !== null && _a !== void 0 ? _a : (_b = Symbol.for) === null || _b === void 0 ? void 0 : _b.call(Symbol, 'Symbol.asyncIterator')) !== null && _c !== void 0 ? _c : '@@asyncIterator';\n function GetIterator(obj, hint = 'sync', method) {\n if (method === undefined) {\n if (hint === 'async') {\n method = GetMethod(obj, SymbolAsyncIterator);\n if (method === undefined) {\n const syncMethod = GetMethod(obj, Symbol.iterator);\n const syncIteratorRecord = GetIterator(obj, 'sync', syncMethod);\n return CreateAsyncFromSyncIterator(syncIteratorRecord);\n }\n }\n else {\n method = GetMethod(obj, Symbol.iterator);\n }\n }\n if (method === undefined) {\n throw new TypeError('The object is not iterable');\n }\n const iterator = reflectCall(method, obj, []);\n if (!typeIsObject(iterator)) {\n throw new TypeError('The iterator method must return an object');\n }\n const nextMethod = iterator.next;\n return { iterator, nextMethod, done: false };\n }\n function IteratorNext(iteratorRecord) {\n const result = reflectCall(iteratorRecord.nextMethod, iteratorRecord.iterator, []);\n if (!typeIsObject(result)) {\n throw new TypeError('The iterator.next() method must return an object');\n }\n return result;\n }\n function IteratorComplete(iterResult) {\n return Boolean(iterResult.done);\n }\n function IteratorValue(iterResult) {\n return iterResult.value;\n }\n\n function IsNonNegativeNumber(v) {\n if (typeof v !== 'number') {\n return false;\n }\n if (NumberIsNaN(v)) {\n return false;\n }\n if (v < 0) {\n return false;\n }\n return true;\n }\n function CloneAsUint8Array(O) {\n const buffer = ArrayBufferSlice(O.buffer, O.byteOffset, O.byteOffset + O.byteLength);\n return new Uint8Array(buffer);\n }\n\n function DequeueValue(container) {\n const pair = container._queue.shift();\n container._queueTotalSize -= pair.size;\n if (container._queueTotalSize < 0) {\n container._queueTotalSize = 0;\n }\n return pair.value;\n }\n function EnqueueValueWithSize(container, value, size) {\n if (!IsNonNegativeNumber(size) || size === Infinity) {\n throw new RangeError('Size must be a finite, non-NaN, non-negative number.');\n }\n container._queue.push({ value, size });\n container._queueTotalSize += size;\n }\n function PeekQueueValue(container) {\n const pair = container._queue.peek();\n return pair.value;\n }\n function ResetQueue(container) {\n container._queue = new SimpleQueue();\n container._queueTotalSize = 0;\n }\n\n function isDataViewConstructor(ctor) {\n return ctor === DataView;\n }\n function isDataView(view) {\n return isDataViewConstructor(view.constructor);\n }\n function arrayBufferViewElementSize(ctor) {\n if (isDataViewConstructor(ctor)) {\n return 1;\n }\n return ctor.BYTES_PER_ELEMENT;\n }\n\n /**\n * A pull-into request in a {@link ReadableByteStreamController}.\n *\n * @public\n */\n class ReadableStreamBYOBRequest {\n constructor() {\n throw new TypeError('Illegal constructor');\n }\n /**\n * Returns the view for writing in to, or `null` if the BYOB request has already been responded to.\n */\n get view() {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('view');\n }\n return this._view;\n }\n respond(bytesWritten) {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('respond');\n }\n assertRequiredArgument(bytesWritten, 1, 'respond');\n bytesWritten = convertUnsignedLongLongWithEnforceRange(bytesWritten, 'First parameter');\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError('This BYOB request has been invalidated');\n }\n if (IsDetachedBuffer(this._view.buffer)) {\n throw new TypeError(`The BYOB request's buffer has been detached and so cannot be used as a response`);\n }\n ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten);\n }\n respondWithNewView(view) {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('respondWithNewView');\n }\n assertRequiredArgument(view, 1, 'respondWithNewView');\n if (!ArrayBuffer.isView(view)) {\n throw new TypeError('You can only respond with array buffer views');\n }\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError('This BYOB request has been invalidated');\n }\n if (IsDetachedBuffer(view.buffer)) {\n throw new TypeError('The given view\\'s buffer has been detached and so cannot be used as a response');\n }\n ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view);\n }\n }\n Object.defineProperties(ReadableStreamBYOBRequest.prototype, {\n respond: { enumerable: true },\n respondWithNewView: { enumerable: true },\n view: { enumerable: true }\n });\n setFunctionName(ReadableStreamBYOBRequest.prototype.respond, 'respond');\n setFunctionName(ReadableStreamBYOBRequest.prototype.respondWithNewView, 'respondWithNewView');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamBYOBRequest.prototype, Symbol.toStringTag, {\n value: 'ReadableStreamBYOBRequest',\n configurable: true\n });\n }\n /**\n * Allows control of a {@link ReadableStream | readable byte stream}'s state and internal queue.\n *\n * @public\n */\n class ReadableByteStreamController {\n constructor() {\n throw new TypeError('Illegal constructor');\n }\n /**\n * Returns the current BYOB pull request, or `null` if there isn't one.\n */\n get byobRequest() {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('byobRequest');\n }\n return ReadableByteStreamControllerGetBYOBRequest(this);\n }\n /**\n * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is\n * over-full. An underlying byte source ought to use this information to determine when and how to apply backpressure.\n */\n get desiredSize() {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('desiredSize');\n }\n return ReadableByteStreamControllerGetDesiredSize(this);\n }\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n close() {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('close');\n }\n if (this._closeRequested) {\n throw new TypeError('The stream has already been closed; do not close it again!');\n }\n const state = this._controlledReadableByteStream._state;\n if (state !== 'readable') {\n throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be closed`);\n }\n ReadableByteStreamControllerClose(this);\n }\n enqueue(chunk) {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('enqueue');\n }\n assertRequiredArgument(chunk, 1, 'enqueue');\n if (!ArrayBuffer.isView(chunk)) {\n throw new TypeError('chunk must be an array buffer view');\n }\n if (chunk.byteLength === 0) {\n throw new TypeError('chunk must have non-zero byteLength');\n }\n if (chunk.buffer.byteLength === 0) {\n throw new TypeError(`chunk's buffer must have non-zero byteLength`);\n }\n if (this._closeRequested) {\n throw new TypeError('stream is closed or draining');\n }\n const state = this._controlledReadableByteStream._state;\n if (state !== 'readable') {\n throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be enqueued to`);\n }\n ReadableByteStreamControllerEnqueue(this, chunk);\n }\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n error(e = undefined) {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('error');\n }\n ReadableByteStreamControllerError(this, e);\n }\n /** @internal */\n [CancelSteps](reason) {\n ReadableByteStreamControllerClearPendingPullIntos(this);\n ResetQueue(this);\n const result = this._cancelAlgorithm(reason);\n ReadableByteStreamControllerClearAlgorithms(this);\n return result;\n }\n /** @internal */\n [PullSteps](readRequest) {\n const stream = this._controlledReadableByteStream;\n if (this._queueTotalSize > 0) {\n ReadableByteStreamControllerFillReadRequestFromQueue(this, readRequest);\n return;\n }\n const autoAllocateChunkSize = this._autoAllocateChunkSize;\n if (autoAllocateChunkSize !== undefined) {\n let buffer;\n try {\n buffer = new ArrayBuffer(autoAllocateChunkSize);\n }\n catch (bufferE) {\n readRequest._errorSteps(bufferE);\n return;\n }\n const pullIntoDescriptor = {\n buffer,\n bufferByteLength: autoAllocateChunkSize,\n byteOffset: 0,\n byteLength: autoAllocateChunkSize,\n bytesFilled: 0,\n minimumFill: 1,\n elementSize: 1,\n viewConstructor: Uint8Array,\n readerType: 'default'\n };\n this._pendingPullIntos.push(pullIntoDescriptor);\n }\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableByteStreamControllerCallPullIfNeeded(this);\n }\n /** @internal */\n [ReleaseSteps]() {\n if (this._pendingPullIntos.length > 0) {\n const firstPullInto = this._pendingPullIntos.peek();\n firstPullInto.readerType = 'none';\n this._pendingPullIntos = new SimpleQueue();\n this._pendingPullIntos.push(firstPullInto);\n }\n }\n }\n Object.defineProperties(ReadableByteStreamController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n byobRequest: { enumerable: true },\n desiredSize: { enumerable: true }\n });\n setFunctionName(ReadableByteStreamController.prototype.close, 'close');\n setFunctionName(ReadableByteStreamController.prototype.enqueue, 'enqueue');\n setFunctionName(ReadableByteStreamController.prototype.error, 'error');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableByteStreamController.prototype, Symbol.toStringTag, {\n value: 'ReadableByteStreamController',\n configurable: true\n });\n }\n // Abstract operations for the ReadableByteStreamController.\n function IsReadableByteStreamController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableByteStream')) {\n return false;\n }\n return x instanceof ReadableByteStreamController;\n }\n function IsReadableStreamBYOBRequest(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_associatedReadableByteStreamController')) {\n return false;\n }\n return x instanceof ReadableStreamBYOBRequest;\n }\n function ReadableByteStreamControllerCallPullIfNeeded(controller) {\n const shouldPull = ReadableByteStreamControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n controller._pulling = true;\n // TODO: Test controller argument\n const pullPromise = controller._pullAlgorithm();\n uponPromise(pullPromise, () => {\n controller._pulling = false;\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n return null;\n }, e => {\n ReadableByteStreamControllerError(controller, e);\n return null;\n });\n }\n function ReadableByteStreamControllerClearPendingPullIntos(controller) {\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n controller._pendingPullIntos = new SimpleQueue();\n }\n function ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor) {\n let done = false;\n if (stream._state === 'closed') {\n done = true;\n }\n const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);\n if (pullIntoDescriptor.readerType === 'default') {\n ReadableStreamFulfillReadRequest(stream, filledView, done);\n }\n else {\n ReadableStreamFulfillReadIntoRequest(stream, filledView, done);\n }\n }\n function ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor) {\n const bytesFilled = pullIntoDescriptor.bytesFilled;\n const elementSize = pullIntoDescriptor.elementSize;\n return new pullIntoDescriptor.viewConstructor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize);\n }\n function ReadableByteStreamControllerEnqueueChunkToQueue(controller, buffer, byteOffset, byteLength) {\n controller._queue.push({ buffer, byteOffset, byteLength });\n controller._queueTotalSize += byteLength;\n }\n function ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, buffer, byteOffset, byteLength) {\n let clonedChunk;\n try {\n clonedChunk = ArrayBufferSlice(buffer, byteOffset, byteOffset + byteLength);\n }\n catch (cloneE) {\n ReadableByteStreamControllerError(controller, cloneE);\n throw cloneE;\n }\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, clonedChunk, 0, byteLength);\n }\n function ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstDescriptor) {\n if (firstDescriptor.bytesFilled > 0) {\n ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, firstDescriptor.buffer, firstDescriptor.byteOffset, firstDescriptor.bytesFilled);\n }\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n }\n function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) {\n const maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled);\n const maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy;\n let totalBytesToCopyRemaining = maxBytesToCopy;\n let ready = false;\n const remainderBytes = maxBytesFilled % pullIntoDescriptor.elementSize;\n const maxAlignedBytes = maxBytesFilled - remainderBytes;\n // A descriptor for a read() request that is not yet filled up to its minimum length will stay at the head\n // of the queue, so the underlying source can keep filling it.\n if (maxAlignedBytes >= pullIntoDescriptor.minimumFill) {\n totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled;\n ready = true;\n }\n const queue = controller._queue;\n while (totalBytesToCopyRemaining > 0) {\n const headOfQueue = queue.peek();\n const bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength);\n const destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n CopyDataBlockBytes(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy);\n if (headOfQueue.byteLength === bytesToCopy) {\n queue.shift();\n }\n else {\n headOfQueue.byteOffset += bytesToCopy;\n headOfQueue.byteLength -= bytesToCopy;\n }\n controller._queueTotalSize -= bytesToCopy;\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor);\n totalBytesToCopyRemaining -= bytesToCopy;\n }\n return ready;\n }\n function ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, size, pullIntoDescriptor) {\n pullIntoDescriptor.bytesFilled += size;\n }\n function ReadableByteStreamControllerHandleQueueDrain(controller) {\n if (controller._queueTotalSize === 0 && controller._closeRequested) {\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(controller._controlledReadableByteStream);\n }\n else {\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n }\n function ReadableByteStreamControllerInvalidateBYOBRequest(controller) {\n if (controller._byobRequest === null) {\n return;\n }\n controller._byobRequest._associatedReadableByteStreamController = undefined;\n controller._byobRequest._view = null;\n controller._byobRequest = null;\n }\n function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller) {\n while (controller._pendingPullIntos.length > 0) {\n if (controller._queueTotalSize === 0) {\n return;\n }\n const pullIntoDescriptor = controller._pendingPullIntos.peek();\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\n }\n }\n }\n function ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller) {\n const reader = controller._controlledReadableByteStream._reader;\n while (reader._readRequests.length > 0) {\n if (controller._queueTotalSize === 0) {\n return;\n }\n const readRequest = reader._readRequests.shift();\n ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest);\n }\n }\n function ReadableByteStreamControllerPullInto(controller, view, min, readIntoRequest) {\n const stream = controller._controlledReadableByteStream;\n const ctor = view.constructor;\n const elementSize = arrayBufferViewElementSize(ctor);\n const { byteOffset, byteLength } = view;\n const minimumFill = min * elementSize;\n let buffer;\n try {\n buffer = TransferArrayBuffer(view.buffer);\n }\n catch (e) {\n readIntoRequest._errorSteps(e);\n return;\n }\n const pullIntoDescriptor = {\n buffer,\n bufferByteLength: buffer.byteLength,\n byteOffset,\n byteLength,\n bytesFilled: 0,\n minimumFill,\n elementSize,\n viewConstructor: ctor,\n readerType: 'byob'\n };\n if (controller._pendingPullIntos.length > 0) {\n controller._pendingPullIntos.push(pullIntoDescriptor);\n // No ReadableByteStreamControllerCallPullIfNeeded() call since:\n // - No change happens on desiredSize\n // - The source has already been notified of that there's at least 1 pending read(view)\n ReadableStreamAddReadIntoRequest(stream, readIntoRequest);\n return;\n }\n if (stream._state === 'closed') {\n const emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0);\n readIntoRequest._closeSteps(emptyView);\n return;\n }\n if (controller._queueTotalSize > 0) {\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);\n ReadableByteStreamControllerHandleQueueDrain(controller);\n readIntoRequest._chunkSteps(filledView);\n return;\n }\n if (controller._closeRequested) {\n const e = new TypeError('Insufficient bytes to fill elements in the given buffer');\n ReadableByteStreamControllerError(controller, e);\n readIntoRequest._errorSteps(e);\n return;\n }\n }\n controller._pendingPullIntos.push(pullIntoDescriptor);\n ReadableStreamAddReadIntoRequest(stream, readIntoRequest);\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n function ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) {\n if (firstDescriptor.readerType === 'none') {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n }\n const stream = controller._controlledReadableByteStream;\n if (ReadableStreamHasBYOBReader(stream)) {\n while (ReadableStreamGetNumReadIntoRequests(stream) > 0) {\n const pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller);\n ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor);\n }\n }\n }\n function ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) {\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor);\n if (pullIntoDescriptor.readerType === 'none') {\n ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, pullIntoDescriptor);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n return;\n }\n if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.minimumFill) {\n // A descriptor for a read() request that is not yet filled up to its minimum length will stay at the head\n // of the queue, so the underlying source can keep filling it.\n return;\n }\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n const remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize;\n if (remainderSize > 0) {\n const end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, pullIntoDescriptor.buffer, end - remainderSize, remainderSize);\n }\n pullIntoDescriptor.bytesFilled -= remainderSize;\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n }\n function ReadableByteStreamControllerRespondInternal(controller, bytesWritten) {\n const firstDescriptor = controller._pendingPullIntos.peek();\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n const state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor);\n }\n else {\n ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor);\n }\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n function ReadableByteStreamControllerShiftPendingPullInto(controller) {\n const descriptor = controller._pendingPullIntos.shift();\n return descriptor;\n }\n function ReadableByteStreamControllerShouldCallPull(controller) {\n const stream = controller._controlledReadableByteStream;\n if (stream._state !== 'readable') {\n return false;\n }\n if (controller._closeRequested) {\n return false;\n }\n if (!controller._started) {\n return false;\n }\n if (ReadableStreamHasDefaultReader(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n return true;\n }\n if (ReadableStreamHasBYOBReader(stream) && ReadableStreamGetNumReadIntoRequests(stream) > 0) {\n return true;\n }\n const desiredSize = ReadableByteStreamControllerGetDesiredSize(controller);\n if (desiredSize > 0) {\n return true;\n }\n return false;\n }\n function ReadableByteStreamControllerClearAlgorithms(controller) {\n controller._pullAlgorithm = undefined;\n controller._cancelAlgorithm = undefined;\n }\n // A client of ReadableByteStreamController may use these functions directly to bypass state check.\n function ReadableByteStreamControllerClose(controller) {\n const stream = controller._controlledReadableByteStream;\n if (controller._closeRequested || stream._state !== 'readable') {\n return;\n }\n if (controller._queueTotalSize > 0) {\n controller._closeRequested = true;\n return;\n }\n if (controller._pendingPullIntos.length > 0) {\n const firstPendingPullInto = controller._pendingPullIntos.peek();\n if (firstPendingPullInto.bytesFilled % firstPendingPullInto.elementSize !== 0) {\n const e = new TypeError('Insufficient bytes to fill elements in the given buffer');\n ReadableByteStreamControllerError(controller, e);\n throw e;\n }\n }\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n }\n function ReadableByteStreamControllerEnqueue(controller, chunk) {\n const stream = controller._controlledReadableByteStream;\n if (controller._closeRequested || stream._state !== 'readable') {\n return;\n }\n const { buffer, byteOffset, byteLength } = chunk;\n if (IsDetachedBuffer(buffer)) {\n throw new TypeError('chunk\\'s buffer is detached and so cannot be enqueued');\n }\n const transferredBuffer = TransferArrayBuffer(buffer);\n if (controller._pendingPullIntos.length > 0) {\n const firstPendingPullInto = controller._pendingPullIntos.peek();\n if (IsDetachedBuffer(firstPendingPullInto.buffer)) {\n throw new TypeError('The BYOB request\\'s buffer has been detached and so cannot be filled with an enqueued chunk');\n }\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n firstPendingPullInto.buffer = TransferArrayBuffer(firstPendingPullInto.buffer);\n if (firstPendingPullInto.readerType === 'none') {\n ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstPendingPullInto);\n }\n }\n if (ReadableStreamHasDefaultReader(stream)) {\n ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller);\n if (ReadableStreamGetNumReadRequests(stream) === 0) {\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n }\n else {\n if (controller._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n }\n const transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength);\n ReadableStreamFulfillReadRequest(stream, transferredView, false);\n }\n }\n else if (ReadableStreamHasBYOBReader(stream)) {\n // TODO: Ideally in this branch detaching should happen only if the buffer is not consumed fully.\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n }\n else {\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n }\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n function ReadableByteStreamControllerError(controller, e) {\n const stream = controller._controlledReadableByteStream;\n if (stream._state !== 'readable') {\n return;\n }\n ReadableByteStreamControllerClearPendingPullIntos(controller);\n ResetQueue(controller);\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n }\n function ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest) {\n const entry = controller._queue.shift();\n controller._queueTotalSize -= entry.byteLength;\n ReadableByteStreamControllerHandleQueueDrain(controller);\n const view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength);\n readRequest._chunkSteps(view);\n }\n function ReadableByteStreamControllerGetBYOBRequest(controller) {\n if (controller._byobRequest === null && controller._pendingPullIntos.length > 0) {\n const firstDescriptor = controller._pendingPullIntos.peek();\n const view = new Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled);\n const byobRequest = Object.create(ReadableStreamBYOBRequest.prototype);\n SetUpReadableStreamBYOBRequest(byobRequest, controller, view);\n controller._byobRequest = byobRequest;\n }\n return controller._byobRequest;\n }\n function ReadableByteStreamControllerGetDesiredSize(controller) {\n const state = controller._controlledReadableByteStream._state;\n if (state === 'errored') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return controller._strategyHWM - controller._queueTotalSize;\n }\n function ReadableByteStreamControllerRespond(controller, bytesWritten) {\n const firstDescriptor = controller._pendingPullIntos.peek();\n const state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n if (bytesWritten !== 0) {\n throw new TypeError('bytesWritten must be 0 when calling respond() on a closed stream');\n }\n }\n else {\n if (bytesWritten === 0) {\n throw new TypeError('bytesWritten must be greater than 0 when calling respond() on a readable stream');\n }\n if (firstDescriptor.bytesFilled + bytesWritten > firstDescriptor.byteLength) {\n throw new RangeError('bytesWritten out of range');\n }\n }\n firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer);\n ReadableByteStreamControllerRespondInternal(controller, bytesWritten);\n }\n function ReadableByteStreamControllerRespondWithNewView(controller, view) {\n const firstDescriptor = controller._pendingPullIntos.peek();\n const state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n if (view.byteLength !== 0) {\n throw new TypeError('The view\\'s length must be 0 when calling respondWithNewView() on a closed stream');\n }\n }\n else {\n if (view.byteLength === 0) {\n throw new TypeError('The view\\'s length must be greater than 0 when calling respondWithNewView() on a readable stream');\n }\n }\n if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) {\n throw new RangeError('The region specified by view does not match byobRequest');\n }\n if (firstDescriptor.bufferByteLength !== view.buffer.byteLength) {\n throw new RangeError('The buffer of view has different capacity than byobRequest');\n }\n if (firstDescriptor.bytesFilled + view.byteLength > firstDescriptor.byteLength) {\n throw new RangeError('The region specified by view is larger than byobRequest');\n }\n const viewByteLength = view.byteLength;\n firstDescriptor.buffer = TransferArrayBuffer(view.buffer);\n ReadableByteStreamControllerRespondInternal(controller, viewByteLength);\n }\n function SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize) {\n controller._controlledReadableByteStream = stream;\n controller._pullAgain = false;\n controller._pulling = false;\n controller._byobRequest = null;\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\n controller._queue = controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._closeRequested = false;\n controller._started = false;\n controller._strategyHWM = highWaterMark;\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n controller._autoAllocateChunkSize = autoAllocateChunkSize;\n controller._pendingPullIntos = new SimpleQueue();\n stream._readableStreamController = controller;\n const startResult = startAlgorithm();\n uponPromise(promiseResolvedWith(startResult), () => {\n controller._started = true;\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n return null;\n }, r => {\n ReadableByteStreamControllerError(controller, r);\n return null;\n });\n }\n function SetUpReadableByteStreamControllerFromUnderlyingSource(stream, underlyingByteSource, highWaterMark) {\n const controller = Object.create(ReadableByteStreamController.prototype);\n let startAlgorithm;\n let pullAlgorithm;\n let cancelAlgorithm;\n if (underlyingByteSource.start !== undefined) {\n startAlgorithm = () => underlyingByteSource.start(controller);\n }\n else {\n startAlgorithm = () => undefined;\n }\n if (underlyingByteSource.pull !== undefined) {\n pullAlgorithm = () => underlyingByteSource.pull(controller);\n }\n else {\n pullAlgorithm = () => promiseResolvedWith(undefined);\n }\n if (underlyingByteSource.cancel !== undefined) {\n cancelAlgorithm = reason => underlyingByteSource.cancel(reason);\n }\n else {\n cancelAlgorithm = () => promiseResolvedWith(undefined);\n }\n const autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;\n if (autoAllocateChunkSize === 0) {\n throw new TypeError('autoAllocateChunkSize must be greater than 0');\n }\n SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize);\n }\n function SetUpReadableStreamBYOBRequest(request, controller, view) {\n request._associatedReadableByteStreamController = controller;\n request._view = view;\n }\n // Helper functions for the ReadableStreamBYOBRequest.\n function byobRequestBrandCheckException(name) {\n return new TypeError(`ReadableStreamBYOBRequest.prototype.${name} can only be used on a ReadableStreamBYOBRequest`);\n }\n // Helper functions for the ReadableByteStreamController.\n function byteStreamControllerBrandCheckException(name) {\n return new TypeError(`ReadableByteStreamController.prototype.${name} can only be used on a ReadableByteStreamController`);\n }\n\n function convertReaderOptions(options, context) {\n assertDictionary(options, context);\n const mode = options === null || options === void 0 ? void 0 : options.mode;\n return {\n mode: mode === undefined ? undefined : convertReadableStreamReaderMode(mode, `${context} has member 'mode' that`)\n };\n }\n function convertReadableStreamReaderMode(mode, context) {\n mode = `${mode}`;\n if (mode !== 'byob') {\n throw new TypeError(`${context} '${mode}' is not a valid enumeration value for ReadableStreamReaderMode`);\n }\n return mode;\n }\n function convertByobReadOptions(options, context) {\n var _a;\n assertDictionary(options, context);\n const min = (_a = options === null || options === void 0 ? void 0 : options.min) !== null && _a !== void 0 ? _a : 1;\n return {\n min: convertUnsignedLongLongWithEnforceRange(min, `${context} has member 'min' that`)\n };\n }\n\n // Abstract operations for the ReadableStream.\n function AcquireReadableStreamBYOBReader(stream) {\n return new ReadableStreamBYOBReader(stream);\n }\n // ReadableStream API exposed for controllers.\n function ReadableStreamAddReadIntoRequest(stream, readIntoRequest) {\n stream._reader._readIntoRequests.push(readIntoRequest);\n }\n function ReadableStreamFulfillReadIntoRequest(stream, chunk, done) {\n const reader = stream._reader;\n const readIntoRequest = reader._readIntoRequests.shift();\n if (done) {\n readIntoRequest._closeSteps(chunk);\n }\n else {\n readIntoRequest._chunkSteps(chunk);\n }\n }\n function ReadableStreamGetNumReadIntoRequests(stream) {\n return stream._reader._readIntoRequests.length;\n }\n function ReadableStreamHasBYOBReader(stream) {\n const reader = stream._reader;\n if (reader === undefined) {\n return false;\n }\n if (!IsReadableStreamBYOBReader(reader)) {\n return false;\n }\n return true;\n }\n /**\n * A BYOB reader vended by a {@link ReadableStream}.\n *\n * @public\n */\n class ReadableStreamBYOBReader {\n constructor(stream) {\n assertRequiredArgument(stream, 1, 'ReadableStreamBYOBReader');\n assertReadableStream(stream, 'First parameter');\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\n }\n if (!IsReadableByteStreamController(stream._readableStreamController)) {\n throw new TypeError('Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte ' +\n 'source');\n }\n ReadableStreamReaderGenericInitialize(this, stream);\n this._readIntoRequests = new SimpleQueue();\n }\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the reader's lock is released before the stream finishes closing.\n */\n get closed() {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('closed'));\n }\n return this._closedPromise;\n }\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n cancel(reason = undefined) {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('cancel'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('cancel'));\n }\n return ReadableStreamReaderGenericCancel(this, reason);\n }\n read(view, rawOptions = {}) {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('read'));\n }\n if (!ArrayBuffer.isView(view)) {\n return promiseRejectedWith(new TypeError('view must be an array buffer view'));\n }\n if (view.byteLength === 0) {\n return promiseRejectedWith(new TypeError('view must have non-zero byteLength'));\n }\n if (view.buffer.byteLength === 0) {\n return promiseRejectedWith(new TypeError(`view's buffer must have non-zero byteLength`));\n }\n if (IsDetachedBuffer(view.buffer)) {\n return promiseRejectedWith(new TypeError('view\\'s buffer has been detached'));\n }\n let options;\n try {\n options = convertByobReadOptions(rawOptions, 'options');\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n const min = options.min;\n if (min === 0) {\n return promiseRejectedWith(new TypeError('options.min must be greater than 0'));\n }\n if (!isDataView(view)) {\n if (min > view.length) {\n return promiseRejectedWith(new RangeError('options.min must be less than or equal to view\\'s length'));\n }\n }\n else if (min > view.byteLength) {\n return promiseRejectedWith(new RangeError('options.min must be less than or equal to view\\'s byteLength'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('read from'));\n }\n let resolvePromise;\n let rejectPromise;\n const promise = newPromise((resolve, reject) => {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readIntoRequest = {\n _chunkSteps: chunk => resolvePromise({ value: chunk, done: false }),\n _closeSteps: chunk => resolvePromise({ value: chunk, done: true }),\n _errorSteps: e => rejectPromise(e)\n };\n ReadableStreamBYOBReaderRead(this, view, min, readIntoRequest);\n return promise;\n }\n /**\n * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader's {@link ReadableStreamBYOBReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n releaseLock() {\n if (!IsReadableStreamBYOBReader(this)) {\n throw byobReaderBrandCheckException('releaseLock');\n }\n if (this._ownerReadableStream === undefined) {\n return;\n }\n ReadableStreamBYOBReaderRelease(this);\n }\n }\n Object.defineProperties(ReadableStreamBYOBReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n });\n setFunctionName(ReadableStreamBYOBReader.prototype.cancel, 'cancel');\n setFunctionName(ReadableStreamBYOBReader.prototype.read, 'read');\n setFunctionName(ReadableStreamBYOBReader.prototype.releaseLock, 'releaseLock');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamBYOBReader.prototype, Symbol.toStringTag, {\n value: 'ReadableStreamBYOBReader',\n configurable: true\n });\n }\n // Abstract operations for the readers.\n function IsReadableStreamBYOBReader(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readIntoRequests')) {\n return false;\n }\n return x instanceof ReadableStreamBYOBReader;\n }\n function ReadableStreamBYOBReaderRead(reader, view, min, readIntoRequest) {\n const stream = reader._ownerReadableStream;\n stream._disturbed = true;\n if (stream._state === 'errored') {\n readIntoRequest._errorSteps(stream._storedError);\n }\n else {\n ReadableByteStreamControllerPullInto(stream._readableStreamController, view, min, readIntoRequest);\n }\n }\n function ReadableStreamBYOBReaderRelease(reader) {\n ReadableStreamReaderGenericRelease(reader);\n const e = new TypeError('Reader was released');\n ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e);\n }\n function ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e) {\n const readIntoRequests = reader._readIntoRequests;\n reader._readIntoRequests = new SimpleQueue();\n readIntoRequests.forEach(readIntoRequest => {\n readIntoRequest._errorSteps(e);\n });\n }\n // Helper functions for the ReadableStreamBYOBReader.\n function byobReaderBrandCheckException(name) {\n return new TypeError(`ReadableStreamBYOBReader.prototype.${name} can only be used on a ReadableStreamBYOBReader`);\n }\n\n function ExtractHighWaterMark(strategy, defaultHWM) {\n const { highWaterMark } = strategy;\n if (highWaterMark === undefined) {\n return defaultHWM;\n }\n if (NumberIsNaN(highWaterMark) || highWaterMark < 0) {\n throw new RangeError('Invalid highWaterMark');\n }\n return highWaterMark;\n }\n function ExtractSizeAlgorithm(strategy) {\n const { size } = strategy;\n if (!size) {\n return () => 1;\n }\n return size;\n }\n\n function convertQueuingStrategy(init, context) {\n assertDictionary(init, context);\n const highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark;\n const size = init === null || init === void 0 ? void 0 : init.size;\n return {\n highWaterMark: highWaterMark === undefined ? undefined : convertUnrestrictedDouble(highWaterMark),\n size: size === undefined ? undefined : convertQueuingStrategySize(size, `${context} has member 'size' that`)\n };\n }\n function convertQueuingStrategySize(fn, context) {\n assertFunction(fn, context);\n return chunk => convertUnrestrictedDouble(fn(chunk));\n }\n\n function convertUnderlyingSink(original, context) {\n assertDictionary(original, context);\n const abort = original === null || original === void 0 ? void 0 : original.abort;\n const close = original === null || original === void 0 ? void 0 : original.close;\n const start = original === null || original === void 0 ? void 0 : original.start;\n const type = original === null || original === void 0 ? void 0 : original.type;\n const write = original === null || original === void 0 ? void 0 : original.write;\n return {\n abort: abort === undefined ?\n undefined :\n convertUnderlyingSinkAbortCallback(abort, original, `${context} has member 'abort' that`),\n close: close === undefined ?\n undefined :\n convertUnderlyingSinkCloseCallback(close, original, `${context} has member 'close' that`),\n start: start === undefined ?\n undefined :\n convertUnderlyingSinkStartCallback(start, original, `${context} has member 'start' that`),\n write: write === undefined ?\n undefined :\n convertUnderlyingSinkWriteCallback(write, original, `${context} has member 'write' that`),\n type\n };\n }\n function convertUnderlyingSinkAbortCallback(fn, original, context) {\n assertFunction(fn, context);\n return (reason) => promiseCall(fn, original, [reason]);\n }\n function convertUnderlyingSinkCloseCallback(fn, original, context) {\n assertFunction(fn, context);\n return () => promiseCall(fn, original, []);\n }\n function convertUnderlyingSinkStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return (controller) => reflectCall(fn, original, [controller]);\n }\n function convertUnderlyingSinkWriteCallback(fn, original, context) {\n assertFunction(fn, context);\n return (chunk, controller) => promiseCall(fn, original, [chunk, controller]);\n }\n\n function assertWritableStream(x, context) {\n if (!IsWritableStream(x)) {\n throw new TypeError(`${context} is not a WritableStream.`);\n }\n }\n\n function isAbortSignal(value) {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n try {\n return typeof value.aborted === 'boolean';\n }\n catch (_a) {\n // AbortSignal.prototype.aborted throws if its brand check fails\n return false;\n }\n }\n const supportsAbortController = typeof AbortController === 'function';\n /**\n * Construct a new AbortController, if supported by the platform.\n *\n * @internal\n */\n function createAbortController() {\n if (supportsAbortController) {\n return new AbortController();\n }\n return undefined;\n }\n\n /**\n * A writable stream represents a destination for data, into which you can write.\n *\n * @public\n */\n class WritableStream {\n constructor(rawUnderlyingSink = {}, rawStrategy = {}) {\n if (rawUnderlyingSink === undefined) {\n rawUnderlyingSink = null;\n }\n else {\n assertObject(rawUnderlyingSink, 'First parameter');\n }\n const strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');\n const underlyingSink = convertUnderlyingSink(rawUnderlyingSink, 'First parameter');\n InitializeWritableStream(this);\n const type = underlyingSink.type;\n if (type !== undefined) {\n throw new RangeError('Invalid type is specified');\n }\n const sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n const highWaterMark = ExtractHighWaterMark(strategy, 1);\n SetUpWritableStreamDefaultControllerFromUnderlyingSink(this, underlyingSink, highWaterMark, sizeAlgorithm);\n }\n /**\n * Returns whether or not the writable stream is locked to a writer.\n */\n get locked() {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException$2('locked');\n }\n return IsWritableStreamLocked(this);\n }\n /**\n * Aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be\n * immediately moved to an errored state, with any queued-up writes discarded. This will also execute any abort\n * mechanism of the underlying sink.\n *\n * The returned promise will fulfill if the stream shuts down successfully, or reject if the underlying sink signaled\n * that there was an error doing so. Additionally, it will reject with a `TypeError` (without attempting to cancel\n * the stream) if the stream is currently locked.\n */\n abort(reason = undefined) {\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$2('abort'));\n }\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot abort a stream that already has a writer'));\n }\n return WritableStreamAbort(this, reason);\n }\n /**\n * Closes the stream. The underlying sink will finish processing any previously-written chunks, before invoking its\n * close behavior. During this time any further attempts to write will fail (without erroring the stream).\n *\n * The method returns a promise that will fulfill if all remaining chunks are successfully written and the stream\n * successfully closes, or rejects if an error is encountered during this process. Additionally, it will reject with\n * a `TypeError` (without attempting to cancel the stream) if the stream is currently locked.\n */\n close() {\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$2('close'));\n }\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot close a stream that already has a writer'));\n }\n if (WritableStreamCloseQueuedOrInFlight(this)) {\n return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));\n }\n return WritableStreamClose(this);\n }\n /**\n * Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream\n * is locked, no other writer can be acquired until this one is released.\n *\n * This functionality is especially useful for creating abstractions that desire the ability to write to a stream\n * without interruption or interleaving. By getting a writer for the stream, you can ensure nobody else can write at\n * the same time, which would cause the resulting written data to be unpredictable and probably useless.\n */\n getWriter() {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException$2('getWriter');\n }\n return AcquireWritableStreamDefaultWriter(this);\n }\n }\n Object.defineProperties(WritableStream.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n getWriter: { enumerable: true },\n locked: { enumerable: true }\n });\n setFunctionName(WritableStream.prototype.abort, 'abort');\n setFunctionName(WritableStream.prototype.close, 'close');\n setFunctionName(WritableStream.prototype.getWriter, 'getWriter');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(WritableStream.prototype, Symbol.toStringTag, {\n value: 'WritableStream',\n configurable: true\n });\n }\n // Abstract operations for the WritableStream.\n function AcquireWritableStreamDefaultWriter(stream) {\n return new WritableStreamDefaultWriter(stream);\n }\n // Throws if and only if startAlgorithm throws.\n function CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark = 1, sizeAlgorithm = () => 1) {\n const stream = Object.create(WritableStream.prototype);\n InitializeWritableStream(stream);\n const controller = Object.create(WritableStreamDefaultController.prototype);\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n }\n function InitializeWritableStream(stream) {\n stream._state = 'writable';\n // The error that will be reported by new method calls once the state becomes errored. Only set when [[state]] is\n // 'erroring' or 'errored'. May be set to an undefined value.\n stream._storedError = undefined;\n stream._writer = undefined;\n // Initialize to undefined first because the constructor of the controller checks this\n // variable to validate the caller.\n stream._writableStreamController = undefined;\n // This queue is placed here instead of the writer class in order to allow for passing a writer to the next data\n // producer without waiting for the queued writes to finish.\n stream._writeRequests = new SimpleQueue();\n // Write requests are removed from _writeRequests when write() is called on the underlying sink. This prevents\n // them from being erroneously rejected on error. If a write() call is in-flight, the request is stored here.\n stream._inFlightWriteRequest = undefined;\n // The promise that was returned from writer.close(). Stored here because it may be fulfilled after the writer\n // has been detached.\n stream._closeRequest = undefined;\n // Close request is removed from _closeRequest when close() is called on the underlying sink. This prevents it\n // from being erroneously rejected on error. If a close() call is in-flight, the request is stored here.\n stream._inFlightCloseRequest = undefined;\n // The promise that was returned from writer.abort(). This may also be fulfilled after the writer has detached.\n stream._pendingAbortRequest = undefined;\n // The backpressure signal set by the controller.\n stream._backpressure = false;\n }\n function IsWritableStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_writableStreamController')) {\n return false;\n }\n return x instanceof WritableStream;\n }\n function IsWritableStreamLocked(stream) {\n if (stream._writer === undefined) {\n return false;\n }\n return true;\n }\n function WritableStreamAbort(stream, reason) {\n var _a;\n if (stream._state === 'closed' || stream._state === 'errored') {\n return promiseResolvedWith(undefined);\n }\n stream._writableStreamController._abortReason = reason;\n (_a = stream._writableStreamController._abortController) === null || _a === void 0 ? void 0 : _a.abort(reason);\n // TypeScript narrows the type of `stream._state` down to 'writable' | 'erroring',\n // but it doesn't know that signaling abort runs author code that might have changed the state.\n // Widen the type again by casting to WritableStreamState.\n const state = stream._state;\n if (state === 'closed' || state === 'errored') {\n return promiseResolvedWith(undefined);\n }\n if (stream._pendingAbortRequest !== undefined) {\n return stream._pendingAbortRequest._promise;\n }\n let wasAlreadyErroring = false;\n if (state === 'erroring') {\n wasAlreadyErroring = true;\n // reason will not be used, so don't keep a reference to it.\n reason = undefined;\n }\n const promise = newPromise((resolve, reject) => {\n stream._pendingAbortRequest = {\n _promise: undefined,\n _resolve: resolve,\n _reject: reject,\n _reason: reason,\n _wasAlreadyErroring: wasAlreadyErroring\n };\n });\n stream._pendingAbortRequest._promise = promise;\n if (!wasAlreadyErroring) {\n WritableStreamStartErroring(stream, reason);\n }\n return promise;\n }\n function WritableStreamClose(stream) {\n const state = stream._state;\n if (state === 'closed' || state === 'errored') {\n return promiseRejectedWith(new TypeError(`The stream (in ${state} state) is not in the writable state and cannot be closed`));\n }\n const promise = newPromise((resolve, reject) => {\n const closeRequest = {\n _resolve: resolve,\n _reject: reject\n };\n stream._closeRequest = closeRequest;\n });\n const writer = stream._writer;\n if (writer !== undefined && stream._backpressure && state === 'writable') {\n defaultWriterReadyPromiseResolve(writer);\n }\n WritableStreamDefaultControllerClose(stream._writableStreamController);\n return promise;\n }\n // WritableStream API exposed for controllers.\n function WritableStreamAddWriteRequest(stream) {\n const promise = newPromise((resolve, reject) => {\n const writeRequest = {\n _resolve: resolve,\n _reject: reject\n };\n stream._writeRequests.push(writeRequest);\n });\n return promise;\n }\n function WritableStreamDealWithRejection(stream, error) {\n const state = stream._state;\n if (state === 'writable') {\n WritableStreamStartErroring(stream, error);\n return;\n }\n WritableStreamFinishErroring(stream);\n }\n function WritableStreamStartErroring(stream, reason) {\n const controller = stream._writableStreamController;\n stream._state = 'erroring';\n stream._storedError = reason;\n const writer = stream._writer;\n if (writer !== undefined) {\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason);\n }\n if (!WritableStreamHasOperationMarkedInFlight(stream) && controller._started) {\n WritableStreamFinishErroring(stream);\n }\n }\n function WritableStreamFinishErroring(stream) {\n stream._state = 'errored';\n stream._writableStreamController[ErrorSteps]();\n const storedError = stream._storedError;\n stream._writeRequests.forEach(writeRequest => {\n writeRequest._reject(storedError);\n });\n stream._writeRequests = new SimpleQueue();\n if (stream._pendingAbortRequest === undefined) {\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n const abortRequest = stream._pendingAbortRequest;\n stream._pendingAbortRequest = undefined;\n if (abortRequest._wasAlreadyErroring) {\n abortRequest._reject(storedError);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n const promise = stream._writableStreamController[AbortSteps](abortRequest._reason);\n uponPromise(promise, () => {\n abortRequest._resolve();\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return null;\n }, (reason) => {\n abortRequest._reject(reason);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return null;\n });\n }\n function WritableStreamFinishInFlightWrite(stream) {\n stream._inFlightWriteRequest._resolve(undefined);\n stream._inFlightWriteRequest = undefined;\n }\n function WritableStreamFinishInFlightWriteWithError(stream, error) {\n stream._inFlightWriteRequest._reject(error);\n stream._inFlightWriteRequest = undefined;\n WritableStreamDealWithRejection(stream, error);\n }\n function WritableStreamFinishInFlightClose(stream) {\n stream._inFlightCloseRequest._resolve(undefined);\n stream._inFlightCloseRequest = undefined;\n const state = stream._state;\n if (state === 'erroring') {\n // The error was too late to do anything, so it is ignored.\n stream._storedError = undefined;\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._resolve();\n stream._pendingAbortRequest = undefined;\n }\n }\n stream._state = 'closed';\n const writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseResolve(writer);\n }\n }\n function WritableStreamFinishInFlightCloseWithError(stream, error) {\n stream._inFlightCloseRequest._reject(error);\n stream._inFlightCloseRequest = undefined;\n // Never execute sink abort() after sink close().\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._reject(error);\n stream._pendingAbortRequest = undefined;\n }\n WritableStreamDealWithRejection(stream, error);\n }\n // TODO(ricea): Fix alphabetical order.\n function WritableStreamCloseQueuedOrInFlight(stream) {\n if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n return true;\n }\n function WritableStreamHasOperationMarkedInFlight(stream) {\n if (stream._inFlightWriteRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n return true;\n }\n function WritableStreamMarkCloseRequestInFlight(stream) {\n stream._inFlightCloseRequest = stream._closeRequest;\n stream._closeRequest = undefined;\n }\n function WritableStreamMarkFirstWriteRequestInFlight(stream) {\n stream._inFlightWriteRequest = stream._writeRequests.shift();\n }\n function WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream) {\n if (stream._closeRequest !== undefined) {\n stream._closeRequest._reject(stream._storedError);\n stream._closeRequest = undefined;\n }\n const writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseReject(writer, stream._storedError);\n }\n }\n function WritableStreamUpdateBackpressure(stream, backpressure) {\n const writer = stream._writer;\n if (writer !== undefined && backpressure !== stream._backpressure) {\n if (backpressure) {\n defaultWriterReadyPromiseReset(writer);\n }\n else {\n defaultWriterReadyPromiseResolve(writer);\n }\n }\n stream._backpressure = backpressure;\n }\n /**\n * A default writer vended by a {@link WritableStream}.\n *\n * @public\n */\n class WritableStreamDefaultWriter {\n constructor(stream) {\n assertRequiredArgument(stream, 1, 'WritableStreamDefaultWriter');\n assertWritableStream(stream, 'First parameter');\n if (IsWritableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive writing by another writer');\n }\n this._ownerWritableStream = stream;\n stream._writer = this;\n const state = stream._state;\n if (state === 'writable') {\n if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._backpressure) {\n defaultWriterReadyPromiseInitialize(this);\n }\n else {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n }\n defaultWriterClosedPromiseInitialize(this);\n }\n else if (state === 'erroring') {\n defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError);\n defaultWriterClosedPromiseInitialize(this);\n }\n else if (state === 'closed') {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n defaultWriterClosedPromiseInitializeAsResolved(this);\n }\n else {\n const storedError = stream._storedError;\n defaultWriterReadyPromiseInitializeAsRejected(this, storedError);\n defaultWriterClosedPromiseInitializeAsRejected(this, storedError);\n }\n }\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the writer’s lock is released before the stream finishes closing.\n */\n get closed() {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('closed'));\n }\n return this._closedPromise;\n }\n /**\n * Returns the desired size to fill the stream’s internal queue. It can be negative, if the queue is over-full.\n * A producer can use this information to determine the right amount of data to write.\n *\n * It will be `null` if the stream cannot be successfully written to (due to either being errored, or having an abort\n * queued up). It will return zero if the stream is closed. And the getter will throw an exception if invoked when\n * the writer’s lock is released.\n */\n get desiredSize() {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException('desiredSize');\n }\n if (this._ownerWritableStream === undefined) {\n throw defaultWriterLockException('desiredSize');\n }\n return WritableStreamDefaultWriterGetDesiredSize(this);\n }\n /**\n * Returns a promise that will be fulfilled when the desired size to fill the stream’s internal queue transitions\n * from non-positive to positive, signaling that it is no longer applying backpressure. Once the desired size dips\n * back to zero or below, the getter will return a new promise that stays pending until the next transition.\n *\n * If the stream becomes errored or aborted, or the writer’s lock is released, the returned promise will become\n * rejected.\n */\n get ready() {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('ready'));\n }\n return this._readyPromise;\n }\n /**\n * If the reader is active, behaves the same as {@link WritableStream.abort | stream.abort(reason)}.\n */\n abort(reason = undefined) {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('abort'));\n }\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('abort'));\n }\n return WritableStreamDefaultWriterAbort(this, reason);\n }\n /**\n * If the reader is active, behaves the same as {@link WritableStream.close | stream.close()}.\n */\n close() {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('close'));\n }\n const stream = this._ownerWritableStream;\n if (stream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('close'));\n }\n if (WritableStreamCloseQueuedOrInFlight(stream)) {\n return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));\n }\n return WritableStreamDefaultWriterClose(this);\n }\n /**\n * Releases the writer’s lock on the corresponding stream. After the lock is released, the writer is no longer active.\n * If the associated stream is errored when the lock is released, the writer will appear errored in the same way from\n * now on; otherwise, the writer will appear closed.\n *\n * Note that the lock can still be released even if some ongoing writes have not yet finished (i.e. even if the\n * promises returned from previous calls to {@link WritableStreamDefaultWriter.write | write()} have not yet settled).\n * It’s not necessary to hold the lock on the writer for the duration of the write; the lock instead simply prevents\n * other producers from writing in an interleaved manner.\n */\n releaseLock() {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException('releaseLock');\n }\n const stream = this._ownerWritableStream;\n if (stream === undefined) {\n return;\n }\n WritableStreamDefaultWriterRelease(this);\n }\n write(chunk = undefined) {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('write'));\n }\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('write to'));\n }\n return WritableStreamDefaultWriterWrite(this, chunk);\n }\n }\n Object.defineProperties(WritableStreamDefaultWriter.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n releaseLock: { enumerable: true },\n write: { enumerable: true },\n closed: { enumerable: true },\n desiredSize: { enumerable: true },\n ready: { enumerable: true }\n });\n setFunctionName(WritableStreamDefaultWriter.prototype.abort, 'abort');\n setFunctionName(WritableStreamDefaultWriter.prototype.close, 'close');\n setFunctionName(WritableStreamDefaultWriter.prototype.releaseLock, 'releaseLock');\n setFunctionName(WritableStreamDefaultWriter.prototype.write, 'write');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(WritableStreamDefaultWriter.prototype, Symbol.toStringTag, {\n value: 'WritableStreamDefaultWriter',\n configurable: true\n });\n }\n // Abstract operations for the WritableStreamDefaultWriter.\n function IsWritableStreamDefaultWriter(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_ownerWritableStream')) {\n return false;\n }\n return x instanceof WritableStreamDefaultWriter;\n }\n // A client of WritableStreamDefaultWriter may use these functions directly to bypass state check.\n function WritableStreamDefaultWriterAbort(writer, reason) {\n const stream = writer._ownerWritableStream;\n return WritableStreamAbort(stream, reason);\n }\n function WritableStreamDefaultWriterClose(writer) {\n const stream = writer._ownerWritableStream;\n return WritableStreamClose(stream);\n }\n function WritableStreamDefaultWriterCloseWithErrorPropagation(writer) {\n const stream = writer._ownerWritableStream;\n const state = stream._state;\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {\n return promiseResolvedWith(undefined);\n }\n if (state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n return WritableStreamDefaultWriterClose(writer);\n }\n function WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) {\n if (writer._closedPromiseState === 'pending') {\n defaultWriterClosedPromiseReject(writer, error);\n }\n else {\n defaultWriterClosedPromiseResetToRejected(writer, error);\n }\n }\n function WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) {\n if (writer._readyPromiseState === 'pending') {\n defaultWriterReadyPromiseReject(writer, error);\n }\n else {\n defaultWriterReadyPromiseResetToRejected(writer, error);\n }\n }\n function WritableStreamDefaultWriterGetDesiredSize(writer) {\n const stream = writer._ownerWritableStream;\n const state = stream._state;\n if (state === 'errored' || state === 'erroring') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController);\n }\n function WritableStreamDefaultWriterRelease(writer) {\n const stream = writer._ownerWritableStream;\n const releasedError = new TypeError(`Writer was released and can no longer be used to monitor the stream's closedness`);\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError);\n // The state transitions to \"errored\" before the sink abort() method runs, but the writer.closed promise is not\n // rejected until afterwards. This means that simply testing state will not work.\n WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError);\n stream._writer = undefined;\n writer._ownerWritableStream = undefined;\n }\n function WritableStreamDefaultWriterWrite(writer, chunk) {\n const stream = writer._ownerWritableStream;\n const controller = stream._writableStreamController;\n const chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk);\n if (stream !== writer._ownerWritableStream) {\n return promiseRejectedWith(defaultWriterLockException('write to'));\n }\n const state = stream._state;\n if (state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {\n return promiseRejectedWith(new TypeError('The stream is closing or closed and cannot be written to'));\n }\n if (state === 'erroring') {\n return promiseRejectedWith(stream._storedError);\n }\n const promise = WritableStreamAddWriteRequest(stream);\n WritableStreamDefaultControllerWrite(controller, chunk, chunkSize);\n return promise;\n }\n const closeSentinel = {};\n /**\n * Allows control of a {@link WritableStream | writable stream}'s state and internal queue.\n *\n * @public\n */\n class WritableStreamDefaultController {\n constructor() {\n throw new TypeError('Illegal constructor');\n }\n /**\n * The reason which was passed to `WritableStream.abort(reason)` when the stream was aborted.\n *\n * @deprecated\n * This property has been removed from the specification, see https://github.com/whatwg/streams/pull/1177.\n * Use {@link WritableStreamDefaultController.signal}'s `reason` instead.\n */\n get abortReason() {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('abortReason');\n }\n return this._abortReason;\n }\n /**\n * An `AbortSignal` that can be used to abort the pending write or close operation when the stream is aborted.\n */\n get signal() {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('signal');\n }\n if (this._abortController === undefined) {\n // Older browsers or older Node versions may not support `AbortController` or `AbortSignal`.\n // We don't want to bundle and ship an `AbortController` polyfill together with our polyfill,\n // so instead we only implement support for `signal` if we find a global `AbortController` constructor.\n throw new TypeError('WritableStreamDefaultController.prototype.signal is not supported');\n }\n return this._abortController.signal;\n }\n /**\n * Closes the controlled writable stream, making all future interactions with it fail with the given error `e`.\n *\n * This method is rarely used, since usually it suffices to return a rejected promise from one of the underlying\n * sink's methods. However, it can be useful for suddenly shutting down a stream in response to an event outside the\n * normal lifecycle of interactions with the underlying sink.\n */\n error(e = undefined) {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('error');\n }\n const state = this._controlledWritableStream._state;\n if (state !== 'writable') {\n // The stream is closed, errored or will be soon. The sink can't do anything useful if it gets an error here, so\n // just treat it as a no-op.\n return;\n }\n WritableStreamDefaultControllerError(this, e);\n }\n /** @internal */\n [AbortSteps](reason) {\n const result = this._abortAlgorithm(reason);\n WritableStreamDefaultControllerClearAlgorithms(this);\n return result;\n }\n /** @internal */\n [ErrorSteps]() {\n ResetQueue(this);\n }\n }\n Object.defineProperties(WritableStreamDefaultController.prototype, {\n abortReason: { enumerable: true },\n signal: { enumerable: true },\n error: { enumerable: true }\n });\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(WritableStreamDefaultController.prototype, Symbol.toStringTag, {\n value: 'WritableStreamDefaultController',\n configurable: true\n });\n }\n // Abstract operations implementing interface required by the WritableStream.\n function IsWritableStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledWritableStream')) {\n return false;\n }\n return x instanceof WritableStreamDefaultController;\n }\n function SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\n controller._controlledWritableStream = stream;\n stream._writableStreamController = controller;\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\n controller._queue = undefined;\n controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._abortReason = undefined;\n controller._abortController = createAbortController();\n controller._started = false;\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n controller._writeAlgorithm = writeAlgorithm;\n controller._closeAlgorithm = closeAlgorithm;\n controller._abortAlgorithm = abortAlgorithm;\n const backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n const startResult = startAlgorithm();\n const startPromise = promiseResolvedWith(startResult);\n uponPromise(startPromise, () => {\n controller._started = true;\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n return null;\n }, r => {\n controller._started = true;\n WritableStreamDealWithRejection(stream, r);\n return null;\n });\n }\n function SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, highWaterMark, sizeAlgorithm) {\n const controller = Object.create(WritableStreamDefaultController.prototype);\n let startAlgorithm;\n let writeAlgorithm;\n let closeAlgorithm;\n let abortAlgorithm;\n if (underlyingSink.start !== undefined) {\n startAlgorithm = () => underlyingSink.start(controller);\n }\n else {\n startAlgorithm = () => undefined;\n }\n if (underlyingSink.write !== undefined) {\n writeAlgorithm = chunk => underlyingSink.write(chunk, controller);\n }\n else {\n writeAlgorithm = () => promiseResolvedWith(undefined);\n }\n if (underlyingSink.close !== undefined) {\n closeAlgorithm = () => underlyingSink.close();\n }\n else {\n closeAlgorithm = () => promiseResolvedWith(undefined);\n }\n if (underlyingSink.abort !== undefined) {\n abortAlgorithm = reason => underlyingSink.abort(reason);\n }\n else {\n abortAlgorithm = () => promiseResolvedWith(undefined);\n }\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\n }\n // ClearAlgorithms may be called twice. Erroring the same stream in multiple ways will often result in redundant calls.\n function WritableStreamDefaultControllerClearAlgorithms(controller) {\n controller._writeAlgorithm = undefined;\n controller._closeAlgorithm = undefined;\n controller._abortAlgorithm = undefined;\n controller._strategySizeAlgorithm = undefined;\n }\n function WritableStreamDefaultControllerClose(controller) {\n EnqueueValueWithSize(controller, closeSentinel, 0);\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }\n function WritableStreamDefaultControllerGetChunkSize(controller, chunk) {\n try {\n return controller._strategySizeAlgorithm(chunk);\n }\n catch (chunkSizeE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE);\n return 1;\n }\n }\n function WritableStreamDefaultControllerGetDesiredSize(controller) {\n return controller._strategyHWM - controller._queueTotalSize;\n }\n function WritableStreamDefaultControllerWrite(controller, chunk, chunkSize) {\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n }\n catch (enqueueE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE);\n return;\n }\n const stream = controller._controlledWritableStream;\n if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._state === 'writable') {\n const backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }\n // Abstract operations for the WritableStreamDefaultController.\n function WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) {\n const stream = controller._controlledWritableStream;\n if (!controller._started) {\n return;\n }\n if (stream._inFlightWriteRequest !== undefined) {\n return;\n }\n const state = stream._state;\n if (state === 'erroring') {\n WritableStreamFinishErroring(stream);\n return;\n }\n if (controller._queue.length === 0) {\n return;\n }\n const value = PeekQueueValue(controller);\n if (value === closeSentinel) {\n WritableStreamDefaultControllerProcessClose(controller);\n }\n else {\n WritableStreamDefaultControllerProcessWrite(controller, value);\n }\n }\n function WritableStreamDefaultControllerErrorIfNeeded(controller, error) {\n if (controller._controlledWritableStream._state === 'writable') {\n WritableStreamDefaultControllerError(controller, error);\n }\n }\n function WritableStreamDefaultControllerProcessClose(controller) {\n const stream = controller._controlledWritableStream;\n WritableStreamMarkCloseRequestInFlight(stream);\n DequeueValue(controller);\n const sinkClosePromise = controller._closeAlgorithm();\n WritableStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(sinkClosePromise, () => {\n WritableStreamFinishInFlightClose(stream);\n return null;\n }, reason => {\n WritableStreamFinishInFlightCloseWithError(stream, reason);\n return null;\n });\n }\n function WritableStreamDefaultControllerProcessWrite(controller, chunk) {\n const stream = controller._controlledWritableStream;\n WritableStreamMarkFirstWriteRequestInFlight(stream);\n const sinkWritePromise = controller._writeAlgorithm(chunk);\n uponPromise(sinkWritePromise, () => {\n WritableStreamFinishInFlightWrite(stream);\n const state = stream._state;\n DequeueValue(controller);\n if (!WritableStreamCloseQueuedOrInFlight(stream) && state === 'writable') {\n const backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n return null;\n }, reason => {\n if (stream._state === 'writable') {\n WritableStreamDefaultControllerClearAlgorithms(controller);\n }\n WritableStreamFinishInFlightWriteWithError(stream, reason);\n return null;\n });\n }\n function WritableStreamDefaultControllerGetBackpressure(controller) {\n const desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller);\n return desiredSize <= 0;\n }\n // A client of WritableStreamDefaultController may use these functions directly to bypass state check.\n function WritableStreamDefaultControllerError(controller, error) {\n const stream = controller._controlledWritableStream;\n WritableStreamDefaultControllerClearAlgorithms(controller);\n WritableStreamStartErroring(stream, error);\n }\n // Helper functions for the WritableStream.\n function streamBrandCheckException$2(name) {\n return new TypeError(`WritableStream.prototype.${name} can only be used on a WritableStream`);\n }\n // Helper functions for the WritableStreamDefaultController.\n function defaultControllerBrandCheckException$2(name) {\n return new TypeError(`WritableStreamDefaultController.prototype.${name} can only be used on a WritableStreamDefaultController`);\n }\n // Helper functions for the WritableStreamDefaultWriter.\n function defaultWriterBrandCheckException(name) {\n return new TypeError(`WritableStreamDefaultWriter.prototype.${name} can only be used on a WritableStreamDefaultWriter`);\n }\n function defaultWriterLockException(name) {\n return new TypeError('Cannot ' + name + ' a stream using a released writer');\n }\n function defaultWriterClosedPromiseInitialize(writer) {\n writer._closedPromise = newPromise((resolve, reject) => {\n writer._closedPromise_resolve = resolve;\n writer._closedPromise_reject = reject;\n writer._closedPromiseState = 'pending';\n });\n }\n function defaultWriterClosedPromiseInitializeAsRejected(writer, reason) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseReject(writer, reason);\n }\n function defaultWriterClosedPromiseInitializeAsResolved(writer) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseResolve(writer);\n }\n function defaultWriterClosedPromiseReject(writer, reason) {\n if (writer._closedPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(writer._closedPromise);\n writer._closedPromise_reject(reason);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = 'rejected';\n }\n function defaultWriterClosedPromiseResetToRejected(writer, reason) {\n defaultWriterClosedPromiseInitializeAsRejected(writer, reason);\n }\n function defaultWriterClosedPromiseResolve(writer) {\n if (writer._closedPromise_resolve === undefined) {\n return;\n }\n writer._closedPromise_resolve(undefined);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = 'resolved';\n }\n function defaultWriterReadyPromiseInitialize(writer) {\n writer._readyPromise = newPromise((resolve, reject) => {\n writer._readyPromise_resolve = resolve;\n writer._readyPromise_reject = reject;\n });\n writer._readyPromiseState = 'pending';\n }\n function defaultWriterReadyPromiseInitializeAsRejected(writer, reason) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseReject(writer, reason);\n }\n function defaultWriterReadyPromiseInitializeAsResolved(writer) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseResolve(writer);\n }\n function defaultWriterReadyPromiseReject(writer, reason) {\n if (writer._readyPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(writer._readyPromise);\n writer._readyPromise_reject(reason);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = 'rejected';\n }\n function defaultWriterReadyPromiseReset(writer) {\n defaultWriterReadyPromiseInitialize(writer);\n }\n function defaultWriterReadyPromiseResetToRejected(writer, reason) {\n defaultWriterReadyPromiseInitializeAsRejected(writer, reason);\n }\n function defaultWriterReadyPromiseResolve(writer) {\n if (writer._readyPromise_resolve === undefined) {\n return;\n }\n writer._readyPromise_resolve(undefined);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = 'fulfilled';\n }\n\n /// \n function getGlobals() {\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n else if (typeof self !== 'undefined') {\n return self;\n }\n else if (typeof global !== 'undefined') {\n return global;\n }\n return undefined;\n }\n const globals = getGlobals();\n\n /// \n function isDOMExceptionConstructor(ctor) {\n if (!(typeof ctor === 'function' || typeof ctor === 'object')) {\n return false;\n }\n if (ctor.name !== 'DOMException') {\n return false;\n }\n try {\n new ctor();\n return true;\n }\n catch (_a) {\n return false;\n }\n }\n /**\n * Support:\n * - Web browsers\n * - Node 18 and higher (https://github.com/nodejs/node/commit/e4b1fb5e6422c1ff151234bb9de792d45dd88d87)\n */\n function getFromGlobal() {\n const ctor = globals === null || globals === void 0 ? void 0 : globals.DOMException;\n return isDOMExceptionConstructor(ctor) ? ctor : undefined;\n }\n /**\n * Support:\n * - All platforms\n */\n function createPolyfill() {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const ctor = function DOMException(message, name) {\n this.message = message || '';\n this.name = name || 'Error';\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n };\n setFunctionName(ctor, 'DOMException');\n ctor.prototype = Object.create(Error.prototype);\n Object.defineProperty(ctor.prototype, 'constructor', { value: ctor, writable: true, configurable: true });\n return ctor;\n }\n // eslint-disable-next-line @typescript-eslint/no-redeclare\n const DOMException = getFromGlobal() || createPolyfill();\n\n function ReadableStreamPipeTo(source, dest, preventClose, preventAbort, preventCancel, signal) {\n const reader = AcquireReadableStreamDefaultReader(source);\n const writer = AcquireWritableStreamDefaultWriter(dest);\n source._disturbed = true;\n let shuttingDown = false;\n // This is used to keep track of the spec's requirement that we wait for ongoing writes during shutdown.\n let currentWrite = promiseResolvedWith(undefined);\n return newPromise((resolve, reject) => {\n let abortAlgorithm;\n if (signal !== undefined) {\n abortAlgorithm = () => {\n const error = signal.reason !== undefined ? signal.reason : new DOMException('Aborted', 'AbortError');\n const actions = [];\n if (!preventAbort) {\n actions.push(() => {\n if (dest._state === 'writable') {\n return WritableStreamAbort(dest, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n if (!preventCancel) {\n actions.push(() => {\n if (source._state === 'readable') {\n return ReadableStreamCancel(source, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n shutdownWithAction(() => Promise.all(actions.map(action => action())), true, error);\n };\n if (signal.aborted) {\n abortAlgorithm();\n return;\n }\n signal.addEventListener('abort', abortAlgorithm);\n }\n // Using reader and writer, read all chunks from this and write them to dest\n // - Backpressure must be enforced\n // - Shutdown must stop all activity\n function pipeLoop() {\n return newPromise((resolveLoop, rejectLoop) => {\n function next(done) {\n if (done) {\n resolveLoop();\n }\n else {\n // Use `PerformPromiseThen` instead of `uponPromise` to avoid\n // adding unnecessary `.catch(rethrowAssertionErrorRejection)` handlers\n PerformPromiseThen(pipeStep(), next, rejectLoop);\n }\n }\n next(false);\n });\n }\n function pipeStep() {\n if (shuttingDown) {\n return promiseResolvedWith(true);\n }\n return PerformPromiseThen(writer._readyPromise, () => {\n return newPromise((resolveRead, rejectRead) => {\n ReadableStreamDefaultReaderRead(reader, {\n _chunkSteps: chunk => {\n currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), undefined, noop);\n resolveRead(false);\n },\n _closeSteps: () => resolveRead(true),\n _errorSteps: rejectRead\n });\n });\n });\n }\n // Errors must be propagated forward\n isOrBecomesErrored(source, reader._closedPromise, storedError => {\n if (!preventAbort) {\n shutdownWithAction(() => WritableStreamAbort(dest, storedError), true, storedError);\n }\n else {\n shutdown(true, storedError);\n }\n return null;\n });\n // Errors must be propagated backward\n isOrBecomesErrored(dest, writer._closedPromise, storedError => {\n if (!preventCancel) {\n shutdownWithAction(() => ReadableStreamCancel(source, storedError), true, storedError);\n }\n else {\n shutdown(true, storedError);\n }\n return null;\n });\n // Closing must be propagated forward\n isOrBecomesClosed(source, reader._closedPromise, () => {\n if (!preventClose) {\n shutdownWithAction(() => WritableStreamDefaultWriterCloseWithErrorPropagation(writer));\n }\n else {\n shutdown();\n }\n return null;\n });\n // Closing must be propagated backward\n if (WritableStreamCloseQueuedOrInFlight(dest) || dest._state === 'closed') {\n const destClosed = new TypeError('the destination writable stream closed before all data could be piped to it');\n if (!preventCancel) {\n shutdownWithAction(() => ReadableStreamCancel(source, destClosed), true, destClosed);\n }\n else {\n shutdown(true, destClosed);\n }\n }\n setPromiseIsHandledToTrue(pipeLoop());\n function waitForWritesToFinish() {\n // Another write may have started while we were waiting on this currentWrite, so we have to be sure to wait\n // for that too.\n const oldCurrentWrite = currentWrite;\n return PerformPromiseThen(currentWrite, () => oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : undefined);\n }\n function isOrBecomesErrored(stream, promise, action) {\n if (stream._state === 'errored') {\n action(stream._storedError);\n }\n else {\n uponRejection(promise, action);\n }\n }\n function isOrBecomesClosed(stream, promise, action) {\n if (stream._state === 'closed') {\n action();\n }\n else {\n uponFulfillment(promise, action);\n }\n }\n function shutdownWithAction(action, originalIsError, originalError) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), doTheRest);\n }\n else {\n doTheRest();\n }\n function doTheRest() {\n uponPromise(action(), () => finalize(originalIsError, originalError), newError => finalize(true, newError));\n return null;\n }\n }\n function shutdown(isError, error) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), () => finalize(isError, error));\n }\n else {\n finalize(isError, error);\n }\n }\n function finalize(isError, error) {\n WritableStreamDefaultWriterRelease(writer);\n ReadableStreamReaderGenericRelease(reader);\n if (signal !== undefined) {\n signal.removeEventListener('abort', abortAlgorithm);\n }\n if (isError) {\n reject(error);\n }\n else {\n resolve(undefined);\n }\n return null;\n }\n });\n }\n\n /**\n * Allows control of a {@link ReadableStream | readable stream}'s state and internal queue.\n *\n * @public\n */\n class ReadableStreamDefaultController {\n constructor() {\n throw new TypeError('Illegal constructor');\n }\n /**\n * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is\n * over-full. An underlying source ought to use this information to determine when and how to apply backpressure.\n */\n get desiredSize() {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('desiredSize');\n }\n return ReadableStreamDefaultControllerGetDesiredSize(this);\n }\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n close() {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('close');\n }\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError('The stream is not in a state that permits close');\n }\n ReadableStreamDefaultControllerClose(this);\n }\n enqueue(chunk = undefined) {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('enqueue');\n }\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError('The stream is not in a state that permits enqueue');\n }\n return ReadableStreamDefaultControllerEnqueue(this, chunk);\n }\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n error(e = undefined) {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('error');\n }\n ReadableStreamDefaultControllerError(this, e);\n }\n /** @internal */\n [CancelSteps](reason) {\n ResetQueue(this);\n const result = this._cancelAlgorithm(reason);\n ReadableStreamDefaultControllerClearAlgorithms(this);\n return result;\n }\n /** @internal */\n [PullSteps](readRequest) {\n const stream = this._controlledReadableStream;\n if (this._queue.length > 0) {\n const chunk = DequeueValue(this);\n if (this._closeRequested && this._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(this);\n ReadableStreamClose(stream);\n }\n else {\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n readRequest._chunkSteps(chunk);\n }\n else {\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n }\n /** @internal */\n [ReleaseSteps]() {\n // Do nothing.\n }\n }\n Object.defineProperties(ReadableStreamDefaultController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n desiredSize: { enumerable: true }\n });\n setFunctionName(ReadableStreamDefaultController.prototype.close, 'close');\n setFunctionName(ReadableStreamDefaultController.prototype.enqueue, 'enqueue');\n setFunctionName(ReadableStreamDefaultController.prototype.error, 'error');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamDefaultController.prototype, Symbol.toStringTag, {\n value: 'ReadableStreamDefaultController',\n configurable: true\n });\n }\n // Abstract operations for the ReadableStreamDefaultController.\n function IsReadableStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableStream')) {\n return false;\n }\n return x instanceof ReadableStreamDefaultController;\n }\n function ReadableStreamDefaultControllerCallPullIfNeeded(controller) {\n const shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n controller._pulling = true;\n const pullPromise = controller._pullAlgorithm();\n uponPromise(pullPromise, () => {\n controller._pulling = false;\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }\n return null;\n }, e => {\n ReadableStreamDefaultControllerError(controller, e);\n return null;\n });\n }\n function ReadableStreamDefaultControllerShouldCallPull(controller) {\n const stream = controller._controlledReadableStream;\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return false;\n }\n if (!controller._started) {\n return false;\n }\n if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n return true;\n }\n const desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller);\n if (desiredSize > 0) {\n return true;\n }\n return false;\n }\n function ReadableStreamDefaultControllerClearAlgorithms(controller) {\n controller._pullAlgorithm = undefined;\n controller._cancelAlgorithm = undefined;\n controller._strategySizeAlgorithm = undefined;\n }\n // A client of ReadableStreamDefaultController may use these functions directly to bypass state check.\n function ReadableStreamDefaultControllerClose(controller) {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n const stream = controller._controlledReadableStream;\n controller._closeRequested = true;\n if (controller._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n }\n }\n function ReadableStreamDefaultControllerEnqueue(controller, chunk) {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n const stream = controller._controlledReadableStream;\n if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n ReadableStreamFulfillReadRequest(stream, chunk, false);\n }\n else {\n let chunkSize;\n try {\n chunkSize = controller._strategySizeAlgorithm(chunk);\n }\n catch (chunkSizeE) {\n ReadableStreamDefaultControllerError(controller, chunkSizeE);\n throw chunkSizeE;\n }\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n }\n catch (enqueueE) {\n ReadableStreamDefaultControllerError(controller, enqueueE);\n throw enqueueE;\n }\n }\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }\n function ReadableStreamDefaultControllerError(controller, e) {\n const stream = controller._controlledReadableStream;\n if (stream._state !== 'readable') {\n return;\n }\n ResetQueue(controller);\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n }\n function ReadableStreamDefaultControllerGetDesiredSize(controller) {\n const state = controller._controlledReadableStream._state;\n if (state === 'errored') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return controller._strategyHWM - controller._queueTotalSize;\n }\n // This is used in the implementation of TransformStream.\n function ReadableStreamDefaultControllerHasBackpressure(controller) {\n if (ReadableStreamDefaultControllerShouldCallPull(controller)) {\n return false;\n }\n return true;\n }\n function ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) {\n const state = controller._controlledReadableStream._state;\n if (!controller._closeRequested && state === 'readable') {\n return true;\n }\n return false;\n }\n function SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) {\n controller._controlledReadableStream = stream;\n controller._queue = undefined;\n controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._started = false;\n controller._closeRequested = false;\n controller._pullAgain = false;\n controller._pulling = false;\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n stream._readableStreamController = controller;\n const startResult = startAlgorithm();\n uponPromise(promiseResolvedWith(startResult), () => {\n controller._started = true;\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n return null;\n }, r => {\n ReadableStreamDefaultControllerError(controller, r);\n return null;\n });\n }\n function SetUpReadableStreamDefaultControllerFromUnderlyingSource(stream, underlyingSource, highWaterMark, sizeAlgorithm) {\n const controller = Object.create(ReadableStreamDefaultController.prototype);\n let startAlgorithm;\n let pullAlgorithm;\n let cancelAlgorithm;\n if (underlyingSource.start !== undefined) {\n startAlgorithm = () => underlyingSource.start(controller);\n }\n else {\n startAlgorithm = () => undefined;\n }\n if (underlyingSource.pull !== undefined) {\n pullAlgorithm = () => underlyingSource.pull(controller);\n }\n else {\n pullAlgorithm = () => promiseResolvedWith(undefined);\n }\n if (underlyingSource.cancel !== undefined) {\n cancelAlgorithm = reason => underlyingSource.cancel(reason);\n }\n else {\n cancelAlgorithm = () => promiseResolvedWith(undefined);\n }\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n }\n // Helper functions for the ReadableStreamDefaultController.\n function defaultControllerBrandCheckException$1(name) {\n return new TypeError(`ReadableStreamDefaultController.prototype.${name} can only be used on a ReadableStreamDefaultController`);\n }\n\n function ReadableStreamTee(stream, cloneForBranch2) {\n if (IsReadableByteStreamController(stream._readableStreamController)) {\n return ReadableByteStreamTee(stream);\n }\n return ReadableStreamDefaultTee(stream);\n }\n function ReadableStreamDefaultTee(stream, cloneForBranch2) {\n const reader = AcquireReadableStreamDefaultReader(stream);\n let reading = false;\n let readAgain = false;\n let canceled1 = false;\n let canceled2 = false;\n let reason1;\n let reason2;\n let branch1;\n let branch2;\n let resolveCancelPromise;\n const cancelPromise = newPromise(resolve => {\n resolveCancelPromise = resolve;\n });\n function pullAlgorithm() {\n if (reading) {\n readAgain = true;\n return promiseResolvedWith(undefined);\n }\n reading = true;\n const readRequest = {\n _chunkSteps: chunk => {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n _queueMicrotask(() => {\n readAgain = false;\n const chunk1 = chunk;\n const chunk2 = chunk;\n // There is no way to access the cloning code right now in the reference implementation.\n // If we add one then we'll need an implementation for serializable objects.\n // if (!canceled2 && cloneForBranch2) {\n // chunk2 = StructuredDeserialize(StructuredSerialize(chunk2));\n // }\n if (!canceled1) {\n ReadableStreamDefaultControllerEnqueue(branch1._readableStreamController, chunk1);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerEnqueue(branch2._readableStreamController, chunk2);\n }\n reading = false;\n if (readAgain) {\n pullAlgorithm();\n }\n });\n },\n _closeSteps: () => {\n reading = false;\n if (!canceled1) {\n ReadableStreamDefaultControllerClose(branch1._readableStreamController);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerClose(branch2._readableStreamController);\n }\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: () => {\n reading = false;\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n return promiseResolvedWith(undefined);\n }\n function cancel1Algorithm(reason) {\n canceled1 = true;\n reason1 = reason;\n if (canceled2) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function cancel2Algorithm(reason) {\n canceled2 = true;\n reason2 = reason;\n if (canceled1) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function startAlgorithm() {\n // do nothing\n }\n branch1 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel1Algorithm);\n branch2 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel2Algorithm);\n uponRejection(reader._closedPromise, (r) => {\n ReadableStreamDefaultControllerError(branch1._readableStreamController, r);\n ReadableStreamDefaultControllerError(branch2._readableStreamController, r);\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n return null;\n });\n return [branch1, branch2];\n }\n function ReadableByteStreamTee(stream) {\n let reader = AcquireReadableStreamDefaultReader(stream);\n let reading = false;\n let readAgainForBranch1 = false;\n let readAgainForBranch2 = false;\n let canceled1 = false;\n let canceled2 = false;\n let reason1;\n let reason2;\n let branch1;\n let branch2;\n let resolveCancelPromise;\n const cancelPromise = newPromise(resolve => {\n resolveCancelPromise = resolve;\n });\n function forwardReaderError(thisReader) {\n uponRejection(thisReader._closedPromise, r => {\n if (thisReader !== reader) {\n return null;\n }\n ReadableByteStreamControllerError(branch1._readableStreamController, r);\n ReadableByteStreamControllerError(branch2._readableStreamController, r);\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n return null;\n });\n }\n function pullWithDefaultReader() {\n if (IsReadableStreamBYOBReader(reader)) {\n ReadableStreamReaderGenericRelease(reader);\n reader = AcquireReadableStreamDefaultReader(stream);\n forwardReaderError(reader);\n }\n const readRequest = {\n _chunkSteps: chunk => {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n _queueMicrotask(() => {\n readAgainForBranch1 = false;\n readAgainForBranch2 = false;\n const chunk1 = chunk;\n let chunk2 = chunk;\n if (!canceled1 && !canceled2) {\n try {\n chunk2 = CloneAsUint8Array(chunk);\n }\n catch (cloneE) {\n ReadableByteStreamControllerError(branch1._readableStreamController, cloneE);\n ReadableByteStreamControllerError(branch2._readableStreamController, cloneE);\n resolveCancelPromise(ReadableStreamCancel(stream, cloneE));\n return;\n }\n }\n if (!canceled1) {\n ReadableByteStreamControllerEnqueue(branch1._readableStreamController, chunk1);\n }\n if (!canceled2) {\n ReadableByteStreamControllerEnqueue(branch2._readableStreamController, chunk2);\n }\n reading = false;\n if (readAgainForBranch1) {\n pull1Algorithm();\n }\n else if (readAgainForBranch2) {\n pull2Algorithm();\n }\n });\n },\n _closeSteps: () => {\n reading = false;\n if (!canceled1) {\n ReadableByteStreamControllerClose(branch1._readableStreamController);\n }\n if (!canceled2) {\n ReadableByteStreamControllerClose(branch2._readableStreamController);\n }\n if (branch1._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(branch1._readableStreamController, 0);\n }\n if (branch2._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(branch2._readableStreamController, 0);\n }\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: () => {\n reading = false;\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n }\n function pullWithBYOBReader(view, forBranch2) {\n if (IsReadableStreamDefaultReader(reader)) {\n ReadableStreamReaderGenericRelease(reader);\n reader = AcquireReadableStreamBYOBReader(stream);\n forwardReaderError(reader);\n }\n const byobBranch = forBranch2 ? branch2 : branch1;\n const otherBranch = forBranch2 ? branch1 : branch2;\n const readIntoRequest = {\n _chunkSteps: chunk => {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n _queueMicrotask(() => {\n readAgainForBranch1 = false;\n readAgainForBranch2 = false;\n const byobCanceled = forBranch2 ? canceled2 : canceled1;\n const otherCanceled = forBranch2 ? canceled1 : canceled2;\n if (!otherCanceled) {\n let clonedChunk;\n try {\n clonedChunk = CloneAsUint8Array(chunk);\n }\n catch (cloneE) {\n ReadableByteStreamControllerError(byobBranch._readableStreamController, cloneE);\n ReadableByteStreamControllerError(otherBranch._readableStreamController, cloneE);\n resolveCancelPromise(ReadableStreamCancel(stream, cloneE));\n return;\n }\n if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n ReadableByteStreamControllerEnqueue(otherBranch._readableStreamController, clonedChunk);\n }\n else if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n reading = false;\n if (readAgainForBranch1) {\n pull1Algorithm();\n }\n else if (readAgainForBranch2) {\n pull2Algorithm();\n }\n });\n },\n _closeSteps: chunk => {\n reading = false;\n const byobCanceled = forBranch2 ? canceled2 : canceled1;\n const otherCanceled = forBranch2 ? canceled1 : canceled2;\n if (!byobCanceled) {\n ReadableByteStreamControllerClose(byobBranch._readableStreamController);\n }\n if (!otherCanceled) {\n ReadableByteStreamControllerClose(otherBranch._readableStreamController);\n }\n if (chunk !== undefined) {\n if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n if (!otherCanceled && otherBranch._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(otherBranch._readableStreamController, 0);\n }\n }\n if (!byobCanceled || !otherCanceled) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: () => {\n reading = false;\n }\n };\n ReadableStreamBYOBReaderRead(reader, view, 1, readIntoRequest);\n }\n function pull1Algorithm() {\n if (reading) {\n readAgainForBranch1 = true;\n return promiseResolvedWith(undefined);\n }\n reading = true;\n const byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch1._readableStreamController);\n if (byobRequest === null) {\n pullWithDefaultReader();\n }\n else {\n pullWithBYOBReader(byobRequest._view, false);\n }\n return promiseResolvedWith(undefined);\n }\n function pull2Algorithm() {\n if (reading) {\n readAgainForBranch2 = true;\n return promiseResolvedWith(undefined);\n }\n reading = true;\n const byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch2._readableStreamController);\n if (byobRequest === null) {\n pullWithDefaultReader();\n }\n else {\n pullWithBYOBReader(byobRequest._view, true);\n }\n return promiseResolvedWith(undefined);\n }\n function cancel1Algorithm(reason) {\n canceled1 = true;\n reason1 = reason;\n if (canceled2) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function cancel2Algorithm(reason) {\n canceled2 = true;\n reason2 = reason;\n if (canceled1) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function startAlgorithm() {\n return;\n }\n branch1 = CreateReadableByteStream(startAlgorithm, pull1Algorithm, cancel1Algorithm);\n branch2 = CreateReadableByteStream(startAlgorithm, pull2Algorithm, cancel2Algorithm);\n forwardReaderError(reader);\n return [branch1, branch2];\n }\n\n function isReadableStreamLike(stream) {\n return typeIsObject(stream) && typeof stream.getReader !== 'undefined';\n }\n\n function ReadableStreamFrom(source) {\n if (isReadableStreamLike(source)) {\n return ReadableStreamFromDefaultReader(source.getReader());\n }\n return ReadableStreamFromIterable(source);\n }\n function ReadableStreamFromIterable(asyncIterable) {\n let stream;\n const iteratorRecord = GetIterator(asyncIterable, 'async');\n const startAlgorithm = noop;\n function pullAlgorithm() {\n let nextResult;\n try {\n nextResult = IteratorNext(iteratorRecord);\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n const nextPromise = promiseResolvedWith(nextResult);\n return transformPromiseWith(nextPromise, iterResult => {\n if (!typeIsObject(iterResult)) {\n throw new TypeError('The promise returned by the iterator.next() method must fulfill with an object');\n }\n const done = IteratorComplete(iterResult);\n if (done) {\n ReadableStreamDefaultControllerClose(stream._readableStreamController);\n }\n else {\n const value = IteratorValue(iterResult);\n ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value);\n }\n });\n }\n function cancelAlgorithm(reason) {\n const iterator = iteratorRecord.iterator;\n let returnMethod;\n try {\n returnMethod = GetMethod(iterator, 'return');\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n if (returnMethod === undefined) {\n return promiseResolvedWith(undefined);\n }\n let returnResult;\n try {\n returnResult = reflectCall(returnMethod, iterator, [reason]);\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n const returnPromise = promiseResolvedWith(returnResult);\n return transformPromiseWith(returnPromise, iterResult => {\n if (!typeIsObject(iterResult)) {\n throw new TypeError('The promise returned by the iterator.return() method must fulfill with an object');\n }\n return undefined;\n });\n }\n stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0);\n return stream;\n }\n function ReadableStreamFromDefaultReader(reader) {\n let stream;\n const startAlgorithm = noop;\n function pullAlgorithm() {\n let readPromise;\n try {\n readPromise = reader.read();\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n return transformPromiseWith(readPromise, readResult => {\n if (!typeIsObject(readResult)) {\n throw new TypeError('The promise returned by the reader.read() method must fulfill with an object');\n }\n if (readResult.done) {\n ReadableStreamDefaultControllerClose(stream._readableStreamController);\n }\n else {\n const value = readResult.value;\n ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value);\n }\n });\n }\n function cancelAlgorithm(reason) {\n try {\n return promiseResolvedWith(reader.cancel(reason));\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n }\n stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0);\n return stream;\n }\n\n function convertUnderlyingDefaultOrByteSource(source, context) {\n assertDictionary(source, context);\n const original = source;\n const autoAllocateChunkSize = original === null || original === void 0 ? void 0 : original.autoAllocateChunkSize;\n const cancel = original === null || original === void 0 ? void 0 : original.cancel;\n const pull = original === null || original === void 0 ? void 0 : original.pull;\n const start = original === null || original === void 0 ? void 0 : original.start;\n const type = original === null || original === void 0 ? void 0 : original.type;\n return {\n autoAllocateChunkSize: autoAllocateChunkSize === undefined ?\n undefined :\n convertUnsignedLongLongWithEnforceRange(autoAllocateChunkSize, `${context} has member 'autoAllocateChunkSize' that`),\n cancel: cancel === undefined ?\n undefined :\n convertUnderlyingSourceCancelCallback(cancel, original, `${context} has member 'cancel' that`),\n pull: pull === undefined ?\n undefined :\n convertUnderlyingSourcePullCallback(pull, original, `${context} has member 'pull' that`),\n start: start === undefined ?\n undefined :\n convertUnderlyingSourceStartCallback(start, original, `${context} has member 'start' that`),\n type: type === undefined ? undefined : convertReadableStreamType(type, `${context} has member 'type' that`)\n };\n }\n function convertUnderlyingSourceCancelCallback(fn, original, context) {\n assertFunction(fn, context);\n return (reason) => promiseCall(fn, original, [reason]);\n }\n function convertUnderlyingSourcePullCallback(fn, original, context) {\n assertFunction(fn, context);\n return (controller) => promiseCall(fn, original, [controller]);\n }\n function convertUnderlyingSourceStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return (controller) => reflectCall(fn, original, [controller]);\n }\n function convertReadableStreamType(type, context) {\n type = `${type}`;\n if (type !== 'bytes') {\n throw new TypeError(`${context} '${type}' is not a valid enumeration value for ReadableStreamType`);\n }\n return type;\n }\n\n function convertIteratorOptions(options, context) {\n assertDictionary(options, context);\n const preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel;\n return { preventCancel: Boolean(preventCancel) };\n }\n\n function convertPipeOptions(options, context) {\n assertDictionary(options, context);\n const preventAbort = options === null || options === void 0 ? void 0 : options.preventAbort;\n const preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel;\n const preventClose = options === null || options === void 0 ? void 0 : options.preventClose;\n const signal = options === null || options === void 0 ? void 0 : options.signal;\n if (signal !== undefined) {\n assertAbortSignal(signal, `${context} has member 'signal' that`);\n }\n return {\n preventAbort: Boolean(preventAbort),\n preventCancel: Boolean(preventCancel),\n preventClose: Boolean(preventClose),\n signal\n };\n }\n function assertAbortSignal(signal, context) {\n if (!isAbortSignal(signal)) {\n throw new TypeError(`${context} is not an AbortSignal.`);\n }\n }\n\n function convertReadableWritablePair(pair, context) {\n assertDictionary(pair, context);\n const readable = pair === null || pair === void 0 ? void 0 : pair.readable;\n assertRequiredField(readable, 'readable', 'ReadableWritablePair');\n assertReadableStream(readable, `${context} has member 'readable' that`);\n const writable = pair === null || pair === void 0 ? void 0 : pair.writable;\n assertRequiredField(writable, 'writable', 'ReadableWritablePair');\n assertWritableStream(writable, `${context} has member 'writable' that`);\n return { readable, writable };\n }\n\n /**\n * A readable stream represents a source of data, from which you can read.\n *\n * @public\n */\n class ReadableStream {\n constructor(rawUnderlyingSource = {}, rawStrategy = {}) {\n if (rawUnderlyingSource === undefined) {\n rawUnderlyingSource = null;\n }\n else {\n assertObject(rawUnderlyingSource, 'First parameter');\n }\n const strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');\n const underlyingSource = convertUnderlyingDefaultOrByteSource(rawUnderlyingSource, 'First parameter');\n InitializeReadableStream(this);\n if (underlyingSource.type === 'bytes') {\n if (strategy.size !== undefined) {\n throw new RangeError('The strategy for a byte stream cannot have a size function');\n }\n const highWaterMark = ExtractHighWaterMark(strategy, 0);\n SetUpReadableByteStreamControllerFromUnderlyingSource(this, underlyingSource, highWaterMark);\n }\n else {\n const sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n const highWaterMark = ExtractHighWaterMark(strategy, 1);\n SetUpReadableStreamDefaultControllerFromUnderlyingSource(this, underlyingSource, highWaterMark, sizeAlgorithm);\n }\n }\n /**\n * Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}.\n */\n get locked() {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('locked');\n }\n return IsReadableStreamLocked(this);\n }\n /**\n * Cancels the stream, signaling a loss of interest in the stream by a consumer.\n *\n * The supplied `reason` argument will be given to the underlying source's {@link UnderlyingSource.cancel | cancel()}\n * method, which might or might not use it.\n */\n cancel(reason = undefined) {\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$1('cancel'));\n }\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot cancel a stream that already has a reader'));\n }\n return ReadableStreamCancel(this, reason);\n }\n getReader(rawOptions = undefined) {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('getReader');\n }\n const options = convertReaderOptions(rawOptions, 'First parameter');\n if (options.mode === undefined) {\n return AcquireReadableStreamDefaultReader(this);\n }\n return AcquireReadableStreamBYOBReader(this);\n }\n pipeThrough(rawTransform, rawOptions = {}) {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('pipeThrough');\n }\n assertRequiredArgument(rawTransform, 1, 'pipeThrough');\n const transform = convertReadableWritablePair(rawTransform, 'First parameter');\n const options = convertPipeOptions(rawOptions, 'Second parameter');\n if (IsReadableStreamLocked(this)) {\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream');\n }\n if (IsWritableStreamLocked(transform.writable)) {\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream');\n }\n const promise = ReadableStreamPipeTo(this, transform.writable, options.preventClose, options.preventAbort, options.preventCancel, options.signal);\n setPromiseIsHandledToTrue(promise);\n return transform.readable;\n }\n pipeTo(destination, rawOptions = {}) {\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$1('pipeTo'));\n }\n if (destination === undefined) {\n return promiseRejectedWith(`Parameter 1 is required in 'pipeTo'.`);\n }\n if (!IsWritableStream(destination)) {\n return promiseRejectedWith(new TypeError(`ReadableStream.prototype.pipeTo's first argument must be a WritableStream`));\n }\n let options;\n try {\n options = convertPipeOptions(rawOptions, 'Second parameter');\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream'));\n }\n if (IsWritableStreamLocked(destination)) {\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream'));\n }\n return ReadableStreamPipeTo(this, destination, options.preventClose, options.preventAbort, options.preventCancel, options.signal);\n }\n /**\n * Tees this readable stream, returning a two-element array containing the two resulting branches as\n * new {@link ReadableStream} instances.\n *\n * Teeing a stream will lock it, preventing any other consumer from acquiring a reader.\n * To cancel the stream, cancel both of the resulting branches; a composite cancellation reason will then be\n * propagated to the stream's underlying source.\n *\n * Note that the chunks seen in each branch will be the same object. If the chunks are not immutable,\n * this could allow interference between the two branches.\n */\n tee() {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('tee');\n }\n const branches = ReadableStreamTee(this);\n return CreateArrayFromList(branches);\n }\n values(rawOptions = undefined) {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('values');\n }\n const options = convertIteratorOptions(rawOptions, 'First parameter');\n return AcquireReadableStreamAsyncIterator(this, options.preventCancel);\n }\n [SymbolAsyncIterator](options) {\n // Stub implementation, overridden below\n return this.values(options);\n }\n /**\n * Creates a new ReadableStream wrapping the provided iterable or async iterable.\n *\n * This can be used to adapt various kinds of objects into a readable stream,\n * such as an array, an async generator, or a Node.js readable stream.\n */\n static from(asyncIterable) {\n return ReadableStreamFrom(asyncIterable);\n }\n }\n Object.defineProperties(ReadableStream, {\n from: { enumerable: true }\n });\n Object.defineProperties(ReadableStream.prototype, {\n cancel: { enumerable: true },\n getReader: { enumerable: true },\n pipeThrough: { enumerable: true },\n pipeTo: { enumerable: true },\n tee: { enumerable: true },\n values: { enumerable: true },\n locked: { enumerable: true }\n });\n setFunctionName(ReadableStream.from, 'from');\n setFunctionName(ReadableStream.prototype.cancel, 'cancel');\n setFunctionName(ReadableStream.prototype.getReader, 'getReader');\n setFunctionName(ReadableStream.prototype.pipeThrough, 'pipeThrough');\n setFunctionName(ReadableStream.prototype.pipeTo, 'pipeTo');\n setFunctionName(ReadableStream.prototype.tee, 'tee');\n setFunctionName(ReadableStream.prototype.values, 'values');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStream.prototype, Symbol.toStringTag, {\n value: 'ReadableStream',\n configurable: true\n });\n }\n Object.defineProperty(ReadableStream.prototype, SymbolAsyncIterator, {\n value: ReadableStream.prototype.values,\n writable: true,\n configurable: true\n });\n // Abstract operations for the ReadableStream.\n // Throws if and only if startAlgorithm throws.\n function CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark = 1, sizeAlgorithm = () => 1) {\n const stream = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n const controller = Object.create(ReadableStreamDefaultController.prototype);\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n }\n // Throws if and only if startAlgorithm throws.\n function CreateReadableByteStream(startAlgorithm, pullAlgorithm, cancelAlgorithm) {\n const stream = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n const controller = Object.create(ReadableByteStreamController.prototype);\n SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, 0, undefined);\n return stream;\n }\n function InitializeReadableStream(stream) {\n stream._state = 'readable';\n stream._reader = undefined;\n stream._storedError = undefined;\n stream._disturbed = false;\n }\n function IsReadableStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readableStreamController')) {\n return false;\n }\n return x instanceof ReadableStream;\n }\n function IsReadableStreamLocked(stream) {\n if (stream._reader === undefined) {\n return false;\n }\n return true;\n }\n // ReadableStream API exposed for controllers.\n function ReadableStreamCancel(stream, reason) {\n stream._disturbed = true;\n if (stream._state === 'closed') {\n return promiseResolvedWith(undefined);\n }\n if (stream._state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n ReadableStreamClose(stream);\n const reader = stream._reader;\n if (reader !== undefined && IsReadableStreamBYOBReader(reader)) {\n const readIntoRequests = reader._readIntoRequests;\n reader._readIntoRequests = new SimpleQueue();\n readIntoRequests.forEach(readIntoRequest => {\n readIntoRequest._closeSteps(undefined);\n });\n }\n const sourceCancelPromise = stream._readableStreamController[CancelSteps](reason);\n return transformPromiseWith(sourceCancelPromise, noop);\n }\n function ReadableStreamClose(stream) {\n stream._state = 'closed';\n const reader = stream._reader;\n if (reader === undefined) {\n return;\n }\n defaultReaderClosedPromiseResolve(reader);\n if (IsReadableStreamDefaultReader(reader)) {\n const readRequests = reader._readRequests;\n reader._readRequests = new SimpleQueue();\n readRequests.forEach(readRequest => {\n readRequest._closeSteps();\n });\n }\n }\n function ReadableStreamError(stream, e) {\n stream._state = 'errored';\n stream._storedError = e;\n const reader = stream._reader;\n if (reader === undefined) {\n return;\n }\n defaultReaderClosedPromiseReject(reader, e);\n if (IsReadableStreamDefaultReader(reader)) {\n ReadableStreamDefaultReaderErrorReadRequests(reader, e);\n }\n else {\n ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e);\n }\n }\n // Helper functions for the ReadableStream.\n function streamBrandCheckException$1(name) {\n return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`);\n }\n\n function convertQueuingStrategyInit(init, context) {\n assertDictionary(init, context);\n const highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark;\n assertRequiredField(highWaterMark, 'highWaterMark', 'QueuingStrategyInit');\n return {\n highWaterMark: convertUnrestrictedDouble(highWaterMark)\n };\n }\n\n // The size function must not have a prototype property nor be a constructor\n const byteLengthSizeFunction = (chunk) => {\n return chunk.byteLength;\n };\n setFunctionName(byteLengthSizeFunction, 'size');\n /**\n * A queuing strategy that counts the number of bytes in each chunk.\n *\n * @public\n */\n class ByteLengthQueuingStrategy {\n constructor(options) {\n assertRequiredArgument(options, 1, 'ByteLengthQueuingStrategy');\n options = convertQueuingStrategyInit(options, 'First parameter');\n this._byteLengthQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n /**\n * Returns the high water mark provided to the constructor.\n */\n get highWaterMark() {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException('highWaterMark');\n }\n return this._byteLengthQueuingStrategyHighWaterMark;\n }\n /**\n * Measures the size of `chunk` by returning the value of its `byteLength` property.\n */\n get size() {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException('size');\n }\n return byteLengthSizeFunction;\n }\n }\n Object.defineProperties(ByteLengthQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n });\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ByteLengthQueuingStrategy.prototype, Symbol.toStringTag, {\n value: 'ByteLengthQueuingStrategy',\n configurable: true\n });\n }\n // Helper functions for the ByteLengthQueuingStrategy.\n function byteLengthBrandCheckException(name) {\n return new TypeError(`ByteLengthQueuingStrategy.prototype.${name} can only be used on a ByteLengthQueuingStrategy`);\n }\n function IsByteLengthQueuingStrategy(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_byteLengthQueuingStrategyHighWaterMark')) {\n return false;\n }\n return x instanceof ByteLengthQueuingStrategy;\n }\n\n // The size function must not have a prototype property nor be a constructor\n const countSizeFunction = () => {\n return 1;\n };\n setFunctionName(countSizeFunction, 'size');\n /**\n * A queuing strategy that counts the number of chunks.\n *\n * @public\n */\n class CountQueuingStrategy {\n constructor(options) {\n assertRequiredArgument(options, 1, 'CountQueuingStrategy');\n options = convertQueuingStrategyInit(options, 'First parameter');\n this._countQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n /**\n * Returns the high water mark provided to the constructor.\n */\n get highWaterMark() {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException('highWaterMark');\n }\n return this._countQueuingStrategyHighWaterMark;\n }\n /**\n * Measures the size of `chunk` by always returning 1.\n * This ensures that the total queue size is a count of the number of chunks in the queue.\n */\n get size() {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException('size');\n }\n return countSizeFunction;\n }\n }\n Object.defineProperties(CountQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n });\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(CountQueuingStrategy.prototype, Symbol.toStringTag, {\n value: 'CountQueuingStrategy',\n configurable: true\n });\n }\n // Helper functions for the CountQueuingStrategy.\n function countBrandCheckException(name) {\n return new TypeError(`CountQueuingStrategy.prototype.${name} can only be used on a CountQueuingStrategy`);\n }\n function IsCountQueuingStrategy(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_countQueuingStrategyHighWaterMark')) {\n return false;\n }\n return x instanceof CountQueuingStrategy;\n }\n\n function convertTransformer(original, context) {\n assertDictionary(original, context);\n const cancel = original === null || original === void 0 ? void 0 : original.cancel;\n const flush = original === null || original === void 0 ? void 0 : original.flush;\n const readableType = original === null || original === void 0 ? void 0 : original.readableType;\n const start = original === null || original === void 0 ? void 0 : original.start;\n const transform = original === null || original === void 0 ? void 0 : original.transform;\n const writableType = original === null || original === void 0 ? void 0 : original.writableType;\n return {\n cancel: cancel === undefined ?\n undefined :\n convertTransformerCancelCallback(cancel, original, `${context} has member 'cancel' that`),\n flush: flush === undefined ?\n undefined :\n convertTransformerFlushCallback(flush, original, `${context} has member 'flush' that`),\n readableType,\n start: start === undefined ?\n undefined :\n convertTransformerStartCallback(start, original, `${context} has member 'start' that`),\n transform: transform === undefined ?\n undefined :\n convertTransformerTransformCallback(transform, original, `${context} has member 'transform' that`),\n writableType\n };\n }\n function convertTransformerFlushCallback(fn, original, context) {\n assertFunction(fn, context);\n return (controller) => promiseCall(fn, original, [controller]);\n }\n function convertTransformerStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return (controller) => reflectCall(fn, original, [controller]);\n }\n function convertTransformerTransformCallback(fn, original, context) {\n assertFunction(fn, context);\n return (chunk, controller) => promiseCall(fn, original, [chunk, controller]);\n }\n function convertTransformerCancelCallback(fn, original, context) {\n assertFunction(fn, context);\n return (reason) => promiseCall(fn, original, [reason]);\n }\n\n // Class TransformStream\n /**\n * A transform stream consists of a pair of streams: a {@link WritableStream | writable stream},\n * known as its writable side, and a {@link ReadableStream | readable stream}, known as its readable side.\n * In a manner specific to the transform stream in question, writes to the writable side result in new data being\n * made available for reading from the readable side.\n *\n * @public\n */\n class TransformStream {\n constructor(rawTransformer = {}, rawWritableStrategy = {}, rawReadableStrategy = {}) {\n if (rawTransformer === undefined) {\n rawTransformer = null;\n }\n const writableStrategy = convertQueuingStrategy(rawWritableStrategy, 'Second parameter');\n const readableStrategy = convertQueuingStrategy(rawReadableStrategy, 'Third parameter');\n const transformer = convertTransformer(rawTransformer, 'First parameter');\n if (transformer.readableType !== undefined) {\n throw new RangeError('Invalid readableType specified');\n }\n if (transformer.writableType !== undefined) {\n throw new RangeError('Invalid writableType specified');\n }\n const readableHighWaterMark = ExtractHighWaterMark(readableStrategy, 0);\n const readableSizeAlgorithm = ExtractSizeAlgorithm(readableStrategy);\n const writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1);\n const writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy);\n let startPromise_resolve;\n const startPromise = newPromise(resolve => {\n startPromise_resolve = resolve;\n });\n InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\n SetUpTransformStreamDefaultControllerFromTransformer(this, transformer);\n if (transformer.start !== undefined) {\n startPromise_resolve(transformer.start(this._transformStreamController));\n }\n else {\n startPromise_resolve(undefined);\n }\n }\n /**\n * The readable side of the transform stream.\n */\n get readable() {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException('readable');\n }\n return this._readable;\n }\n /**\n * The writable side of the transform stream.\n */\n get writable() {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException('writable');\n }\n return this._writable;\n }\n }\n Object.defineProperties(TransformStream.prototype, {\n readable: { enumerable: true },\n writable: { enumerable: true }\n });\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(TransformStream.prototype, Symbol.toStringTag, {\n value: 'TransformStream',\n configurable: true\n });\n }\n function InitializeTransformStream(stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) {\n function startAlgorithm() {\n return startPromise;\n }\n function writeAlgorithm(chunk) {\n return TransformStreamDefaultSinkWriteAlgorithm(stream, chunk);\n }\n function abortAlgorithm(reason) {\n return TransformStreamDefaultSinkAbortAlgorithm(stream, reason);\n }\n function closeAlgorithm() {\n return TransformStreamDefaultSinkCloseAlgorithm(stream);\n }\n stream._writable = CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, writableHighWaterMark, writableSizeAlgorithm);\n function pullAlgorithm() {\n return TransformStreamDefaultSourcePullAlgorithm(stream);\n }\n function cancelAlgorithm(reason) {\n return TransformStreamDefaultSourceCancelAlgorithm(stream, reason);\n }\n stream._readable = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\n // The [[backpressure]] slot is set to undefined so that it can be initialised by TransformStreamSetBackpressure.\n stream._backpressure = undefined;\n stream._backpressureChangePromise = undefined;\n stream._backpressureChangePromise_resolve = undefined;\n TransformStreamSetBackpressure(stream, true);\n stream._transformStreamController = undefined;\n }\n function IsTransformStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_transformStreamController')) {\n return false;\n }\n return x instanceof TransformStream;\n }\n // This is a no-op if both sides are already errored.\n function TransformStreamError(stream, e) {\n ReadableStreamDefaultControllerError(stream._readable._readableStreamController, e);\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n }\n function TransformStreamErrorWritableAndUnblockWrite(stream, e) {\n TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController);\n WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController, e);\n TransformStreamUnblockWrite(stream);\n }\n function TransformStreamUnblockWrite(stream) {\n if (stream._backpressure) {\n // Pretend that pull() was called to permit any pending write() calls to complete. TransformStreamSetBackpressure()\n // cannot be called from enqueue() or pull() once the ReadableStream is errored, so this will will be the final time\n // _backpressure is set.\n TransformStreamSetBackpressure(stream, false);\n }\n }\n function TransformStreamSetBackpressure(stream, backpressure) {\n // Passes also when called during construction.\n if (stream._backpressureChangePromise !== undefined) {\n stream._backpressureChangePromise_resolve();\n }\n stream._backpressureChangePromise = newPromise(resolve => {\n stream._backpressureChangePromise_resolve = resolve;\n });\n stream._backpressure = backpressure;\n }\n // Class TransformStreamDefaultController\n /**\n * Allows control of the {@link ReadableStream} and {@link WritableStream} of the associated {@link TransformStream}.\n *\n * @public\n */\n class TransformStreamDefaultController {\n constructor() {\n throw new TypeError('Illegal constructor');\n }\n /**\n * Returns the desired size to fill the readable side’s internal queue. It can be negative, if the queue is over-full.\n */\n get desiredSize() {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('desiredSize');\n }\n const readableController = this._controlledTransformStream._readable._readableStreamController;\n return ReadableStreamDefaultControllerGetDesiredSize(readableController);\n }\n enqueue(chunk = undefined) {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('enqueue');\n }\n TransformStreamDefaultControllerEnqueue(this, chunk);\n }\n /**\n * Errors both the readable side and the writable side of the controlled transform stream, making all future\n * interactions with it fail with the given error `e`. Any chunks queued for transformation will be discarded.\n */\n error(reason = undefined) {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('error');\n }\n TransformStreamDefaultControllerError(this, reason);\n }\n /**\n * Closes the readable side and errors the writable side of the controlled transform stream. This is useful when the\n * transformer only needs to consume a portion of the chunks written to the writable side.\n */\n terminate() {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('terminate');\n }\n TransformStreamDefaultControllerTerminate(this);\n }\n }\n Object.defineProperties(TransformStreamDefaultController.prototype, {\n enqueue: { enumerable: true },\n error: { enumerable: true },\n terminate: { enumerable: true },\n desiredSize: { enumerable: true }\n });\n setFunctionName(TransformStreamDefaultController.prototype.enqueue, 'enqueue');\n setFunctionName(TransformStreamDefaultController.prototype.error, 'error');\n setFunctionName(TransformStreamDefaultController.prototype.terminate, 'terminate');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(TransformStreamDefaultController.prototype, Symbol.toStringTag, {\n value: 'TransformStreamDefaultController',\n configurable: true\n });\n }\n // Transform Stream Default Controller Abstract Operations\n function IsTransformStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledTransformStream')) {\n return false;\n }\n return x instanceof TransformStreamDefaultController;\n }\n function SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm) {\n controller._controlledTransformStream = stream;\n stream._transformStreamController = controller;\n controller._transformAlgorithm = transformAlgorithm;\n controller._flushAlgorithm = flushAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n controller._finishPromise = undefined;\n controller._finishPromise_resolve = undefined;\n controller._finishPromise_reject = undefined;\n }\n function SetUpTransformStreamDefaultControllerFromTransformer(stream, transformer) {\n const controller = Object.create(TransformStreamDefaultController.prototype);\n let transformAlgorithm;\n let flushAlgorithm;\n let cancelAlgorithm;\n if (transformer.transform !== undefined) {\n transformAlgorithm = chunk => transformer.transform(chunk, controller);\n }\n else {\n transformAlgorithm = chunk => {\n try {\n TransformStreamDefaultControllerEnqueue(controller, chunk);\n return promiseResolvedWith(undefined);\n }\n catch (transformResultE) {\n return promiseRejectedWith(transformResultE);\n }\n };\n }\n if (transformer.flush !== undefined) {\n flushAlgorithm = () => transformer.flush(controller);\n }\n else {\n flushAlgorithm = () => promiseResolvedWith(undefined);\n }\n if (transformer.cancel !== undefined) {\n cancelAlgorithm = reason => transformer.cancel(reason);\n }\n else {\n cancelAlgorithm = () => promiseResolvedWith(undefined);\n }\n SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm);\n }\n function TransformStreamDefaultControllerClearAlgorithms(controller) {\n controller._transformAlgorithm = undefined;\n controller._flushAlgorithm = undefined;\n controller._cancelAlgorithm = undefined;\n }\n function TransformStreamDefaultControllerEnqueue(controller, chunk) {\n const stream = controller._controlledTransformStream;\n const readableController = stream._readable._readableStreamController;\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController)) {\n throw new TypeError('Readable side is not in a state that permits enqueue');\n }\n // We throttle transform invocations based on the backpressure of the ReadableStream, but we still\n // accept TransformStreamDefaultControllerEnqueue() calls.\n try {\n ReadableStreamDefaultControllerEnqueue(readableController, chunk);\n }\n catch (e) {\n // This happens when readableStrategy.size() throws.\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n throw stream._readable._storedError;\n }\n const backpressure = ReadableStreamDefaultControllerHasBackpressure(readableController);\n if (backpressure !== stream._backpressure) {\n TransformStreamSetBackpressure(stream, true);\n }\n }\n function TransformStreamDefaultControllerError(controller, e) {\n TransformStreamError(controller._controlledTransformStream, e);\n }\n function TransformStreamDefaultControllerPerformTransform(controller, chunk) {\n const transformPromise = controller._transformAlgorithm(chunk);\n return transformPromiseWith(transformPromise, undefined, r => {\n TransformStreamError(controller._controlledTransformStream, r);\n throw r;\n });\n }\n function TransformStreamDefaultControllerTerminate(controller) {\n const stream = controller._controlledTransformStream;\n const readableController = stream._readable._readableStreamController;\n ReadableStreamDefaultControllerClose(readableController);\n const error = new TypeError('TransformStream terminated');\n TransformStreamErrorWritableAndUnblockWrite(stream, error);\n }\n // TransformStreamDefaultSink Algorithms\n function TransformStreamDefaultSinkWriteAlgorithm(stream, chunk) {\n const controller = stream._transformStreamController;\n if (stream._backpressure) {\n const backpressureChangePromise = stream._backpressureChangePromise;\n return transformPromiseWith(backpressureChangePromise, () => {\n const writable = stream._writable;\n const state = writable._state;\n if (state === 'erroring') {\n throw writable._storedError;\n }\n return TransformStreamDefaultControllerPerformTransform(controller, chunk);\n });\n }\n return TransformStreamDefaultControllerPerformTransform(controller, chunk);\n }\n function TransformStreamDefaultSinkAbortAlgorithm(stream, reason) {\n const controller = stream._transformStreamController;\n if (controller._finishPromise !== undefined) {\n return controller._finishPromise;\n }\n // stream._readable cannot change after construction, so caching it across a call to user code is safe.\n const readable = stream._readable;\n // Assign the _finishPromise now so that if _cancelAlgorithm calls readable.cancel() internally,\n // we don't run the _cancelAlgorithm again.\n controller._finishPromise = newPromise((resolve, reject) => {\n controller._finishPromise_resolve = resolve;\n controller._finishPromise_reject = reject;\n });\n const cancelPromise = controller._cancelAlgorithm(reason);\n TransformStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(cancelPromise, () => {\n if (readable._state === 'errored') {\n defaultControllerFinishPromiseReject(controller, readable._storedError);\n }\n else {\n ReadableStreamDefaultControllerError(readable._readableStreamController, reason);\n defaultControllerFinishPromiseResolve(controller);\n }\n return null;\n }, r => {\n ReadableStreamDefaultControllerError(readable._readableStreamController, r);\n defaultControllerFinishPromiseReject(controller, r);\n return null;\n });\n return controller._finishPromise;\n }\n function TransformStreamDefaultSinkCloseAlgorithm(stream) {\n const controller = stream._transformStreamController;\n if (controller._finishPromise !== undefined) {\n return controller._finishPromise;\n }\n // stream._readable cannot change after construction, so caching it across a call to user code is safe.\n const readable = stream._readable;\n // Assign the _finishPromise now so that if _flushAlgorithm calls readable.cancel() internally,\n // we don't also run the _cancelAlgorithm.\n controller._finishPromise = newPromise((resolve, reject) => {\n controller._finishPromise_resolve = resolve;\n controller._finishPromise_reject = reject;\n });\n const flushPromise = controller._flushAlgorithm();\n TransformStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(flushPromise, () => {\n if (readable._state === 'errored') {\n defaultControllerFinishPromiseReject(controller, readable._storedError);\n }\n else {\n ReadableStreamDefaultControllerClose(readable._readableStreamController);\n defaultControllerFinishPromiseResolve(controller);\n }\n return null;\n }, r => {\n ReadableStreamDefaultControllerError(readable._readableStreamController, r);\n defaultControllerFinishPromiseReject(controller, r);\n return null;\n });\n return controller._finishPromise;\n }\n // TransformStreamDefaultSource Algorithms\n function TransformStreamDefaultSourcePullAlgorithm(stream) {\n // Invariant. Enforced by the promises returned by start() and pull().\n TransformStreamSetBackpressure(stream, false);\n // Prevent the next pull() call until there is backpressure.\n return stream._backpressureChangePromise;\n }\n function TransformStreamDefaultSourceCancelAlgorithm(stream, reason) {\n const controller = stream._transformStreamController;\n if (controller._finishPromise !== undefined) {\n return controller._finishPromise;\n }\n // stream._writable cannot change after construction, so caching it across a call to user code is safe.\n const writable = stream._writable;\n // Assign the _finishPromise now so that if _flushAlgorithm calls writable.abort() or\n // writable.cancel() internally, we don't run the _cancelAlgorithm again, or also run the\n // _flushAlgorithm.\n controller._finishPromise = newPromise((resolve, reject) => {\n controller._finishPromise_resolve = resolve;\n controller._finishPromise_reject = reject;\n });\n const cancelPromise = controller._cancelAlgorithm(reason);\n TransformStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(cancelPromise, () => {\n if (writable._state === 'errored') {\n defaultControllerFinishPromiseReject(controller, writable._storedError);\n }\n else {\n WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, reason);\n TransformStreamUnblockWrite(stream);\n defaultControllerFinishPromiseResolve(controller);\n }\n return null;\n }, r => {\n WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, r);\n TransformStreamUnblockWrite(stream);\n defaultControllerFinishPromiseReject(controller, r);\n return null;\n });\n return controller._finishPromise;\n }\n // Helper functions for the TransformStreamDefaultController.\n function defaultControllerBrandCheckException(name) {\n return new TypeError(`TransformStreamDefaultController.prototype.${name} can only be used on a TransformStreamDefaultController`);\n }\n function defaultControllerFinishPromiseResolve(controller) {\n if (controller._finishPromise_resolve === undefined) {\n return;\n }\n controller._finishPromise_resolve();\n controller._finishPromise_resolve = undefined;\n controller._finishPromise_reject = undefined;\n }\n function defaultControllerFinishPromiseReject(controller, reason) {\n if (controller._finishPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(controller._finishPromise);\n controller._finishPromise_reject(reason);\n controller._finishPromise_resolve = undefined;\n controller._finishPromise_reject = undefined;\n }\n // Helper functions for the TransformStream.\n function streamBrandCheckException(name) {\n return new TypeError(`TransformStream.prototype.${name} can only be used on a TransformStream`);\n }\n\n exports.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy;\n exports.CountQueuingStrategy = CountQueuingStrategy;\n exports.ReadableByteStreamController = ReadableByteStreamController;\n exports.ReadableStream = ReadableStream;\n exports.ReadableStreamBYOBReader = ReadableStreamBYOBReader;\n exports.ReadableStreamBYOBRequest = ReadableStreamBYOBRequest;\n exports.ReadableStreamDefaultController = ReadableStreamDefaultController;\n exports.ReadableStreamDefaultReader = ReadableStreamDefaultReader;\n exports.TransformStream = TransformStream;\n exports.TransformStreamDefaultController = TransformStreamDefaultController;\n exports.WritableStream = WritableStream;\n exports.WritableStreamDefaultController = WritableStreamDefaultController;\n exports.WritableStreamDefaultWriter = WritableStreamDefaultWriter;\n\n}));\n//# sourceMappingURL=ponyfill.es2018.js.map\n","/* c8 ignore start */\n// 64 KiB (same size chrome slice theirs blob into Uint8array's)\nconst POOL_SIZE = 65536\n\nif (!globalThis.ReadableStream) {\n // `node:stream/web` got introduced in v16.5.0 as experimental\n // and it's preferred over the polyfilled version. So we also\n // suppress the warning that gets emitted by NodeJS for using it.\n try {\n const process = require('node:process')\n const { emitWarning } = process\n try {\n process.emitWarning = () => {}\n Object.assign(globalThis, require('node:stream/web'))\n process.emitWarning = emitWarning\n } catch (error) {\n process.emitWarning = emitWarning\n throw error\n }\n } catch (error) {\n // fallback to polyfill implementation\n Object.assign(globalThis, require('web-streams-polyfill/dist/ponyfill.es2018.js'))\n }\n}\n\ntry {\n // Don't use node: prefix for this, require+node: is not supported until node v14.14\n // Only `import()` can use prefix in 12.20 and later\n const { Blob } = require('buffer')\n if (Blob && !Blob.prototype.stream) {\n Blob.prototype.stream = function name (params) {\n let position = 0\n const blob = this\n\n return new ReadableStream({\n type: 'bytes',\n async pull (ctrl) {\n const chunk = blob.slice(position, Math.min(blob.size, position + POOL_SIZE))\n const buffer = await chunk.arrayBuffer()\n position += buffer.byteLength\n ctrl.enqueue(new Uint8Array(buffer))\n\n if (position === blob.size) {\n ctrl.close()\n }\n }\n })\n }\n }\n} catch (error) {}\n/* c8 ignore end */\n","/*! fetch-blob. MIT License. Jimmy Wärting */\n\n// TODO (jimmywarting): in the feature use conditional loading with top level await (requires 14.x)\n// Node has recently added whatwg stream into core\n\nimport './streams.cjs'\n\n// 64 KiB (same size chrome slice theirs blob into Uint8array's)\nconst POOL_SIZE = 65536\n\n/** @param {(Blob | Uint8Array)[]} parts */\nasync function * toIterator (parts, clone = true) {\n for (const part of parts) {\n if ('stream' in part) {\n yield * (/** @type {AsyncIterableIterator} */ (part.stream()))\n } else if (ArrayBuffer.isView(part)) {\n if (clone) {\n let position = part.byteOffset\n const end = part.byteOffset + part.byteLength\n while (position !== end) {\n const size = Math.min(end - position, POOL_SIZE)\n const chunk = part.buffer.slice(position, position + size)\n position += chunk.byteLength\n yield new Uint8Array(chunk)\n }\n } else {\n yield part\n }\n /* c8 ignore next 10 */\n } else {\n // For blobs that have arrayBuffer but no stream method (nodes buffer.Blob)\n let position = 0, b = (/** @type {Blob} */ (part))\n while (position !== b.size) {\n const chunk = b.slice(position, Math.min(b.size, position + POOL_SIZE))\n const buffer = await chunk.arrayBuffer()\n position += buffer.byteLength\n yield new Uint8Array(buffer)\n }\n }\n }\n}\n\nconst _Blob = class Blob {\n /** @type {Array.<(Blob|Uint8Array)>} */\n #parts = []\n #type = ''\n #size = 0\n #endings = 'transparent'\n\n /**\n * The Blob() constructor returns a new Blob object. The content\n * of the blob consists of the concatenation of the values given\n * in the parameter array.\n *\n * @param {*} blobParts\n * @param {{ type?: string, endings?: string }} [options]\n */\n constructor (blobParts = [], options = {}) {\n if (typeof blobParts !== 'object' || blobParts === null) {\n throw new TypeError('Failed to construct \\'Blob\\': The provided value cannot be converted to a sequence.')\n }\n\n if (typeof blobParts[Symbol.iterator] !== 'function') {\n throw new TypeError('Failed to construct \\'Blob\\': The object must have a callable @@iterator property.')\n }\n\n if (typeof options !== 'object' && typeof options !== 'function') {\n throw new TypeError('Failed to construct \\'Blob\\': parameter 2 cannot convert to dictionary.')\n }\n\n if (options === null) options = {}\n\n const encoder = new TextEncoder()\n for (const element of blobParts) {\n let part\n if (ArrayBuffer.isView(element)) {\n part = new Uint8Array(element.buffer.slice(element.byteOffset, element.byteOffset + element.byteLength))\n } else if (element instanceof ArrayBuffer) {\n part = new Uint8Array(element.slice(0))\n } else if (element instanceof Blob) {\n part = element\n } else {\n part = encoder.encode(`${element}`)\n }\n\n this.#size += ArrayBuffer.isView(part) ? part.byteLength : part.size\n this.#parts.push(part)\n }\n\n this.#endings = `${options.endings === undefined ? 'transparent' : options.endings}`\n const type = options.type === undefined ? '' : String(options.type)\n this.#type = /^[\\x20-\\x7E]*$/.test(type) ? type : ''\n }\n\n /**\n * The Blob interface's size property returns the\n * size of the Blob in bytes.\n */\n get size () {\n return this.#size\n }\n\n /**\n * The type property of a Blob object returns the MIME type of the file.\n */\n get type () {\n return this.#type\n }\n\n /**\n * The text() method in the Blob interface returns a Promise\n * that resolves with a string containing the contents of\n * the blob, interpreted as UTF-8.\n *\n * @return {Promise}\n */\n async text () {\n // More optimized than using this.arrayBuffer()\n // that requires twice as much ram\n const decoder = new TextDecoder()\n let str = ''\n for await (const part of toIterator(this.#parts, false)) {\n str += decoder.decode(part, { stream: true })\n }\n // Remaining\n str += decoder.decode()\n return str\n }\n\n /**\n * The arrayBuffer() method in the Blob interface returns a\n * Promise that resolves with the contents of the blob as\n * binary data contained in an ArrayBuffer.\n *\n * @return {Promise}\n */\n async arrayBuffer () {\n // Easier way... Just a unnecessary overhead\n // const view = new Uint8Array(this.size);\n // await this.stream().getReader({mode: 'byob'}).read(view);\n // return view.buffer;\n\n const data = new Uint8Array(this.size)\n let offset = 0\n for await (const chunk of toIterator(this.#parts, false)) {\n data.set(chunk, offset)\n offset += chunk.length\n }\n\n return data.buffer\n }\n\n stream () {\n const it = toIterator(this.#parts, true)\n\n return new globalThis.ReadableStream({\n // @ts-ignore\n type: 'bytes',\n async pull (ctrl) {\n const chunk = await it.next()\n chunk.done ? ctrl.close() : ctrl.enqueue(chunk.value)\n },\n\n async cancel () {\n await it.return()\n }\n })\n }\n\n /**\n * The Blob interface's slice() method creates and returns a\n * new Blob object which contains data from a subset of the\n * blob on which it's called.\n *\n * @param {number} [start]\n * @param {number} [end]\n * @param {string} [type]\n */\n slice (start = 0, end = this.size, type = '') {\n const { size } = this\n\n let relativeStart = start < 0 ? Math.max(size + start, 0) : Math.min(start, size)\n let relativeEnd = end < 0 ? Math.max(size + end, 0) : Math.min(end, size)\n\n const span = Math.max(relativeEnd - relativeStart, 0)\n const parts = this.#parts\n const blobParts = []\n let added = 0\n\n for (const part of parts) {\n // don't add the overflow to new blobParts\n if (added >= span) {\n break\n }\n\n const size = ArrayBuffer.isView(part) ? part.byteLength : part.size\n if (relativeStart && size <= relativeStart) {\n // Skip the beginning and change the relative\n // start & end position as we skip the unwanted parts\n relativeStart -= size\n relativeEnd -= size\n } else {\n let chunk\n if (ArrayBuffer.isView(part)) {\n chunk = part.subarray(relativeStart, Math.min(size, relativeEnd))\n added += chunk.byteLength\n } else {\n chunk = part.slice(relativeStart, Math.min(size, relativeEnd))\n added += chunk.size\n }\n relativeEnd -= size\n blobParts.push(chunk)\n relativeStart = 0 // All next sequential parts should start at 0\n }\n }\n\n const blob = new Blob([], { type: String(type).toLowerCase() })\n blob.#size = span\n blob.#parts = blobParts\n\n return blob\n }\n\n get [Symbol.toStringTag] () {\n return 'Blob'\n }\n\n static [Symbol.hasInstance] (object) {\n return (\n object &&\n typeof object === 'object' &&\n typeof object.constructor === 'function' &&\n (\n typeof object.stream === 'function' ||\n typeof object.arrayBuffer === 'function'\n ) &&\n /^(Blob|File)$/.test(object[Symbol.toStringTag])\n )\n }\n}\n\nObject.defineProperties(_Blob.prototype, {\n size: { enumerable: true },\n type: { enumerable: true },\n slice: { enumerable: true }\n})\n\n/** @type {typeof globalThis.Blob} */\nexport const Blob = _Blob\nexport default Blob\n","import Blob from './index.js'\n\nconst _File = class File extends Blob {\n #lastModified = 0\n #name = ''\n\n /**\n * @param {*[]} fileBits\n * @param {string} fileName\n * @param {{lastModified?: number, type?: string}} options\n */// @ts-ignore\n constructor (fileBits, fileName, options = {}) {\n if (arguments.length < 2) {\n throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`)\n }\n super(fileBits, options)\n\n if (options === null) options = {}\n\n // Simulate WebIDL type casting for NaN value in lastModified option.\n const lastModified = options.lastModified === undefined ? Date.now() : Number(options.lastModified)\n if (!Number.isNaN(lastModified)) {\n this.#lastModified = lastModified\n }\n\n this.#name = String(fileName)\n }\n\n get name () {\n return this.#name\n }\n\n get lastModified () {\n return this.#lastModified\n }\n\n get [Symbol.toStringTag] () {\n return 'File'\n }\n\n static [Symbol.hasInstance] (object) {\n return !!object && object instanceof Blob &&\n /^(File)$/.test(object[Symbol.toStringTag])\n }\n}\n\n/** @type {typeof globalThis.File} */// @ts-ignore\nexport const File = _File\nexport default File\n","/*! formdata-polyfill. MIT License. Jimmy Wärting */\n\nimport C from 'fetch-blob'\nimport F from 'fetch-blob/file.js'\n\nvar {toStringTag:t,iterator:i,hasInstance:h}=Symbol,\nr=Math.random,\nm='append,set,get,getAll,delete,keys,values,entries,forEach,constructor'.split(','),\nf=(a,b,c)=>(a+='',/^(Blob|File)$/.test(b && b[t])?[(c=c!==void 0?c+'':b[t]=='File'?b.name:'blob',a),b.name!==c||b[t]=='blob'?new F([b],c,b):b]:[a,b+'']),\ne=(c,f)=>(f?c:c.replace(/\\r?\\n|\\r/g,'\\r\\n')).replace(/\\n/g,'%0A').replace(/\\r/g,'%0D').replace(/\"/g,'%22'),\nx=(n, a, e)=>{if(a.lengthtypeof o[m]!='function')}\nappend(...a){x('append',arguments,2);this.#d.push(f(...a))}\ndelete(a){x('delete',arguments,1);a+='';this.#d=this.#d.filter(([b])=>b!==a)}\nget(a){x('get',arguments,1);a+='';for(var b=this.#d,l=b.length,c=0;cc[0]===a&&b.push(c[1]));return b}\nhas(a){x('has',arguments,1);a+='';return this.#d.some(b=>b[0]===a)}\nforEach(a,b){x('forEach',arguments,1);for(var [c,d]of this)a.call(b,d,c,this)}\nset(...a){x('set',arguments,2);var b=[],c=!0;a=f(...a);this.#d.forEach(d=>{d[0]===a[0]?c&&(c=!b.push(a)):b.push(d)});c&&b.push(a);this.#d=b}\n*entries(){yield*this.#d}\n*keys(){for(var[a]of this)yield a}\n*values(){for(var[,a]of this)yield a}}\n\n/** @param {FormData} F */\nexport function formDataToBlob (F,B=C){\nvar b=`${r()}${r()}`.replace(/\\./g, '').slice(-28).padStart(32, '-'),c=[],p=`--${b}\\r\\nContent-Disposition: form-data; name=\"`\nF.forEach((v,n)=>typeof v=='string'\n?c.push(p+e(n)+`\"\\r\\n\\r\\n${v.replace(/\\r(?!\\n)|(? {\n\treturn (\n\t\ttypeof object === 'object' &&\n\t\ttypeof object.append === 'function' &&\n\t\ttypeof object.delete === 'function' &&\n\t\ttypeof object.get === 'function' &&\n\t\ttypeof object.getAll === 'function' &&\n\t\ttypeof object.has === 'function' &&\n\t\ttypeof object.set === 'function' &&\n\t\ttypeof object.sort === 'function' &&\n\t\tobject[NAME] === 'URLSearchParams'\n\t);\n};\n\n/**\n * Check if `object` is a W3C `Blob` object (which `File` inherits from)\n * @param {*} object - Object to check for\n * @return {boolean}\n */\nexport const isBlob = object => {\n\treturn (\n\t\tobject &&\n\t\ttypeof object === 'object' &&\n\t\ttypeof object.arrayBuffer === 'function' &&\n\t\ttypeof object.type === 'string' &&\n\t\ttypeof object.stream === 'function' &&\n\t\ttypeof object.constructor === 'function' &&\n\t\t/^(Blob|File)$/.test(object[NAME])\n\t);\n};\n\n/**\n * Check if `obj` is an instance of AbortSignal.\n * @param {*} object - Object to check for\n * @return {boolean}\n */\nexport const isAbortSignal = object => {\n\treturn (\n\t\ttypeof object === 'object' && (\n\t\t\tobject[NAME] === 'AbortSignal' ||\n\t\t\tobject[NAME] === 'EventTarget'\n\t\t)\n\t);\n};\n\n/**\n * isDomainOrSubdomain reports whether sub is a subdomain (or exact match) of\n * the parent domain.\n *\n * Both domains must already be in canonical form.\n * @param {string|URL} original\n * @param {string|URL} destination\n */\nexport const isDomainOrSubdomain = (destination, original) => {\n\tconst orig = new URL(original).hostname;\n\tconst dest = new URL(destination).hostname;\n\n\treturn orig === dest || orig.endsWith(`.${dest}`);\n};\n\n/**\n * isSameProtocol reports whether the two provided URLs use the same protocol.\n *\n * Both domains must already be in canonical form.\n * @param {string|URL} original\n * @param {string|URL} destination\n */\nexport const isSameProtocol = (destination, original) => {\n\tconst orig = new URL(original).protocol;\n\tconst dest = new URL(destination).protocol;\n\n\treturn orig === dest;\n};\n","\n/**\n * Body.js\n *\n * Body interface provides common methods for Request and Response\n */\n\nimport Stream, {PassThrough} from 'node:stream';\nimport {types, deprecate, promisify} from 'node:util';\nimport {Buffer} from 'node:buffer';\n\nimport Blob from 'fetch-blob';\nimport {FormData, formDataToBlob} from 'formdata-polyfill/esm.min.js';\n\nimport {FetchError} from './errors/fetch-error.js';\nimport {FetchBaseError} from './errors/base.js';\nimport {isBlob, isURLSearchParameters} from './utils/is.js';\n\nconst pipeline = promisify(Stream.pipeline);\nconst INTERNALS = Symbol('Body internals');\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nexport default class Body {\n\tconstructor(body, {\n\t\tsize = 0\n\t} = {}) {\n\t\tlet boundary = null;\n\n\t\tif (body === null) {\n\t\t\t// Body is undefined or null\n\t\t\tbody = null;\n\t\t} else if (isURLSearchParameters(body)) {\n\t\t\t// Body is a URLSearchParams\n\t\t\tbody = Buffer.from(body.toString());\n\t\t} else if (isBlob(body)) {\n\t\t\t// Body is blob\n\t\t} else if (Buffer.isBuffer(body)) {\n\t\t\t// Body is Buffer\n\t\t} else if (types.isAnyArrayBuffer(body)) {\n\t\t\t// Body is ArrayBuffer\n\t\t\tbody = Buffer.from(body);\n\t\t} else if (ArrayBuffer.isView(body)) {\n\t\t\t// Body is ArrayBufferView\n\t\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t\t} else if (body instanceof Stream) {\n\t\t\t// Body is stream\n\t\t} else if (body instanceof FormData) {\n\t\t\t// Body is FormData\n\t\t\tbody = formDataToBlob(body);\n\t\t\tboundary = body.type.split('=')[1];\n\t\t} else {\n\t\t\t// None of the above\n\t\t\t// coerce to string then buffer\n\t\t\tbody = Buffer.from(String(body));\n\t\t}\n\n\t\tlet stream = body;\n\n\t\tif (Buffer.isBuffer(body)) {\n\t\t\tstream = Stream.Readable.from(body);\n\t\t} else if (isBlob(body)) {\n\t\t\tstream = Stream.Readable.from(body.stream());\n\t\t}\n\n\t\tthis[INTERNALS] = {\n\t\t\tbody,\n\t\t\tstream,\n\t\t\tboundary,\n\t\t\tdisturbed: false,\n\t\t\terror: null\n\t\t};\n\t\tthis.size = size;\n\n\t\tif (body instanceof Stream) {\n\t\t\tbody.on('error', error_ => {\n\t\t\t\tconst error = error_ instanceof FetchBaseError ?\n\t\t\t\t\terror_ :\n\t\t\t\t\tnew FetchError(`Invalid response body while trying to fetch ${this.url}: ${error_.message}`, 'system', error_);\n\t\t\t\tthis[INTERNALS].error = error;\n\t\t\t});\n\t\t}\n\t}\n\n\tget body() {\n\t\treturn this[INTERNALS].stream;\n\t}\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t}\n\n\t/**\n\t * Decode response as ArrayBuffer\n\t *\n\t * @return Promise\n\t */\n\tasync arrayBuffer() {\n\t\tconst {buffer, byteOffset, byteLength} = await consumeBody(this);\n\t\treturn buffer.slice(byteOffset, byteOffset + byteLength);\n\t}\n\n\tasync formData() {\n\t\tconst ct = this.headers.get('content-type');\n\n\t\tif (ct.startsWith('application/x-www-form-urlencoded')) {\n\t\t\tconst formData = new FormData();\n\t\t\tconst parameters = new URLSearchParams(await this.text());\n\n\t\t\tfor (const [name, value] of parameters) {\n\t\t\t\tformData.append(name, value);\n\t\t\t}\n\n\t\t\treturn formData;\n\t\t}\n\n\t\tconst {toFormData} = await import('./utils/multipart-parser.js');\n\t\treturn toFormData(this.body, ct);\n\t}\n\n\t/**\n\t * Return raw response as Blob\n\t *\n\t * @return Promise\n\t */\n\tasync blob() {\n\t\tconst ct = (this.headers && this.headers.get('content-type')) || (this[INTERNALS].body && this[INTERNALS].body.type) || '';\n\t\tconst buf = await this.arrayBuffer();\n\n\t\treturn new Blob([buf], {\n\t\t\ttype: ct\n\t\t});\n\t}\n\n\t/**\n\t * Decode response as json\n\t *\n\t * @return Promise\n\t */\n\tasync json() {\n\t\tconst text = await this.text();\n\t\treturn JSON.parse(text);\n\t}\n\n\t/**\n\t * Decode response as text\n\t *\n\t * @return Promise\n\t */\n\tasync text() {\n\t\tconst buffer = await consumeBody(this);\n\t\treturn new TextDecoder().decode(buffer);\n\t}\n\n\t/**\n\t * Decode response as buffer (non-spec api)\n\t *\n\t * @return Promise\n\t */\n\tbuffer() {\n\t\treturn consumeBody(this);\n\t}\n}\n\nBody.prototype.buffer = deprecate(Body.prototype.buffer, 'Please use \\'response.arrayBuffer()\\' instead of \\'response.buffer()\\'', 'node-fetch#buffer');\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: {enumerable: true},\n\tbodyUsed: {enumerable: true},\n\tarrayBuffer: {enumerable: true},\n\tblob: {enumerable: true},\n\tjson: {enumerable: true},\n\ttext: {enumerable: true},\n\tdata: {get: deprecate(() => {},\n\t\t'data doesn\\'t exist, use json(), text(), arrayBuffer(), or body instead',\n\t\t'https://github.com/node-fetch/node-fetch/issues/1000 (response)')}\n});\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nasync function consumeBody(data) {\n\tif (data[INTERNALS].disturbed) {\n\t\tthrow new TypeError(`body used already for: ${data.url}`);\n\t}\n\n\tdata[INTERNALS].disturbed = true;\n\n\tif (data[INTERNALS].error) {\n\t\tthrow data[INTERNALS].error;\n\t}\n\n\tconst {body} = data;\n\n\t// Body is null\n\tif (body === null) {\n\t\treturn Buffer.alloc(0);\n\t}\n\n\t/* c8 ignore next 3 */\n\tif (!(body instanceof Stream)) {\n\t\treturn Buffer.alloc(0);\n\t}\n\n\t// Body is stream\n\t// get ready to actually consume the body\n\tconst accum = [];\n\tlet accumBytes = 0;\n\n\ttry {\n\t\tfor await (const chunk of body) {\n\t\t\tif (data.size > 0 && accumBytes + chunk.length > data.size) {\n\t\t\t\tconst error = new FetchError(`content size at ${data.url} over limit: ${data.size}`, 'max-size');\n\t\t\t\tbody.destroy(error);\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t}\n\t} catch (error) {\n\t\tconst error_ = error instanceof FetchBaseError ? error : new FetchError(`Invalid response body while trying to fetch ${data.url}: ${error.message}`, 'system', error);\n\t\tthrow error_;\n\t}\n\n\tif (body.readableEnded === true || body._readableState.ended === true) {\n\t\ttry {\n\t\t\tif (accum.every(c => typeof c === 'string')) {\n\t\t\t\treturn Buffer.from(accum.join(''));\n\t\t\t}\n\n\t\t\treturn Buffer.concat(accum, accumBytes);\n\t\t} catch (error) {\n\t\t\tthrow new FetchError(`Could not create Buffer from response body for ${data.url}: ${error.message}`, 'system', error);\n\t\t}\n\t} else {\n\t\tthrow new FetchError(`Premature close of server response while trying to fetch ${data.url}`);\n\t}\n}\n\n/**\n * Clone body given Res/Req instance\n *\n * @param Mixed instance Response or Request instance\n * @param String highWaterMark highWaterMark for both PassThrough body streams\n * @return Mixed\n */\nexport const clone = (instance, highWaterMark) => {\n\tlet p1;\n\tlet p2;\n\tlet {body} = instance[INTERNALS];\n\n\t// Don't allow cloning a used body\n\tif (instance.bodyUsed) {\n\t\tthrow new Error('cannot clone body after it is used');\n\t}\n\n\t// Check that body is a stream and not form-data object\n\t// note: we can't clone the form-data object without having it as a dependency\n\tif ((body instanceof Stream) && (typeof body.getBoundary !== 'function')) {\n\t\t// Tee instance body\n\t\tp1 = new PassThrough({highWaterMark});\n\t\tp2 = new PassThrough({highWaterMark});\n\t\tbody.pipe(p1);\n\t\tbody.pipe(p2);\n\t\t// Set instance body to teed body and return the other teed body\n\t\tinstance[INTERNALS].stream = p1;\n\t\tbody = p2;\n\t}\n\n\treturn body;\n};\n\nconst getNonSpecFormDataBoundary = deprecate(\n\tbody => body.getBoundary(),\n\t'form-data doesn\\'t follow the spec and requires special treatment. Use alternative package',\n\t'https://github.com/node-fetch/node-fetch/issues/1167'\n);\n\n/**\n * Performs the operation \"extract a `Content-Type` value from |object|\" as\n * specified in the specification:\n * https://fetch.spec.whatwg.org/#concept-bodyinit-extract\n *\n * This function assumes that instance.body is present.\n *\n * @param {any} body Any options.body input\n * @returns {string | null}\n */\nexport const extractContentType = (body, request) => {\n\t// Body is null or undefined\n\tif (body === null) {\n\t\treturn null;\n\t}\n\n\t// Body is string\n\tif (typeof body === 'string') {\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n\n\t// Body is a URLSearchParams\n\tif (isURLSearchParameters(body)) {\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t}\n\n\t// Body is blob\n\tif (isBlob(body)) {\n\t\treturn body.type || null;\n\t}\n\n\t// Body is a Buffer (Buffer, ArrayBuffer or ArrayBufferView)\n\tif (Buffer.isBuffer(body) || types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) {\n\t\treturn null;\n\t}\n\n\tif (body instanceof FormData) {\n\t\treturn `multipart/form-data; boundary=${request[INTERNALS].boundary}`;\n\t}\n\n\t// Detect form data input from form-data module\n\tif (body && typeof body.getBoundary === 'function') {\n\t\treturn `multipart/form-data;boundary=${getNonSpecFormDataBoundary(body)}`;\n\t}\n\n\t// Body is stream - can't really do much about this\n\tif (body instanceof Stream) {\n\t\treturn null;\n\t}\n\n\t// Body constructor defaults other things to string\n\treturn 'text/plain;charset=UTF-8';\n};\n\n/**\n * The Fetch Standard treats this as if \"total bytes\" is a property on the body.\n * For us, we have to explicitly get it with a function.\n *\n * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes\n *\n * @param {any} obj.body Body object from the Body instance.\n * @returns {number | null}\n */\nexport const getTotalBytes = request => {\n\tconst {body} = request[INTERNALS];\n\n\t// Body is null or undefined\n\tif (body === null) {\n\t\treturn 0;\n\t}\n\n\t// Body is Blob\n\tif (isBlob(body)) {\n\t\treturn body.size;\n\t}\n\n\t// Body is Buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn body.length;\n\t}\n\n\t// Detect form data input from form-data module\n\tif (body && typeof body.getLengthSync === 'function') {\n\t\treturn body.hasKnownLength && body.hasKnownLength() ? body.getLengthSync() : null;\n\t}\n\n\t// Body is stream\n\treturn null;\n};\n\n/**\n * Write a Body to a Node.js WritableStream (e.g. http.Request) object.\n *\n * @param {Stream.Writable} dest The stream to write to.\n * @param obj.body Body object from the Body instance.\n * @returns {Promise}\n */\nexport const writeToStream = async (dest, {body}) => {\n\tif (body === null) {\n\t\t// Body is null\n\t\tdest.end();\n\t} else {\n\t\t// Body is stream\n\t\tawait pipeline(body, dest);\n\t}\n};\n","/**\n * Headers.js\n *\n * Headers class offers convenient helpers\n */\n\nimport {types} from 'node:util';\nimport http from 'node:http';\n\n/* c8 ignore next 9 */\nconst validateHeaderName = typeof http.validateHeaderName === 'function' ?\n\thttp.validateHeaderName :\n\tname => {\n\t\tif (!/^[\\^`\\-\\w!#$%&'*+.|~]+$/.test(name)) {\n\t\t\tconst error = new TypeError(`Header name must be a valid HTTP token [${name}]`);\n\t\t\tObject.defineProperty(error, 'code', {value: 'ERR_INVALID_HTTP_TOKEN'});\n\t\t\tthrow error;\n\t\t}\n\t};\n\n/* c8 ignore next 9 */\nconst validateHeaderValue = typeof http.validateHeaderValue === 'function' ?\n\thttp.validateHeaderValue :\n\t(name, value) => {\n\t\tif (/[^\\t\\u0020-\\u007E\\u0080-\\u00FF]/.test(value)) {\n\t\t\tconst error = new TypeError(`Invalid character in header content [\"${name}\"]`);\n\t\t\tObject.defineProperty(error, 'code', {value: 'ERR_INVALID_CHAR'});\n\t\t\tthrow error;\n\t\t}\n\t};\n\n/**\n * @typedef {Headers | Record | Iterable | Iterable>} HeadersInit\n */\n\n/**\n * This Fetch API interface allows you to perform various actions on HTTP request and response headers.\n * These actions include retrieving, setting, adding to, and removing.\n * A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.\n * You can add to this using methods like append() (see Examples.)\n * In all methods of this interface, header names are matched by case-insensitive byte sequence.\n *\n */\nexport default class Headers extends URLSearchParams {\n\t/**\n\t * Headers class\n\t *\n\t * @constructor\n\t * @param {HeadersInit} [init] - Response headers\n\t */\n\tconstructor(init) {\n\t\t// Validate and normalize init object in [name, value(s)][]\n\t\t/** @type {string[][]} */\n\t\tlet result = [];\n\t\tif (init instanceof Headers) {\n\t\t\tconst raw = init.raw();\n\t\t\tfor (const [name, values] of Object.entries(raw)) {\n\t\t\t\tresult.push(...values.map(value => [name, value]));\n\t\t\t}\n\t\t} else if (init == null) { // eslint-disable-line no-eq-null, eqeqeq\n\t\t\t// No op\n\t\t} else if (typeof init === 'object' && !types.isBoxedPrimitive(init)) {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\t\tif (method == null) {\n\t\t\t\t// Record\n\t\t\t\tresult.push(...Object.entries(init));\n\t\t\t} else {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// Sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tresult = [...init]\n\t\t\t\t\t.map(pair => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof pair !== 'object' || types.isBoxedPrimitive(pair)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new TypeError('Each header pair must be an iterable object');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn [...pair];\n\t\t\t\t\t}).map(pair => {\n\t\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn [...pair];\n\t\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Failed to construct \\'Headers\\': The provided value is not of type \\'(sequence> or record)');\n\t\t}\n\n\t\t// Validate and lowercase\n\t\tresult =\n\t\t\tresult.length > 0 ?\n\t\t\t\tresult.map(([name, value]) => {\n\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\treturn [String(name).toLowerCase(), String(value)];\n\t\t\t\t}) :\n\t\t\t\tundefined;\n\n\t\tsuper(result);\n\n\t\t// Returning a Proxy that will lowercase key names, validate parameters and sort keys\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn new Proxy(this, {\n\t\t\tget(target, p, receiver) {\n\t\t\t\tswitch (p) {\n\t\t\t\t\tcase 'append':\n\t\t\t\t\tcase 'set':\n\t\t\t\t\t\treturn (name, value) => {\n\t\t\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\t\t\treturn URLSearchParams.prototype[p].call(\n\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\tString(name).toLowerCase(),\n\t\t\t\t\t\t\t\tString(value)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase 'delete':\n\t\t\t\t\tcase 'has':\n\t\t\t\t\tcase 'getAll':\n\t\t\t\t\t\treturn name => {\n\t\t\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\t\t\treturn URLSearchParams.prototype[p].call(\n\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\tString(name).toLowerCase()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase 'keys':\n\t\t\t\t\t\treturn () => {\n\t\t\t\t\t\t\ttarget.sort();\n\t\t\t\t\t\t\treturn new Set(URLSearchParams.prototype.keys.call(target)).keys();\n\t\t\t\t\t\t};\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn Reflect.get(target, p, receiver);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t/* c8 ignore next */\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn this.constructor.name;\n\t}\n\n\ttoString() {\n\t\treturn Object.prototype.toString.call(this);\n\t}\n\n\tget(name) {\n\t\tconst values = this.getAll(name);\n\t\tif (values.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet value = values.join(', ');\n\t\tif (/^content-encoding$/i.test(name)) {\n\t\t\tvalue = value.toLowerCase();\n\t\t}\n\n\t\treturn value;\n\t}\n\n\tforEach(callback, thisArg = undefined) {\n\t\tfor (const name of this.keys()) {\n\t\t\tReflect.apply(callback, thisArg, [this.get(name), name, this]);\n\t\t}\n\t}\n\n\t* values() {\n\t\tfor (const name of this.keys()) {\n\t\t\tyield this.get(name);\n\t\t}\n\t}\n\n\t/**\n\t * @type {() => IterableIterator<[string, string]>}\n\t */\n\t* entries() {\n\t\tfor (const name of this.keys()) {\n\t\t\tyield [name, this.get(name)];\n\t\t}\n\t}\n\n\t[Symbol.iterator]() {\n\t\treturn this.entries();\n\t}\n\n\t/**\n\t * Node-fetch non-spec method\n\t * returning all headers and their values as array\n\t * @returns {Record}\n\t */\n\traw() {\n\t\treturn [...this.keys()].reduce((result, key) => {\n\t\t\tresult[key] = this.getAll(key);\n\t\t\treturn result;\n\t\t}, {});\n\t}\n\n\t/**\n\t * For better console.log(headers) and also to convert Headers into Node.js Request compatible format\n\t */\n\t[Symbol.for('nodejs.util.inspect.custom')]() {\n\t\treturn [...this.keys()].reduce((result, key) => {\n\t\t\tconst values = this.getAll(key);\n\t\t\t// Http.request() only supports string as Host header.\n\t\t\t// This hack makes specifying custom Host header possible.\n\t\t\tif (key === 'host') {\n\t\t\t\tresult[key] = values[0];\n\t\t\t} else {\n\t\t\t\tresult[key] = values.length > 1 ? values : values[0];\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}, {});\n\t}\n}\n\n/**\n * Re-shaping object for Web IDL tests\n * Only need to do it for overridden methods\n */\nObject.defineProperties(\n\tHeaders.prototype,\n\t['get', 'entries', 'forEach', 'values'].reduce((result, property) => {\n\t\tresult[property] = {enumerable: true};\n\t\treturn result;\n\t}, {})\n);\n\n/**\n * Create a Headers object from an http.IncomingMessage.rawHeaders, ignoring those that do\n * not conform to HTTP grammar productions.\n * @param {import('http').IncomingMessage['rawHeaders']} headers\n */\nexport function fromRawHeaders(headers = []) {\n\treturn new Headers(\n\t\theaders\n\t\t\t// Split into pairs\n\t\t\t.reduce((result, value, index, array) => {\n\t\t\t\tif (index % 2 === 0) {\n\t\t\t\t\tresult.push(array.slice(index, index + 2));\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}, [])\n\t\t\t.filter(([name, value]) => {\n\t\t\t\ttry {\n\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\treturn true;\n\t\t\t\t} catch {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t})\n\n\t);\n}\n","const redirectStatus = new Set([301, 302, 303, 307, 308]);\n\n/**\n * Redirect code matching\n *\n * @param {number} code - Status code\n * @return {boolean}\n */\nexport const isRedirect = code => {\n\treturn redirectStatus.has(code);\n};\n","/**\n * Response.js\n *\n * Response class provides content decoding\n */\n\nimport Headers from './headers.js';\nimport Body, {clone, extractContentType} from './body.js';\nimport {isRedirect} from './utils/is-redirect.js';\n\nconst INTERNALS = Symbol('Response internals');\n\n/**\n * Response class\n *\n * Ref: https://fetch.spec.whatwg.org/#response-class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nexport default class Response extends Body {\n\tconstructor(body = null, options = {}) {\n\t\tsuper(body, options);\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq, no-negated-condition\n\t\tconst status = options.status != null ? options.status : 200;\n\n\t\tconst headers = new Headers(options.headers);\n\n\t\tif (body !== null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body, this);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS] = {\n\t\t\ttype: 'default',\n\t\t\turl: options.url,\n\t\t\tstatus,\n\t\t\tstatusText: options.statusText || '',\n\t\t\theaders,\n\t\t\tcounter: options.counter,\n\t\t\thighWaterMark: options.highWaterMark\n\t\t};\n\t}\n\n\tget type() {\n\t\treturn this[INTERNALS].type;\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS].status;\n\t}\n\n\t/**\n\t * Convenience property representing if the request ended normally\n\t */\n\tget ok() {\n\t\treturn this[INTERNALS].status >= 200 && this[INTERNALS].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS].headers;\n\t}\n\n\tget highWaterMark() {\n\t\treturn this[INTERNALS].highWaterMark;\n\t}\n\n\t/**\n\t * Clone this response\n\t *\n\t * @return Response\n\t */\n\tclone() {\n\t\treturn new Response(clone(this, this.highWaterMark), {\n\t\t\ttype: this.type,\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected,\n\t\t\tsize: this.size,\n\t\t\thighWaterMark: this.highWaterMark\n\t\t});\n\t}\n\n\t/**\n\t * @param {string} url The URL that the new response is to originate from.\n\t * @param {number} status An optional status code for the response (e.g., 302.)\n\t * @returns {Response} A Response object.\n\t */\n\tstatic redirect(url, status = 302) {\n\t\tif (!isRedirect(status)) {\n\t\t\tthrow new RangeError('Failed to execute \"redirect\" on \"response\": Invalid status code');\n\t\t}\n\n\t\treturn new Response(null, {\n\t\t\theaders: {\n\t\t\t\tlocation: new URL(url).toString()\n\t\t\t},\n\t\t\tstatus\n\t\t});\n\t}\n\n\tstatic error() {\n\t\tconst response = new Response(null, {status: 0, statusText: ''});\n\t\tresponse[INTERNALS].type = 'error';\n\t\treturn response;\n\t}\n\n\tstatic json(data = undefined, init = {}) {\n\t\tconst body = JSON.stringify(data);\n\n\t\tif (body === undefined) {\n\t\t\tthrow new TypeError('data is not JSON serializable');\n\t\t}\n\n\t\tconst headers = new Headers(init && init.headers);\n\n\t\tif (!headers.has('content-type')) {\n\t\t\theaders.set('content-type', 'application/json');\n\t\t}\n\n\t\treturn new Response(body, {\n\t\t\t...init,\n\t\t\theaders\n\t\t});\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Response';\n\t}\n}\n\nObject.defineProperties(Response.prototype, {\n\ttype: {enumerable: true},\n\turl: {enumerable: true},\n\tstatus: {enumerable: true},\n\tok: {enumerable: true},\n\tredirected: {enumerable: true},\n\tstatusText: {enumerable: true},\n\theaders: {enumerable: true},\n\tclone: {enumerable: true}\n});\n","export const getSearch = parsedURL => {\n\tif (parsedURL.search) {\n\t\treturn parsedURL.search;\n\t}\n\n\tconst lastOffset = parsedURL.href.length - 1;\n\tconst hash = parsedURL.hash || (parsedURL.href[lastOffset] === '#' ? '#' : '');\n\treturn parsedURL.href[lastOffset - hash.length] === '?' ? '?' : '';\n};\n","import {isIP} from 'node:net';\n\n/**\n * @external URL\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/URL|URL}\n */\n\n/**\n * @module utils/referrer\n * @private\n */\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#strip-url|Referrer Policy §8.4. Strip url for use as a referrer}\n * @param {string} URL\n * @param {boolean} [originOnly=false]\n */\nexport function stripURLForUseAsAReferrer(url, originOnly = false) {\n\t// 1. If url is null, return no referrer.\n\tif (url == null) { // eslint-disable-line no-eq-null, eqeqeq\n\t\treturn 'no-referrer';\n\t}\n\n\turl = new URL(url);\n\n\t// 2. If url's scheme is a local scheme, then return no referrer.\n\tif (/^(about|blob|data):$/.test(url.protocol)) {\n\t\treturn 'no-referrer';\n\t}\n\n\t// 3. Set url's username to the empty string.\n\turl.username = '';\n\n\t// 4. Set url's password to null.\n\t// Note: `null` appears to be a mistake as this actually results in the password being `\"null\"`.\n\turl.password = '';\n\n\t// 5. Set url's fragment to null.\n\t// Note: `null` appears to be a mistake as this actually results in the fragment being `\"#null\"`.\n\turl.hash = '';\n\n\t// 6. If the origin-only flag is true, then:\n\tif (originOnly) {\n\t\t// 6.1. Set url's path to null.\n\t\t// Note: `null` appears to be a mistake as this actually results in the path being `\"/null\"`.\n\t\turl.pathname = '';\n\n\t\t// 6.2. Set url's query to null.\n\t\t// Note: `null` appears to be a mistake as this actually results in the query being `\"?null\"`.\n\t\turl.search = '';\n\t}\n\n\t// 7. Return url.\n\treturn url;\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#enumdef-referrerpolicy|enum ReferrerPolicy}\n */\nexport const ReferrerPolicy = new Set([\n\t'',\n\t'no-referrer',\n\t'no-referrer-when-downgrade',\n\t'same-origin',\n\t'origin',\n\t'strict-origin',\n\t'origin-when-cross-origin',\n\t'strict-origin-when-cross-origin',\n\t'unsafe-url'\n]);\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#default-referrer-policy|default referrer policy}\n */\nexport const DEFAULT_REFERRER_POLICY = 'strict-origin-when-cross-origin';\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#referrer-policies|Referrer Policy §3. Referrer Policies}\n * @param {string} referrerPolicy\n * @returns {string} referrerPolicy\n */\nexport function validateReferrerPolicy(referrerPolicy) {\n\tif (!ReferrerPolicy.has(referrerPolicy)) {\n\t\tthrow new TypeError(`Invalid referrerPolicy: ${referrerPolicy}`);\n\t}\n\n\treturn referrerPolicy;\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy|Referrer Policy §3.2. Is origin potentially trustworthy?}\n * @param {external:URL} url\n * @returns `true`: \"Potentially Trustworthy\", `false`: \"Not Trustworthy\"\n */\nexport function isOriginPotentiallyTrustworthy(url) {\n\t// 1. If origin is an opaque origin, return \"Not Trustworthy\".\n\t// Not applicable\n\n\t// 2. Assert: origin is a tuple origin.\n\t// Not for implementations\n\n\t// 3. If origin's scheme is either \"https\" or \"wss\", return \"Potentially Trustworthy\".\n\tif (/^(http|ws)s:$/.test(url.protocol)) {\n\t\treturn true;\n\t}\n\n\t// 4. If origin's host component matches one of the CIDR notations 127.0.0.0/8 or ::1/128 [RFC4632], return \"Potentially Trustworthy\".\n\tconst hostIp = url.host.replace(/(^\\[)|(]$)/g, '');\n\tconst hostIPVersion = isIP(hostIp);\n\n\tif (hostIPVersion === 4 && /^127\\./.test(hostIp)) {\n\t\treturn true;\n\t}\n\n\tif (hostIPVersion === 6 && /^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(hostIp)) {\n\t\treturn true;\n\t}\n\n\t// 5. If origin's host component is \"localhost\" or falls within \".localhost\", and the user agent conforms to the name resolution rules in [let-localhost-be-localhost], return \"Potentially Trustworthy\".\n\t// We are returning FALSE here because we cannot ensure conformance to\n\t// let-localhost-be-loalhost (https://tools.ietf.org/html/draft-west-let-localhost-be-localhost)\n\tif (url.host === 'localhost' || url.host.endsWith('.localhost')) {\n\t\treturn false;\n\t}\n\n\t// 6. If origin's scheme component is file, return \"Potentially Trustworthy\".\n\tif (url.protocol === 'file:') {\n\t\treturn true;\n\t}\n\n\t// 7. If origin's scheme component is one which the user agent considers to be authenticated, return \"Potentially Trustworthy\".\n\t// Not supported\n\n\t// 8. If origin has been configured as a trustworthy origin, return \"Potentially Trustworthy\".\n\t// Not supported\n\n\t// 9. Return \"Not Trustworthy\".\n\treturn false;\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-secure-contexts/#is-url-trustworthy|Referrer Policy §3.3. Is url potentially trustworthy?}\n * @param {external:URL} url\n * @returns `true`: \"Potentially Trustworthy\", `false`: \"Not Trustworthy\"\n */\nexport function isUrlPotentiallyTrustworthy(url) {\n\t// 1. If url is \"about:blank\" or \"about:srcdoc\", return \"Potentially Trustworthy\".\n\tif (/^about:(blank|srcdoc)$/.test(url)) {\n\t\treturn true;\n\t}\n\n\t// 2. If url's scheme is \"data\", return \"Potentially Trustworthy\".\n\tif (url.protocol === 'data:') {\n\t\treturn true;\n\t}\n\n\t// Note: The origin of blob: and filesystem: URLs is the origin of the context in which they were\n\t// created. Therefore, blobs created in a trustworthy origin will themselves be potentially\n\t// trustworthy.\n\tif (/^(blob|filesystem):$/.test(url.protocol)) {\n\t\treturn true;\n\t}\n\n\t// 3. Return the result of executing §3.2 Is origin potentially trustworthy? on url's origin.\n\treturn isOriginPotentiallyTrustworthy(url);\n}\n\n/**\n * Modifies the referrerURL to enforce any extra security policy considerations.\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer|Referrer Policy §8.3. Determine request's Referrer}, step 7\n * @callback module:utils/referrer~referrerURLCallback\n * @param {external:URL} referrerURL\n * @returns {external:URL} modified referrerURL\n */\n\n/**\n * Modifies the referrerOrigin to enforce any extra security policy considerations.\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer|Referrer Policy §8.3. Determine request's Referrer}, step 7\n * @callback module:utils/referrer~referrerOriginCallback\n * @param {external:URL} referrerOrigin\n * @returns {external:URL} modified referrerOrigin\n */\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer|Referrer Policy §8.3. Determine request's Referrer}\n * @param {Request} request\n * @param {object} o\n * @param {module:utils/referrer~referrerURLCallback} o.referrerURLCallback\n * @param {module:utils/referrer~referrerOriginCallback} o.referrerOriginCallback\n * @returns {external:URL} Request's referrer\n */\nexport function determineRequestsReferrer(request, {referrerURLCallback, referrerOriginCallback} = {}) {\n\t// There are 2 notes in the specification about invalid pre-conditions. We return null, here, for\n\t// these cases:\n\t// > Note: If request's referrer is \"no-referrer\", Fetch will not call into this algorithm.\n\t// > Note: If request's referrer policy is the empty string, Fetch will not call into this\n\t// > algorithm.\n\tif (request.referrer === 'no-referrer' || request.referrerPolicy === '') {\n\t\treturn null;\n\t}\n\n\t// 1. Let policy be request's associated referrer policy.\n\tconst policy = request.referrerPolicy;\n\n\t// 2. Let environment be request's client.\n\t// not applicable to node.js\n\n\t// 3. Switch on request's referrer:\n\tif (request.referrer === 'about:client') {\n\t\treturn 'no-referrer';\n\t}\n\n\t// \"a URL\": Let referrerSource be request's referrer.\n\tconst referrerSource = request.referrer;\n\n\t// 4. Let request's referrerURL be the result of stripping referrerSource for use as a referrer.\n\tlet referrerURL = stripURLForUseAsAReferrer(referrerSource);\n\n\t// 5. Let referrerOrigin be the result of stripping referrerSource for use as a referrer, with the\n\t// origin-only flag set to true.\n\tlet referrerOrigin = stripURLForUseAsAReferrer(referrerSource, true);\n\n\t// 6. If the result of serializing referrerURL is a string whose length is greater than 4096, set\n\t// referrerURL to referrerOrigin.\n\tif (referrerURL.toString().length > 4096) {\n\t\treferrerURL = referrerOrigin;\n\t}\n\n\t// 7. The user agent MAY alter referrerURL or referrerOrigin at this point to enforce arbitrary\n\t// policy considerations in the interests of minimizing data leakage. For example, the user\n\t// agent could strip the URL down to an origin, modify its host, replace it with an empty\n\t// string, etc.\n\tif (referrerURLCallback) {\n\t\treferrerURL = referrerURLCallback(referrerURL);\n\t}\n\n\tif (referrerOriginCallback) {\n\t\treferrerOrigin = referrerOriginCallback(referrerOrigin);\n\t}\n\n\t// 8.Execute the statements corresponding to the value of policy:\n\tconst currentURL = new URL(request.url);\n\n\tswitch (policy) {\n\t\tcase 'no-referrer':\n\t\t\treturn 'no-referrer';\n\n\t\tcase 'origin':\n\t\t\treturn referrerOrigin;\n\n\t\tcase 'unsafe-url':\n\t\t\treturn referrerURL;\n\n\t\tcase 'strict-origin':\n\t\t\t// 1. If referrerURL is a potentially trustworthy URL and request's current URL is not a\n\t\t\t// potentially trustworthy URL, then return no referrer.\n\t\t\tif (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) {\n\t\t\t\treturn 'no-referrer';\n\t\t\t}\n\n\t\t\t// 2. Return referrerOrigin.\n\t\t\treturn referrerOrigin.toString();\n\n\t\tcase 'strict-origin-when-cross-origin':\n\t\t\t// 1. If the origin of referrerURL and the origin of request's current URL are the same, then\n\t\t\t// return referrerURL.\n\t\t\tif (referrerURL.origin === currentURL.origin) {\n\t\t\t\treturn referrerURL;\n\t\t\t}\n\n\t\t\t// 2. If referrerURL is a potentially trustworthy URL and request's current URL is not a\n\t\t\t// potentially trustworthy URL, then return no referrer.\n\t\t\tif (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) {\n\t\t\t\treturn 'no-referrer';\n\t\t\t}\n\n\t\t\t// 3. Return referrerOrigin.\n\t\t\treturn referrerOrigin;\n\n\t\tcase 'same-origin':\n\t\t\t// 1. If the origin of referrerURL and the origin of request's current URL are the same, then\n\t\t\t// return referrerURL.\n\t\t\tif (referrerURL.origin === currentURL.origin) {\n\t\t\t\treturn referrerURL;\n\t\t\t}\n\n\t\t\t// 2. Return no referrer.\n\t\t\treturn 'no-referrer';\n\n\t\tcase 'origin-when-cross-origin':\n\t\t\t// 1. If the origin of referrerURL and the origin of request's current URL are the same, then\n\t\t\t// return referrerURL.\n\t\t\tif (referrerURL.origin === currentURL.origin) {\n\t\t\t\treturn referrerURL;\n\t\t\t}\n\n\t\t\t// Return referrerOrigin.\n\t\t\treturn referrerOrigin;\n\n\t\tcase 'no-referrer-when-downgrade':\n\t\t\t// 1. If referrerURL is a potentially trustworthy URL and request's current URL is not a\n\t\t\t// potentially trustworthy URL, then return no referrer.\n\t\t\tif (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) {\n\t\t\t\treturn 'no-referrer';\n\t\t\t}\n\n\t\t\t// 2. Return referrerURL.\n\t\t\treturn referrerURL;\n\n\t\tdefault:\n\t\t\tthrow new TypeError(`Invalid referrerPolicy: ${policy}`);\n\t}\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#parse-referrer-policy-from-header|Referrer Policy §8.1. Parse a referrer policy from a Referrer-Policy header}\n * @param {Headers} headers Response headers\n * @returns {string} policy\n */\nexport function parseReferrerPolicyFromHeader(headers) {\n\t// 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy`\n\t// and response’s header list.\n\tconst policyTokens = (headers.get('referrer-policy') || '').split(/[,\\s]+/);\n\n\t// 2. Let policy be the empty string.\n\tlet policy = '';\n\n\t// 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty\n\t// string, then set policy to token.\n\t// Note: This algorithm loops over multiple policy values to allow deployment of new policy\n\t// values with fallbacks for older user agents, as described in § 11.1 Unknown Policy Values.\n\tfor (const token of policyTokens) {\n\t\tif (token && ReferrerPolicy.has(token)) {\n\t\t\tpolicy = token;\n\t\t}\n\t}\n\n\t// 4. Return policy.\n\treturn policy;\n}\n","/**\n * Request.js\n *\n * Request class contains server only options\n *\n * All spec algorithm step numbers are based on https://fetch.spec.whatwg.org/commit-snapshots/ae716822cb3a61843226cd090eefc6589446c1d2/.\n */\n\nimport {format as formatUrl} from 'node:url';\nimport {deprecate} from 'node:util';\nimport Headers from './headers.js';\nimport Body, {clone, extractContentType, getTotalBytes} from './body.js';\nimport {isAbortSignal} from './utils/is.js';\nimport {getSearch} from './utils/get-search.js';\nimport {\n\tvalidateReferrerPolicy, determineRequestsReferrer, DEFAULT_REFERRER_POLICY\n} from './utils/referrer.js';\n\nconst INTERNALS = Symbol('Request internals');\n\n/**\n * Check if `obj` is an instance of Request.\n *\n * @param {*} object\n * @return {boolean}\n */\nconst isRequest = object => {\n\treturn (\n\t\ttypeof object === 'object' &&\n\t\ttypeof object[INTERNALS] === 'object'\n\t);\n};\n\nconst doBadDataWarn = deprecate(() => {},\n\t'.data is not a valid RequestInit property, use .body instead',\n\t'https://github.com/node-fetch/node-fetch/issues/1000 (request)');\n\n/**\n * Request class\n *\n * Ref: https://fetch.spec.whatwg.org/#request-class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nexport default class Request extends Body {\n\tconstructor(input, init = {}) {\n\t\tlet parsedURL;\n\n\t\t// Normalize input and force URL to be encoded as UTF-8 (https://github.com/node-fetch/node-fetch/issues/245)\n\t\tif (isRequest(input)) {\n\t\t\tparsedURL = new URL(input.url);\n\t\t} else {\n\t\t\tparsedURL = new URL(input);\n\t\t\tinput = {};\n\t\t}\n\n\t\tif (parsedURL.username !== '' || parsedURL.password !== '') {\n\t\t\tthrow new TypeError(`${parsedURL} is an url with embedded credentials.`);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tif (/^(delete|get|head|options|post|put)$/i.test(method)) {\n\t\t\tmethod = method.toUpperCase();\n\t\t}\n\n\t\tif (!isRequest(init) && 'data' in init) {\n\t\t\tdoBadDataWarn();\n\t\t}\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tif ((init.body != null || (isRequest(input) && input.body !== null)) &&\n\t\t\t(method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tconst inputBody = init.body ?\n\t\t\tinit.body :\n\t\t\t(isRequest(input) && input.body !== null ?\n\t\t\t\tclone(input) :\n\t\t\t\tnull);\n\n\t\tsuper(inputBody, {\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody !== null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody, this);\n\t\t\tif (contentType) {\n\t\t\t\theaders.set('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ?\n\t\t\tinput.signal :\n\t\t\tnull;\n\t\tif ('signal' in init) {\n\t\t\tsignal = init.signal;\n\t\t}\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal or EventTarget');\n\t\t}\n\n\t\t// §5.4, Request constructor steps, step 15.1\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tlet referrer = init.referrer == null ? input.referrer : init.referrer;\n\t\tif (referrer === '') {\n\t\t\t// §5.4, Request constructor steps, step 15.2\n\t\t\treferrer = 'no-referrer';\n\t\t} else if (referrer) {\n\t\t\t// §5.4, Request constructor steps, step 15.3.1, 15.3.2\n\t\t\tconst parsedReferrer = new URL(referrer);\n\t\t\t// §5.4, Request constructor steps, step 15.3.3, 15.3.4\n\t\t\treferrer = /^about:(\\/\\/)?client$/.test(parsedReferrer) ? 'client' : parsedReferrer;\n\t\t} else {\n\t\t\treferrer = undefined;\n\t\t}\n\n\t\tthis[INTERNALS] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal,\n\t\t\treferrer\n\t\t};\n\n\t\t// Node-fetch-only options\n\t\tthis.follow = init.follow === undefined ? (input.follow === undefined ? 20 : input.follow) : init.follow;\n\t\tthis.compress = init.compress === undefined ? (input.compress === undefined ? true : input.compress) : init.compress;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t\tthis.highWaterMark = init.highWaterMark || input.highWaterMark || 16384;\n\t\tthis.insecureHTTPParser = init.insecureHTTPParser || input.insecureHTTPParser || false;\n\n\t\t// §5.4, Request constructor steps, step 16.\n\t\t// Default is empty string per https://fetch.spec.whatwg.org/#concept-request-referrer-policy\n\t\tthis.referrerPolicy = init.referrerPolicy || input.referrerPolicy || '';\n\t}\n\n\t/** @returns {string} */\n\tget method() {\n\t\treturn this[INTERNALS].method;\n\t}\n\n\t/** @returns {string} */\n\tget url() {\n\t\treturn formatUrl(this[INTERNALS].parsedURL);\n\t}\n\n\t/** @returns {Headers} */\n\tget headers() {\n\t\treturn this[INTERNALS].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS].redirect;\n\t}\n\n\t/** @returns {AbortSignal} */\n\tget signal() {\n\t\treturn this[INTERNALS].signal;\n\t}\n\n\t// https://fetch.spec.whatwg.org/#dom-request-referrer\n\tget referrer() {\n\t\tif (this[INTERNALS].referrer === 'no-referrer') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (this[INTERNALS].referrer === 'client') {\n\t\t\treturn 'about:client';\n\t\t}\n\n\t\tif (this[INTERNALS].referrer) {\n\t\t\treturn this[INTERNALS].referrer.toString();\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tget referrerPolicy() {\n\t\treturn this[INTERNALS].referrerPolicy;\n\t}\n\n\tset referrerPolicy(referrerPolicy) {\n\t\tthis[INTERNALS].referrerPolicy = validateReferrerPolicy(referrerPolicy);\n\t}\n\n\t/**\n\t * Clone this request\n\t *\n\t * @return Request\n\t */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Request';\n\t}\n}\n\nObject.defineProperties(Request.prototype, {\n\tmethod: {enumerable: true},\n\turl: {enumerable: true},\n\theaders: {enumerable: true},\n\tredirect: {enumerable: true},\n\tclone: {enumerable: true},\n\tsignal: {enumerable: true},\n\treferrer: {enumerable: true},\n\treferrerPolicy: {enumerable: true}\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param {Request} request - A Request instance\n * @return The options object to be passed to http.request\n */\nexport const getNodeRequestOptions = request => {\n\tconst {parsedURL} = request[INTERNALS];\n\tconst headers = new Headers(request[INTERNALS].headers);\n\n\t// Fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body === null && /^(post|put)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\n\tif (request.body !== null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\t// Set Content-Length if totalBytes is a number (that is not NaN)\n\t\tif (typeof totalBytes === 'number' && !Number.isNaN(totalBytes)) {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// 4.1. Main fetch, step 2.6\n\t// > If request's referrer policy is the empty string, then set request's referrer policy to the\n\t// > default referrer policy.\n\tif (request.referrerPolicy === '') {\n\t\trequest.referrerPolicy = DEFAULT_REFERRER_POLICY;\n\t}\n\n\t// 4.1. Main fetch, step 2.7\n\t// > If request's referrer is not \"no-referrer\", set request's referrer to the result of invoking\n\t// > determine request's referrer.\n\tif (request.referrer && request.referrer !== 'no-referrer') {\n\t\trequest[INTERNALS].referrer = determineRequestsReferrer(request);\n\t} else {\n\t\trequest[INTERNALS].referrer = 'no-referrer';\n\t}\n\n\t// 4.5. HTTP-network-or-cache fetch, step 6.9\n\t// > If httpRequest's referrer is a URL, then append `Referer`/httpRequest's referrer, serialized\n\t// > and isomorphic encoded, to httpRequest's header list.\n\tif (request[INTERNALS].referrer instanceof URL) {\n\t\theaders.set('Referer', request.referrer);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip, deflate, br');\n\t}\n\n\tlet {agent} = request;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\tconst search = getSearch(parsedURL);\n\n\t// Pass the full URL directly to request(), but overwrite the following\n\t// options:\n\tconst options = {\n\t\t// Overwrite search to retain trailing ? (issue #776)\n\t\tpath: parsedURL.pathname + search,\n\t\t// The following options are not expressed in the URL\n\t\tmethod: request.method,\n\t\theaders: headers[Symbol.for('nodejs.util.inspect.custom')](),\n\t\tinsecureHTTPParser: request.insecureHTTPParser,\n\t\tagent\n\t};\n\n\treturn {\n\t\t/** @type {URL} */\n\t\tparsedURL,\n\t\toptions\n\t};\n};\n","import {FetchBaseError} from './base.js';\n\n/**\n * AbortError interface for cancelled requests\n */\nexport class AbortError extends FetchBaseError {\n\tconstructor(message, type = 'aborted') {\n\t\tsuper(message, type);\n\t}\n}\n","/*! node-domexception. MIT License. Jimmy Wärting */\n\nif (!globalThis.DOMException) {\n try {\n const { MessageChannel } = require('worker_threads'),\n port = new MessageChannel().port1,\n ab = new ArrayBuffer()\n port.postMessage(ab, [ab, ab])\n } catch (err) {\n err.constructor.name === 'DOMException' && (\n globalThis.DOMException = err.constructor\n )\n }\n}\n\nmodule.exports = globalThis.DOMException\n","import { statSync, createReadStream, promises as fs } from 'node:fs'\nimport { basename } from 'node:path'\nimport DOMException from 'node-domexception'\n\nimport File from './file.js'\nimport Blob from './index.js'\n\nconst { stat } = fs\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n */\nconst blobFromSync = (path, type) => fromBlob(statSync(path), path, type)\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n * @returns {Promise}\n */\nconst blobFrom = (path, type) => stat(path).then(stat => fromBlob(stat, path, type))\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n * @returns {Promise}\n */\nconst fileFrom = (path, type) => stat(path).then(stat => fromFile(stat, path, type))\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n */\nconst fileFromSync = (path, type) => fromFile(statSync(path), path, type)\n\n// @ts-ignore\nconst fromBlob = (stat, path, type = '') => new Blob([new BlobDataItem({\n path,\n size: stat.size,\n lastModified: stat.mtimeMs,\n start: 0\n})], { type })\n\n// @ts-ignore\nconst fromFile = (stat, path, type = '') => new File([new BlobDataItem({\n path,\n size: stat.size,\n lastModified: stat.mtimeMs,\n start: 0\n})], basename(path), { type, lastModified: stat.mtimeMs })\n\n/**\n * This is a blob backed up by a file on the disk\n * with minium requirement. Its wrapped around a Blob as a blobPart\n * so you have no direct access to this.\n *\n * @private\n */\nclass BlobDataItem {\n #path\n #start\n\n constructor (options) {\n this.#path = options.path\n this.#start = options.start\n this.size = options.size\n this.lastModified = options.lastModified\n }\n\n /**\n * Slicing arguments is first validated and formatted\n * to not be out of range by Blob.prototype.slice\n */\n slice (start, end) {\n return new BlobDataItem({\n path: this.#path,\n lastModified: this.lastModified,\n size: end - start,\n start: this.#start + start\n })\n }\n\n async * stream () {\n const { mtimeMs } = await stat(this.#path)\n if (mtimeMs > this.lastModified) {\n throw new DOMException('The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.', 'NotReadableError')\n }\n yield * createReadStream(this.#path, {\n start: this.#start,\n end: this.#start + this.size - 1\n })\n }\n\n get [Symbol.toStringTag] () {\n return 'Blob'\n }\n}\n\nexport default blobFromSync\nexport { File, Blob, blobFrom, blobFromSync, fileFrom, fileFromSync }\n","/**\n * Index.js\n *\n * a request API compatible with window.fetch\n *\n * All spec algorithm step numbers are based on https://fetch.spec.whatwg.org/commit-snapshots/ae716822cb3a61843226cd090eefc6589446c1d2/.\n */\n\nimport http from 'node:http';\nimport https from 'node:https';\nimport zlib from 'node:zlib';\nimport Stream, {PassThrough, pipeline as pump} from 'node:stream';\nimport {Buffer} from 'node:buffer';\n\nimport dataUriToBuffer from 'data-uri-to-buffer';\n\nimport {writeToStream, clone} from './body.js';\nimport Response from './response.js';\nimport Headers, {fromRawHeaders} from './headers.js';\nimport Request, {getNodeRequestOptions} from './request.js';\nimport {FetchError} from './errors/fetch-error.js';\nimport {AbortError} from './errors/abort-error.js';\nimport {isRedirect} from './utils/is-redirect.js';\nimport {FormData} from 'formdata-polyfill/esm.min.js';\nimport {isDomainOrSubdomain, isSameProtocol} from './utils/is.js';\nimport {parseReferrerPolicyFromHeader} from './utils/referrer.js';\nimport {\n\tBlob,\n\tFile,\n\tfileFromSync,\n\tfileFrom,\n\tblobFromSync,\n\tblobFrom\n} from 'fetch-blob/from.js';\n\nexport {FormData, Headers, Request, Response, FetchError, AbortError, isRedirect};\nexport {Blob, File, fileFromSync, fileFrom, blobFromSync, blobFrom};\n\nconst supportedSchemas = new Set(['data:', 'http:', 'https:']);\n\n/**\n * Fetch function\n *\n * @param {string | URL | import('./request').default} url - Absolute url or Request instance\n * @param {*} [options_] - Fetch options\n * @return {Promise}\n */\nexport default async function fetch(url, options_) {\n\treturn new Promise((resolve, reject) => {\n\t\t// Build request object\n\t\tconst request = new Request(url, options_);\n\t\tconst {parsedURL, options} = getNodeRequestOptions(request);\n\t\tif (!supportedSchemas.has(parsedURL.protocol)) {\n\t\t\tthrow new TypeError(`node-fetch cannot load ${url}. URL scheme \"${parsedURL.protocol.replace(/:$/, '')}\" is not supported.`);\n\t\t}\n\n\t\tif (parsedURL.protocol === 'data:') {\n\t\t\tconst data = dataUriToBuffer(request.url);\n\t\t\tconst response = new Response(data, {headers: {'Content-Type': data.typeFull}});\n\t\t\tresolve(response);\n\t\t\treturn;\n\t\t}\n\n\t\t// Wrap http.request into fetch\n\t\tconst send = (parsedURL.protocol === 'https:' ? https : http).request;\n\t\tconst {signal} = request;\n\t\tlet response = null;\n\n\t\tconst abort = () => {\n\t\t\tconst error = new AbortError('The operation was aborted.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\n\t\t\tif (!response || !response.body) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = () => {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// Send request\n\t\tconst request_ = send(parsedURL.toString(), options);\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tconst finalize = () => {\n\t\t\trequest_.abort();\n\t\t\tif (signal) {\n\t\t\t\tsignal.removeEventListener('abort', abortAndFinalize);\n\t\t\t}\n\t\t};\n\n\t\trequest_.on('error', error => {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${error.message}`, 'system', error));\n\t\t\tfinalize();\n\t\t});\n\n\t\tfixResponseChunkedTransferBadEnding(request_, error => {\n\t\t\tif (response && response.body) {\n\t\t\t\tresponse.body.destroy(error);\n\t\t\t}\n\t\t});\n\n\t\t/* c8 ignore next 18 */\n\t\tif (process.version < 'v14') {\n\t\t\t// Before Node.js 14, pipeline() does not fully support async iterators and does not always\n\t\t\t// properly handle when the socket close/end events are out of order.\n\t\t\trequest_.on('socket', s => {\n\t\t\t\tlet endedWithEventsCount;\n\t\t\t\ts.prependListener('end', () => {\n\t\t\t\t\tendedWithEventsCount = s._eventsCount;\n\t\t\t\t});\n\t\t\t\ts.prependListener('close', hadError => {\n\t\t\t\t\t// if end happened before close but the socket didn't emit an error, do it now\n\t\t\t\t\tif (response && endedWithEventsCount < s._eventsCount && !hadError) {\n\t\t\t\t\t\tconst error = new Error('Premature close');\n\t\t\t\t\t\terror.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\t\t\tresponse.body.emit('error', error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\trequest_.on('response', response_ => {\n\t\t\trequest_.setTimeout(0);\n\t\t\tconst headers = fromRawHeaders(response_.rawHeaders);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (isRedirect(response_.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tlet locationURL = null;\n\t\t\t\ttry {\n\t\t\t\t\tlocationURL = location === null ? null : new URL(location, request.url);\n\t\t\t\t} catch {\n\t\t\t\t\t// error here can only be invalid URL in Location: header\n\t\t\t\t\t// do not throw when options.redirect == manual\n\t\t\t\t\t// let the user extract the errorneous redirect URL\n\t\t\t\t\tif (request.redirect !== 'manual') {\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// Nothing to do\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow': {\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOptions = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: clone(request),\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\tsize: request.size,\n\t\t\t\t\t\t\treferrer: request.referrer,\n\t\t\t\t\t\t\treferrerPolicy: request.referrerPolicy\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// when forwarding sensitive headers like \"Authorization\",\n\t\t\t\t\t\t// \"WWW-Authenticate\", and \"Cookie\" to untrusted targets,\n\t\t\t\t\t\t// headers will be ignored when following a redirect to a domain\n\t\t\t\t\t\t// that is not a subdomain match or exact match of the initial domain.\n\t\t\t\t\t\t// For example, a redirect from \"foo.com\" to either \"foo.com\" or \"sub.foo.com\"\n\t\t\t\t\t\t// will forward the sensitive headers, but a redirect to \"bar.com\" will not.\n\t\t\t\t\t\t// headers will also be ignored when following a redirect to a domain using\n\t\t\t\t\t\t// a different protocol. For example, a redirect from \"https://foo.com\" to \"http://foo.com\"\n\t\t\t\t\t\t// will not forward the sensitive headers\n\t\t\t\t\t\tif (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {\n\t\t\t\t\t\t\tfor (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {\n\t\t\t\t\t\t\t\trequestOptions.headers.delete(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (response_.statusCode !== 303 && request.body && options_.body instanceof Stream.Readable) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (response_.statusCode === 303 || ((response_.statusCode === 301 || response_.statusCode === 302) && request.method === 'POST')) {\n\t\t\t\t\t\t\trequestOptions.method = 'GET';\n\t\t\t\t\t\t\trequestOptions.body = undefined;\n\t\t\t\t\t\t\trequestOptions.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 14\n\t\t\t\t\t\tconst responseReferrerPolicy = parseReferrerPolicyFromHeader(headers);\n\t\t\t\t\t\tif (responseReferrerPolicy) {\n\t\t\t\t\t\t\trequestOptions.referrerPolicy = responseReferrerPolicy;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOptions)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn reject(new TypeError(`Redirect option '${request.redirect}' is not a valid value of RequestRedirect`));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Prepare response\n\t\t\tif (signal) {\n\t\t\t\tresponse_.once('end', () => {\n\t\t\t\t\tsignal.removeEventListener('abort', abortAndFinalize);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tlet body = pump(response_, new PassThrough(), error => {\n\t\t\t\tif (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t});\n\t\t\t// see https://github.com/nodejs/node/pull/29376\n\t\t\t/* c8 ignore next 3 */\n\t\t\tif (process.version < 'v12.10') {\n\t\t\t\tresponse_.on('aborted', abortAndFinalize);\n\t\t\t}\n\n\t\t\tconst responseOptions = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: response_.statusCode,\n\t\t\t\tstatusText: response_.statusMessage,\n\t\t\t\theaders,\n\t\t\t\tsize: request.size,\n\t\t\t\tcounter: request.counter,\n\t\t\t\thighWaterMark: request.highWaterMark\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || response_.statusCode === 204 || response_.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// For gzip\n\t\t\tif (codings === 'gzip' || codings === 'x-gzip') {\n\t\t\t\tbody = pump(body, zlib.createGunzip(zlibOptions), error => {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For deflate\n\t\t\tif (codings === 'deflate' || codings === 'x-deflate') {\n\t\t\t\t// Handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = pump(response_, new PassThrough(), error => {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\traw.once('data', chunk => {\n\t\t\t\t\t// See http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = pump(body, zlib.createInflate(), error => {\n\t\t\t\t\t\t\tif (error) {\n\t\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = pump(body, zlib.createInflateRaw(), error => {\n\t\t\t\t\t\t\tif (error) {\n\t\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\traw.once('end', () => {\n\t\t\t\t\t// Some old IIS servers return zero-length OK deflate responses, so\n\t\t\t\t\t// 'data' is never emitted. See https://github.com/node-fetch/node-fetch/pull/903\n\t\t\t\t\tif (!response) {\n\t\t\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For br\n\t\t\tif (codings === 'br') {\n\t\t\t\tbody = pump(body, zlib.createBrotliDecompress(), error => {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Otherwise, use response as-is\n\t\t\tresponse = new Response(body, responseOptions);\n\t\t\tresolve(response);\n\t\t});\n\n\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\twriteToStream(request_, request).catch(reject);\n\t});\n}\n\nfunction fixResponseChunkedTransferBadEnding(request, errorCallback) {\n\tconst LAST_CHUNK = Buffer.from('0\\r\\n\\r\\n');\n\n\tlet isChunkedTransfer = false;\n\tlet properLastChunkReceived = false;\n\tlet previousChunk;\n\n\trequest.on('response', response => {\n\t\tconst {headers} = response;\n\t\tisChunkedTransfer = headers['transfer-encoding'] === 'chunked' && !headers['content-length'];\n\t});\n\n\trequest.on('socket', socket => {\n\t\tconst onSocketClose = () => {\n\t\t\tif (isChunkedTransfer && !properLastChunkReceived) {\n\t\t\t\tconst error = new Error('Premature close');\n\t\t\t\terror.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\terrorCallback(error);\n\t\t\t}\n\t\t};\n\n\t\tconst onData = buf => {\n\t\t\tproperLastChunkReceived = Buffer.compare(buf.slice(-5), LAST_CHUNK) === 0;\n\n\t\t\t// Sometimes final 0-length chunk and end of message code are in separate packets\n\t\t\tif (!properLastChunkReceived && previousChunk) {\n\t\t\t\tproperLastChunkReceived = (\n\t\t\t\t\tBuffer.compare(previousChunk.slice(-3), LAST_CHUNK.slice(0, 3)) === 0 &&\n\t\t\t\t\tBuffer.compare(buf.slice(-2), LAST_CHUNK.slice(3)) === 0\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tpreviousChunk = buf;\n\t\t};\n\n\t\tsocket.prependListener('close', onSocketClose);\n\t\tsocket.on('data', onData);\n\n\t\trequest.on('close', () => {\n\t\t\tsocket.removeListener('close', onSocketClose);\n\t\t\tsocket.removeListener('data', onData);\n\t\t});\n\t});\n}\n"],"names":["exports","this","global","require$$2","F","C","promisify","INTERNALS","Buffer","types","deprecate","PassThrough","isIP","formatUrl","fs","pump"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA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AC,KAAK,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;AAC5D,KAAK;AACL,GAAG;;AAEH,GAAG,aAAa,GAAG,GAAG;AACtB,EAAE,CAAC;;AAEH,EAAE,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,aAAa,CAAC;AAChD,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;;AAE3B,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM;AAC5B,GAAG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,aAAa,CAAC;AAChD,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC;AACxC,EAAE,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AACH;;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]} \ No newline at end of file +{"version":3,"file":"index-OVNlT4CO.cjs","sources":["../node_modules/data-uri-to-buffer/dist/index.js","../node_modules/web-streams-polyfill/dist/ponyfill.es2018.js","../node_modules/fetch-blob/streams.cjs","../node_modules/fetch-blob/index.js","../node_modules/fetch-blob/file.js","../node_modules/formdata-polyfill/esm.min.js","../node_modules/node-fetch/src/errors/base.js","../node_modules/node-fetch/src/errors/fetch-error.js","../node_modules/node-fetch/src/utils/is.js","../node_modules/node-fetch/src/body.js","../node_modules/node-fetch/src/headers.js","../node_modules/node-fetch/src/utils/is-redirect.js","../node_modules/node-fetch/src/response.js","../node_modules/node-fetch/src/utils/get-search.js","../node_modules/node-fetch/src/utils/referrer.js","../node_modules/node-fetch/src/request.js","../node_modules/node-fetch/src/errors/abort-error.js","../node_modules/node-domexception/index.js","../node_modules/fetch-blob/from.js","../node_modules/node-fetch/src/index.js"],"sourcesContent":["/**\n * Returns a `Buffer` instance from the given data URI `uri`.\n *\n * @param {String} uri Data URI to turn into a Buffer instance\n * @returns {Buffer} Buffer instance from Data URI\n * @api public\n */\nexport function dataUriToBuffer(uri) {\n if (!/^data:/i.test(uri)) {\n throw new TypeError('`uri` does not appear to be a Data URI (must begin with \"data:\")');\n }\n // strip newlines\n uri = uri.replace(/\\r?\\n/g, '');\n // split the URI up into the \"metadata\" and the \"data\" portions\n const firstComma = uri.indexOf(',');\n if (firstComma === -1 || firstComma <= 4) {\n throw new TypeError('malformed data: URI');\n }\n // remove the \"data:\" scheme and parse the metadata\n const meta = uri.substring(5, firstComma).split(';');\n let charset = '';\n let base64 = false;\n const type = meta[0] || 'text/plain';\n let typeFull = type;\n for (let i = 1; i < meta.length; i++) {\n if (meta[i] === 'base64') {\n base64 = true;\n }\n else if (meta[i]) {\n typeFull += `;${meta[i]}`;\n if (meta[i].indexOf('charset=') === 0) {\n charset = meta[i].substring(8);\n }\n }\n }\n // defaults to US-ASCII only if type is not provided\n if (!meta[0] && !charset.length) {\n typeFull += ';charset=US-ASCII';\n charset = 'US-ASCII';\n }\n // get the encoded data portion and decode URI-encoded chars\n const encoding = base64 ? 'base64' : 'ascii';\n const data = unescape(uri.substring(firstComma + 1));\n const buffer = Buffer.from(data, encoding);\n // set `.type` and `.typeFull` properties to MIME type\n buffer.type = type;\n buffer.typeFull = typeFull;\n // set the `.charset` property\n buffer.charset = charset;\n return buffer;\n}\nexport default dataUriToBuffer;\n//# sourceMappingURL=index.js.map","/**\n * @license\n * web-streams-polyfill v3.3.3\n * Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.\n * This code is released under the MIT license.\n * SPDX-License-Identifier: MIT\n */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.WebStreamsPolyfill = {}));\n})(this, (function (exports) { 'use strict';\n\n function noop() {\n return undefined;\n }\n\n function typeIsObject(x) {\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\n }\n const rethrowAssertionErrorRejection = noop;\n function setFunctionName(fn, name) {\n try {\n Object.defineProperty(fn, 'name', {\n value: name,\n configurable: true\n });\n }\n catch (_a) {\n // This property is non-configurable in older browsers, so ignore if this throws.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#browser_compatibility\n }\n }\n\n const originalPromise = Promise;\n const originalPromiseThen = Promise.prototype.then;\n const originalPromiseReject = Promise.reject.bind(originalPromise);\n // https://webidl.spec.whatwg.org/#a-new-promise\n function newPromise(executor) {\n return new originalPromise(executor);\n }\n // https://webidl.spec.whatwg.org/#a-promise-resolved-with\n function promiseResolvedWith(value) {\n return newPromise(resolve => resolve(value));\n }\n // https://webidl.spec.whatwg.org/#a-promise-rejected-with\n function promiseRejectedWith(reason) {\n return originalPromiseReject(reason);\n }\n function PerformPromiseThen(promise, onFulfilled, onRejected) {\n // There doesn't appear to be any way to correctly emulate the behaviour from JavaScript, so this is just an\n // approximation.\n return originalPromiseThen.call(promise, onFulfilled, onRejected);\n }\n // Bluebird logs a warning when a promise is created within a fulfillment handler, but then isn't returned\n // from that handler. To prevent this, return null instead of void from all handlers.\n // http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-created-in-a-handler-but-was-not-returned-from-it\n function uponPromise(promise, onFulfilled, onRejected) {\n PerformPromiseThen(PerformPromiseThen(promise, onFulfilled, onRejected), undefined, rethrowAssertionErrorRejection);\n }\n function uponFulfillment(promise, onFulfilled) {\n uponPromise(promise, onFulfilled);\n }\n function uponRejection(promise, onRejected) {\n uponPromise(promise, undefined, onRejected);\n }\n function transformPromiseWith(promise, fulfillmentHandler, rejectionHandler) {\n return PerformPromiseThen(promise, fulfillmentHandler, rejectionHandler);\n }\n function setPromiseIsHandledToTrue(promise) {\n PerformPromiseThen(promise, undefined, rethrowAssertionErrorRejection);\n }\n let _queueMicrotask = callback => {\n if (typeof queueMicrotask === 'function') {\n _queueMicrotask = queueMicrotask;\n }\n else {\n const resolvedPromise = promiseResolvedWith(undefined);\n _queueMicrotask = cb => PerformPromiseThen(resolvedPromise, cb);\n }\n return _queueMicrotask(callback);\n };\n function reflectCall(F, V, args) {\n if (typeof F !== 'function') {\n throw new TypeError('Argument is not a function');\n }\n return Function.prototype.apply.call(F, V, args);\n }\n function promiseCall(F, V, args) {\n try {\n return promiseResolvedWith(reflectCall(F, V, args));\n }\n catch (value) {\n return promiseRejectedWith(value);\n }\n }\n\n // Original from Chromium\n // https://chromium.googlesource.com/chromium/src/+/0aee4434a4dba42a42abaea9bfbc0cd196a63bc1/third_party/blink/renderer/core/streams/SimpleQueue.js\n const QUEUE_MAX_ARRAY_SIZE = 16384;\n /**\n * Simple queue structure.\n *\n * Avoids scalability issues with using a packed array directly by using\n * multiple arrays in a linked list and keeping the array size bounded.\n */\n class SimpleQueue {\n constructor() {\n this._cursor = 0;\n this._size = 0;\n // _front and _back are always defined.\n this._front = {\n _elements: [],\n _next: undefined\n };\n this._back = this._front;\n // The cursor is used to avoid calling Array.shift().\n // It contains the index of the front element of the array inside the\n // front-most node. It is always in the range [0, QUEUE_MAX_ARRAY_SIZE).\n this._cursor = 0;\n // When there is only one node, size === elements.length - cursor.\n this._size = 0;\n }\n get length() {\n return this._size;\n }\n // For exception safety, this method is structured in order:\n // 1. Read state\n // 2. Calculate required state mutations\n // 3. Perform state mutations\n push(element) {\n const oldBack = this._back;\n let newBack = oldBack;\n if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) {\n newBack = {\n _elements: [],\n _next: undefined\n };\n }\n // push() is the mutation most likely to throw an exception, so it\n // goes first.\n oldBack._elements.push(element);\n if (newBack !== oldBack) {\n this._back = newBack;\n oldBack._next = newBack;\n }\n ++this._size;\n }\n // Like push(), shift() follows the read -> calculate -> mutate pattern for\n // exception safety.\n shift() { // must not be called on an empty queue\n const oldFront = this._front;\n let newFront = oldFront;\n const oldCursor = this._cursor;\n let newCursor = oldCursor + 1;\n const elements = oldFront._elements;\n const element = elements[oldCursor];\n if (newCursor === QUEUE_MAX_ARRAY_SIZE) {\n newFront = oldFront._next;\n newCursor = 0;\n }\n // No mutations before this point.\n --this._size;\n this._cursor = newCursor;\n if (oldFront !== newFront) {\n this._front = newFront;\n }\n // Permit shifted element to be garbage collected.\n elements[oldCursor] = undefined;\n return element;\n }\n // The tricky thing about forEach() is that it can be called\n // re-entrantly. The queue may be mutated inside the callback. It is easy to\n // see that push() within the callback has no negative effects since the end\n // of the queue is checked for on every iteration. If shift() is called\n // repeatedly within the callback then the next iteration may return an\n // element that has been removed. In this case the callback will be called\n // with undefined values until we either \"catch up\" with elements that still\n // exist or reach the back of the queue.\n forEach(callback) {\n let i = this._cursor;\n let node = this._front;\n let elements = node._elements;\n while (i !== elements.length || node._next !== undefined) {\n if (i === elements.length) {\n node = node._next;\n elements = node._elements;\n i = 0;\n if (elements.length === 0) {\n break;\n }\n }\n callback(elements[i]);\n ++i;\n }\n }\n // Return the element that would be returned if shift() was called now,\n // without modifying the queue.\n peek() { // must not be called on an empty queue\n const front = this._front;\n const cursor = this._cursor;\n return front._elements[cursor];\n }\n }\n\n const AbortSteps = Symbol('[[AbortSteps]]');\n const ErrorSteps = Symbol('[[ErrorSteps]]');\n const CancelSteps = Symbol('[[CancelSteps]]');\n const PullSteps = Symbol('[[PullSteps]]');\n const ReleaseSteps = Symbol('[[ReleaseSteps]]');\n\n function ReadableStreamReaderGenericInitialize(reader, stream) {\n reader._ownerReadableStream = stream;\n stream._reader = reader;\n if (stream._state === 'readable') {\n defaultReaderClosedPromiseInitialize(reader);\n }\n else if (stream._state === 'closed') {\n defaultReaderClosedPromiseInitializeAsResolved(reader);\n }\n else {\n defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError);\n }\n }\n // A client of ReadableStreamDefaultReader and ReadableStreamBYOBReader may use these functions directly to bypass state\n // check.\n function ReadableStreamReaderGenericCancel(reader, reason) {\n const stream = reader._ownerReadableStream;\n return ReadableStreamCancel(stream, reason);\n }\n function ReadableStreamReaderGenericRelease(reader) {\n const stream = reader._ownerReadableStream;\n if (stream._state === 'readable') {\n defaultReaderClosedPromiseReject(reader, new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`));\n }\n else {\n defaultReaderClosedPromiseResetToRejected(reader, new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`));\n }\n stream._readableStreamController[ReleaseSteps]();\n stream._reader = undefined;\n reader._ownerReadableStream = undefined;\n }\n // Helper functions for the readers.\n function readerLockException(name) {\n return new TypeError('Cannot ' + name + ' a stream using a released reader');\n }\n // Helper functions for the ReadableStreamDefaultReader.\n function defaultReaderClosedPromiseInitialize(reader) {\n reader._closedPromise = newPromise((resolve, reject) => {\n reader._closedPromise_resolve = resolve;\n reader._closedPromise_reject = reject;\n });\n }\n function defaultReaderClosedPromiseInitializeAsRejected(reader, reason) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseReject(reader, reason);\n }\n function defaultReaderClosedPromiseInitializeAsResolved(reader) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseResolve(reader);\n }\n function defaultReaderClosedPromiseReject(reader, reason) {\n if (reader._closedPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(reader._closedPromise);\n reader._closedPromise_reject(reason);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n }\n function defaultReaderClosedPromiseResetToRejected(reader, reason) {\n defaultReaderClosedPromiseInitializeAsRejected(reader, reason);\n }\n function defaultReaderClosedPromiseResolve(reader) {\n if (reader._closedPromise_resolve === undefined) {\n return;\n }\n reader._closedPromise_resolve(undefined);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n }\n\n /// \n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill\n const NumberIsFinite = Number.isFinite || function (x) {\n return typeof x === 'number' && isFinite(x);\n };\n\n /// \n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc#Polyfill\n const MathTrunc = Math.trunc || function (v) {\n return v < 0 ? Math.ceil(v) : Math.floor(v);\n };\n\n // https://heycam.github.io/webidl/#idl-dictionaries\n function isDictionary(x) {\n return typeof x === 'object' || typeof x === 'function';\n }\n function assertDictionary(obj, context) {\n if (obj !== undefined && !isDictionary(obj)) {\n throw new TypeError(`${context} is not an object.`);\n }\n }\n // https://heycam.github.io/webidl/#idl-callback-functions\n function assertFunction(x, context) {\n if (typeof x !== 'function') {\n throw new TypeError(`${context} is not a function.`);\n }\n }\n // https://heycam.github.io/webidl/#idl-object\n function isObject(x) {\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\n }\n function assertObject(x, context) {\n if (!isObject(x)) {\n throw new TypeError(`${context} is not an object.`);\n }\n }\n function assertRequiredArgument(x, position, context) {\n if (x === undefined) {\n throw new TypeError(`Parameter ${position} is required in '${context}'.`);\n }\n }\n function assertRequiredField(x, field, context) {\n if (x === undefined) {\n throw new TypeError(`${field} is required in '${context}'.`);\n }\n }\n // https://heycam.github.io/webidl/#idl-unrestricted-double\n function convertUnrestrictedDouble(value) {\n return Number(value);\n }\n function censorNegativeZero(x) {\n return x === 0 ? 0 : x;\n }\n function integerPart(x) {\n return censorNegativeZero(MathTrunc(x));\n }\n // https://heycam.github.io/webidl/#idl-unsigned-long-long\n function convertUnsignedLongLongWithEnforceRange(value, context) {\n const lowerBound = 0;\n const upperBound = Number.MAX_SAFE_INTEGER;\n let x = Number(value);\n x = censorNegativeZero(x);\n if (!NumberIsFinite(x)) {\n throw new TypeError(`${context} is not a finite number`);\n }\n x = integerPart(x);\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(`${context} is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`);\n }\n if (!NumberIsFinite(x) || x === 0) {\n return 0;\n }\n // TODO Use BigInt if supported?\n // let xBigInt = BigInt(integerPart(x));\n // xBigInt = BigInt.asUintN(64, xBigInt);\n // return Number(xBigInt);\n return x;\n }\n\n function assertReadableStream(x, context) {\n if (!IsReadableStream(x)) {\n throw new TypeError(`${context} is not a ReadableStream.`);\n }\n }\n\n // Abstract operations for the ReadableStream.\n function AcquireReadableStreamDefaultReader(stream) {\n return new ReadableStreamDefaultReader(stream);\n }\n // ReadableStream API exposed for controllers.\n function ReadableStreamAddReadRequest(stream, readRequest) {\n stream._reader._readRequests.push(readRequest);\n }\n function ReadableStreamFulfillReadRequest(stream, chunk, done) {\n const reader = stream._reader;\n const readRequest = reader._readRequests.shift();\n if (done) {\n readRequest._closeSteps();\n }\n else {\n readRequest._chunkSteps(chunk);\n }\n }\n function ReadableStreamGetNumReadRequests(stream) {\n return stream._reader._readRequests.length;\n }\n function ReadableStreamHasDefaultReader(stream) {\n const reader = stream._reader;\n if (reader === undefined) {\n return false;\n }\n if (!IsReadableStreamDefaultReader(reader)) {\n return false;\n }\n return true;\n }\n /**\n * A default reader vended by a {@link ReadableStream}.\n *\n * @public\n */\n class ReadableStreamDefaultReader {\n constructor(stream) {\n assertRequiredArgument(stream, 1, 'ReadableStreamDefaultReader');\n assertReadableStream(stream, 'First parameter');\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\n }\n ReadableStreamReaderGenericInitialize(this, stream);\n this._readRequests = new SimpleQueue();\n }\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed,\n * or rejected if the stream ever errors or the reader's lock is released before the stream finishes closing.\n */\n get closed() {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('closed'));\n }\n return this._closedPromise;\n }\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n cancel(reason = undefined) {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('cancel'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('cancel'));\n }\n return ReadableStreamReaderGenericCancel(this, reason);\n }\n /**\n * Returns a promise that allows access to the next chunk from the stream's internal queue, if available.\n *\n * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.\n */\n read() {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('read'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('read from'));\n }\n let resolvePromise;\n let rejectPromise;\n const promise = newPromise((resolve, reject) => {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readRequest = {\n _chunkSteps: chunk => resolvePromise({ value: chunk, done: false }),\n _closeSteps: () => resolvePromise({ value: undefined, done: true }),\n _errorSteps: e => rejectPromise(e)\n };\n ReadableStreamDefaultReaderRead(this, readRequest);\n return promise;\n }\n /**\n * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader's {@link ReadableStreamDefaultReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n releaseLock() {\n if (!IsReadableStreamDefaultReader(this)) {\n throw defaultReaderBrandCheckException('releaseLock');\n }\n if (this._ownerReadableStream === undefined) {\n return;\n }\n ReadableStreamDefaultReaderRelease(this);\n }\n }\n Object.defineProperties(ReadableStreamDefaultReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n });\n setFunctionName(ReadableStreamDefaultReader.prototype.cancel, 'cancel');\n setFunctionName(ReadableStreamDefaultReader.prototype.read, 'read');\n setFunctionName(ReadableStreamDefaultReader.prototype.releaseLock, 'releaseLock');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamDefaultReader.prototype, Symbol.toStringTag, {\n value: 'ReadableStreamDefaultReader',\n configurable: true\n });\n }\n // Abstract operations for the readers.\n function IsReadableStreamDefaultReader(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readRequests')) {\n return false;\n }\n return x instanceof ReadableStreamDefaultReader;\n }\n function ReadableStreamDefaultReaderRead(reader, readRequest) {\n const stream = reader._ownerReadableStream;\n stream._disturbed = true;\n if (stream._state === 'closed') {\n readRequest._closeSteps();\n }\n else if (stream._state === 'errored') {\n readRequest._errorSteps(stream._storedError);\n }\n else {\n stream._readableStreamController[PullSteps](readRequest);\n }\n }\n function ReadableStreamDefaultReaderRelease(reader) {\n ReadableStreamReaderGenericRelease(reader);\n const e = new TypeError('Reader was released');\n ReadableStreamDefaultReaderErrorReadRequests(reader, e);\n }\n function ReadableStreamDefaultReaderErrorReadRequests(reader, e) {\n const readRequests = reader._readRequests;\n reader._readRequests = new SimpleQueue();\n readRequests.forEach(readRequest => {\n readRequest._errorSteps(e);\n });\n }\n // Helper functions for the ReadableStreamDefaultReader.\n function defaultReaderBrandCheckException(name) {\n return new TypeError(`ReadableStreamDefaultReader.prototype.${name} can only be used on a ReadableStreamDefaultReader`);\n }\n\n /// \n /* eslint-disable @typescript-eslint/no-empty-function */\n const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () { }).prototype);\n\n /// \n class ReadableStreamAsyncIteratorImpl {\n constructor(reader, preventCancel) {\n this._ongoingPromise = undefined;\n this._isFinished = false;\n this._reader = reader;\n this._preventCancel = preventCancel;\n }\n next() {\n const nextSteps = () => this._nextSteps();\n this._ongoingPromise = this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, nextSteps, nextSteps) :\n nextSteps();\n return this._ongoingPromise;\n }\n return(value) {\n const returnSteps = () => this._returnSteps(value);\n return this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, returnSteps, returnSteps) :\n returnSteps();\n }\n _nextSteps() {\n if (this._isFinished) {\n return Promise.resolve({ value: undefined, done: true });\n }\n const reader = this._reader;\n let resolvePromise;\n let rejectPromise;\n const promise = newPromise((resolve, reject) => {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readRequest = {\n _chunkSteps: chunk => {\n this._ongoingPromise = undefined;\n // This needs to be delayed by one microtask, otherwise we stop pulling too early which breaks a test.\n // FIXME Is this a bug in the specification, or in the test?\n _queueMicrotask(() => resolvePromise({ value: chunk, done: false }));\n },\n _closeSteps: () => {\n this._ongoingPromise = undefined;\n this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n resolvePromise({ value: undefined, done: true });\n },\n _errorSteps: reason => {\n this._ongoingPromise = undefined;\n this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n rejectPromise(reason);\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n return promise;\n }\n _returnSteps(value) {\n if (this._isFinished) {\n return Promise.resolve({ value, done: true });\n }\n this._isFinished = true;\n const reader = this._reader;\n if (!this._preventCancel) {\n const result = ReadableStreamReaderGenericCancel(reader, value);\n ReadableStreamReaderGenericRelease(reader);\n return transformPromiseWith(result, () => ({ value, done: true }));\n }\n ReadableStreamReaderGenericRelease(reader);\n return promiseResolvedWith({ value, done: true });\n }\n }\n const ReadableStreamAsyncIteratorPrototype = {\n next() {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('next'));\n }\n return this._asyncIteratorImpl.next();\n },\n return(value) {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('return'));\n }\n return this._asyncIteratorImpl.return(value);\n }\n };\n Object.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype);\n // Abstract operations for the ReadableStream.\n function AcquireReadableStreamAsyncIterator(stream, preventCancel) {\n const reader = AcquireReadableStreamDefaultReader(stream);\n const impl = new ReadableStreamAsyncIteratorImpl(reader, preventCancel);\n const iterator = Object.create(ReadableStreamAsyncIteratorPrototype);\n iterator._asyncIteratorImpl = impl;\n return iterator;\n }\n function IsReadableStreamAsyncIterator(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_asyncIteratorImpl')) {\n return false;\n }\n try {\n // noinspection SuspiciousTypeOfGuard\n return x._asyncIteratorImpl instanceof\n ReadableStreamAsyncIteratorImpl;\n }\n catch (_a) {\n return false;\n }\n }\n // Helper functions for the ReadableStream.\n function streamAsyncIteratorBrandCheckException(name) {\n return new TypeError(`ReadableStreamAsyncIterator.${name} can only be used on a ReadableSteamAsyncIterator`);\n }\n\n /// \n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN#Polyfill\n const NumberIsNaN = Number.isNaN || function (x) {\n // eslint-disable-next-line no-self-compare\n return x !== x;\n };\n\n var _a, _b, _c;\n function CreateArrayFromList(elements) {\n // We use arrays to represent lists, so this is basically a no-op.\n // Do a slice though just in case we happen to depend on the unique-ness.\n return elements.slice();\n }\n function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n) {\n new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset);\n }\n let TransferArrayBuffer = (O) => {\n if (typeof O.transfer === 'function') {\n TransferArrayBuffer = buffer => buffer.transfer();\n }\n else if (typeof structuredClone === 'function') {\n TransferArrayBuffer = buffer => structuredClone(buffer, { transfer: [buffer] });\n }\n else {\n // Not implemented correctly\n TransferArrayBuffer = buffer => buffer;\n }\n return TransferArrayBuffer(O);\n };\n let IsDetachedBuffer = (O) => {\n if (typeof O.detached === 'boolean') {\n IsDetachedBuffer = buffer => buffer.detached;\n }\n else {\n // Not implemented correctly\n IsDetachedBuffer = buffer => buffer.byteLength === 0;\n }\n return IsDetachedBuffer(O);\n };\n function ArrayBufferSlice(buffer, begin, end) {\n // ArrayBuffer.prototype.slice is not available on IE10\n // https://www.caniuse.com/mdn-javascript_builtins_arraybuffer_slice\n if (buffer.slice) {\n return buffer.slice(begin, end);\n }\n const length = end - begin;\n const slice = new ArrayBuffer(length);\n CopyDataBlockBytes(slice, 0, buffer, begin, length);\n return slice;\n }\n function GetMethod(receiver, prop) {\n const func = receiver[prop];\n if (func === undefined || func === null) {\n return undefined;\n }\n if (typeof func !== 'function') {\n throw new TypeError(`${String(prop)} is not a function`);\n }\n return func;\n }\n function CreateAsyncFromSyncIterator(syncIteratorRecord) {\n // Instead of re-implementing CreateAsyncFromSyncIterator and %AsyncFromSyncIteratorPrototype%,\n // we use yield* inside an async generator function to achieve the same result.\n // Wrap the sync iterator inside a sync iterable, so we can use it with yield*.\n const syncIterable = {\n [Symbol.iterator]: () => syncIteratorRecord.iterator\n };\n // Create an async generator function and immediately invoke it.\n const asyncIterator = (async function* () {\n return yield* syncIterable;\n }());\n // Return as an async iterator record.\n const nextMethod = asyncIterator.next;\n return { iterator: asyncIterator, nextMethod, done: false };\n }\n // Aligns with core-js/modules/es.symbol.async-iterator.js\n const SymbolAsyncIterator = (_c = (_a = Symbol.asyncIterator) !== null && _a !== void 0 ? _a : (_b = Symbol.for) === null || _b === void 0 ? void 0 : _b.call(Symbol, 'Symbol.asyncIterator')) !== null && _c !== void 0 ? _c : '@@asyncIterator';\n function GetIterator(obj, hint = 'sync', method) {\n if (method === undefined) {\n if (hint === 'async') {\n method = GetMethod(obj, SymbolAsyncIterator);\n if (method === undefined) {\n const syncMethod = GetMethod(obj, Symbol.iterator);\n const syncIteratorRecord = GetIterator(obj, 'sync', syncMethod);\n return CreateAsyncFromSyncIterator(syncIteratorRecord);\n }\n }\n else {\n method = GetMethod(obj, Symbol.iterator);\n }\n }\n if (method === undefined) {\n throw new TypeError('The object is not iterable');\n }\n const iterator = reflectCall(method, obj, []);\n if (!typeIsObject(iterator)) {\n throw new TypeError('The iterator method must return an object');\n }\n const nextMethod = iterator.next;\n return { iterator, nextMethod, done: false };\n }\n function IteratorNext(iteratorRecord) {\n const result = reflectCall(iteratorRecord.nextMethod, iteratorRecord.iterator, []);\n if (!typeIsObject(result)) {\n throw new TypeError('The iterator.next() method must return an object');\n }\n return result;\n }\n function IteratorComplete(iterResult) {\n return Boolean(iterResult.done);\n }\n function IteratorValue(iterResult) {\n return iterResult.value;\n }\n\n function IsNonNegativeNumber(v) {\n if (typeof v !== 'number') {\n return false;\n }\n if (NumberIsNaN(v)) {\n return false;\n }\n if (v < 0) {\n return false;\n }\n return true;\n }\n function CloneAsUint8Array(O) {\n const buffer = ArrayBufferSlice(O.buffer, O.byteOffset, O.byteOffset + O.byteLength);\n return new Uint8Array(buffer);\n }\n\n function DequeueValue(container) {\n const pair = container._queue.shift();\n container._queueTotalSize -= pair.size;\n if (container._queueTotalSize < 0) {\n container._queueTotalSize = 0;\n }\n return pair.value;\n }\n function EnqueueValueWithSize(container, value, size) {\n if (!IsNonNegativeNumber(size) || size === Infinity) {\n throw new RangeError('Size must be a finite, non-NaN, non-negative number.');\n }\n container._queue.push({ value, size });\n container._queueTotalSize += size;\n }\n function PeekQueueValue(container) {\n const pair = container._queue.peek();\n return pair.value;\n }\n function ResetQueue(container) {\n container._queue = new SimpleQueue();\n container._queueTotalSize = 0;\n }\n\n function isDataViewConstructor(ctor) {\n return ctor === DataView;\n }\n function isDataView(view) {\n return isDataViewConstructor(view.constructor);\n }\n function arrayBufferViewElementSize(ctor) {\n if (isDataViewConstructor(ctor)) {\n return 1;\n }\n return ctor.BYTES_PER_ELEMENT;\n }\n\n /**\n * A pull-into request in a {@link ReadableByteStreamController}.\n *\n * @public\n */\n class ReadableStreamBYOBRequest {\n constructor() {\n throw new TypeError('Illegal constructor');\n }\n /**\n * Returns the view for writing in to, or `null` if the BYOB request has already been responded to.\n */\n get view() {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('view');\n }\n return this._view;\n }\n respond(bytesWritten) {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('respond');\n }\n assertRequiredArgument(bytesWritten, 1, 'respond');\n bytesWritten = convertUnsignedLongLongWithEnforceRange(bytesWritten, 'First parameter');\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError('This BYOB request has been invalidated');\n }\n if (IsDetachedBuffer(this._view.buffer)) {\n throw new TypeError(`The BYOB request's buffer has been detached and so cannot be used as a response`);\n }\n ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten);\n }\n respondWithNewView(view) {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('respondWithNewView');\n }\n assertRequiredArgument(view, 1, 'respondWithNewView');\n if (!ArrayBuffer.isView(view)) {\n throw new TypeError('You can only respond with array buffer views');\n }\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError('This BYOB request has been invalidated');\n }\n if (IsDetachedBuffer(view.buffer)) {\n throw new TypeError('The given view\\'s buffer has been detached and so cannot be used as a response');\n }\n ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view);\n }\n }\n Object.defineProperties(ReadableStreamBYOBRequest.prototype, {\n respond: { enumerable: true },\n respondWithNewView: { enumerable: true },\n view: { enumerable: true }\n });\n setFunctionName(ReadableStreamBYOBRequest.prototype.respond, 'respond');\n setFunctionName(ReadableStreamBYOBRequest.prototype.respondWithNewView, 'respondWithNewView');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamBYOBRequest.prototype, Symbol.toStringTag, {\n value: 'ReadableStreamBYOBRequest',\n configurable: true\n });\n }\n /**\n * Allows control of a {@link ReadableStream | readable byte stream}'s state and internal queue.\n *\n * @public\n */\n class ReadableByteStreamController {\n constructor() {\n throw new TypeError('Illegal constructor');\n }\n /**\n * Returns the current BYOB pull request, or `null` if there isn't one.\n */\n get byobRequest() {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('byobRequest');\n }\n return ReadableByteStreamControllerGetBYOBRequest(this);\n }\n /**\n * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is\n * over-full. An underlying byte source ought to use this information to determine when and how to apply backpressure.\n */\n get desiredSize() {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('desiredSize');\n }\n return ReadableByteStreamControllerGetDesiredSize(this);\n }\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n close() {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('close');\n }\n if (this._closeRequested) {\n throw new TypeError('The stream has already been closed; do not close it again!');\n }\n const state = this._controlledReadableByteStream._state;\n if (state !== 'readable') {\n throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be closed`);\n }\n ReadableByteStreamControllerClose(this);\n }\n enqueue(chunk) {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('enqueue');\n }\n assertRequiredArgument(chunk, 1, 'enqueue');\n if (!ArrayBuffer.isView(chunk)) {\n throw new TypeError('chunk must be an array buffer view');\n }\n if (chunk.byteLength === 0) {\n throw new TypeError('chunk must have non-zero byteLength');\n }\n if (chunk.buffer.byteLength === 0) {\n throw new TypeError(`chunk's buffer must have non-zero byteLength`);\n }\n if (this._closeRequested) {\n throw new TypeError('stream is closed or draining');\n }\n const state = this._controlledReadableByteStream._state;\n if (state !== 'readable') {\n throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be enqueued to`);\n }\n ReadableByteStreamControllerEnqueue(this, chunk);\n }\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n error(e = undefined) {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('error');\n }\n ReadableByteStreamControllerError(this, e);\n }\n /** @internal */\n [CancelSteps](reason) {\n ReadableByteStreamControllerClearPendingPullIntos(this);\n ResetQueue(this);\n const result = this._cancelAlgorithm(reason);\n ReadableByteStreamControllerClearAlgorithms(this);\n return result;\n }\n /** @internal */\n [PullSteps](readRequest) {\n const stream = this._controlledReadableByteStream;\n if (this._queueTotalSize > 0) {\n ReadableByteStreamControllerFillReadRequestFromQueue(this, readRequest);\n return;\n }\n const autoAllocateChunkSize = this._autoAllocateChunkSize;\n if (autoAllocateChunkSize !== undefined) {\n let buffer;\n try {\n buffer = new ArrayBuffer(autoAllocateChunkSize);\n }\n catch (bufferE) {\n readRequest._errorSteps(bufferE);\n return;\n }\n const pullIntoDescriptor = {\n buffer,\n bufferByteLength: autoAllocateChunkSize,\n byteOffset: 0,\n byteLength: autoAllocateChunkSize,\n bytesFilled: 0,\n minimumFill: 1,\n elementSize: 1,\n viewConstructor: Uint8Array,\n readerType: 'default'\n };\n this._pendingPullIntos.push(pullIntoDescriptor);\n }\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableByteStreamControllerCallPullIfNeeded(this);\n }\n /** @internal */\n [ReleaseSteps]() {\n if (this._pendingPullIntos.length > 0) {\n const firstPullInto = this._pendingPullIntos.peek();\n firstPullInto.readerType = 'none';\n this._pendingPullIntos = new SimpleQueue();\n this._pendingPullIntos.push(firstPullInto);\n }\n }\n }\n Object.defineProperties(ReadableByteStreamController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n byobRequest: { enumerable: true },\n desiredSize: { enumerable: true }\n });\n setFunctionName(ReadableByteStreamController.prototype.close, 'close');\n setFunctionName(ReadableByteStreamController.prototype.enqueue, 'enqueue');\n setFunctionName(ReadableByteStreamController.prototype.error, 'error');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableByteStreamController.prototype, Symbol.toStringTag, {\n value: 'ReadableByteStreamController',\n configurable: true\n });\n }\n // Abstract operations for the ReadableByteStreamController.\n function IsReadableByteStreamController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableByteStream')) {\n return false;\n }\n return x instanceof ReadableByteStreamController;\n }\n function IsReadableStreamBYOBRequest(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_associatedReadableByteStreamController')) {\n return false;\n }\n return x instanceof ReadableStreamBYOBRequest;\n }\n function ReadableByteStreamControllerCallPullIfNeeded(controller) {\n const shouldPull = ReadableByteStreamControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n controller._pulling = true;\n // TODO: Test controller argument\n const pullPromise = controller._pullAlgorithm();\n uponPromise(pullPromise, () => {\n controller._pulling = false;\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n return null;\n }, e => {\n ReadableByteStreamControllerError(controller, e);\n return null;\n });\n }\n function ReadableByteStreamControllerClearPendingPullIntos(controller) {\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n controller._pendingPullIntos = new SimpleQueue();\n }\n function ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor) {\n let done = false;\n if (stream._state === 'closed') {\n done = true;\n }\n const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);\n if (pullIntoDescriptor.readerType === 'default') {\n ReadableStreamFulfillReadRequest(stream, filledView, done);\n }\n else {\n ReadableStreamFulfillReadIntoRequest(stream, filledView, done);\n }\n }\n function ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor) {\n const bytesFilled = pullIntoDescriptor.bytesFilled;\n const elementSize = pullIntoDescriptor.elementSize;\n return new pullIntoDescriptor.viewConstructor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize);\n }\n function ReadableByteStreamControllerEnqueueChunkToQueue(controller, buffer, byteOffset, byteLength) {\n controller._queue.push({ buffer, byteOffset, byteLength });\n controller._queueTotalSize += byteLength;\n }\n function ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, buffer, byteOffset, byteLength) {\n let clonedChunk;\n try {\n clonedChunk = ArrayBufferSlice(buffer, byteOffset, byteOffset + byteLength);\n }\n catch (cloneE) {\n ReadableByteStreamControllerError(controller, cloneE);\n throw cloneE;\n }\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, clonedChunk, 0, byteLength);\n }\n function ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstDescriptor) {\n if (firstDescriptor.bytesFilled > 0) {\n ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, firstDescriptor.buffer, firstDescriptor.byteOffset, firstDescriptor.bytesFilled);\n }\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n }\n function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) {\n const maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled);\n const maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy;\n let totalBytesToCopyRemaining = maxBytesToCopy;\n let ready = false;\n const remainderBytes = maxBytesFilled % pullIntoDescriptor.elementSize;\n const maxAlignedBytes = maxBytesFilled - remainderBytes;\n // A descriptor for a read() request that is not yet filled up to its minimum length will stay at the head\n // of the queue, so the underlying source can keep filling it.\n if (maxAlignedBytes >= pullIntoDescriptor.minimumFill) {\n totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled;\n ready = true;\n }\n const queue = controller._queue;\n while (totalBytesToCopyRemaining > 0) {\n const headOfQueue = queue.peek();\n const bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength);\n const destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n CopyDataBlockBytes(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy);\n if (headOfQueue.byteLength === bytesToCopy) {\n queue.shift();\n }\n else {\n headOfQueue.byteOffset += bytesToCopy;\n headOfQueue.byteLength -= bytesToCopy;\n }\n controller._queueTotalSize -= bytesToCopy;\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor);\n totalBytesToCopyRemaining -= bytesToCopy;\n }\n return ready;\n }\n function ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, size, pullIntoDescriptor) {\n pullIntoDescriptor.bytesFilled += size;\n }\n function ReadableByteStreamControllerHandleQueueDrain(controller) {\n if (controller._queueTotalSize === 0 && controller._closeRequested) {\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(controller._controlledReadableByteStream);\n }\n else {\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n }\n function ReadableByteStreamControllerInvalidateBYOBRequest(controller) {\n if (controller._byobRequest === null) {\n return;\n }\n controller._byobRequest._associatedReadableByteStreamController = undefined;\n controller._byobRequest._view = null;\n controller._byobRequest = null;\n }\n function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller) {\n while (controller._pendingPullIntos.length > 0) {\n if (controller._queueTotalSize === 0) {\n return;\n }\n const pullIntoDescriptor = controller._pendingPullIntos.peek();\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\n }\n }\n }\n function ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller) {\n const reader = controller._controlledReadableByteStream._reader;\n while (reader._readRequests.length > 0) {\n if (controller._queueTotalSize === 0) {\n return;\n }\n const readRequest = reader._readRequests.shift();\n ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest);\n }\n }\n function ReadableByteStreamControllerPullInto(controller, view, min, readIntoRequest) {\n const stream = controller._controlledReadableByteStream;\n const ctor = view.constructor;\n const elementSize = arrayBufferViewElementSize(ctor);\n const { byteOffset, byteLength } = view;\n const minimumFill = min * elementSize;\n let buffer;\n try {\n buffer = TransferArrayBuffer(view.buffer);\n }\n catch (e) {\n readIntoRequest._errorSteps(e);\n return;\n }\n const pullIntoDescriptor = {\n buffer,\n bufferByteLength: buffer.byteLength,\n byteOffset,\n byteLength,\n bytesFilled: 0,\n minimumFill,\n elementSize,\n viewConstructor: ctor,\n readerType: 'byob'\n };\n if (controller._pendingPullIntos.length > 0) {\n controller._pendingPullIntos.push(pullIntoDescriptor);\n // No ReadableByteStreamControllerCallPullIfNeeded() call since:\n // - No change happens on desiredSize\n // - The source has already been notified of that there's at least 1 pending read(view)\n ReadableStreamAddReadIntoRequest(stream, readIntoRequest);\n return;\n }\n if (stream._state === 'closed') {\n const emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0);\n readIntoRequest._closeSteps(emptyView);\n return;\n }\n if (controller._queueTotalSize > 0) {\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);\n ReadableByteStreamControllerHandleQueueDrain(controller);\n readIntoRequest._chunkSteps(filledView);\n return;\n }\n if (controller._closeRequested) {\n const e = new TypeError('Insufficient bytes to fill elements in the given buffer');\n ReadableByteStreamControllerError(controller, e);\n readIntoRequest._errorSteps(e);\n return;\n }\n }\n controller._pendingPullIntos.push(pullIntoDescriptor);\n ReadableStreamAddReadIntoRequest(stream, readIntoRequest);\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n function ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) {\n if (firstDescriptor.readerType === 'none') {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n }\n const stream = controller._controlledReadableByteStream;\n if (ReadableStreamHasBYOBReader(stream)) {\n while (ReadableStreamGetNumReadIntoRequests(stream) > 0) {\n const pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller);\n ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor);\n }\n }\n }\n function ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) {\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor);\n if (pullIntoDescriptor.readerType === 'none') {\n ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, pullIntoDescriptor);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n return;\n }\n if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.minimumFill) {\n // A descriptor for a read() request that is not yet filled up to its minimum length will stay at the head\n // of the queue, so the underlying source can keep filling it.\n return;\n }\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n const remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize;\n if (remainderSize > 0) {\n const end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, pullIntoDescriptor.buffer, end - remainderSize, remainderSize);\n }\n pullIntoDescriptor.bytesFilled -= remainderSize;\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n }\n function ReadableByteStreamControllerRespondInternal(controller, bytesWritten) {\n const firstDescriptor = controller._pendingPullIntos.peek();\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n const state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor);\n }\n else {\n ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor);\n }\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n function ReadableByteStreamControllerShiftPendingPullInto(controller) {\n const descriptor = controller._pendingPullIntos.shift();\n return descriptor;\n }\n function ReadableByteStreamControllerShouldCallPull(controller) {\n const stream = controller._controlledReadableByteStream;\n if (stream._state !== 'readable') {\n return false;\n }\n if (controller._closeRequested) {\n return false;\n }\n if (!controller._started) {\n return false;\n }\n if (ReadableStreamHasDefaultReader(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n return true;\n }\n if (ReadableStreamHasBYOBReader(stream) && ReadableStreamGetNumReadIntoRequests(stream) > 0) {\n return true;\n }\n const desiredSize = ReadableByteStreamControllerGetDesiredSize(controller);\n if (desiredSize > 0) {\n return true;\n }\n return false;\n }\n function ReadableByteStreamControllerClearAlgorithms(controller) {\n controller._pullAlgorithm = undefined;\n controller._cancelAlgorithm = undefined;\n }\n // A client of ReadableByteStreamController may use these functions directly to bypass state check.\n function ReadableByteStreamControllerClose(controller) {\n const stream = controller._controlledReadableByteStream;\n if (controller._closeRequested || stream._state !== 'readable') {\n return;\n }\n if (controller._queueTotalSize > 0) {\n controller._closeRequested = true;\n return;\n }\n if (controller._pendingPullIntos.length > 0) {\n const firstPendingPullInto = controller._pendingPullIntos.peek();\n if (firstPendingPullInto.bytesFilled % firstPendingPullInto.elementSize !== 0) {\n const e = new TypeError('Insufficient bytes to fill elements in the given buffer');\n ReadableByteStreamControllerError(controller, e);\n throw e;\n }\n }\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n }\n function ReadableByteStreamControllerEnqueue(controller, chunk) {\n const stream = controller._controlledReadableByteStream;\n if (controller._closeRequested || stream._state !== 'readable') {\n return;\n }\n const { buffer, byteOffset, byteLength } = chunk;\n if (IsDetachedBuffer(buffer)) {\n throw new TypeError('chunk\\'s buffer is detached and so cannot be enqueued');\n }\n const transferredBuffer = TransferArrayBuffer(buffer);\n if (controller._pendingPullIntos.length > 0) {\n const firstPendingPullInto = controller._pendingPullIntos.peek();\n if (IsDetachedBuffer(firstPendingPullInto.buffer)) {\n throw new TypeError('The BYOB request\\'s buffer has been detached and so cannot be filled with an enqueued chunk');\n }\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n firstPendingPullInto.buffer = TransferArrayBuffer(firstPendingPullInto.buffer);\n if (firstPendingPullInto.readerType === 'none') {\n ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstPendingPullInto);\n }\n }\n if (ReadableStreamHasDefaultReader(stream)) {\n ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller);\n if (ReadableStreamGetNumReadRequests(stream) === 0) {\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n }\n else {\n if (controller._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n }\n const transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength);\n ReadableStreamFulfillReadRequest(stream, transferredView, false);\n }\n }\n else if (ReadableStreamHasBYOBReader(stream)) {\n // TODO: Ideally in this branch detaching should happen only if the buffer is not consumed fully.\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n }\n else {\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n }\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n function ReadableByteStreamControllerError(controller, e) {\n const stream = controller._controlledReadableByteStream;\n if (stream._state !== 'readable') {\n return;\n }\n ReadableByteStreamControllerClearPendingPullIntos(controller);\n ResetQueue(controller);\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n }\n function ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest) {\n const entry = controller._queue.shift();\n controller._queueTotalSize -= entry.byteLength;\n ReadableByteStreamControllerHandleQueueDrain(controller);\n const view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength);\n readRequest._chunkSteps(view);\n }\n function ReadableByteStreamControllerGetBYOBRequest(controller) {\n if (controller._byobRequest === null && controller._pendingPullIntos.length > 0) {\n const firstDescriptor = controller._pendingPullIntos.peek();\n const view = new Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled);\n const byobRequest = Object.create(ReadableStreamBYOBRequest.prototype);\n SetUpReadableStreamBYOBRequest(byobRequest, controller, view);\n controller._byobRequest = byobRequest;\n }\n return controller._byobRequest;\n }\n function ReadableByteStreamControllerGetDesiredSize(controller) {\n const state = controller._controlledReadableByteStream._state;\n if (state === 'errored') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return controller._strategyHWM - controller._queueTotalSize;\n }\n function ReadableByteStreamControllerRespond(controller, bytesWritten) {\n const firstDescriptor = controller._pendingPullIntos.peek();\n const state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n if (bytesWritten !== 0) {\n throw new TypeError('bytesWritten must be 0 when calling respond() on a closed stream');\n }\n }\n else {\n if (bytesWritten === 0) {\n throw new TypeError('bytesWritten must be greater than 0 when calling respond() on a readable stream');\n }\n if (firstDescriptor.bytesFilled + bytesWritten > firstDescriptor.byteLength) {\n throw new RangeError('bytesWritten out of range');\n }\n }\n firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer);\n ReadableByteStreamControllerRespondInternal(controller, bytesWritten);\n }\n function ReadableByteStreamControllerRespondWithNewView(controller, view) {\n const firstDescriptor = controller._pendingPullIntos.peek();\n const state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n if (view.byteLength !== 0) {\n throw new TypeError('The view\\'s length must be 0 when calling respondWithNewView() on a closed stream');\n }\n }\n else {\n if (view.byteLength === 0) {\n throw new TypeError('The view\\'s length must be greater than 0 when calling respondWithNewView() on a readable stream');\n }\n }\n if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) {\n throw new RangeError('The region specified by view does not match byobRequest');\n }\n if (firstDescriptor.bufferByteLength !== view.buffer.byteLength) {\n throw new RangeError('The buffer of view has different capacity than byobRequest');\n }\n if (firstDescriptor.bytesFilled + view.byteLength > firstDescriptor.byteLength) {\n throw new RangeError('The region specified by view is larger than byobRequest');\n }\n const viewByteLength = view.byteLength;\n firstDescriptor.buffer = TransferArrayBuffer(view.buffer);\n ReadableByteStreamControllerRespondInternal(controller, viewByteLength);\n }\n function SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize) {\n controller._controlledReadableByteStream = stream;\n controller._pullAgain = false;\n controller._pulling = false;\n controller._byobRequest = null;\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\n controller._queue = controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._closeRequested = false;\n controller._started = false;\n controller._strategyHWM = highWaterMark;\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n controller._autoAllocateChunkSize = autoAllocateChunkSize;\n controller._pendingPullIntos = new SimpleQueue();\n stream._readableStreamController = controller;\n const startResult = startAlgorithm();\n uponPromise(promiseResolvedWith(startResult), () => {\n controller._started = true;\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n return null;\n }, r => {\n ReadableByteStreamControllerError(controller, r);\n return null;\n });\n }\n function SetUpReadableByteStreamControllerFromUnderlyingSource(stream, underlyingByteSource, highWaterMark) {\n const controller = Object.create(ReadableByteStreamController.prototype);\n let startAlgorithm;\n let pullAlgorithm;\n let cancelAlgorithm;\n if (underlyingByteSource.start !== undefined) {\n startAlgorithm = () => underlyingByteSource.start(controller);\n }\n else {\n startAlgorithm = () => undefined;\n }\n if (underlyingByteSource.pull !== undefined) {\n pullAlgorithm = () => underlyingByteSource.pull(controller);\n }\n else {\n pullAlgorithm = () => promiseResolvedWith(undefined);\n }\n if (underlyingByteSource.cancel !== undefined) {\n cancelAlgorithm = reason => underlyingByteSource.cancel(reason);\n }\n else {\n cancelAlgorithm = () => promiseResolvedWith(undefined);\n }\n const autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;\n if (autoAllocateChunkSize === 0) {\n throw new TypeError('autoAllocateChunkSize must be greater than 0');\n }\n SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize);\n }\n function SetUpReadableStreamBYOBRequest(request, controller, view) {\n request._associatedReadableByteStreamController = controller;\n request._view = view;\n }\n // Helper functions for the ReadableStreamBYOBRequest.\n function byobRequestBrandCheckException(name) {\n return new TypeError(`ReadableStreamBYOBRequest.prototype.${name} can only be used on a ReadableStreamBYOBRequest`);\n }\n // Helper functions for the ReadableByteStreamController.\n function byteStreamControllerBrandCheckException(name) {\n return new TypeError(`ReadableByteStreamController.prototype.${name} can only be used on a ReadableByteStreamController`);\n }\n\n function convertReaderOptions(options, context) {\n assertDictionary(options, context);\n const mode = options === null || options === void 0 ? void 0 : options.mode;\n return {\n mode: mode === undefined ? undefined : convertReadableStreamReaderMode(mode, `${context} has member 'mode' that`)\n };\n }\n function convertReadableStreamReaderMode(mode, context) {\n mode = `${mode}`;\n if (mode !== 'byob') {\n throw new TypeError(`${context} '${mode}' is not a valid enumeration value for ReadableStreamReaderMode`);\n }\n return mode;\n }\n function convertByobReadOptions(options, context) {\n var _a;\n assertDictionary(options, context);\n const min = (_a = options === null || options === void 0 ? void 0 : options.min) !== null && _a !== void 0 ? _a : 1;\n return {\n min: convertUnsignedLongLongWithEnforceRange(min, `${context} has member 'min' that`)\n };\n }\n\n // Abstract operations for the ReadableStream.\n function AcquireReadableStreamBYOBReader(stream) {\n return new ReadableStreamBYOBReader(stream);\n }\n // ReadableStream API exposed for controllers.\n function ReadableStreamAddReadIntoRequest(stream, readIntoRequest) {\n stream._reader._readIntoRequests.push(readIntoRequest);\n }\n function ReadableStreamFulfillReadIntoRequest(stream, chunk, done) {\n const reader = stream._reader;\n const readIntoRequest = reader._readIntoRequests.shift();\n if (done) {\n readIntoRequest._closeSteps(chunk);\n }\n else {\n readIntoRequest._chunkSteps(chunk);\n }\n }\n function ReadableStreamGetNumReadIntoRequests(stream) {\n return stream._reader._readIntoRequests.length;\n }\n function ReadableStreamHasBYOBReader(stream) {\n const reader = stream._reader;\n if (reader === undefined) {\n return false;\n }\n if (!IsReadableStreamBYOBReader(reader)) {\n return false;\n }\n return true;\n }\n /**\n * A BYOB reader vended by a {@link ReadableStream}.\n *\n * @public\n */\n class ReadableStreamBYOBReader {\n constructor(stream) {\n assertRequiredArgument(stream, 1, 'ReadableStreamBYOBReader');\n assertReadableStream(stream, 'First parameter');\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\n }\n if (!IsReadableByteStreamController(stream._readableStreamController)) {\n throw new TypeError('Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte ' +\n 'source');\n }\n ReadableStreamReaderGenericInitialize(this, stream);\n this._readIntoRequests = new SimpleQueue();\n }\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the reader's lock is released before the stream finishes closing.\n */\n get closed() {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('closed'));\n }\n return this._closedPromise;\n }\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n cancel(reason = undefined) {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('cancel'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('cancel'));\n }\n return ReadableStreamReaderGenericCancel(this, reason);\n }\n read(view, rawOptions = {}) {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('read'));\n }\n if (!ArrayBuffer.isView(view)) {\n return promiseRejectedWith(new TypeError('view must be an array buffer view'));\n }\n if (view.byteLength === 0) {\n return promiseRejectedWith(new TypeError('view must have non-zero byteLength'));\n }\n if (view.buffer.byteLength === 0) {\n return promiseRejectedWith(new TypeError(`view's buffer must have non-zero byteLength`));\n }\n if (IsDetachedBuffer(view.buffer)) {\n return promiseRejectedWith(new TypeError('view\\'s buffer has been detached'));\n }\n let options;\n try {\n options = convertByobReadOptions(rawOptions, 'options');\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n const min = options.min;\n if (min === 0) {\n return promiseRejectedWith(new TypeError('options.min must be greater than 0'));\n }\n if (!isDataView(view)) {\n if (min > view.length) {\n return promiseRejectedWith(new RangeError('options.min must be less than or equal to view\\'s length'));\n }\n }\n else if (min > view.byteLength) {\n return promiseRejectedWith(new RangeError('options.min must be less than or equal to view\\'s byteLength'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('read from'));\n }\n let resolvePromise;\n let rejectPromise;\n const promise = newPromise((resolve, reject) => {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readIntoRequest = {\n _chunkSteps: chunk => resolvePromise({ value: chunk, done: false }),\n _closeSteps: chunk => resolvePromise({ value: chunk, done: true }),\n _errorSteps: e => rejectPromise(e)\n };\n ReadableStreamBYOBReaderRead(this, view, min, readIntoRequest);\n return promise;\n }\n /**\n * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader's {@link ReadableStreamBYOBReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n releaseLock() {\n if (!IsReadableStreamBYOBReader(this)) {\n throw byobReaderBrandCheckException('releaseLock');\n }\n if (this._ownerReadableStream === undefined) {\n return;\n }\n ReadableStreamBYOBReaderRelease(this);\n }\n }\n Object.defineProperties(ReadableStreamBYOBReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n });\n setFunctionName(ReadableStreamBYOBReader.prototype.cancel, 'cancel');\n setFunctionName(ReadableStreamBYOBReader.prototype.read, 'read');\n setFunctionName(ReadableStreamBYOBReader.prototype.releaseLock, 'releaseLock');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamBYOBReader.prototype, Symbol.toStringTag, {\n value: 'ReadableStreamBYOBReader',\n configurable: true\n });\n }\n // Abstract operations for the readers.\n function IsReadableStreamBYOBReader(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readIntoRequests')) {\n return false;\n }\n return x instanceof ReadableStreamBYOBReader;\n }\n function ReadableStreamBYOBReaderRead(reader, view, min, readIntoRequest) {\n const stream = reader._ownerReadableStream;\n stream._disturbed = true;\n if (stream._state === 'errored') {\n readIntoRequest._errorSteps(stream._storedError);\n }\n else {\n ReadableByteStreamControllerPullInto(stream._readableStreamController, view, min, readIntoRequest);\n }\n }\n function ReadableStreamBYOBReaderRelease(reader) {\n ReadableStreamReaderGenericRelease(reader);\n const e = new TypeError('Reader was released');\n ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e);\n }\n function ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e) {\n const readIntoRequests = reader._readIntoRequests;\n reader._readIntoRequests = new SimpleQueue();\n readIntoRequests.forEach(readIntoRequest => {\n readIntoRequest._errorSteps(e);\n });\n }\n // Helper functions for the ReadableStreamBYOBReader.\n function byobReaderBrandCheckException(name) {\n return new TypeError(`ReadableStreamBYOBReader.prototype.${name} can only be used on a ReadableStreamBYOBReader`);\n }\n\n function ExtractHighWaterMark(strategy, defaultHWM) {\n const { highWaterMark } = strategy;\n if (highWaterMark === undefined) {\n return defaultHWM;\n }\n if (NumberIsNaN(highWaterMark) || highWaterMark < 0) {\n throw new RangeError('Invalid highWaterMark');\n }\n return highWaterMark;\n }\n function ExtractSizeAlgorithm(strategy) {\n const { size } = strategy;\n if (!size) {\n return () => 1;\n }\n return size;\n }\n\n function convertQueuingStrategy(init, context) {\n assertDictionary(init, context);\n const highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark;\n const size = init === null || init === void 0 ? void 0 : init.size;\n return {\n highWaterMark: highWaterMark === undefined ? undefined : convertUnrestrictedDouble(highWaterMark),\n size: size === undefined ? undefined : convertQueuingStrategySize(size, `${context} has member 'size' that`)\n };\n }\n function convertQueuingStrategySize(fn, context) {\n assertFunction(fn, context);\n return chunk => convertUnrestrictedDouble(fn(chunk));\n }\n\n function convertUnderlyingSink(original, context) {\n assertDictionary(original, context);\n const abort = original === null || original === void 0 ? void 0 : original.abort;\n const close = original === null || original === void 0 ? void 0 : original.close;\n const start = original === null || original === void 0 ? void 0 : original.start;\n const type = original === null || original === void 0 ? void 0 : original.type;\n const write = original === null || original === void 0 ? void 0 : original.write;\n return {\n abort: abort === undefined ?\n undefined :\n convertUnderlyingSinkAbortCallback(abort, original, `${context} has member 'abort' that`),\n close: close === undefined ?\n undefined :\n convertUnderlyingSinkCloseCallback(close, original, `${context} has member 'close' that`),\n start: start === undefined ?\n undefined :\n convertUnderlyingSinkStartCallback(start, original, `${context} has member 'start' that`),\n write: write === undefined ?\n undefined :\n convertUnderlyingSinkWriteCallback(write, original, `${context} has member 'write' that`),\n type\n };\n }\n function convertUnderlyingSinkAbortCallback(fn, original, context) {\n assertFunction(fn, context);\n return (reason) => promiseCall(fn, original, [reason]);\n }\n function convertUnderlyingSinkCloseCallback(fn, original, context) {\n assertFunction(fn, context);\n return () => promiseCall(fn, original, []);\n }\n function convertUnderlyingSinkStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return (controller) => reflectCall(fn, original, [controller]);\n }\n function convertUnderlyingSinkWriteCallback(fn, original, context) {\n assertFunction(fn, context);\n return (chunk, controller) => promiseCall(fn, original, [chunk, controller]);\n }\n\n function assertWritableStream(x, context) {\n if (!IsWritableStream(x)) {\n throw new TypeError(`${context} is not a WritableStream.`);\n }\n }\n\n function isAbortSignal(value) {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n try {\n return typeof value.aborted === 'boolean';\n }\n catch (_a) {\n // AbortSignal.prototype.aborted throws if its brand check fails\n return false;\n }\n }\n const supportsAbortController = typeof AbortController === 'function';\n /**\n * Construct a new AbortController, if supported by the platform.\n *\n * @internal\n */\n function createAbortController() {\n if (supportsAbortController) {\n return new AbortController();\n }\n return undefined;\n }\n\n /**\n * A writable stream represents a destination for data, into which you can write.\n *\n * @public\n */\n class WritableStream {\n constructor(rawUnderlyingSink = {}, rawStrategy = {}) {\n if (rawUnderlyingSink === undefined) {\n rawUnderlyingSink = null;\n }\n else {\n assertObject(rawUnderlyingSink, 'First parameter');\n }\n const strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');\n const underlyingSink = convertUnderlyingSink(rawUnderlyingSink, 'First parameter');\n InitializeWritableStream(this);\n const type = underlyingSink.type;\n if (type !== undefined) {\n throw new RangeError('Invalid type is specified');\n }\n const sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n const highWaterMark = ExtractHighWaterMark(strategy, 1);\n SetUpWritableStreamDefaultControllerFromUnderlyingSink(this, underlyingSink, highWaterMark, sizeAlgorithm);\n }\n /**\n * Returns whether or not the writable stream is locked to a writer.\n */\n get locked() {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException$2('locked');\n }\n return IsWritableStreamLocked(this);\n }\n /**\n * Aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be\n * immediately moved to an errored state, with any queued-up writes discarded. This will also execute any abort\n * mechanism of the underlying sink.\n *\n * The returned promise will fulfill if the stream shuts down successfully, or reject if the underlying sink signaled\n * that there was an error doing so. Additionally, it will reject with a `TypeError` (without attempting to cancel\n * the stream) if the stream is currently locked.\n */\n abort(reason = undefined) {\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$2('abort'));\n }\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot abort a stream that already has a writer'));\n }\n return WritableStreamAbort(this, reason);\n }\n /**\n * Closes the stream. The underlying sink will finish processing any previously-written chunks, before invoking its\n * close behavior. During this time any further attempts to write will fail (without erroring the stream).\n *\n * The method returns a promise that will fulfill if all remaining chunks are successfully written and the stream\n * successfully closes, or rejects if an error is encountered during this process. Additionally, it will reject with\n * a `TypeError` (without attempting to cancel the stream) if the stream is currently locked.\n */\n close() {\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$2('close'));\n }\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot close a stream that already has a writer'));\n }\n if (WritableStreamCloseQueuedOrInFlight(this)) {\n return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));\n }\n return WritableStreamClose(this);\n }\n /**\n * Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream\n * is locked, no other writer can be acquired until this one is released.\n *\n * This functionality is especially useful for creating abstractions that desire the ability to write to a stream\n * without interruption or interleaving. By getting a writer for the stream, you can ensure nobody else can write at\n * the same time, which would cause the resulting written data to be unpredictable and probably useless.\n */\n getWriter() {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException$2('getWriter');\n }\n return AcquireWritableStreamDefaultWriter(this);\n }\n }\n Object.defineProperties(WritableStream.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n getWriter: { enumerable: true },\n locked: { enumerable: true }\n });\n setFunctionName(WritableStream.prototype.abort, 'abort');\n setFunctionName(WritableStream.prototype.close, 'close');\n setFunctionName(WritableStream.prototype.getWriter, 'getWriter');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(WritableStream.prototype, Symbol.toStringTag, {\n value: 'WritableStream',\n configurable: true\n });\n }\n // Abstract operations for the WritableStream.\n function AcquireWritableStreamDefaultWriter(stream) {\n return new WritableStreamDefaultWriter(stream);\n }\n // Throws if and only if startAlgorithm throws.\n function CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark = 1, sizeAlgorithm = () => 1) {\n const stream = Object.create(WritableStream.prototype);\n InitializeWritableStream(stream);\n const controller = Object.create(WritableStreamDefaultController.prototype);\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n }\n function InitializeWritableStream(stream) {\n stream._state = 'writable';\n // The error that will be reported by new method calls once the state becomes errored. Only set when [[state]] is\n // 'erroring' or 'errored'. May be set to an undefined value.\n stream._storedError = undefined;\n stream._writer = undefined;\n // Initialize to undefined first because the constructor of the controller checks this\n // variable to validate the caller.\n stream._writableStreamController = undefined;\n // This queue is placed here instead of the writer class in order to allow for passing a writer to the next data\n // producer without waiting for the queued writes to finish.\n stream._writeRequests = new SimpleQueue();\n // Write requests are removed from _writeRequests when write() is called on the underlying sink. This prevents\n // them from being erroneously rejected on error. If a write() call is in-flight, the request is stored here.\n stream._inFlightWriteRequest = undefined;\n // The promise that was returned from writer.close(). Stored here because it may be fulfilled after the writer\n // has been detached.\n stream._closeRequest = undefined;\n // Close request is removed from _closeRequest when close() is called on the underlying sink. This prevents it\n // from being erroneously rejected on error. If a close() call is in-flight, the request is stored here.\n stream._inFlightCloseRequest = undefined;\n // The promise that was returned from writer.abort(). This may also be fulfilled after the writer has detached.\n stream._pendingAbortRequest = undefined;\n // The backpressure signal set by the controller.\n stream._backpressure = false;\n }\n function IsWritableStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_writableStreamController')) {\n return false;\n }\n return x instanceof WritableStream;\n }\n function IsWritableStreamLocked(stream) {\n if (stream._writer === undefined) {\n return false;\n }\n return true;\n }\n function WritableStreamAbort(stream, reason) {\n var _a;\n if (stream._state === 'closed' || stream._state === 'errored') {\n return promiseResolvedWith(undefined);\n }\n stream._writableStreamController._abortReason = reason;\n (_a = stream._writableStreamController._abortController) === null || _a === void 0 ? void 0 : _a.abort(reason);\n // TypeScript narrows the type of `stream._state` down to 'writable' | 'erroring',\n // but it doesn't know that signaling abort runs author code that might have changed the state.\n // Widen the type again by casting to WritableStreamState.\n const state = stream._state;\n if (state === 'closed' || state === 'errored') {\n return promiseResolvedWith(undefined);\n }\n if (stream._pendingAbortRequest !== undefined) {\n return stream._pendingAbortRequest._promise;\n }\n let wasAlreadyErroring = false;\n if (state === 'erroring') {\n wasAlreadyErroring = true;\n // reason will not be used, so don't keep a reference to it.\n reason = undefined;\n }\n const promise = newPromise((resolve, reject) => {\n stream._pendingAbortRequest = {\n _promise: undefined,\n _resolve: resolve,\n _reject: reject,\n _reason: reason,\n _wasAlreadyErroring: wasAlreadyErroring\n };\n });\n stream._pendingAbortRequest._promise = promise;\n if (!wasAlreadyErroring) {\n WritableStreamStartErroring(stream, reason);\n }\n return promise;\n }\n function WritableStreamClose(stream) {\n const state = stream._state;\n if (state === 'closed' || state === 'errored') {\n return promiseRejectedWith(new TypeError(`The stream (in ${state} state) is not in the writable state and cannot be closed`));\n }\n const promise = newPromise((resolve, reject) => {\n const closeRequest = {\n _resolve: resolve,\n _reject: reject\n };\n stream._closeRequest = closeRequest;\n });\n const writer = stream._writer;\n if (writer !== undefined && stream._backpressure && state === 'writable') {\n defaultWriterReadyPromiseResolve(writer);\n }\n WritableStreamDefaultControllerClose(stream._writableStreamController);\n return promise;\n }\n // WritableStream API exposed for controllers.\n function WritableStreamAddWriteRequest(stream) {\n const promise = newPromise((resolve, reject) => {\n const writeRequest = {\n _resolve: resolve,\n _reject: reject\n };\n stream._writeRequests.push(writeRequest);\n });\n return promise;\n }\n function WritableStreamDealWithRejection(stream, error) {\n const state = stream._state;\n if (state === 'writable') {\n WritableStreamStartErroring(stream, error);\n return;\n }\n WritableStreamFinishErroring(stream);\n }\n function WritableStreamStartErroring(stream, reason) {\n const controller = stream._writableStreamController;\n stream._state = 'erroring';\n stream._storedError = reason;\n const writer = stream._writer;\n if (writer !== undefined) {\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason);\n }\n if (!WritableStreamHasOperationMarkedInFlight(stream) && controller._started) {\n WritableStreamFinishErroring(stream);\n }\n }\n function WritableStreamFinishErroring(stream) {\n stream._state = 'errored';\n stream._writableStreamController[ErrorSteps]();\n const storedError = stream._storedError;\n stream._writeRequests.forEach(writeRequest => {\n writeRequest._reject(storedError);\n });\n stream._writeRequests = new SimpleQueue();\n if (stream._pendingAbortRequest === undefined) {\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n const abortRequest = stream._pendingAbortRequest;\n stream._pendingAbortRequest = undefined;\n if (abortRequest._wasAlreadyErroring) {\n abortRequest._reject(storedError);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n const promise = stream._writableStreamController[AbortSteps](abortRequest._reason);\n uponPromise(promise, () => {\n abortRequest._resolve();\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return null;\n }, (reason) => {\n abortRequest._reject(reason);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return null;\n });\n }\n function WritableStreamFinishInFlightWrite(stream) {\n stream._inFlightWriteRequest._resolve(undefined);\n stream._inFlightWriteRequest = undefined;\n }\n function WritableStreamFinishInFlightWriteWithError(stream, error) {\n stream._inFlightWriteRequest._reject(error);\n stream._inFlightWriteRequest = undefined;\n WritableStreamDealWithRejection(stream, error);\n }\n function WritableStreamFinishInFlightClose(stream) {\n stream._inFlightCloseRequest._resolve(undefined);\n stream._inFlightCloseRequest = undefined;\n const state = stream._state;\n if (state === 'erroring') {\n // The error was too late to do anything, so it is ignored.\n stream._storedError = undefined;\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._resolve();\n stream._pendingAbortRequest = undefined;\n }\n }\n stream._state = 'closed';\n const writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseResolve(writer);\n }\n }\n function WritableStreamFinishInFlightCloseWithError(stream, error) {\n stream._inFlightCloseRequest._reject(error);\n stream._inFlightCloseRequest = undefined;\n // Never execute sink abort() after sink close().\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._reject(error);\n stream._pendingAbortRequest = undefined;\n }\n WritableStreamDealWithRejection(stream, error);\n }\n // TODO(ricea): Fix alphabetical order.\n function WritableStreamCloseQueuedOrInFlight(stream) {\n if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n return true;\n }\n function WritableStreamHasOperationMarkedInFlight(stream) {\n if (stream._inFlightWriteRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n return true;\n }\n function WritableStreamMarkCloseRequestInFlight(stream) {\n stream._inFlightCloseRequest = stream._closeRequest;\n stream._closeRequest = undefined;\n }\n function WritableStreamMarkFirstWriteRequestInFlight(stream) {\n stream._inFlightWriteRequest = stream._writeRequests.shift();\n }\n function WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream) {\n if (stream._closeRequest !== undefined) {\n stream._closeRequest._reject(stream._storedError);\n stream._closeRequest = undefined;\n }\n const writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseReject(writer, stream._storedError);\n }\n }\n function WritableStreamUpdateBackpressure(stream, backpressure) {\n const writer = stream._writer;\n if (writer !== undefined && backpressure !== stream._backpressure) {\n if (backpressure) {\n defaultWriterReadyPromiseReset(writer);\n }\n else {\n defaultWriterReadyPromiseResolve(writer);\n }\n }\n stream._backpressure = backpressure;\n }\n /**\n * A default writer vended by a {@link WritableStream}.\n *\n * @public\n */\n class WritableStreamDefaultWriter {\n constructor(stream) {\n assertRequiredArgument(stream, 1, 'WritableStreamDefaultWriter');\n assertWritableStream(stream, 'First parameter');\n if (IsWritableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive writing by another writer');\n }\n this._ownerWritableStream = stream;\n stream._writer = this;\n const state = stream._state;\n if (state === 'writable') {\n if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._backpressure) {\n defaultWriterReadyPromiseInitialize(this);\n }\n else {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n }\n defaultWriterClosedPromiseInitialize(this);\n }\n else if (state === 'erroring') {\n defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError);\n defaultWriterClosedPromiseInitialize(this);\n }\n else if (state === 'closed') {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n defaultWriterClosedPromiseInitializeAsResolved(this);\n }\n else {\n const storedError = stream._storedError;\n defaultWriterReadyPromiseInitializeAsRejected(this, storedError);\n defaultWriterClosedPromiseInitializeAsRejected(this, storedError);\n }\n }\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the writer’s lock is released before the stream finishes closing.\n */\n get closed() {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('closed'));\n }\n return this._closedPromise;\n }\n /**\n * Returns the desired size to fill the stream’s internal queue. It can be negative, if the queue is over-full.\n * A producer can use this information to determine the right amount of data to write.\n *\n * It will be `null` if the stream cannot be successfully written to (due to either being errored, or having an abort\n * queued up). It will return zero if the stream is closed. And the getter will throw an exception if invoked when\n * the writer’s lock is released.\n */\n get desiredSize() {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException('desiredSize');\n }\n if (this._ownerWritableStream === undefined) {\n throw defaultWriterLockException('desiredSize');\n }\n return WritableStreamDefaultWriterGetDesiredSize(this);\n }\n /**\n * Returns a promise that will be fulfilled when the desired size to fill the stream’s internal queue transitions\n * from non-positive to positive, signaling that it is no longer applying backpressure. Once the desired size dips\n * back to zero or below, the getter will return a new promise that stays pending until the next transition.\n *\n * If the stream becomes errored or aborted, or the writer’s lock is released, the returned promise will become\n * rejected.\n */\n get ready() {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('ready'));\n }\n return this._readyPromise;\n }\n /**\n * If the reader is active, behaves the same as {@link WritableStream.abort | stream.abort(reason)}.\n */\n abort(reason = undefined) {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('abort'));\n }\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('abort'));\n }\n return WritableStreamDefaultWriterAbort(this, reason);\n }\n /**\n * If the reader is active, behaves the same as {@link WritableStream.close | stream.close()}.\n */\n close() {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('close'));\n }\n const stream = this._ownerWritableStream;\n if (stream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('close'));\n }\n if (WritableStreamCloseQueuedOrInFlight(stream)) {\n return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));\n }\n return WritableStreamDefaultWriterClose(this);\n }\n /**\n * Releases the writer’s lock on the corresponding stream. After the lock is released, the writer is no longer active.\n * If the associated stream is errored when the lock is released, the writer will appear errored in the same way from\n * now on; otherwise, the writer will appear closed.\n *\n * Note that the lock can still be released even if some ongoing writes have not yet finished (i.e. even if the\n * promises returned from previous calls to {@link WritableStreamDefaultWriter.write | write()} have not yet settled).\n * It’s not necessary to hold the lock on the writer for the duration of the write; the lock instead simply prevents\n * other producers from writing in an interleaved manner.\n */\n releaseLock() {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException('releaseLock');\n }\n const stream = this._ownerWritableStream;\n if (stream === undefined) {\n return;\n }\n WritableStreamDefaultWriterRelease(this);\n }\n write(chunk = undefined) {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('write'));\n }\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('write to'));\n }\n return WritableStreamDefaultWriterWrite(this, chunk);\n }\n }\n Object.defineProperties(WritableStreamDefaultWriter.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n releaseLock: { enumerable: true },\n write: { enumerable: true },\n closed: { enumerable: true },\n desiredSize: { enumerable: true },\n ready: { enumerable: true }\n });\n setFunctionName(WritableStreamDefaultWriter.prototype.abort, 'abort');\n setFunctionName(WritableStreamDefaultWriter.prototype.close, 'close');\n setFunctionName(WritableStreamDefaultWriter.prototype.releaseLock, 'releaseLock');\n setFunctionName(WritableStreamDefaultWriter.prototype.write, 'write');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(WritableStreamDefaultWriter.prototype, Symbol.toStringTag, {\n value: 'WritableStreamDefaultWriter',\n configurable: true\n });\n }\n // Abstract operations for the WritableStreamDefaultWriter.\n function IsWritableStreamDefaultWriter(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_ownerWritableStream')) {\n return false;\n }\n return x instanceof WritableStreamDefaultWriter;\n }\n // A client of WritableStreamDefaultWriter may use these functions directly to bypass state check.\n function WritableStreamDefaultWriterAbort(writer, reason) {\n const stream = writer._ownerWritableStream;\n return WritableStreamAbort(stream, reason);\n }\n function WritableStreamDefaultWriterClose(writer) {\n const stream = writer._ownerWritableStream;\n return WritableStreamClose(stream);\n }\n function WritableStreamDefaultWriterCloseWithErrorPropagation(writer) {\n const stream = writer._ownerWritableStream;\n const state = stream._state;\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {\n return promiseResolvedWith(undefined);\n }\n if (state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n return WritableStreamDefaultWriterClose(writer);\n }\n function WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) {\n if (writer._closedPromiseState === 'pending') {\n defaultWriterClosedPromiseReject(writer, error);\n }\n else {\n defaultWriterClosedPromiseResetToRejected(writer, error);\n }\n }\n function WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) {\n if (writer._readyPromiseState === 'pending') {\n defaultWriterReadyPromiseReject(writer, error);\n }\n else {\n defaultWriterReadyPromiseResetToRejected(writer, error);\n }\n }\n function WritableStreamDefaultWriterGetDesiredSize(writer) {\n const stream = writer._ownerWritableStream;\n const state = stream._state;\n if (state === 'errored' || state === 'erroring') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController);\n }\n function WritableStreamDefaultWriterRelease(writer) {\n const stream = writer._ownerWritableStream;\n const releasedError = new TypeError(`Writer was released and can no longer be used to monitor the stream's closedness`);\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError);\n // The state transitions to \"errored\" before the sink abort() method runs, but the writer.closed promise is not\n // rejected until afterwards. This means that simply testing state will not work.\n WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError);\n stream._writer = undefined;\n writer._ownerWritableStream = undefined;\n }\n function WritableStreamDefaultWriterWrite(writer, chunk) {\n const stream = writer._ownerWritableStream;\n const controller = stream._writableStreamController;\n const chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk);\n if (stream !== writer._ownerWritableStream) {\n return promiseRejectedWith(defaultWriterLockException('write to'));\n }\n const state = stream._state;\n if (state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {\n return promiseRejectedWith(new TypeError('The stream is closing or closed and cannot be written to'));\n }\n if (state === 'erroring') {\n return promiseRejectedWith(stream._storedError);\n }\n const promise = WritableStreamAddWriteRequest(stream);\n WritableStreamDefaultControllerWrite(controller, chunk, chunkSize);\n return promise;\n }\n const closeSentinel = {};\n /**\n * Allows control of a {@link WritableStream | writable stream}'s state and internal queue.\n *\n * @public\n */\n class WritableStreamDefaultController {\n constructor() {\n throw new TypeError('Illegal constructor');\n }\n /**\n * The reason which was passed to `WritableStream.abort(reason)` when the stream was aborted.\n *\n * @deprecated\n * This property has been removed from the specification, see https://github.com/whatwg/streams/pull/1177.\n * Use {@link WritableStreamDefaultController.signal}'s `reason` instead.\n */\n get abortReason() {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('abortReason');\n }\n return this._abortReason;\n }\n /**\n * An `AbortSignal` that can be used to abort the pending write or close operation when the stream is aborted.\n */\n get signal() {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('signal');\n }\n if (this._abortController === undefined) {\n // Older browsers or older Node versions may not support `AbortController` or `AbortSignal`.\n // We don't want to bundle and ship an `AbortController` polyfill together with our polyfill,\n // so instead we only implement support for `signal` if we find a global `AbortController` constructor.\n throw new TypeError('WritableStreamDefaultController.prototype.signal is not supported');\n }\n return this._abortController.signal;\n }\n /**\n * Closes the controlled writable stream, making all future interactions with it fail with the given error `e`.\n *\n * This method is rarely used, since usually it suffices to return a rejected promise from one of the underlying\n * sink's methods. However, it can be useful for suddenly shutting down a stream in response to an event outside the\n * normal lifecycle of interactions with the underlying sink.\n */\n error(e = undefined) {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('error');\n }\n const state = this._controlledWritableStream._state;\n if (state !== 'writable') {\n // The stream is closed, errored or will be soon. The sink can't do anything useful if it gets an error here, so\n // just treat it as a no-op.\n return;\n }\n WritableStreamDefaultControllerError(this, e);\n }\n /** @internal */\n [AbortSteps](reason) {\n const result = this._abortAlgorithm(reason);\n WritableStreamDefaultControllerClearAlgorithms(this);\n return result;\n }\n /** @internal */\n [ErrorSteps]() {\n ResetQueue(this);\n }\n }\n Object.defineProperties(WritableStreamDefaultController.prototype, {\n abortReason: { enumerable: true },\n signal: { enumerable: true },\n error: { enumerable: true }\n });\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(WritableStreamDefaultController.prototype, Symbol.toStringTag, {\n value: 'WritableStreamDefaultController',\n configurable: true\n });\n }\n // Abstract operations implementing interface required by the WritableStream.\n function IsWritableStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledWritableStream')) {\n return false;\n }\n return x instanceof WritableStreamDefaultController;\n }\n function SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\n controller._controlledWritableStream = stream;\n stream._writableStreamController = controller;\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\n controller._queue = undefined;\n controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._abortReason = undefined;\n controller._abortController = createAbortController();\n controller._started = false;\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n controller._writeAlgorithm = writeAlgorithm;\n controller._closeAlgorithm = closeAlgorithm;\n controller._abortAlgorithm = abortAlgorithm;\n const backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n const startResult = startAlgorithm();\n const startPromise = promiseResolvedWith(startResult);\n uponPromise(startPromise, () => {\n controller._started = true;\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n return null;\n }, r => {\n controller._started = true;\n WritableStreamDealWithRejection(stream, r);\n return null;\n });\n }\n function SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, highWaterMark, sizeAlgorithm) {\n const controller = Object.create(WritableStreamDefaultController.prototype);\n let startAlgorithm;\n let writeAlgorithm;\n let closeAlgorithm;\n let abortAlgorithm;\n if (underlyingSink.start !== undefined) {\n startAlgorithm = () => underlyingSink.start(controller);\n }\n else {\n startAlgorithm = () => undefined;\n }\n if (underlyingSink.write !== undefined) {\n writeAlgorithm = chunk => underlyingSink.write(chunk, controller);\n }\n else {\n writeAlgorithm = () => promiseResolvedWith(undefined);\n }\n if (underlyingSink.close !== undefined) {\n closeAlgorithm = () => underlyingSink.close();\n }\n else {\n closeAlgorithm = () => promiseResolvedWith(undefined);\n }\n if (underlyingSink.abort !== undefined) {\n abortAlgorithm = reason => underlyingSink.abort(reason);\n }\n else {\n abortAlgorithm = () => promiseResolvedWith(undefined);\n }\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\n }\n // ClearAlgorithms may be called twice. Erroring the same stream in multiple ways will often result in redundant calls.\n function WritableStreamDefaultControllerClearAlgorithms(controller) {\n controller._writeAlgorithm = undefined;\n controller._closeAlgorithm = undefined;\n controller._abortAlgorithm = undefined;\n controller._strategySizeAlgorithm = undefined;\n }\n function WritableStreamDefaultControllerClose(controller) {\n EnqueueValueWithSize(controller, closeSentinel, 0);\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }\n function WritableStreamDefaultControllerGetChunkSize(controller, chunk) {\n try {\n return controller._strategySizeAlgorithm(chunk);\n }\n catch (chunkSizeE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE);\n return 1;\n }\n }\n function WritableStreamDefaultControllerGetDesiredSize(controller) {\n return controller._strategyHWM - controller._queueTotalSize;\n }\n function WritableStreamDefaultControllerWrite(controller, chunk, chunkSize) {\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n }\n catch (enqueueE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE);\n return;\n }\n const stream = controller._controlledWritableStream;\n if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._state === 'writable') {\n const backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }\n // Abstract operations for the WritableStreamDefaultController.\n function WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) {\n const stream = controller._controlledWritableStream;\n if (!controller._started) {\n return;\n }\n if (stream._inFlightWriteRequest !== undefined) {\n return;\n }\n const state = stream._state;\n if (state === 'erroring') {\n WritableStreamFinishErroring(stream);\n return;\n }\n if (controller._queue.length === 0) {\n return;\n }\n const value = PeekQueueValue(controller);\n if (value === closeSentinel) {\n WritableStreamDefaultControllerProcessClose(controller);\n }\n else {\n WritableStreamDefaultControllerProcessWrite(controller, value);\n }\n }\n function WritableStreamDefaultControllerErrorIfNeeded(controller, error) {\n if (controller._controlledWritableStream._state === 'writable') {\n WritableStreamDefaultControllerError(controller, error);\n }\n }\n function WritableStreamDefaultControllerProcessClose(controller) {\n const stream = controller._controlledWritableStream;\n WritableStreamMarkCloseRequestInFlight(stream);\n DequeueValue(controller);\n const sinkClosePromise = controller._closeAlgorithm();\n WritableStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(sinkClosePromise, () => {\n WritableStreamFinishInFlightClose(stream);\n return null;\n }, reason => {\n WritableStreamFinishInFlightCloseWithError(stream, reason);\n return null;\n });\n }\n function WritableStreamDefaultControllerProcessWrite(controller, chunk) {\n const stream = controller._controlledWritableStream;\n WritableStreamMarkFirstWriteRequestInFlight(stream);\n const sinkWritePromise = controller._writeAlgorithm(chunk);\n uponPromise(sinkWritePromise, () => {\n WritableStreamFinishInFlightWrite(stream);\n const state = stream._state;\n DequeueValue(controller);\n if (!WritableStreamCloseQueuedOrInFlight(stream) && state === 'writable') {\n const backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n return null;\n }, reason => {\n if (stream._state === 'writable') {\n WritableStreamDefaultControllerClearAlgorithms(controller);\n }\n WritableStreamFinishInFlightWriteWithError(stream, reason);\n return null;\n });\n }\n function WritableStreamDefaultControllerGetBackpressure(controller) {\n const desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller);\n return desiredSize <= 0;\n }\n // A client of WritableStreamDefaultController may use these functions directly to bypass state check.\n function WritableStreamDefaultControllerError(controller, error) {\n const stream = controller._controlledWritableStream;\n WritableStreamDefaultControllerClearAlgorithms(controller);\n WritableStreamStartErroring(stream, error);\n }\n // Helper functions for the WritableStream.\n function streamBrandCheckException$2(name) {\n return new TypeError(`WritableStream.prototype.${name} can only be used on a WritableStream`);\n }\n // Helper functions for the WritableStreamDefaultController.\n function defaultControllerBrandCheckException$2(name) {\n return new TypeError(`WritableStreamDefaultController.prototype.${name} can only be used on a WritableStreamDefaultController`);\n }\n // Helper functions for the WritableStreamDefaultWriter.\n function defaultWriterBrandCheckException(name) {\n return new TypeError(`WritableStreamDefaultWriter.prototype.${name} can only be used on a WritableStreamDefaultWriter`);\n }\n function defaultWriterLockException(name) {\n return new TypeError('Cannot ' + name + ' a stream using a released writer');\n }\n function defaultWriterClosedPromiseInitialize(writer) {\n writer._closedPromise = newPromise((resolve, reject) => {\n writer._closedPromise_resolve = resolve;\n writer._closedPromise_reject = reject;\n writer._closedPromiseState = 'pending';\n });\n }\n function defaultWriterClosedPromiseInitializeAsRejected(writer, reason) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseReject(writer, reason);\n }\n function defaultWriterClosedPromiseInitializeAsResolved(writer) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseResolve(writer);\n }\n function defaultWriterClosedPromiseReject(writer, reason) {\n if (writer._closedPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(writer._closedPromise);\n writer._closedPromise_reject(reason);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = 'rejected';\n }\n function defaultWriterClosedPromiseResetToRejected(writer, reason) {\n defaultWriterClosedPromiseInitializeAsRejected(writer, reason);\n }\n function defaultWriterClosedPromiseResolve(writer) {\n if (writer._closedPromise_resolve === undefined) {\n return;\n }\n writer._closedPromise_resolve(undefined);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = 'resolved';\n }\n function defaultWriterReadyPromiseInitialize(writer) {\n writer._readyPromise = newPromise((resolve, reject) => {\n writer._readyPromise_resolve = resolve;\n writer._readyPromise_reject = reject;\n });\n writer._readyPromiseState = 'pending';\n }\n function defaultWriterReadyPromiseInitializeAsRejected(writer, reason) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseReject(writer, reason);\n }\n function defaultWriterReadyPromiseInitializeAsResolved(writer) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseResolve(writer);\n }\n function defaultWriterReadyPromiseReject(writer, reason) {\n if (writer._readyPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(writer._readyPromise);\n writer._readyPromise_reject(reason);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = 'rejected';\n }\n function defaultWriterReadyPromiseReset(writer) {\n defaultWriterReadyPromiseInitialize(writer);\n }\n function defaultWriterReadyPromiseResetToRejected(writer, reason) {\n defaultWriterReadyPromiseInitializeAsRejected(writer, reason);\n }\n function defaultWriterReadyPromiseResolve(writer) {\n if (writer._readyPromise_resolve === undefined) {\n return;\n }\n writer._readyPromise_resolve(undefined);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = 'fulfilled';\n }\n\n /// \n function getGlobals() {\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n else if (typeof self !== 'undefined') {\n return self;\n }\n else if (typeof global !== 'undefined') {\n return global;\n }\n return undefined;\n }\n const globals = getGlobals();\n\n /// \n function isDOMExceptionConstructor(ctor) {\n if (!(typeof ctor === 'function' || typeof ctor === 'object')) {\n return false;\n }\n if (ctor.name !== 'DOMException') {\n return false;\n }\n try {\n new ctor();\n return true;\n }\n catch (_a) {\n return false;\n }\n }\n /**\n * Support:\n * - Web browsers\n * - Node 18 and higher (https://github.com/nodejs/node/commit/e4b1fb5e6422c1ff151234bb9de792d45dd88d87)\n */\n function getFromGlobal() {\n const ctor = globals === null || globals === void 0 ? void 0 : globals.DOMException;\n return isDOMExceptionConstructor(ctor) ? ctor : undefined;\n }\n /**\n * Support:\n * - All platforms\n */\n function createPolyfill() {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const ctor = function DOMException(message, name) {\n this.message = message || '';\n this.name = name || 'Error';\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n };\n setFunctionName(ctor, 'DOMException');\n ctor.prototype = Object.create(Error.prototype);\n Object.defineProperty(ctor.prototype, 'constructor', { value: ctor, writable: true, configurable: true });\n return ctor;\n }\n // eslint-disable-next-line @typescript-eslint/no-redeclare\n const DOMException = getFromGlobal() || createPolyfill();\n\n function ReadableStreamPipeTo(source, dest, preventClose, preventAbort, preventCancel, signal) {\n const reader = AcquireReadableStreamDefaultReader(source);\n const writer = AcquireWritableStreamDefaultWriter(dest);\n source._disturbed = true;\n let shuttingDown = false;\n // This is used to keep track of the spec's requirement that we wait for ongoing writes during shutdown.\n let currentWrite = promiseResolvedWith(undefined);\n return newPromise((resolve, reject) => {\n let abortAlgorithm;\n if (signal !== undefined) {\n abortAlgorithm = () => {\n const error = signal.reason !== undefined ? signal.reason : new DOMException('Aborted', 'AbortError');\n const actions = [];\n if (!preventAbort) {\n actions.push(() => {\n if (dest._state === 'writable') {\n return WritableStreamAbort(dest, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n if (!preventCancel) {\n actions.push(() => {\n if (source._state === 'readable') {\n return ReadableStreamCancel(source, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n shutdownWithAction(() => Promise.all(actions.map(action => action())), true, error);\n };\n if (signal.aborted) {\n abortAlgorithm();\n return;\n }\n signal.addEventListener('abort', abortAlgorithm);\n }\n // Using reader and writer, read all chunks from this and write them to dest\n // - Backpressure must be enforced\n // - Shutdown must stop all activity\n function pipeLoop() {\n return newPromise((resolveLoop, rejectLoop) => {\n function next(done) {\n if (done) {\n resolveLoop();\n }\n else {\n // Use `PerformPromiseThen` instead of `uponPromise` to avoid\n // adding unnecessary `.catch(rethrowAssertionErrorRejection)` handlers\n PerformPromiseThen(pipeStep(), next, rejectLoop);\n }\n }\n next(false);\n });\n }\n function pipeStep() {\n if (shuttingDown) {\n return promiseResolvedWith(true);\n }\n return PerformPromiseThen(writer._readyPromise, () => {\n return newPromise((resolveRead, rejectRead) => {\n ReadableStreamDefaultReaderRead(reader, {\n _chunkSteps: chunk => {\n currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), undefined, noop);\n resolveRead(false);\n },\n _closeSteps: () => resolveRead(true),\n _errorSteps: rejectRead\n });\n });\n });\n }\n // Errors must be propagated forward\n isOrBecomesErrored(source, reader._closedPromise, storedError => {\n if (!preventAbort) {\n shutdownWithAction(() => WritableStreamAbort(dest, storedError), true, storedError);\n }\n else {\n shutdown(true, storedError);\n }\n return null;\n });\n // Errors must be propagated backward\n isOrBecomesErrored(dest, writer._closedPromise, storedError => {\n if (!preventCancel) {\n shutdownWithAction(() => ReadableStreamCancel(source, storedError), true, storedError);\n }\n else {\n shutdown(true, storedError);\n }\n return null;\n });\n // Closing must be propagated forward\n isOrBecomesClosed(source, reader._closedPromise, () => {\n if (!preventClose) {\n shutdownWithAction(() => WritableStreamDefaultWriterCloseWithErrorPropagation(writer));\n }\n else {\n shutdown();\n }\n return null;\n });\n // Closing must be propagated backward\n if (WritableStreamCloseQueuedOrInFlight(dest) || dest._state === 'closed') {\n const destClosed = new TypeError('the destination writable stream closed before all data could be piped to it');\n if (!preventCancel) {\n shutdownWithAction(() => ReadableStreamCancel(source, destClosed), true, destClosed);\n }\n else {\n shutdown(true, destClosed);\n }\n }\n setPromiseIsHandledToTrue(pipeLoop());\n function waitForWritesToFinish() {\n // Another write may have started while we were waiting on this currentWrite, so we have to be sure to wait\n // for that too.\n const oldCurrentWrite = currentWrite;\n return PerformPromiseThen(currentWrite, () => oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : undefined);\n }\n function isOrBecomesErrored(stream, promise, action) {\n if (stream._state === 'errored') {\n action(stream._storedError);\n }\n else {\n uponRejection(promise, action);\n }\n }\n function isOrBecomesClosed(stream, promise, action) {\n if (stream._state === 'closed') {\n action();\n }\n else {\n uponFulfillment(promise, action);\n }\n }\n function shutdownWithAction(action, originalIsError, originalError) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), doTheRest);\n }\n else {\n doTheRest();\n }\n function doTheRest() {\n uponPromise(action(), () => finalize(originalIsError, originalError), newError => finalize(true, newError));\n return null;\n }\n }\n function shutdown(isError, error) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), () => finalize(isError, error));\n }\n else {\n finalize(isError, error);\n }\n }\n function finalize(isError, error) {\n WritableStreamDefaultWriterRelease(writer);\n ReadableStreamReaderGenericRelease(reader);\n if (signal !== undefined) {\n signal.removeEventListener('abort', abortAlgorithm);\n }\n if (isError) {\n reject(error);\n }\n else {\n resolve(undefined);\n }\n return null;\n }\n });\n }\n\n /**\n * Allows control of a {@link ReadableStream | readable stream}'s state and internal queue.\n *\n * @public\n */\n class ReadableStreamDefaultController {\n constructor() {\n throw new TypeError('Illegal constructor');\n }\n /**\n * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is\n * over-full. An underlying source ought to use this information to determine when and how to apply backpressure.\n */\n get desiredSize() {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('desiredSize');\n }\n return ReadableStreamDefaultControllerGetDesiredSize(this);\n }\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n close() {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('close');\n }\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError('The stream is not in a state that permits close');\n }\n ReadableStreamDefaultControllerClose(this);\n }\n enqueue(chunk = undefined) {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('enqueue');\n }\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError('The stream is not in a state that permits enqueue');\n }\n return ReadableStreamDefaultControllerEnqueue(this, chunk);\n }\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n error(e = undefined) {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('error');\n }\n ReadableStreamDefaultControllerError(this, e);\n }\n /** @internal */\n [CancelSteps](reason) {\n ResetQueue(this);\n const result = this._cancelAlgorithm(reason);\n ReadableStreamDefaultControllerClearAlgorithms(this);\n return result;\n }\n /** @internal */\n [PullSteps](readRequest) {\n const stream = this._controlledReadableStream;\n if (this._queue.length > 0) {\n const chunk = DequeueValue(this);\n if (this._closeRequested && this._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(this);\n ReadableStreamClose(stream);\n }\n else {\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n readRequest._chunkSteps(chunk);\n }\n else {\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n }\n /** @internal */\n [ReleaseSteps]() {\n // Do nothing.\n }\n }\n Object.defineProperties(ReadableStreamDefaultController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n desiredSize: { enumerable: true }\n });\n setFunctionName(ReadableStreamDefaultController.prototype.close, 'close');\n setFunctionName(ReadableStreamDefaultController.prototype.enqueue, 'enqueue');\n setFunctionName(ReadableStreamDefaultController.prototype.error, 'error');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamDefaultController.prototype, Symbol.toStringTag, {\n value: 'ReadableStreamDefaultController',\n configurable: true\n });\n }\n // Abstract operations for the ReadableStreamDefaultController.\n function IsReadableStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableStream')) {\n return false;\n }\n return x instanceof ReadableStreamDefaultController;\n }\n function ReadableStreamDefaultControllerCallPullIfNeeded(controller) {\n const shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n controller._pulling = true;\n const pullPromise = controller._pullAlgorithm();\n uponPromise(pullPromise, () => {\n controller._pulling = false;\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }\n return null;\n }, e => {\n ReadableStreamDefaultControllerError(controller, e);\n return null;\n });\n }\n function ReadableStreamDefaultControllerShouldCallPull(controller) {\n const stream = controller._controlledReadableStream;\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return false;\n }\n if (!controller._started) {\n return false;\n }\n if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n return true;\n }\n const desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller);\n if (desiredSize > 0) {\n return true;\n }\n return false;\n }\n function ReadableStreamDefaultControllerClearAlgorithms(controller) {\n controller._pullAlgorithm = undefined;\n controller._cancelAlgorithm = undefined;\n controller._strategySizeAlgorithm = undefined;\n }\n // A client of ReadableStreamDefaultController may use these functions directly to bypass state check.\n function ReadableStreamDefaultControllerClose(controller) {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n const stream = controller._controlledReadableStream;\n controller._closeRequested = true;\n if (controller._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n }\n }\n function ReadableStreamDefaultControllerEnqueue(controller, chunk) {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n const stream = controller._controlledReadableStream;\n if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n ReadableStreamFulfillReadRequest(stream, chunk, false);\n }\n else {\n let chunkSize;\n try {\n chunkSize = controller._strategySizeAlgorithm(chunk);\n }\n catch (chunkSizeE) {\n ReadableStreamDefaultControllerError(controller, chunkSizeE);\n throw chunkSizeE;\n }\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n }\n catch (enqueueE) {\n ReadableStreamDefaultControllerError(controller, enqueueE);\n throw enqueueE;\n }\n }\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }\n function ReadableStreamDefaultControllerError(controller, e) {\n const stream = controller._controlledReadableStream;\n if (stream._state !== 'readable') {\n return;\n }\n ResetQueue(controller);\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n }\n function ReadableStreamDefaultControllerGetDesiredSize(controller) {\n const state = controller._controlledReadableStream._state;\n if (state === 'errored') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return controller._strategyHWM - controller._queueTotalSize;\n }\n // This is used in the implementation of TransformStream.\n function ReadableStreamDefaultControllerHasBackpressure(controller) {\n if (ReadableStreamDefaultControllerShouldCallPull(controller)) {\n return false;\n }\n return true;\n }\n function ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) {\n const state = controller._controlledReadableStream._state;\n if (!controller._closeRequested && state === 'readable') {\n return true;\n }\n return false;\n }\n function SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) {\n controller._controlledReadableStream = stream;\n controller._queue = undefined;\n controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._started = false;\n controller._closeRequested = false;\n controller._pullAgain = false;\n controller._pulling = false;\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n stream._readableStreamController = controller;\n const startResult = startAlgorithm();\n uponPromise(promiseResolvedWith(startResult), () => {\n controller._started = true;\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n return null;\n }, r => {\n ReadableStreamDefaultControllerError(controller, r);\n return null;\n });\n }\n function SetUpReadableStreamDefaultControllerFromUnderlyingSource(stream, underlyingSource, highWaterMark, sizeAlgorithm) {\n const controller = Object.create(ReadableStreamDefaultController.prototype);\n let startAlgorithm;\n let pullAlgorithm;\n let cancelAlgorithm;\n if (underlyingSource.start !== undefined) {\n startAlgorithm = () => underlyingSource.start(controller);\n }\n else {\n startAlgorithm = () => undefined;\n }\n if (underlyingSource.pull !== undefined) {\n pullAlgorithm = () => underlyingSource.pull(controller);\n }\n else {\n pullAlgorithm = () => promiseResolvedWith(undefined);\n }\n if (underlyingSource.cancel !== undefined) {\n cancelAlgorithm = reason => underlyingSource.cancel(reason);\n }\n else {\n cancelAlgorithm = () => promiseResolvedWith(undefined);\n }\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n }\n // Helper functions for the ReadableStreamDefaultController.\n function defaultControllerBrandCheckException$1(name) {\n return new TypeError(`ReadableStreamDefaultController.prototype.${name} can only be used on a ReadableStreamDefaultController`);\n }\n\n function ReadableStreamTee(stream, cloneForBranch2) {\n if (IsReadableByteStreamController(stream._readableStreamController)) {\n return ReadableByteStreamTee(stream);\n }\n return ReadableStreamDefaultTee(stream);\n }\n function ReadableStreamDefaultTee(stream, cloneForBranch2) {\n const reader = AcquireReadableStreamDefaultReader(stream);\n let reading = false;\n let readAgain = false;\n let canceled1 = false;\n let canceled2 = false;\n let reason1;\n let reason2;\n let branch1;\n let branch2;\n let resolveCancelPromise;\n const cancelPromise = newPromise(resolve => {\n resolveCancelPromise = resolve;\n });\n function pullAlgorithm() {\n if (reading) {\n readAgain = true;\n return promiseResolvedWith(undefined);\n }\n reading = true;\n const readRequest = {\n _chunkSteps: chunk => {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n _queueMicrotask(() => {\n readAgain = false;\n const chunk1 = chunk;\n const chunk2 = chunk;\n // There is no way to access the cloning code right now in the reference implementation.\n // If we add one then we'll need an implementation for serializable objects.\n // if (!canceled2 && cloneForBranch2) {\n // chunk2 = StructuredDeserialize(StructuredSerialize(chunk2));\n // }\n if (!canceled1) {\n ReadableStreamDefaultControllerEnqueue(branch1._readableStreamController, chunk1);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerEnqueue(branch2._readableStreamController, chunk2);\n }\n reading = false;\n if (readAgain) {\n pullAlgorithm();\n }\n });\n },\n _closeSteps: () => {\n reading = false;\n if (!canceled1) {\n ReadableStreamDefaultControllerClose(branch1._readableStreamController);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerClose(branch2._readableStreamController);\n }\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: () => {\n reading = false;\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n return promiseResolvedWith(undefined);\n }\n function cancel1Algorithm(reason) {\n canceled1 = true;\n reason1 = reason;\n if (canceled2) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function cancel2Algorithm(reason) {\n canceled2 = true;\n reason2 = reason;\n if (canceled1) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function startAlgorithm() {\n // do nothing\n }\n branch1 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel1Algorithm);\n branch2 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel2Algorithm);\n uponRejection(reader._closedPromise, (r) => {\n ReadableStreamDefaultControllerError(branch1._readableStreamController, r);\n ReadableStreamDefaultControllerError(branch2._readableStreamController, r);\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n return null;\n });\n return [branch1, branch2];\n }\n function ReadableByteStreamTee(stream) {\n let reader = AcquireReadableStreamDefaultReader(stream);\n let reading = false;\n let readAgainForBranch1 = false;\n let readAgainForBranch2 = false;\n let canceled1 = false;\n let canceled2 = false;\n let reason1;\n let reason2;\n let branch1;\n let branch2;\n let resolveCancelPromise;\n const cancelPromise = newPromise(resolve => {\n resolveCancelPromise = resolve;\n });\n function forwardReaderError(thisReader) {\n uponRejection(thisReader._closedPromise, r => {\n if (thisReader !== reader) {\n return null;\n }\n ReadableByteStreamControllerError(branch1._readableStreamController, r);\n ReadableByteStreamControllerError(branch2._readableStreamController, r);\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n return null;\n });\n }\n function pullWithDefaultReader() {\n if (IsReadableStreamBYOBReader(reader)) {\n ReadableStreamReaderGenericRelease(reader);\n reader = AcquireReadableStreamDefaultReader(stream);\n forwardReaderError(reader);\n }\n const readRequest = {\n _chunkSteps: chunk => {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n _queueMicrotask(() => {\n readAgainForBranch1 = false;\n readAgainForBranch2 = false;\n const chunk1 = chunk;\n let chunk2 = chunk;\n if (!canceled1 && !canceled2) {\n try {\n chunk2 = CloneAsUint8Array(chunk);\n }\n catch (cloneE) {\n ReadableByteStreamControllerError(branch1._readableStreamController, cloneE);\n ReadableByteStreamControllerError(branch2._readableStreamController, cloneE);\n resolveCancelPromise(ReadableStreamCancel(stream, cloneE));\n return;\n }\n }\n if (!canceled1) {\n ReadableByteStreamControllerEnqueue(branch1._readableStreamController, chunk1);\n }\n if (!canceled2) {\n ReadableByteStreamControllerEnqueue(branch2._readableStreamController, chunk2);\n }\n reading = false;\n if (readAgainForBranch1) {\n pull1Algorithm();\n }\n else if (readAgainForBranch2) {\n pull2Algorithm();\n }\n });\n },\n _closeSteps: () => {\n reading = false;\n if (!canceled1) {\n ReadableByteStreamControllerClose(branch1._readableStreamController);\n }\n if (!canceled2) {\n ReadableByteStreamControllerClose(branch2._readableStreamController);\n }\n if (branch1._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(branch1._readableStreamController, 0);\n }\n if (branch2._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(branch2._readableStreamController, 0);\n }\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: () => {\n reading = false;\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n }\n function pullWithBYOBReader(view, forBranch2) {\n if (IsReadableStreamDefaultReader(reader)) {\n ReadableStreamReaderGenericRelease(reader);\n reader = AcquireReadableStreamBYOBReader(stream);\n forwardReaderError(reader);\n }\n const byobBranch = forBranch2 ? branch2 : branch1;\n const otherBranch = forBranch2 ? branch1 : branch2;\n const readIntoRequest = {\n _chunkSteps: chunk => {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n _queueMicrotask(() => {\n readAgainForBranch1 = false;\n readAgainForBranch2 = false;\n const byobCanceled = forBranch2 ? canceled2 : canceled1;\n const otherCanceled = forBranch2 ? canceled1 : canceled2;\n if (!otherCanceled) {\n let clonedChunk;\n try {\n clonedChunk = CloneAsUint8Array(chunk);\n }\n catch (cloneE) {\n ReadableByteStreamControllerError(byobBranch._readableStreamController, cloneE);\n ReadableByteStreamControllerError(otherBranch._readableStreamController, cloneE);\n resolveCancelPromise(ReadableStreamCancel(stream, cloneE));\n return;\n }\n if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n ReadableByteStreamControllerEnqueue(otherBranch._readableStreamController, clonedChunk);\n }\n else if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n reading = false;\n if (readAgainForBranch1) {\n pull1Algorithm();\n }\n else if (readAgainForBranch2) {\n pull2Algorithm();\n }\n });\n },\n _closeSteps: chunk => {\n reading = false;\n const byobCanceled = forBranch2 ? canceled2 : canceled1;\n const otherCanceled = forBranch2 ? canceled1 : canceled2;\n if (!byobCanceled) {\n ReadableByteStreamControllerClose(byobBranch._readableStreamController);\n }\n if (!otherCanceled) {\n ReadableByteStreamControllerClose(otherBranch._readableStreamController);\n }\n if (chunk !== undefined) {\n if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n if (!otherCanceled && otherBranch._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(otherBranch._readableStreamController, 0);\n }\n }\n if (!byobCanceled || !otherCanceled) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: () => {\n reading = false;\n }\n };\n ReadableStreamBYOBReaderRead(reader, view, 1, readIntoRequest);\n }\n function pull1Algorithm() {\n if (reading) {\n readAgainForBranch1 = true;\n return promiseResolvedWith(undefined);\n }\n reading = true;\n const byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch1._readableStreamController);\n if (byobRequest === null) {\n pullWithDefaultReader();\n }\n else {\n pullWithBYOBReader(byobRequest._view, false);\n }\n return promiseResolvedWith(undefined);\n }\n function pull2Algorithm() {\n if (reading) {\n readAgainForBranch2 = true;\n return promiseResolvedWith(undefined);\n }\n reading = true;\n const byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch2._readableStreamController);\n if (byobRequest === null) {\n pullWithDefaultReader();\n }\n else {\n pullWithBYOBReader(byobRequest._view, true);\n }\n return promiseResolvedWith(undefined);\n }\n function cancel1Algorithm(reason) {\n canceled1 = true;\n reason1 = reason;\n if (canceled2) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function cancel2Algorithm(reason) {\n canceled2 = true;\n reason2 = reason;\n if (canceled1) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function startAlgorithm() {\n return;\n }\n branch1 = CreateReadableByteStream(startAlgorithm, pull1Algorithm, cancel1Algorithm);\n branch2 = CreateReadableByteStream(startAlgorithm, pull2Algorithm, cancel2Algorithm);\n forwardReaderError(reader);\n return [branch1, branch2];\n }\n\n function isReadableStreamLike(stream) {\n return typeIsObject(stream) && typeof stream.getReader !== 'undefined';\n }\n\n function ReadableStreamFrom(source) {\n if (isReadableStreamLike(source)) {\n return ReadableStreamFromDefaultReader(source.getReader());\n }\n return ReadableStreamFromIterable(source);\n }\n function ReadableStreamFromIterable(asyncIterable) {\n let stream;\n const iteratorRecord = GetIterator(asyncIterable, 'async');\n const startAlgorithm = noop;\n function pullAlgorithm() {\n let nextResult;\n try {\n nextResult = IteratorNext(iteratorRecord);\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n const nextPromise = promiseResolvedWith(nextResult);\n return transformPromiseWith(nextPromise, iterResult => {\n if (!typeIsObject(iterResult)) {\n throw new TypeError('The promise returned by the iterator.next() method must fulfill with an object');\n }\n const done = IteratorComplete(iterResult);\n if (done) {\n ReadableStreamDefaultControllerClose(stream._readableStreamController);\n }\n else {\n const value = IteratorValue(iterResult);\n ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value);\n }\n });\n }\n function cancelAlgorithm(reason) {\n const iterator = iteratorRecord.iterator;\n let returnMethod;\n try {\n returnMethod = GetMethod(iterator, 'return');\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n if (returnMethod === undefined) {\n return promiseResolvedWith(undefined);\n }\n let returnResult;\n try {\n returnResult = reflectCall(returnMethod, iterator, [reason]);\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n const returnPromise = promiseResolvedWith(returnResult);\n return transformPromiseWith(returnPromise, iterResult => {\n if (!typeIsObject(iterResult)) {\n throw new TypeError('The promise returned by the iterator.return() method must fulfill with an object');\n }\n return undefined;\n });\n }\n stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0);\n return stream;\n }\n function ReadableStreamFromDefaultReader(reader) {\n let stream;\n const startAlgorithm = noop;\n function pullAlgorithm() {\n let readPromise;\n try {\n readPromise = reader.read();\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n return transformPromiseWith(readPromise, readResult => {\n if (!typeIsObject(readResult)) {\n throw new TypeError('The promise returned by the reader.read() method must fulfill with an object');\n }\n if (readResult.done) {\n ReadableStreamDefaultControllerClose(stream._readableStreamController);\n }\n else {\n const value = readResult.value;\n ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value);\n }\n });\n }\n function cancelAlgorithm(reason) {\n try {\n return promiseResolvedWith(reader.cancel(reason));\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n }\n stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0);\n return stream;\n }\n\n function convertUnderlyingDefaultOrByteSource(source, context) {\n assertDictionary(source, context);\n const original = source;\n const autoAllocateChunkSize = original === null || original === void 0 ? void 0 : original.autoAllocateChunkSize;\n const cancel = original === null || original === void 0 ? void 0 : original.cancel;\n const pull = original === null || original === void 0 ? void 0 : original.pull;\n const start = original === null || original === void 0 ? void 0 : original.start;\n const type = original === null || original === void 0 ? void 0 : original.type;\n return {\n autoAllocateChunkSize: autoAllocateChunkSize === undefined ?\n undefined :\n convertUnsignedLongLongWithEnforceRange(autoAllocateChunkSize, `${context} has member 'autoAllocateChunkSize' that`),\n cancel: cancel === undefined ?\n undefined :\n convertUnderlyingSourceCancelCallback(cancel, original, `${context} has member 'cancel' that`),\n pull: pull === undefined ?\n undefined :\n convertUnderlyingSourcePullCallback(pull, original, `${context} has member 'pull' that`),\n start: start === undefined ?\n undefined :\n convertUnderlyingSourceStartCallback(start, original, `${context} has member 'start' that`),\n type: type === undefined ? undefined : convertReadableStreamType(type, `${context} has member 'type' that`)\n };\n }\n function convertUnderlyingSourceCancelCallback(fn, original, context) {\n assertFunction(fn, context);\n return (reason) => promiseCall(fn, original, [reason]);\n }\n function convertUnderlyingSourcePullCallback(fn, original, context) {\n assertFunction(fn, context);\n return (controller) => promiseCall(fn, original, [controller]);\n }\n function convertUnderlyingSourceStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return (controller) => reflectCall(fn, original, [controller]);\n }\n function convertReadableStreamType(type, context) {\n type = `${type}`;\n if (type !== 'bytes') {\n throw new TypeError(`${context} '${type}' is not a valid enumeration value for ReadableStreamType`);\n }\n return type;\n }\n\n function convertIteratorOptions(options, context) {\n assertDictionary(options, context);\n const preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel;\n return { preventCancel: Boolean(preventCancel) };\n }\n\n function convertPipeOptions(options, context) {\n assertDictionary(options, context);\n const preventAbort = options === null || options === void 0 ? void 0 : options.preventAbort;\n const preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel;\n const preventClose = options === null || options === void 0 ? void 0 : options.preventClose;\n const signal = options === null || options === void 0 ? void 0 : options.signal;\n if (signal !== undefined) {\n assertAbortSignal(signal, `${context} has member 'signal' that`);\n }\n return {\n preventAbort: Boolean(preventAbort),\n preventCancel: Boolean(preventCancel),\n preventClose: Boolean(preventClose),\n signal\n };\n }\n function assertAbortSignal(signal, context) {\n if (!isAbortSignal(signal)) {\n throw new TypeError(`${context} is not an AbortSignal.`);\n }\n }\n\n function convertReadableWritablePair(pair, context) {\n assertDictionary(pair, context);\n const readable = pair === null || pair === void 0 ? void 0 : pair.readable;\n assertRequiredField(readable, 'readable', 'ReadableWritablePair');\n assertReadableStream(readable, `${context} has member 'readable' that`);\n const writable = pair === null || pair === void 0 ? void 0 : pair.writable;\n assertRequiredField(writable, 'writable', 'ReadableWritablePair');\n assertWritableStream(writable, `${context} has member 'writable' that`);\n return { readable, writable };\n }\n\n /**\n * A readable stream represents a source of data, from which you can read.\n *\n * @public\n */\n class ReadableStream {\n constructor(rawUnderlyingSource = {}, rawStrategy = {}) {\n if (rawUnderlyingSource === undefined) {\n rawUnderlyingSource = null;\n }\n else {\n assertObject(rawUnderlyingSource, 'First parameter');\n }\n const strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');\n const underlyingSource = convertUnderlyingDefaultOrByteSource(rawUnderlyingSource, 'First parameter');\n InitializeReadableStream(this);\n if (underlyingSource.type === 'bytes') {\n if (strategy.size !== undefined) {\n throw new RangeError('The strategy for a byte stream cannot have a size function');\n }\n const highWaterMark = ExtractHighWaterMark(strategy, 0);\n SetUpReadableByteStreamControllerFromUnderlyingSource(this, underlyingSource, highWaterMark);\n }\n else {\n const sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n const highWaterMark = ExtractHighWaterMark(strategy, 1);\n SetUpReadableStreamDefaultControllerFromUnderlyingSource(this, underlyingSource, highWaterMark, sizeAlgorithm);\n }\n }\n /**\n * Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}.\n */\n get locked() {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('locked');\n }\n return IsReadableStreamLocked(this);\n }\n /**\n * Cancels the stream, signaling a loss of interest in the stream by a consumer.\n *\n * The supplied `reason` argument will be given to the underlying source's {@link UnderlyingSource.cancel | cancel()}\n * method, which might or might not use it.\n */\n cancel(reason = undefined) {\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$1('cancel'));\n }\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot cancel a stream that already has a reader'));\n }\n return ReadableStreamCancel(this, reason);\n }\n getReader(rawOptions = undefined) {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('getReader');\n }\n const options = convertReaderOptions(rawOptions, 'First parameter');\n if (options.mode === undefined) {\n return AcquireReadableStreamDefaultReader(this);\n }\n return AcquireReadableStreamBYOBReader(this);\n }\n pipeThrough(rawTransform, rawOptions = {}) {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('pipeThrough');\n }\n assertRequiredArgument(rawTransform, 1, 'pipeThrough');\n const transform = convertReadableWritablePair(rawTransform, 'First parameter');\n const options = convertPipeOptions(rawOptions, 'Second parameter');\n if (IsReadableStreamLocked(this)) {\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream');\n }\n if (IsWritableStreamLocked(transform.writable)) {\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream');\n }\n const promise = ReadableStreamPipeTo(this, transform.writable, options.preventClose, options.preventAbort, options.preventCancel, options.signal);\n setPromiseIsHandledToTrue(promise);\n return transform.readable;\n }\n pipeTo(destination, rawOptions = {}) {\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$1('pipeTo'));\n }\n if (destination === undefined) {\n return promiseRejectedWith(`Parameter 1 is required in 'pipeTo'.`);\n }\n if (!IsWritableStream(destination)) {\n return promiseRejectedWith(new TypeError(`ReadableStream.prototype.pipeTo's first argument must be a WritableStream`));\n }\n let options;\n try {\n options = convertPipeOptions(rawOptions, 'Second parameter');\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream'));\n }\n if (IsWritableStreamLocked(destination)) {\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream'));\n }\n return ReadableStreamPipeTo(this, destination, options.preventClose, options.preventAbort, options.preventCancel, options.signal);\n }\n /**\n * Tees this readable stream, returning a two-element array containing the two resulting branches as\n * new {@link ReadableStream} instances.\n *\n * Teeing a stream will lock it, preventing any other consumer from acquiring a reader.\n * To cancel the stream, cancel both of the resulting branches; a composite cancellation reason will then be\n * propagated to the stream's underlying source.\n *\n * Note that the chunks seen in each branch will be the same object. If the chunks are not immutable,\n * this could allow interference between the two branches.\n */\n tee() {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('tee');\n }\n const branches = ReadableStreamTee(this);\n return CreateArrayFromList(branches);\n }\n values(rawOptions = undefined) {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('values');\n }\n const options = convertIteratorOptions(rawOptions, 'First parameter');\n return AcquireReadableStreamAsyncIterator(this, options.preventCancel);\n }\n [SymbolAsyncIterator](options) {\n // Stub implementation, overridden below\n return this.values(options);\n }\n /**\n * Creates a new ReadableStream wrapping the provided iterable or async iterable.\n *\n * This can be used to adapt various kinds of objects into a readable stream,\n * such as an array, an async generator, or a Node.js readable stream.\n */\n static from(asyncIterable) {\n return ReadableStreamFrom(asyncIterable);\n }\n }\n Object.defineProperties(ReadableStream, {\n from: { enumerable: true }\n });\n Object.defineProperties(ReadableStream.prototype, {\n cancel: { enumerable: true },\n getReader: { enumerable: true },\n pipeThrough: { enumerable: true },\n pipeTo: { enumerable: true },\n tee: { enumerable: true },\n values: { enumerable: true },\n locked: { enumerable: true }\n });\n setFunctionName(ReadableStream.from, 'from');\n setFunctionName(ReadableStream.prototype.cancel, 'cancel');\n setFunctionName(ReadableStream.prototype.getReader, 'getReader');\n setFunctionName(ReadableStream.prototype.pipeThrough, 'pipeThrough');\n setFunctionName(ReadableStream.prototype.pipeTo, 'pipeTo');\n setFunctionName(ReadableStream.prototype.tee, 'tee');\n setFunctionName(ReadableStream.prototype.values, 'values');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStream.prototype, Symbol.toStringTag, {\n value: 'ReadableStream',\n configurable: true\n });\n }\n Object.defineProperty(ReadableStream.prototype, SymbolAsyncIterator, {\n value: ReadableStream.prototype.values,\n writable: true,\n configurable: true\n });\n // Abstract operations for the ReadableStream.\n // Throws if and only if startAlgorithm throws.\n function CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark = 1, sizeAlgorithm = () => 1) {\n const stream = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n const controller = Object.create(ReadableStreamDefaultController.prototype);\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n }\n // Throws if and only if startAlgorithm throws.\n function CreateReadableByteStream(startAlgorithm, pullAlgorithm, cancelAlgorithm) {\n const stream = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n const controller = Object.create(ReadableByteStreamController.prototype);\n SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, 0, undefined);\n return stream;\n }\n function InitializeReadableStream(stream) {\n stream._state = 'readable';\n stream._reader = undefined;\n stream._storedError = undefined;\n stream._disturbed = false;\n }\n function IsReadableStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readableStreamController')) {\n return false;\n }\n return x instanceof ReadableStream;\n }\n function IsReadableStreamLocked(stream) {\n if (stream._reader === undefined) {\n return false;\n }\n return true;\n }\n // ReadableStream API exposed for controllers.\n function ReadableStreamCancel(stream, reason) {\n stream._disturbed = true;\n if (stream._state === 'closed') {\n return promiseResolvedWith(undefined);\n }\n if (stream._state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n ReadableStreamClose(stream);\n const reader = stream._reader;\n if (reader !== undefined && IsReadableStreamBYOBReader(reader)) {\n const readIntoRequests = reader._readIntoRequests;\n reader._readIntoRequests = new SimpleQueue();\n readIntoRequests.forEach(readIntoRequest => {\n readIntoRequest._closeSteps(undefined);\n });\n }\n const sourceCancelPromise = stream._readableStreamController[CancelSteps](reason);\n return transformPromiseWith(sourceCancelPromise, noop);\n }\n function ReadableStreamClose(stream) {\n stream._state = 'closed';\n const reader = stream._reader;\n if (reader === undefined) {\n return;\n }\n defaultReaderClosedPromiseResolve(reader);\n if (IsReadableStreamDefaultReader(reader)) {\n const readRequests = reader._readRequests;\n reader._readRequests = new SimpleQueue();\n readRequests.forEach(readRequest => {\n readRequest._closeSteps();\n });\n }\n }\n function ReadableStreamError(stream, e) {\n stream._state = 'errored';\n stream._storedError = e;\n const reader = stream._reader;\n if (reader === undefined) {\n return;\n }\n defaultReaderClosedPromiseReject(reader, e);\n if (IsReadableStreamDefaultReader(reader)) {\n ReadableStreamDefaultReaderErrorReadRequests(reader, e);\n }\n else {\n ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e);\n }\n }\n // Helper functions for the ReadableStream.\n function streamBrandCheckException$1(name) {\n return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`);\n }\n\n function convertQueuingStrategyInit(init, context) {\n assertDictionary(init, context);\n const highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark;\n assertRequiredField(highWaterMark, 'highWaterMark', 'QueuingStrategyInit');\n return {\n highWaterMark: convertUnrestrictedDouble(highWaterMark)\n };\n }\n\n // The size function must not have a prototype property nor be a constructor\n const byteLengthSizeFunction = (chunk) => {\n return chunk.byteLength;\n };\n setFunctionName(byteLengthSizeFunction, 'size');\n /**\n * A queuing strategy that counts the number of bytes in each chunk.\n *\n * @public\n */\n class ByteLengthQueuingStrategy {\n constructor(options) {\n assertRequiredArgument(options, 1, 'ByteLengthQueuingStrategy');\n options = convertQueuingStrategyInit(options, 'First parameter');\n this._byteLengthQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n /**\n * Returns the high water mark provided to the constructor.\n */\n get highWaterMark() {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException('highWaterMark');\n }\n return this._byteLengthQueuingStrategyHighWaterMark;\n }\n /**\n * Measures the size of `chunk` by returning the value of its `byteLength` property.\n */\n get size() {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException('size');\n }\n return byteLengthSizeFunction;\n }\n }\n Object.defineProperties(ByteLengthQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n });\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ByteLengthQueuingStrategy.prototype, Symbol.toStringTag, {\n value: 'ByteLengthQueuingStrategy',\n configurable: true\n });\n }\n // Helper functions for the ByteLengthQueuingStrategy.\n function byteLengthBrandCheckException(name) {\n return new TypeError(`ByteLengthQueuingStrategy.prototype.${name} can only be used on a ByteLengthQueuingStrategy`);\n }\n function IsByteLengthQueuingStrategy(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_byteLengthQueuingStrategyHighWaterMark')) {\n return false;\n }\n return x instanceof ByteLengthQueuingStrategy;\n }\n\n // The size function must not have a prototype property nor be a constructor\n const countSizeFunction = () => {\n return 1;\n };\n setFunctionName(countSizeFunction, 'size');\n /**\n * A queuing strategy that counts the number of chunks.\n *\n * @public\n */\n class CountQueuingStrategy {\n constructor(options) {\n assertRequiredArgument(options, 1, 'CountQueuingStrategy');\n options = convertQueuingStrategyInit(options, 'First parameter');\n this._countQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n /**\n * Returns the high water mark provided to the constructor.\n */\n get highWaterMark() {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException('highWaterMark');\n }\n return this._countQueuingStrategyHighWaterMark;\n }\n /**\n * Measures the size of `chunk` by always returning 1.\n * This ensures that the total queue size is a count of the number of chunks in the queue.\n */\n get size() {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException('size');\n }\n return countSizeFunction;\n }\n }\n Object.defineProperties(CountQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n });\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(CountQueuingStrategy.prototype, Symbol.toStringTag, {\n value: 'CountQueuingStrategy',\n configurable: true\n });\n }\n // Helper functions for the CountQueuingStrategy.\n function countBrandCheckException(name) {\n return new TypeError(`CountQueuingStrategy.prototype.${name} can only be used on a CountQueuingStrategy`);\n }\n function IsCountQueuingStrategy(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_countQueuingStrategyHighWaterMark')) {\n return false;\n }\n return x instanceof CountQueuingStrategy;\n }\n\n function convertTransformer(original, context) {\n assertDictionary(original, context);\n const cancel = original === null || original === void 0 ? void 0 : original.cancel;\n const flush = original === null || original === void 0 ? void 0 : original.flush;\n const readableType = original === null || original === void 0 ? void 0 : original.readableType;\n const start = original === null || original === void 0 ? void 0 : original.start;\n const transform = original === null || original === void 0 ? void 0 : original.transform;\n const writableType = original === null || original === void 0 ? void 0 : original.writableType;\n return {\n cancel: cancel === undefined ?\n undefined :\n convertTransformerCancelCallback(cancel, original, `${context} has member 'cancel' that`),\n flush: flush === undefined ?\n undefined :\n convertTransformerFlushCallback(flush, original, `${context} has member 'flush' that`),\n readableType,\n start: start === undefined ?\n undefined :\n convertTransformerStartCallback(start, original, `${context} has member 'start' that`),\n transform: transform === undefined ?\n undefined :\n convertTransformerTransformCallback(transform, original, `${context} has member 'transform' that`),\n writableType\n };\n }\n function convertTransformerFlushCallback(fn, original, context) {\n assertFunction(fn, context);\n return (controller) => promiseCall(fn, original, [controller]);\n }\n function convertTransformerStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return (controller) => reflectCall(fn, original, [controller]);\n }\n function convertTransformerTransformCallback(fn, original, context) {\n assertFunction(fn, context);\n return (chunk, controller) => promiseCall(fn, original, [chunk, controller]);\n }\n function convertTransformerCancelCallback(fn, original, context) {\n assertFunction(fn, context);\n return (reason) => promiseCall(fn, original, [reason]);\n }\n\n // Class TransformStream\n /**\n * A transform stream consists of a pair of streams: a {@link WritableStream | writable stream},\n * known as its writable side, and a {@link ReadableStream | readable stream}, known as its readable side.\n * In a manner specific to the transform stream in question, writes to the writable side result in new data being\n * made available for reading from the readable side.\n *\n * @public\n */\n class TransformStream {\n constructor(rawTransformer = {}, rawWritableStrategy = {}, rawReadableStrategy = {}) {\n if (rawTransformer === undefined) {\n rawTransformer = null;\n }\n const writableStrategy = convertQueuingStrategy(rawWritableStrategy, 'Second parameter');\n const readableStrategy = convertQueuingStrategy(rawReadableStrategy, 'Third parameter');\n const transformer = convertTransformer(rawTransformer, 'First parameter');\n if (transformer.readableType !== undefined) {\n throw new RangeError('Invalid readableType specified');\n }\n if (transformer.writableType !== undefined) {\n throw new RangeError('Invalid writableType specified');\n }\n const readableHighWaterMark = ExtractHighWaterMark(readableStrategy, 0);\n const readableSizeAlgorithm = ExtractSizeAlgorithm(readableStrategy);\n const writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1);\n const writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy);\n let startPromise_resolve;\n const startPromise = newPromise(resolve => {\n startPromise_resolve = resolve;\n });\n InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\n SetUpTransformStreamDefaultControllerFromTransformer(this, transformer);\n if (transformer.start !== undefined) {\n startPromise_resolve(transformer.start(this._transformStreamController));\n }\n else {\n startPromise_resolve(undefined);\n }\n }\n /**\n * The readable side of the transform stream.\n */\n get readable() {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException('readable');\n }\n return this._readable;\n }\n /**\n * The writable side of the transform stream.\n */\n get writable() {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException('writable');\n }\n return this._writable;\n }\n }\n Object.defineProperties(TransformStream.prototype, {\n readable: { enumerable: true },\n writable: { enumerable: true }\n });\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(TransformStream.prototype, Symbol.toStringTag, {\n value: 'TransformStream',\n configurable: true\n });\n }\n function InitializeTransformStream(stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) {\n function startAlgorithm() {\n return startPromise;\n }\n function writeAlgorithm(chunk) {\n return TransformStreamDefaultSinkWriteAlgorithm(stream, chunk);\n }\n function abortAlgorithm(reason) {\n return TransformStreamDefaultSinkAbortAlgorithm(stream, reason);\n }\n function closeAlgorithm() {\n return TransformStreamDefaultSinkCloseAlgorithm(stream);\n }\n stream._writable = CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, writableHighWaterMark, writableSizeAlgorithm);\n function pullAlgorithm() {\n return TransformStreamDefaultSourcePullAlgorithm(stream);\n }\n function cancelAlgorithm(reason) {\n return TransformStreamDefaultSourceCancelAlgorithm(stream, reason);\n }\n stream._readable = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\n // The [[backpressure]] slot is set to undefined so that it can be initialised by TransformStreamSetBackpressure.\n stream._backpressure = undefined;\n stream._backpressureChangePromise = undefined;\n stream._backpressureChangePromise_resolve = undefined;\n TransformStreamSetBackpressure(stream, true);\n stream._transformStreamController = undefined;\n }\n function IsTransformStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_transformStreamController')) {\n return false;\n }\n return x instanceof TransformStream;\n }\n // This is a no-op if both sides are already errored.\n function TransformStreamError(stream, e) {\n ReadableStreamDefaultControllerError(stream._readable._readableStreamController, e);\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n }\n function TransformStreamErrorWritableAndUnblockWrite(stream, e) {\n TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController);\n WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController, e);\n TransformStreamUnblockWrite(stream);\n }\n function TransformStreamUnblockWrite(stream) {\n if (stream._backpressure) {\n // Pretend that pull() was called to permit any pending write() calls to complete. TransformStreamSetBackpressure()\n // cannot be called from enqueue() or pull() once the ReadableStream is errored, so this will will be the final time\n // _backpressure is set.\n TransformStreamSetBackpressure(stream, false);\n }\n }\n function TransformStreamSetBackpressure(stream, backpressure) {\n // Passes also when called during construction.\n if (stream._backpressureChangePromise !== undefined) {\n stream._backpressureChangePromise_resolve();\n }\n stream._backpressureChangePromise = newPromise(resolve => {\n stream._backpressureChangePromise_resolve = resolve;\n });\n stream._backpressure = backpressure;\n }\n // Class TransformStreamDefaultController\n /**\n * Allows control of the {@link ReadableStream} and {@link WritableStream} of the associated {@link TransformStream}.\n *\n * @public\n */\n class TransformStreamDefaultController {\n constructor() {\n throw new TypeError('Illegal constructor');\n }\n /**\n * Returns the desired size to fill the readable side’s internal queue. It can be negative, if the queue is over-full.\n */\n get desiredSize() {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('desiredSize');\n }\n const readableController = this._controlledTransformStream._readable._readableStreamController;\n return ReadableStreamDefaultControllerGetDesiredSize(readableController);\n }\n enqueue(chunk = undefined) {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('enqueue');\n }\n TransformStreamDefaultControllerEnqueue(this, chunk);\n }\n /**\n * Errors both the readable side and the writable side of the controlled transform stream, making all future\n * interactions with it fail with the given error `e`. Any chunks queued for transformation will be discarded.\n */\n error(reason = undefined) {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('error');\n }\n TransformStreamDefaultControllerError(this, reason);\n }\n /**\n * Closes the readable side and errors the writable side of the controlled transform stream. This is useful when the\n * transformer only needs to consume a portion of the chunks written to the writable side.\n */\n terminate() {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('terminate');\n }\n TransformStreamDefaultControllerTerminate(this);\n }\n }\n Object.defineProperties(TransformStreamDefaultController.prototype, {\n enqueue: { enumerable: true },\n error: { enumerable: true },\n terminate: { enumerable: true },\n desiredSize: { enumerable: true }\n });\n setFunctionName(TransformStreamDefaultController.prototype.enqueue, 'enqueue');\n setFunctionName(TransformStreamDefaultController.prototype.error, 'error');\n setFunctionName(TransformStreamDefaultController.prototype.terminate, 'terminate');\n if (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(TransformStreamDefaultController.prototype, Symbol.toStringTag, {\n value: 'TransformStreamDefaultController',\n configurable: true\n });\n }\n // Transform Stream Default Controller Abstract Operations\n function IsTransformStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledTransformStream')) {\n return false;\n }\n return x instanceof TransformStreamDefaultController;\n }\n function SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm) {\n controller._controlledTransformStream = stream;\n stream._transformStreamController = controller;\n controller._transformAlgorithm = transformAlgorithm;\n controller._flushAlgorithm = flushAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n controller._finishPromise = undefined;\n controller._finishPromise_resolve = undefined;\n controller._finishPromise_reject = undefined;\n }\n function SetUpTransformStreamDefaultControllerFromTransformer(stream, transformer) {\n const controller = Object.create(TransformStreamDefaultController.prototype);\n let transformAlgorithm;\n let flushAlgorithm;\n let cancelAlgorithm;\n if (transformer.transform !== undefined) {\n transformAlgorithm = chunk => transformer.transform(chunk, controller);\n }\n else {\n transformAlgorithm = chunk => {\n try {\n TransformStreamDefaultControllerEnqueue(controller, chunk);\n return promiseResolvedWith(undefined);\n }\n catch (transformResultE) {\n return promiseRejectedWith(transformResultE);\n }\n };\n }\n if (transformer.flush !== undefined) {\n flushAlgorithm = () => transformer.flush(controller);\n }\n else {\n flushAlgorithm = () => promiseResolvedWith(undefined);\n }\n if (transformer.cancel !== undefined) {\n cancelAlgorithm = reason => transformer.cancel(reason);\n }\n else {\n cancelAlgorithm = () => promiseResolvedWith(undefined);\n }\n SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm);\n }\n function TransformStreamDefaultControllerClearAlgorithms(controller) {\n controller._transformAlgorithm = undefined;\n controller._flushAlgorithm = undefined;\n controller._cancelAlgorithm = undefined;\n }\n function TransformStreamDefaultControllerEnqueue(controller, chunk) {\n const stream = controller._controlledTransformStream;\n const readableController = stream._readable._readableStreamController;\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController)) {\n throw new TypeError('Readable side is not in a state that permits enqueue');\n }\n // We throttle transform invocations based on the backpressure of the ReadableStream, but we still\n // accept TransformStreamDefaultControllerEnqueue() calls.\n try {\n ReadableStreamDefaultControllerEnqueue(readableController, chunk);\n }\n catch (e) {\n // This happens when readableStrategy.size() throws.\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n throw stream._readable._storedError;\n }\n const backpressure = ReadableStreamDefaultControllerHasBackpressure(readableController);\n if (backpressure !== stream._backpressure) {\n TransformStreamSetBackpressure(stream, true);\n }\n }\n function TransformStreamDefaultControllerError(controller, e) {\n TransformStreamError(controller._controlledTransformStream, e);\n }\n function TransformStreamDefaultControllerPerformTransform(controller, chunk) {\n const transformPromise = controller._transformAlgorithm(chunk);\n return transformPromiseWith(transformPromise, undefined, r => {\n TransformStreamError(controller._controlledTransformStream, r);\n throw r;\n });\n }\n function TransformStreamDefaultControllerTerminate(controller) {\n const stream = controller._controlledTransformStream;\n const readableController = stream._readable._readableStreamController;\n ReadableStreamDefaultControllerClose(readableController);\n const error = new TypeError('TransformStream terminated');\n TransformStreamErrorWritableAndUnblockWrite(stream, error);\n }\n // TransformStreamDefaultSink Algorithms\n function TransformStreamDefaultSinkWriteAlgorithm(stream, chunk) {\n const controller = stream._transformStreamController;\n if (stream._backpressure) {\n const backpressureChangePromise = stream._backpressureChangePromise;\n return transformPromiseWith(backpressureChangePromise, () => {\n const writable = stream._writable;\n const state = writable._state;\n if (state === 'erroring') {\n throw writable._storedError;\n }\n return TransformStreamDefaultControllerPerformTransform(controller, chunk);\n });\n }\n return TransformStreamDefaultControllerPerformTransform(controller, chunk);\n }\n function TransformStreamDefaultSinkAbortAlgorithm(stream, reason) {\n const controller = stream._transformStreamController;\n if (controller._finishPromise !== undefined) {\n return controller._finishPromise;\n }\n // stream._readable cannot change after construction, so caching it across a call to user code is safe.\n const readable = stream._readable;\n // Assign the _finishPromise now so that if _cancelAlgorithm calls readable.cancel() internally,\n // we don't run the _cancelAlgorithm again.\n controller._finishPromise = newPromise((resolve, reject) => {\n controller._finishPromise_resolve = resolve;\n controller._finishPromise_reject = reject;\n });\n const cancelPromise = controller._cancelAlgorithm(reason);\n TransformStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(cancelPromise, () => {\n if (readable._state === 'errored') {\n defaultControllerFinishPromiseReject(controller, readable._storedError);\n }\n else {\n ReadableStreamDefaultControllerError(readable._readableStreamController, reason);\n defaultControllerFinishPromiseResolve(controller);\n }\n return null;\n }, r => {\n ReadableStreamDefaultControllerError(readable._readableStreamController, r);\n defaultControllerFinishPromiseReject(controller, r);\n return null;\n });\n return controller._finishPromise;\n }\n function TransformStreamDefaultSinkCloseAlgorithm(stream) {\n const controller = stream._transformStreamController;\n if (controller._finishPromise !== undefined) {\n return controller._finishPromise;\n }\n // stream._readable cannot change after construction, so caching it across a call to user code is safe.\n const readable = stream._readable;\n // Assign the _finishPromise now so that if _flushAlgorithm calls readable.cancel() internally,\n // we don't also run the _cancelAlgorithm.\n controller._finishPromise = newPromise((resolve, reject) => {\n controller._finishPromise_resolve = resolve;\n controller._finishPromise_reject = reject;\n });\n const flushPromise = controller._flushAlgorithm();\n TransformStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(flushPromise, () => {\n if (readable._state === 'errored') {\n defaultControllerFinishPromiseReject(controller, readable._storedError);\n }\n else {\n ReadableStreamDefaultControllerClose(readable._readableStreamController);\n defaultControllerFinishPromiseResolve(controller);\n }\n return null;\n }, r => {\n ReadableStreamDefaultControllerError(readable._readableStreamController, r);\n defaultControllerFinishPromiseReject(controller, r);\n return null;\n });\n return controller._finishPromise;\n }\n // TransformStreamDefaultSource Algorithms\n function TransformStreamDefaultSourcePullAlgorithm(stream) {\n // Invariant. Enforced by the promises returned by start() and pull().\n TransformStreamSetBackpressure(stream, false);\n // Prevent the next pull() call until there is backpressure.\n return stream._backpressureChangePromise;\n }\n function TransformStreamDefaultSourceCancelAlgorithm(stream, reason) {\n const controller = stream._transformStreamController;\n if (controller._finishPromise !== undefined) {\n return controller._finishPromise;\n }\n // stream._writable cannot change after construction, so caching it across a call to user code is safe.\n const writable = stream._writable;\n // Assign the _finishPromise now so that if _flushAlgorithm calls writable.abort() or\n // writable.cancel() internally, we don't run the _cancelAlgorithm again, or also run the\n // _flushAlgorithm.\n controller._finishPromise = newPromise((resolve, reject) => {\n controller._finishPromise_resolve = resolve;\n controller._finishPromise_reject = reject;\n });\n const cancelPromise = controller._cancelAlgorithm(reason);\n TransformStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(cancelPromise, () => {\n if (writable._state === 'errored') {\n defaultControllerFinishPromiseReject(controller, writable._storedError);\n }\n else {\n WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, reason);\n TransformStreamUnblockWrite(stream);\n defaultControllerFinishPromiseResolve(controller);\n }\n return null;\n }, r => {\n WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, r);\n TransformStreamUnblockWrite(stream);\n defaultControllerFinishPromiseReject(controller, r);\n return null;\n });\n return controller._finishPromise;\n }\n // Helper functions for the TransformStreamDefaultController.\n function defaultControllerBrandCheckException(name) {\n return new TypeError(`TransformStreamDefaultController.prototype.${name} can only be used on a TransformStreamDefaultController`);\n }\n function defaultControllerFinishPromiseResolve(controller) {\n if (controller._finishPromise_resolve === undefined) {\n return;\n }\n controller._finishPromise_resolve();\n controller._finishPromise_resolve = undefined;\n controller._finishPromise_reject = undefined;\n }\n function defaultControllerFinishPromiseReject(controller, reason) {\n if (controller._finishPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(controller._finishPromise);\n controller._finishPromise_reject(reason);\n controller._finishPromise_resolve = undefined;\n controller._finishPromise_reject = undefined;\n }\n // Helper functions for the TransformStream.\n function streamBrandCheckException(name) {\n return new TypeError(`TransformStream.prototype.${name} can only be used on a TransformStream`);\n }\n\n exports.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy;\n exports.CountQueuingStrategy = CountQueuingStrategy;\n exports.ReadableByteStreamController = ReadableByteStreamController;\n exports.ReadableStream = ReadableStream;\n exports.ReadableStreamBYOBReader = ReadableStreamBYOBReader;\n exports.ReadableStreamBYOBRequest = ReadableStreamBYOBRequest;\n exports.ReadableStreamDefaultController = ReadableStreamDefaultController;\n exports.ReadableStreamDefaultReader = ReadableStreamDefaultReader;\n exports.TransformStream = TransformStream;\n exports.TransformStreamDefaultController = TransformStreamDefaultController;\n exports.WritableStream = WritableStream;\n exports.WritableStreamDefaultController = WritableStreamDefaultController;\n exports.WritableStreamDefaultWriter = WritableStreamDefaultWriter;\n\n}));\n//# sourceMappingURL=ponyfill.es2018.js.map\n","/* c8 ignore start */\n// 64 KiB (same size chrome slice theirs blob into Uint8array's)\nconst POOL_SIZE = 65536\n\nif (!globalThis.ReadableStream) {\n // `node:stream/web` got introduced in v16.5.0 as experimental\n // and it's preferred over the polyfilled version. So we also\n // suppress the warning that gets emitted by NodeJS for using it.\n try {\n const process = require('node:process')\n const { emitWarning } = process\n try {\n process.emitWarning = () => {}\n Object.assign(globalThis, require('node:stream/web'))\n process.emitWarning = emitWarning\n } catch (error) {\n process.emitWarning = emitWarning\n throw error\n }\n } catch (error) {\n // fallback to polyfill implementation\n Object.assign(globalThis, require('web-streams-polyfill/dist/ponyfill.es2018.js'))\n }\n}\n\ntry {\n // Don't use node: prefix for this, require+node: is not supported until node v14.14\n // Only `import()` can use prefix in 12.20 and later\n const { Blob } = require('buffer')\n if (Blob && !Blob.prototype.stream) {\n Blob.prototype.stream = function name (params) {\n let position = 0\n const blob = this\n\n return new ReadableStream({\n type: 'bytes',\n async pull (ctrl) {\n const chunk = blob.slice(position, Math.min(blob.size, position + POOL_SIZE))\n const buffer = await chunk.arrayBuffer()\n position += buffer.byteLength\n ctrl.enqueue(new Uint8Array(buffer))\n\n if (position === blob.size) {\n ctrl.close()\n }\n }\n })\n }\n }\n} catch (error) {}\n/* c8 ignore end */\n","/*! fetch-blob. MIT License. Jimmy Wärting */\n\n// TODO (jimmywarting): in the feature use conditional loading with top level await (requires 14.x)\n// Node has recently added whatwg stream into core\n\nimport './streams.cjs'\n\n// 64 KiB (same size chrome slice theirs blob into Uint8array's)\nconst POOL_SIZE = 65536\n\n/** @param {(Blob | Uint8Array)[]} parts */\nasync function * toIterator (parts, clone = true) {\n for (const part of parts) {\n if ('stream' in part) {\n yield * (/** @type {AsyncIterableIterator} */ (part.stream()))\n } else if (ArrayBuffer.isView(part)) {\n if (clone) {\n let position = part.byteOffset\n const end = part.byteOffset + part.byteLength\n while (position !== end) {\n const size = Math.min(end - position, POOL_SIZE)\n const chunk = part.buffer.slice(position, position + size)\n position += chunk.byteLength\n yield new Uint8Array(chunk)\n }\n } else {\n yield part\n }\n /* c8 ignore next 10 */\n } else {\n // For blobs that have arrayBuffer but no stream method (nodes buffer.Blob)\n let position = 0, b = (/** @type {Blob} */ (part))\n while (position !== b.size) {\n const chunk = b.slice(position, Math.min(b.size, position + POOL_SIZE))\n const buffer = await chunk.arrayBuffer()\n position += buffer.byteLength\n yield new Uint8Array(buffer)\n }\n }\n }\n}\n\nconst _Blob = class Blob {\n /** @type {Array.<(Blob|Uint8Array)>} */\n #parts = []\n #type = ''\n #size = 0\n #endings = 'transparent'\n\n /**\n * The Blob() constructor returns a new Blob object. The content\n * of the blob consists of the concatenation of the values given\n * in the parameter array.\n *\n * @param {*} blobParts\n * @param {{ type?: string, endings?: string }} [options]\n */\n constructor (blobParts = [], options = {}) {\n if (typeof blobParts !== 'object' || blobParts === null) {\n throw new TypeError('Failed to construct \\'Blob\\': The provided value cannot be converted to a sequence.')\n }\n\n if (typeof blobParts[Symbol.iterator] !== 'function') {\n throw new TypeError('Failed to construct \\'Blob\\': The object must have a callable @@iterator property.')\n }\n\n if (typeof options !== 'object' && typeof options !== 'function') {\n throw new TypeError('Failed to construct \\'Blob\\': parameter 2 cannot convert to dictionary.')\n }\n\n if (options === null) options = {}\n\n const encoder = new TextEncoder()\n for (const element of blobParts) {\n let part\n if (ArrayBuffer.isView(element)) {\n part = new Uint8Array(element.buffer.slice(element.byteOffset, element.byteOffset + element.byteLength))\n } else if (element instanceof ArrayBuffer) {\n part = new Uint8Array(element.slice(0))\n } else if (element instanceof Blob) {\n part = element\n } else {\n part = encoder.encode(`${element}`)\n }\n\n this.#size += ArrayBuffer.isView(part) ? part.byteLength : part.size\n this.#parts.push(part)\n }\n\n this.#endings = `${options.endings === undefined ? 'transparent' : options.endings}`\n const type = options.type === undefined ? '' : String(options.type)\n this.#type = /^[\\x20-\\x7E]*$/.test(type) ? type : ''\n }\n\n /**\n * The Blob interface's size property returns the\n * size of the Blob in bytes.\n */\n get size () {\n return this.#size\n }\n\n /**\n * The type property of a Blob object returns the MIME type of the file.\n */\n get type () {\n return this.#type\n }\n\n /**\n * The text() method in the Blob interface returns a Promise\n * that resolves with a string containing the contents of\n * the blob, interpreted as UTF-8.\n *\n * @return {Promise}\n */\n async text () {\n // More optimized than using this.arrayBuffer()\n // that requires twice as much ram\n const decoder = new TextDecoder()\n let str = ''\n for await (const part of toIterator(this.#parts, false)) {\n str += decoder.decode(part, { stream: true })\n }\n // Remaining\n str += decoder.decode()\n return str\n }\n\n /**\n * The arrayBuffer() method in the Blob interface returns a\n * Promise that resolves with the contents of the blob as\n * binary data contained in an ArrayBuffer.\n *\n * @return {Promise}\n */\n async arrayBuffer () {\n // Easier way... Just a unnecessary overhead\n // const view = new Uint8Array(this.size);\n // await this.stream().getReader({mode: 'byob'}).read(view);\n // return view.buffer;\n\n const data = new Uint8Array(this.size)\n let offset = 0\n for await (const chunk of toIterator(this.#parts, false)) {\n data.set(chunk, offset)\n offset += chunk.length\n }\n\n return data.buffer\n }\n\n stream () {\n const it = toIterator(this.#parts, true)\n\n return new globalThis.ReadableStream({\n // @ts-ignore\n type: 'bytes',\n async pull (ctrl) {\n const chunk = await it.next()\n chunk.done ? ctrl.close() : ctrl.enqueue(chunk.value)\n },\n\n async cancel () {\n await it.return()\n }\n })\n }\n\n /**\n * The Blob interface's slice() method creates and returns a\n * new Blob object which contains data from a subset of the\n * blob on which it's called.\n *\n * @param {number} [start]\n * @param {number} [end]\n * @param {string} [type]\n */\n slice (start = 0, end = this.size, type = '') {\n const { size } = this\n\n let relativeStart = start < 0 ? Math.max(size + start, 0) : Math.min(start, size)\n let relativeEnd = end < 0 ? Math.max(size + end, 0) : Math.min(end, size)\n\n const span = Math.max(relativeEnd - relativeStart, 0)\n const parts = this.#parts\n const blobParts = []\n let added = 0\n\n for (const part of parts) {\n // don't add the overflow to new blobParts\n if (added >= span) {\n break\n }\n\n const size = ArrayBuffer.isView(part) ? part.byteLength : part.size\n if (relativeStart && size <= relativeStart) {\n // Skip the beginning and change the relative\n // start & end position as we skip the unwanted parts\n relativeStart -= size\n relativeEnd -= size\n } else {\n let chunk\n if (ArrayBuffer.isView(part)) {\n chunk = part.subarray(relativeStart, Math.min(size, relativeEnd))\n added += chunk.byteLength\n } else {\n chunk = part.slice(relativeStart, Math.min(size, relativeEnd))\n added += chunk.size\n }\n relativeEnd -= size\n blobParts.push(chunk)\n relativeStart = 0 // All next sequential parts should start at 0\n }\n }\n\n const blob = new Blob([], { type: String(type).toLowerCase() })\n blob.#size = span\n blob.#parts = blobParts\n\n return blob\n }\n\n get [Symbol.toStringTag] () {\n return 'Blob'\n }\n\n static [Symbol.hasInstance] (object) {\n return (\n object &&\n typeof object === 'object' &&\n typeof object.constructor === 'function' &&\n (\n typeof object.stream === 'function' ||\n typeof object.arrayBuffer === 'function'\n ) &&\n /^(Blob|File)$/.test(object[Symbol.toStringTag])\n )\n }\n}\n\nObject.defineProperties(_Blob.prototype, {\n size: { enumerable: true },\n type: { enumerable: true },\n slice: { enumerable: true }\n})\n\n/** @type {typeof globalThis.Blob} */\nexport const Blob = _Blob\nexport default Blob\n","import Blob from './index.js'\n\nconst _File = class File extends Blob {\n #lastModified = 0\n #name = ''\n\n /**\n * @param {*[]} fileBits\n * @param {string} fileName\n * @param {{lastModified?: number, type?: string}} options\n */// @ts-ignore\n constructor (fileBits, fileName, options = {}) {\n if (arguments.length < 2) {\n throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`)\n }\n super(fileBits, options)\n\n if (options === null) options = {}\n\n // Simulate WebIDL type casting for NaN value in lastModified option.\n const lastModified = options.lastModified === undefined ? Date.now() : Number(options.lastModified)\n if (!Number.isNaN(lastModified)) {\n this.#lastModified = lastModified\n }\n\n this.#name = String(fileName)\n }\n\n get name () {\n return this.#name\n }\n\n get lastModified () {\n return this.#lastModified\n }\n\n get [Symbol.toStringTag] () {\n return 'File'\n }\n\n static [Symbol.hasInstance] (object) {\n return !!object && object instanceof Blob &&\n /^(File)$/.test(object[Symbol.toStringTag])\n }\n}\n\n/** @type {typeof globalThis.File} */// @ts-ignore\nexport const File = _File\nexport default File\n","/*! formdata-polyfill. MIT License. Jimmy Wärting */\n\nimport C from 'fetch-blob'\nimport F from 'fetch-blob/file.js'\n\nvar {toStringTag:t,iterator:i,hasInstance:h}=Symbol,\nr=Math.random,\nm='append,set,get,getAll,delete,keys,values,entries,forEach,constructor'.split(','),\nf=(a,b,c)=>(a+='',/^(Blob|File)$/.test(b && b[t])?[(c=c!==void 0?c+'':b[t]=='File'?b.name:'blob',a),b.name!==c||b[t]=='blob'?new F([b],c,b):b]:[a,b+'']),\ne=(c,f)=>(f?c:c.replace(/\\r?\\n|\\r/g,'\\r\\n')).replace(/\\n/g,'%0A').replace(/\\r/g,'%0D').replace(/\"/g,'%22'),\nx=(n, a, e)=>{if(a.lengthtypeof o[m]!='function')}\nappend(...a){x('append',arguments,2);this.#d.push(f(...a))}\ndelete(a){x('delete',arguments,1);a+='';this.#d=this.#d.filter(([b])=>b!==a)}\nget(a){x('get',arguments,1);a+='';for(var b=this.#d,l=b.length,c=0;cc[0]===a&&b.push(c[1]));return b}\nhas(a){x('has',arguments,1);a+='';return this.#d.some(b=>b[0]===a)}\nforEach(a,b){x('forEach',arguments,1);for(var [c,d]of this)a.call(b,d,c,this)}\nset(...a){x('set',arguments,2);var b=[],c=!0;a=f(...a);this.#d.forEach(d=>{d[0]===a[0]?c&&(c=!b.push(a)):b.push(d)});c&&b.push(a);this.#d=b}\n*entries(){yield*this.#d}\n*keys(){for(var[a]of this)yield a}\n*values(){for(var[,a]of this)yield a}}\n\n/** @param {FormData} F */\nexport function formDataToBlob (F,B=C){\nvar b=`${r()}${r()}`.replace(/\\./g, '').slice(-28).padStart(32, '-'),c=[],p=`--${b}\\r\\nContent-Disposition: form-data; name=\"`\nF.forEach((v,n)=>typeof v=='string'\n?c.push(p+e(n)+`\"\\r\\n\\r\\n${v.replace(/\\r(?!\\n)|(? {\n\treturn (\n\t\ttypeof object === 'object' &&\n\t\ttypeof object.append === 'function' &&\n\t\ttypeof object.delete === 'function' &&\n\t\ttypeof object.get === 'function' &&\n\t\ttypeof object.getAll === 'function' &&\n\t\ttypeof object.has === 'function' &&\n\t\ttypeof object.set === 'function' &&\n\t\ttypeof object.sort === 'function' &&\n\t\tobject[NAME] === 'URLSearchParams'\n\t);\n};\n\n/**\n * Check if `object` is a W3C `Blob` object (which `File` inherits from)\n * @param {*} object - Object to check for\n * @return {boolean}\n */\nexport const isBlob = object => {\n\treturn (\n\t\tobject &&\n\t\ttypeof object === 'object' &&\n\t\ttypeof object.arrayBuffer === 'function' &&\n\t\ttypeof object.type === 'string' &&\n\t\ttypeof object.stream === 'function' &&\n\t\ttypeof object.constructor === 'function' &&\n\t\t/^(Blob|File)$/.test(object[NAME])\n\t);\n};\n\n/**\n * Check if `obj` is an instance of AbortSignal.\n * @param {*} object - Object to check for\n * @return {boolean}\n */\nexport const isAbortSignal = object => {\n\treturn (\n\t\ttypeof object === 'object' && (\n\t\t\tobject[NAME] === 'AbortSignal' ||\n\t\t\tobject[NAME] === 'EventTarget'\n\t\t)\n\t);\n};\n\n/**\n * isDomainOrSubdomain reports whether sub is a subdomain (or exact match) of\n * the parent domain.\n *\n * Both domains must already be in canonical form.\n * @param {string|URL} original\n * @param {string|URL} destination\n */\nexport const isDomainOrSubdomain = (destination, original) => {\n\tconst orig = new URL(original).hostname;\n\tconst dest = new URL(destination).hostname;\n\n\treturn orig === dest || orig.endsWith(`.${dest}`);\n};\n\n/**\n * isSameProtocol reports whether the two provided URLs use the same protocol.\n *\n * Both domains must already be in canonical form.\n * @param {string|URL} original\n * @param {string|URL} destination\n */\nexport const isSameProtocol = (destination, original) => {\n\tconst orig = new URL(original).protocol;\n\tconst dest = new URL(destination).protocol;\n\n\treturn orig === dest;\n};\n","\n/**\n * Body.js\n *\n * Body interface provides common methods for Request and Response\n */\n\nimport Stream, {PassThrough} from 'node:stream';\nimport {types, deprecate, promisify} from 'node:util';\nimport {Buffer} from 'node:buffer';\n\nimport Blob from 'fetch-blob';\nimport {FormData, formDataToBlob} from 'formdata-polyfill/esm.min.js';\n\nimport {FetchError} from './errors/fetch-error.js';\nimport {FetchBaseError} from './errors/base.js';\nimport {isBlob, isURLSearchParameters} from './utils/is.js';\n\nconst pipeline = promisify(Stream.pipeline);\nconst INTERNALS = Symbol('Body internals');\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nexport default class Body {\n\tconstructor(body, {\n\t\tsize = 0\n\t} = {}) {\n\t\tlet boundary = null;\n\n\t\tif (body === null) {\n\t\t\t// Body is undefined or null\n\t\t\tbody = null;\n\t\t} else if (isURLSearchParameters(body)) {\n\t\t\t// Body is a URLSearchParams\n\t\t\tbody = Buffer.from(body.toString());\n\t\t} else if (isBlob(body)) {\n\t\t\t// Body is blob\n\t\t} else if (Buffer.isBuffer(body)) {\n\t\t\t// Body is Buffer\n\t\t} else if (types.isAnyArrayBuffer(body)) {\n\t\t\t// Body is ArrayBuffer\n\t\t\tbody = Buffer.from(body);\n\t\t} else if (ArrayBuffer.isView(body)) {\n\t\t\t// Body is ArrayBufferView\n\t\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t\t} else if (body instanceof Stream) {\n\t\t\t// Body is stream\n\t\t} else if (body instanceof FormData) {\n\t\t\t// Body is FormData\n\t\t\tbody = formDataToBlob(body);\n\t\t\tboundary = body.type.split('=')[1];\n\t\t} else {\n\t\t\t// None of the above\n\t\t\t// coerce to string then buffer\n\t\t\tbody = Buffer.from(String(body));\n\t\t}\n\n\t\tlet stream = body;\n\n\t\tif (Buffer.isBuffer(body)) {\n\t\t\tstream = Stream.Readable.from(body);\n\t\t} else if (isBlob(body)) {\n\t\t\tstream = Stream.Readable.from(body.stream());\n\t\t}\n\n\t\tthis[INTERNALS] = {\n\t\t\tbody,\n\t\t\tstream,\n\t\t\tboundary,\n\t\t\tdisturbed: false,\n\t\t\terror: null\n\t\t};\n\t\tthis.size = size;\n\n\t\tif (body instanceof Stream) {\n\t\t\tbody.on('error', error_ => {\n\t\t\t\tconst error = error_ instanceof FetchBaseError ?\n\t\t\t\t\terror_ :\n\t\t\t\t\tnew FetchError(`Invalid response body while trying to fetch ${this.url}: ${error_.message}`, 'system', error_);\n\t\t\t\tthis[INTERNALS].error = error;\n\t\t\t});\n\t\t}\n\t}\n\n\tget body() {\n\t\treturn this[INTERNALS].stream;\n\t}\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t}\n\n\t/**\n\t * Decode response as ArrayBuffer\n\t *\n\t * @return Promise\n\t */\n\tasync arrayBuffer() {\n\t\tconst {buffer, byteOffset, byteLength} = await consumeBody(this);\n\t\treturn buffer.slice(byteOffset, byteOffset + byteLength);\n\t}\n\n\tasync formData() {\n\t\tconst ct = this.headers.get('content-type');\n\n\t\tif (ct.startsWith('application/x-www-form-urlencoded')) {\n\t\t\tconst formData = new FormData();\n\t\t\tconst parameters = new URLSearchParams(await this.text());\n\n\t\t\tfor (const [name, value] of parameters) {\n\t\t\t\tformData.append(name, value);\n\t\t\t}\n\n\t\t\treturn formData;\n\t\t}\n\n\t\tconst {toFormData} = await import('./utils/multipart-parser.js');\n\t\treturn toFormData(this.body, ct);\n\t}\n\n\t/**\n\t * Return raw response as Blob\n\t *\n\t * @return Promise\n\t */\n\tasync blob() {\n\t\tconst ct = (this.headers && this.headers.get('content-type')) || (this[INTERNALS].body && this[INTERNALS].body.type) || '';\n\t\tconst buf = await this.arrayBuffer();\n\n\t\treturn new Blob([buf], {\n\t\t\ttype: ct\n\t\t});\n\t}\n\n\t/**\n\t * Decode response as json\n\t *\n\t * @return Promise\n\t */\n\tasync json() {\n\t\tconst text = await this.text();\n\t\treturn JSON.parse(text);\n\t}\n\n\t/**\n\t * Decode response as text\n\t *\n\t * @return Promise\n\t */\n\tasync text() {\n\t\tconst buffer = await consumeBody(this);\n\t\treturn new TextDecoder().decode(buffer);\n\t}\n\n\t/**\n\t * Decode response as buffer (non-spec api)\n\t *\n\t * @return Promise\n\t */\n\tbuffer() {\n\t\treturn consumeBody(this);\n\t}\n}\n\nBody.prototype.buffer = deprecate(Body.prototype.buffer, 'Please use \\'response.arrayBuffer()\\' instead of \\'response.buffer()\\'', 'node-fetch#buffer');\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: {enumerable: true},\n\tbodyUsed: {enumerable: true},\n\tarrayBuffer: {enumerable: true},\n\tblob: {enumerable: true},\n\tjson: {enumerable: true},\n\ttext: {enumerable: true},\n\tdata: {get: deprecate(() => {},\n\t\t'data doesn\\'t exist, use json(), text(), arrayBuffer(), or body instead',\n\t\t'https://github.com/node-fetch/node-fetch/issues/1000 (response)')}\n});\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nasync function consumeBody(data) {\n\tif (data[INTERNALS].disturbed) {\n\t\tthrow new TypeError(`body used already for: ${data.url}`);\n\t}\n\n\tdata[INTERNALS].disturbed = true;\n\n\tif (data[INTERNALS].error) {\n\t\tthrow data[INTERNALS].error;\n\t}\n\n\tconst {body} = data;\n\n\t// Body is null\n\tif (body === null) {\n\t\treturn Buffer.alloc(0);\n\t}\n\n\t/* c8 ignore next 3 */\n\tif (!(body instanceof Stream)) {\n\t\treturn Buffer.alloc(0);\n\t}\n\n\t// Body is stream\n\t// get ready to actually consume the body\n\tconst accum = [];\n\tlet accumBytes = 0;\n\n\ttry {\n\t\tfor await (const chunk of body) {\n\t\t\tif (data.size > 0 && accumBytes + chunk.length > data.size) {\n\t\t\t\tconst error = new FetchError(`content size at ${data.url} over limit: ${data.size}`, 'max-size');\n\t\t\t\tbody.destroy(error);\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t}\n\t} catch (error) {\n\t\tconst error_ = error instanceof FetchBaseError ? error : new FetchError(`Invalid response body while trying to fetch ${data.url}: ${error.message}`, 'system', error);\n\t\tthrow error_;\n\t}\n\n\tif (body.readableEnded === true || body._readableState.ended === true) {\n\t\ttry {\n\t\t\tif (accum.every(c => typeof c === 'string')) {\n\t\t\t\treturn Buffer.from(accum.join(''));\n\t\t\t}\n\n\t\t\treturn Buffer.concat(accum, accumBytes);\n\t\t} catch (error) {\n\t\t\tthrow new FetchError(`Could not create Buffer from response body for ${data.url}: ${error.message}`, 'system', error);\n\t\t}\n\t} else {\n\t\tthrow new FetchError(`Premature close of server response while trying to fetch ${data.url}`);\n\t}\n}\n\n/**\n * Clone body given Res/Req instance\n *\n * @param Mixed instance Response or Request instance\n * @param String highWaterMark highWaterMark for both PassThrough body streams\n * @return Mixed\n */\nexport const clone = (instance, highWaterMark) => {\n\tlet p1;\n\tlet p2;\n\tlet {body} = instance[INTERNALS];\n\n\t// Don't allow cloning a used body\n\tif (instance.bodyUsed) {\n\t\tthrow new Error('cannot clone body after it is used');\n\t}\n\n\t// Check that body is a stream and not form-data object\n\t// note: we can't clone the form-data object without having it as a dependency\n\tif ((body instanceof Stream) && (typeof body.getBoundary !== 'function')) {\n\t\t// Tee instance body\n\t\tp1 = new PassThrough({highWaterMark});\n\t\tp2 = new PassThrough({highWaterMark});\n\t\tbody.pipe(p1);\n\t\tbody.pipe(p2);\n\t\t// Set instance body to teed body and return the other teed body\n\t\tinstance[INTERNALS].stream = p1;\n\t\tbody = p2;\n\t}\n\n\treturn body;\n};\n\nconst getNonSpecFormDataBoundary = deprecate(\n\tbody => body.getBoundary(),\n\t'form-data doesn\\'t follow the spec and requires special treatment. Use alternative package',\n\t'https://github.com/node-fetch/node-fetch/issues/1167'\n);\n\n/**\n * Performs the operation \"extract a `Content-Type` value from |object|\" as\n * specified in the specification:\n * https://fetch.spec.whatwg.org/#concept-bodyinit-extract\n *\n * This function assumes that instance.body is present.\n *\n * @param {any} body Any options.body input\n * @returns {string | null}\n */\nexport const extractContentType = (body, request) => {\n\t// Body is null or undefined\n\tif (body === null) {\n\t\treturn null;\n\t}\n\n\t// Body is string\n\tif (typeof body === 'string') {\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n\n\t// Body is a URLSearchParams\n\tif (isURLSearchParameters(body)) {\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t}\n\n\t// Body is blob\n\tif (isBlob(body)) {\n\t\treturn body.type || null;\n\t}\n\n\t// Body is a Buffer (Buffer, ArrayBuffer or ArrayBufferView)\n\tif (Buffer.isBuffer(body) || types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) {\n\t\treturn null;\n\t}\n\n\tif (body instanceof FormData) {\n\t\treturn `multipart/form-data; boundary=${request[INTERNALS].boundary}`;\n\t}\n\n\t// Detect form data input from form-data module\n\tif (body && typeof body.getBoundary === 'function') {\n\t\treturn `multipart/form-data;boundary=${getNonSpecFormDataBoundary(body)}`;\n\t}\n\n\t// Body is stream - can't really do much about this\n\tif (body instanceof Stream) {\n\t\treturn null;\n\t}\n\n\t// Body constructor defaults other things to string\n\treturn 'text/plain;charset=UTF-8';\n};\n\n/**\n * The Fetch Standard treats this as if \"total bytes\" is a property on the body.\n * For us, we have to explicitly get it with a function.\n *\n * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes\n *\n * @param {any} obj.body Body object from the Body instance.\n * @returns {number | null}\n */\nexport const getTotalBytes = request => {\n\tconst {body} = request[INTERNALS];\n\n\t// Body is null or undefined\n\tif (body === null) {\n\t\treturn 0;\n\t}\n\n\t// Body is Blob\n\tif (isBlob(body)) {\n\t\treturn body.size;\n\t}\n\n\t// Body is Buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn body.length;\n\t}\n\n\t// Detect form data input from form-data module\n\tif (body && typeof body.getLengthSync === 'function') {\n\t\treturn body.hasKnownLength && body.hasKnownLength() ? body.getLengthSync() : null;\n\t}\n\n\t// Body is stream\n\treturn null;\n};\n\n/**\n * Write a Body to a Node.js WritableStream (e.g. http.Request) object.\n *\n * @param {Stream.Writable} dest The stream to write to.\n * @param obj.body Body object from the Body instance.\n * @returns {Promise}\n */\nexport const writeToStream = async (dest, {body}) => {\n\tif (body === null) {\n\t\t// Body is null\n\t\tdest.end();\n\t} else {\n\t\t// Body is stream\n\t\tawait pipeline(body, dest);\n\t}\n};\n","/**\n * Headers.js\n *\n * Headers class offers convenient helpers\n */\n\nimport {types} from 'node:util';\nimport http from 'node:http';\n\n/* c8 ignore next 9 */\nconst validateHeaderName = typeof http.validateHeaderName === 'function' ?\n\thttp.validateHeaderName :\n\tname => {\n\t\tif (!/^[\\^`\\-\\w!#$%&'*+.|~]+$/.test(name)) {\n\t\t\tconst error = new TypeError(`Header name must be a valid HTTP token [${name}]`);\n\t\t\tObject.defineProperty(error, 'code', {value: 'ERR_INVALID_HTTP_TOKEN'});\n\t\t\tthrow error;\n\t\t}\n\t};\n\n/* c8 ignore next 9 */\nconst validateHeaderValue = typeof http.validateHeaderValue === 'function' ?\n\thttp.validateHeaderValue :\n\t(name, value) => {\n\t\tif (/[^\\t\\u0020-\\u007E\\u0080-\\u00FF]/.test(value)) {\n\t\t\tconst error = new TypeError(`Invalid character in header content [\"${name}\"]`);\n\t\t\tObject.defineProperty(error, 'code', {value: 'ERR_INVALID_CHAR'});\n\t\t\tthrow error;\n\t\t}\n\t};\n\n/**\n * @typedef {Headers | Record | Iterable | Iterable>} HeadersInit\n */\n\n/**\n * This Fetch API interface allows you to perform various actions on HTTP request and response headers.\n * These actions include retrieving, setting, adding to, and removing.\n * A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.\n * You can add to this using methods like append() (see Examples.)\n * In all methods of this interface, header names are matched by case-insensitive byte sequence.\n *\n */\nexport default class Headers extends URLSearchParams {\n\t/**\n\t * Headers class\n\t *\n\t * @constructor\n\t * @param {HeadersInit} [init] - Response headers\n\t */\n\tconstructor(init) {\n\t\t// Validate and normalize init object in [name, value(s)][]\n\t\t/** @type {string[][]} */\n\t\tlet result = [];\n\t\tif (init instanceof Headers) {\n\t\t\tconst raw = init.raw();\n\t\t\tfor (const [name, values] of Object.entries(raw)) {\n\t\t\t\tresult.push(...values.map(value => [name, value]));\n\t\t\t}\n\t\t} else if (init == null) { // eslint-disable-line no-eq-null, eqeqeq\n\t\t\t// No op\n\t\t} else if (typeof init === 'object' && !types.isBoxedPrimitive(init)) {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\t\tif (method == null) {\n\t\t\t\t// Record\n\t\t\t\tresult.push(...Object.entries(init));\n\t\t\t} else {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// Sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tresult = [...init]\n\t\t\t\t\t.map(pair => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof pair !== 'object' || types.isBoxedPrimitive(pair)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new TypeError('Each header pair must be an iterable object');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn [...pair];\n\t\t\t\t\t}).map(pair => {\n\t\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn [...pair];\n\t\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Failed to construct \\'Headers\\': The provided value is not of type \\'(sequence> or record)');\n\t\t}\n\n\t\t// Validate and lowercase\n\t\tresult =\n\t\t\tresult.length > 0 ?\n\t\t\t\tresult.map(([name, value]) => {\n\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\treturn [String(name).toLowerCase(), String(value)];\n\t\t\t\t}) :\n\t\t\t\tundefined;\n\n\t\tsuper(result);\n\n\t\t// Returning a Proxy that will lowercase key names, validate parameters and sort keys\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn new Proxy(this, {\n\t\t\tget(target, p, receiver) {\n\t\t\t\tswitch (p) {\n\t\t\t\t\tcase 'append':\n\t\t\t\t\tcase 'set':\n\t\t\t\t\t\treturn (name, value) => {\n\t\t\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\t\t\treturn URLSearchParams.prototype[p].call(\n\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\tString(name).toLowerCase(),\n\t\t\t\t\t\t\t\tString(value)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase 'delete':\n\t\t\t\t\tcase 'has':\n\t\t\t\t\tcase 'getAll':\n\t\t\t\t\t\treturn name => {\n\t\t\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\t\t\treturn URLSearchParams.prototype[p].call(\n\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\tString(name).toLowerCase()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase 'keys':\n\t\t\t\t\t\treturn () => {\n\t\t\t\t\t\t\ttarget.sort();\n\t\t\t\t\t\t\treturn new Set(URLSearchParams.prototype.keys.call(target)).keys();\n\t\t\t\t\t\t};\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn Reflect.get(target, p, receiver);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t/* c8 ignore next */\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn this.constructor.name;\n\t}\n\n\ttoString() {\n\t\treturn Object.prototype.toString.call(this);\n\t}\n\n\tget(name) {\n\t\tconst values = this.getAll(name);\n\t\tif (values.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet value = values.join(', ');\n\t\tif (/^content-encoding$/i.test(name)) {\n\t\t\tvalue = value.toLowerCase();\n\t\t}\n\n\t\treturn value;\n\t}\n\n\tforEach(callback, thisArg = undefined) {\n\t\tfor (const name of this.keys()) {\n\t\t\tReflect.apply(callback, thisArg, [this.get(name), name, this]);\n\t\t}\n\t}\n\n\t* values() {\n\t\tfor (const name of this.keys()) {\n\t\t\tyield this.get(name);\n\t\t}\n\t}\n\n\t/**\n\t * @type {() => IterableIterator<[string, string]>}\n\t */\n\t* entries() {\n\t\tfor (const name of this.keys()) {\n\t\t\tyield [name, this.get(name)];\n\t\t}\n\t}\n\n\t[Symbol.iterator]() {\n\t\treturn this.entries();\n\t}\n\n\t/**\n\t * Node-fetch non-spec method\n\t * returning all headers and their values as array\n\t * @returns {Record}\n\t */\n\traw() {\n\t\treturn [...this.keys()].reduce((result, key) => {\n\t\t\tresult[key] = this.getAll(key);\n\t\t\treturn result;\n\t\t}, {});\n\t}\n\n\t/**\n\t * For better console.log(headers) and also to convert Headers into Node.js Request compatible format\n\t */\n\t[Symbol.for('nodejs.util.inspect.custom')]() {\n\t\treturn [...this.keys()].reduce((result, key) => {\n\t\t\tconst values = this.getAll(key);\n\t\t\t// Http.request() only supports string as Host header.\n\t\t\t// This hack makes specifying custom Host header possible.\n\t\t\tif (key === 'host') {\n\t\t\t\tresult[key] = values[0];\n\t\t\t} else {\n\t\t\t\tresult[key] = values.length > 1 ? values : values[0];\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}, {});\n\t}\n}\n\n/**\n * Re-shaping object for Web IDL tests\n * Only need to do it for overridden methods\n */\nObject.defineProperties(\n\tHeaders.prototype,\n\t['get', 'entries', 'forEach', 'values'].reduce((result, property) => {\n\t\tresult[property] = {enumerable: true};\n\t\treturn result;\n\t}, {})\n);\n\n/**\n * Create a Headers object from an http.IncomingMessage.rawHeaders, ignoring those that do\n * not conform to HTTP grammar productions.\n * @param {import('http').IncomingMessage['rawHeaders']} headers\n */\nexport function fromRawHeaders(headers = []) {\n\treturn new Headers(\n\t\theaders\n\t\t\t// Split into pairs\n\t\t\t.reduce((result, value, index, array) => {\n\t\t\t\tif (index % 2 === 0) {\n\t\t\t\t\tresult.push(array.slice(index, index + 2));\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}, [])\n\t\t\t.filter(([name, value]) => {\n\t\t\t\ttry {\n\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\treturn true;\n\t\t\t\t} catch {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t})\n\n\t);\n}\n","const redirectStatus = new Set([301, 302, 303, 307, 308]);\n\n/**\n * Redirect code matching\n *\n * @param {number} code - Status code\n * @return {boolean}\n */\nexport const isRedirect = code => {\n\treturn redirectStatus.has(code);\n};\n","/**\n * Response.js\n *\n * Response class provides content decoding\n */\n\nimport Headers from './headers.js';\nimport Body, {clone, extractContentType} from './body.js';\nimport {isRedirect} from './utils/is-redirect.js';\n\nconst INTERNALS = Symbol('Response internals');\n\n/**\n * Response class\n *\n * Ref: https://fetch.spec.whatwg.org/#response-class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nexport default class Response extends Body {\n\tconstructor(body = null, options = {}) {\n\t\tsuper(body, options);\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq, no-negated-condition\n\t\tconst status = options.status != null ? options.status : 200;\n\n\t\tconst headers = new Headers(options.headers);\n\n\t\tif (body !== null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body, this);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS] = {\n\t\t\ttype: 'default',\n\t\t\turl: options.url,\n\t\t\tstatus,\n\t\t\tstatusText: options.statusText || '',\n\t\t\theaders,\n\t\t\tcounter: options.counter,\n\t\t\thighWaterMark: options.highWaterMark\n\t\t};\n\t}\n\n\tget type() {\n\t\treturn this[INTERNALS].type;\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS].status;\n\t}\n\n\t/**\n\t * Convenience property representing if the request ended normally\n\t */\n\tget ok() {\n\t\treturn this[INTERNALS].status >= 200 && this[INTERNALS].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS].headers;\n\t}\n\n\tget highWaterMark() {\n\t\treturn this[INTERNALS].highWaterMark;\n\t}\n\n\t/**\n\t * Clone this response\n\t *\n\t * @return Response\n\t */\n\tclone() {\n\t\treturn new Response(clone(this, this.highWaterMark), {\n\t\t\ttype: this.type,\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected,\n\t\t\tsize: this.size,\n\t\t\thighWaterMark: this.highWaterMark\n\t\t});\n\t}\n\n\t/**\n\t * @param {string} url The URL that the new response is to originate from.\n\t * @param {number} status An optional status code for the response (e.g., 302.)\n\t * @returns {Response} A Response object.\n\t */\n\tstatic redirect(url, status = 302) {\n\t\tif (!isRedirect(status)) {\n\t\t\tthrow new RangeError('Failed to execute \"redirect\" on \"response\": Invalid status code');\n\t\t}\n\n\t\treturn new Response(null, {\n\t\t\theaders: {\n\t\t\t\tlocation: new URL(url).toString()\n\t\t\t},\n\t\t\tstatus\n\t\t});\n\t}\n\n\tstatic error() {\n\t\tconst response = new Response(null, {status: 0, statusText: ''});\n\t\tresponse[INTERNALS].type = 'error';\n\t\treturn response;\n\t}\n\n\tstatic json(data = undefined, init = {}) {\n\t\tconst body = JSON.stringify(data);\n\n\t\tif (body === undefined) {\n\t\t\tthrow new TypeError('data is not JSON serializable');\n\t\t}\n\n\t\tconst headers = new Headers(init && init.headers);\n\n\t\tif (!headers.has('content-type')) {\n\t\t\theaders.set('content-type', 'application/json');\n\t\t}\n\n\t\treturn new Response(body, {\n\t\t\t...init,\n\t\t\theaders\n\t\t});\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Response';\n\t}\n}\n\nObject.defineProperties(Response.prototype, {\n\ttype: {enumerable: true},\n\turl: {enumerable: true},\n\tstatus: {enumerable: true},\n\tok: {enumerable: true},\n\tredirected: {enumerable: true},\n\tstatusText: {enumerable: true},\n\theaders: {enumerable: true},\n\tclone: {enumerable: true}\n});\n","export const getSearch = parsedURL => {\n\tif (parsedURL.search) {\n\t\treturn parsedURL.search;\n\t}\n\n\tconst lastOffset = parsedURL.href.length - 1;\n\tconst hash = parsedURL.hash || (parsedURL.href[lastOffset] === '#' ? '#' : '');\n\treturn parsedURL.href[lastOffset - hash.length] === '?' ? '?' : '';\n};\n","import {isIP} from 'node:net';\n\n/**\n * @external URL\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/URL|URL}\n */\n\n/**\n * @module utils/referrer\n * @private\n */\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#strip-url|Referrer Policy §8.4. Strip url for use as a referrer}\n * @param {string} URL\n * @param {boolean} [originOnly=false]\n */\nexport function stripURLForUseAsAReferrer(url, originOnly = false) {\n\t// 1. If url is null, return no referrer.\n\tif (url == null) { // eslint-disable-line no-eq-null, eqeqeq\n\t\treturn 'no-referrer';\n\t}\n\n\turl = new URL(url);\n\n\t// 2. If url's scheme is a local scheme, then return no referrer.\n\tif (/^(about|blob|data):$/.test(url.protocol)) {\n\t\treturn 'no-referrer';\n\t}\n\n\t// 3. Set url's username to the empty string.\n\turl.username = '';\n\n\t// 4. Set url's password to null.\n\t// Note: `null` appears to be a mistake as this actually results in the password being `\"null\"`.\n\turl.password = '';\n\n\t// 5. Set url's fragment to null.\n\t// Note: `null` appears to be a mistake as this actually results in the fragment being `\"#null\"`.\n\turl.hash = '';\n\n\t// 6. If the origin-only flag is true, then:\n\tif (originOnly) {\n\t\t// 6.1. Set url's path to null.\n\t\t// Note: `null` appears to be a mistake as this actually results in the path being `\"/null\"`.\n\t\turl.pathname = '';\n\n\t\t// 6.2. Set url's query to null.\n\t\t// Note: `null` appears to be a mistake as this actually results in the query being `\"?null\"`.\n\t\turl.search = '';\n\t}\n\n\t// 7. Return url.\n\treturn url;\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#enumdef-referrerpolicy|enum ReferrerPolicy}\n */\nexport const ReferrerPolicy = new Set([\n\t'',\n\t'no-referrer',\n\t'no-referrer-when-downgrade',\n\t'same-origin',\n\t'origin',\n\t'strict-origin',\n\t'origin-when-cross-origin',\n\t'strict-origin-when-cross-origin',\n\t'unsafe-url'\n]);\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#default-referrer-policy|default referrer policy}\n */\nexport const DEFAULT_REFERRER_POLICY = 'strict-origin-when-cross-origin';\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#referrer-policies|Referrer Policy §3. Referrer Policies}\n * @param {string} referrerPolicy\n * @returns {string} referrerPolicy\n */\nexport function validateReferrerPolicy(referrerPolicy) {\n\tif (!ReferrerPolicy.has(referrerPolicy)) {\n\t\tthrow new TypeError(`Invalid referrerPolicy: ${referrerPolicy}`);\n\t}\n\n\treturn referrerPolicy;\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy|Referrer Policy §3.2. Is origin potentially trustworthy?}\n * @param {external:URL} url\n * @returns `true`: \"Potentially Trustworthy\", `false`: \"Not Trustworthy\"\n */\nexport function isOriginPotentiallyTrustworthy(url) {\n\t// 1. If origin is an opaque origin, return \"Not Trustworthy\".\n\t// Not applicable\n\n\t// 2. Assert: origin is a tuple origin.\n\t// Not for implementations\n\n\t// 3. If origin's scheme is either \"https\" or \"wss\", return \"Potentially Trustworthy\".\n\tif (/^(http|ws)s:$/.test(url.protocol)) {\n\t\treturn true;\n\t}\n\n\t// 4. If origin's host component matches one of the CIDR notations 127.0.0.0/8 or ::1/128 [RFC4632], return \"Potentially Trustworthy\".\n\tconst hostIp = url.host.replace(/(^\\[)|(]$)/g, '');\n\tconst hostIPVersion = isIP(hostIp);\n\n\tif (hostIPVersion === 4 && /^127\\./.test(hostIp)) {\n\t\treturn true;\n\t}\n\n\tif (hostIPVersion === 6 && /^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(hostIp)) {\n\t\treturn true;\n\t}\n\n\t// 5. If origin's host component is \"localhost\" or falls within \".localhost\", and the user agent conforms to the name resolution rules in [let-localhost-be-localhost], return \"Potentially Trustworthy\".\n\t// We are returning FALSE here because we cannot ensure conformance to\n\t// let-localhost-be-loalhost (https://tools.ietf.org/html/draft-west-let-localhost-be-localhost)\n\tif (url.host === 'localhost' || url.host.endsWith('.localhost')) {\n\t\treturn false;\n\t}\n\n\t// 6. If origin's scheme component is file, return \"Potentially Trustworthy\".\n\tif (url.protocol === 'file:') {\n\t\treturn true;\n\t}\n\n\t// 7. If origin's scheme component is one which the user agent considers to be authenticated, return \"Potentially Trustworthy\".\n\t// Not supported\n\n\t// 8. If origin has been configured as a trustworthy origin, return \"Potentially Trustworthy\".\n\t// Not supported\n\n\t// 9. Return \"Not Trustworthy\".\n\treturn false;\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-secure-contexts/#is-url-trustworthy|Referrer Policy §3.3. Is url potentially trustworthy?}\n * @param {external:URL} url\n * @returns `true`: \"Potentially Trustworthy\", `false`: \"Not Trustworthy\"\n */\nexport function isUrlPotentiallyTrustworthy(url) {\n\t// 1. If url is \"about:blank\" or \"about:srcdoc\", return \"Potentially Trustworthy\".\n\tif (/^about:(blank|srcdoc)$/.test(url)) {\n\t\treturn true;\n\t}\n\n\t// 2. If url's scheme is \"data\", return \"Potentially Trustworthy\".\n\tif (url.protocol === 'data:') {\n\t\treturn true;\n\t}\n\n\t// Note: The origin of blob: and filesystem: URLs is the origin of the context in which they were\n\t// created. Therefore, blobs created in a trustworthy origin will themselves be potentially\n\t// trustworthy.\n\tif (/^(blob|filesystem):$/.test(url.protocol)) {\n\t\treturn true;\n\t}\n\n\t// 3. Return the result of executing §3.2 Is origin potentially trustworthy? on url's origin.\n\treturn isOriginPotentiallyTrustworthy(url);\n}\n\n/**\n * Modifies the referrerURL to enforce any extra security policy considerations.\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer|Referrer Policy §8.3. Determine request's Referrer}, step 7\n * @callback module:utils/referrer~referrerURLCallback\n * @param {external:URL} referrerURL\n * @returns {external:URL} modified referrerURL\n */\n\n/**\n * Modifies the referrerOrigin to enforce any extra security policy considerations.\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer|Referrer Policy §8.3. Determine request's Referrer}, step 7\n * @callback module:utils/referrer~referrerOriginCallback\n * @param {external:URL} referrerOrigin\n * @returns {external:URL} modified referrerOrigin\n */\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer|Referrer Policy §8.3. Determine request's Referrer}\n * @param {Request} request\n * @param {object} o\n * @param {module:utils/referrer~referrerURLCallback} o.referrerURLCallback\n * @param {module:utils/referrer~referrerOriginCallback} o.referrerOriginCallback\n * @returns {external:URL} Request's referrer\n */\nexport function determineRequestsReferrer(request, {referrerURLCallback, referrerOriginCallback} = {}) {\n\t// There are 2 notes in the specification about invalid pre-conditions. We return null, here, for\n\t// these cases:\n\t// > Note: If request's referrer is \"no-referrer\", Fetch will not call into this algorithm.\n\t// > Note: If request's referrer policy is the empty string, Fetch will not call into this\n\t// > algorithm.\n\tif (request.referrer === 'no-referrer' || request.referrerPolicy === '') {\n\t\treturn null;\n\t}\n\n\t// 1. Let policy be request's associated referrer policy.\n\tconst policy = request.referrerPolicy;\n\n\t// 2. Let environment be request's client.\n\t// not applicable to node.js\n\n\t// 3. Switch on request's referrer:\n\tif (request.referrer === 'about:client') {\n\t\treturn 'no-referrer';\n\t}\n\n\t// \"a URL\": Let referrerSource be request's referrer.\n\tconst referrerSource = request.referrer;\n\n\t// 4. Let request's referrerURL be the result of stripping referrerSource for use as a referrer.\n\tlet referrerURL = stripURLForUseAsAReferrer(referrerSource);\n\n\t// 5. Let referrerOrigin be the result of stripping referrerSource for use as a referrer, with the\n\t// origin-only flag set to true.\n\tlet referrerOrigin = stripURLForUseAsAReferrer(referrerSource, true);\n\n\t// 6. If the result of serializing referrerURL is a string whose length is greater than 4096, set\n\t// referrerURL to referrerOrigin.\n\tif (referrerURL.toString().length > 4096) {\n\t\treferrerURL = referrerOrigin;\n\t}\n\n\t// 7. The user agent MAY alter referrerURL or referrerOrigin at this point to enforce arbitrary\n\t// policy considerations in the interests of minimizing data leakage. For example, the user\n\t// agent could strip the URL down to an origin, modify its host, replace it with an empty\n\t// string, etc.\n\tif (referrerURLCallback) {\n\t\treferrerURL = referrerURLCallback(referrerURL);\n\t}\n\n\tif (referrerOriginCallback) {\n\t\treferrerOrigin = referrerOriginCallback(referrerOrigin);\n\t}\n\n\t// 8.Execute the statements corresponding to the value of policy:\n\tconst currentURL = new URL(request.url);\n\n\tswitch (policy) {\n\t\tcase 'no-referrer':\n\t\t\treturn 'no-referrer';\n\n\t\tcase 'origin':\n\t\t\treturn referrerOrigin;\n\n\t\tcase 'unsafe-url':\n\t\t\treturn referrerURL;\n\n\t\tcase 'strict-origin':\n\t\t\t// 1. If referrerURL is a potentially trustworthy URL and request's current URL is not a\n\t\t\t// potentially trustworthy URL, then return no referrer.\n\t\t\tif (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) {\n\t\t\t\treturn 'no-referrer';\n\t\t\t}\n\n\t\t\t// 2. Return referrerOrigin.\n\t\t\treturn referrerOrigin.toString();\n\n\t\tcase 'strict-origin-when-cross-origin':\n\t\t\t// 1. If the origin of referrerURL and the origin of request's current URL are the same, then\n\t\t\t// return referrerURL.\n\t\t\tif (referrerURL.origin === currentURL.origin) {\n\t\t\t\treturn referrerURL;\n\t\t\t}\n\n\t\t\t// 2. If referrerURL is a potentially trustworthy URL and request's current URL is not a\n\t\t\t// potentially trustworthy URL, then return no referrer.\n\t\t\tif (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) {\n\t\t\t\treturn 'no-referrer';\n\t\t\t}\n\n\t\t\t// 3. Return referrerOrigin.\n\t\t\treturn referrerOrigin;\n\n\t\tcase 'same-origin':\n\t\t\t// 1. If the origin of referrerURL and the origin of request's current URL are the same, then\n\t\t\t// return referrerURL.\n\t\t\tif (referrerURL.origin === currentURL.origin) {\n\t\t\t\treturn referrerURL;\n\t\t\t}\n\n\t\t\t// 2. Return no referrer.\n\t\t\treturn 'no-referrer';\n\n\t\tcase 'origin-when-cross-origin':\n\t\t\t// 1. If the origin of referrerURL and the origin of request's current URL are the same, then\n\t\t\t// return referrerURL.\n\t\t\tif (referrerURL.origin === currentURL.origin) {\n\t\t\t\treturn referrerURL;\n\t\t\t}\n\n\t\t\t// Return referrerOrigin.\n\t\t\treturn referrerOrigin;\n\n\t\tcase 'no-referrer-when-downgrade':\n\t\t\t// 1. If referrerURL is a potentially trustworthy URL and request's current URL is not a\n\t\t\t// potentially trustworthy URL, then return no referrer.\n\t\t\tif (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) {\n\t\t\t\treturn 'no-referrer';\n\t\t\t}\n\n\t\t\t// 2. Return referrerURL.\n\t\t\treturn referrerURL;\n\n\t\tdefault:\n\t\t\tthrow new TypeError(`Invalid referrerPolicy: ${policy}`);\n\t}\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#parse-referrer-policy-from-header|Referrer Policy §8.1. Parse a referrer policy from a Referrer-Policy header}\n * @param {Headers} headers Response headers\n * @returns {string} policy\n */\nexport function parseReferrerPolicyFromHeader(headers) {\n\t// 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy`\n\t// and response’s header list.\n\tconst policyTokens = (headers.get('referrer-policy') || '').split(/[,\\s]+/);\n\n\t// 2. Let policy be the empty string.\n\tlet policy = '';\n\n\t// 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty\n\t// string, then set policy to token.\n\t// Note: This algorithm loops over multiple policy values to allow deployment of new policy\n\t// values with fallbacks for older user agents, as described in § 11.1 Unknown Policy Values.\n\tfor (const token of policyTokens) {\n\t\tif (token && ReferrerPolicy.has(token)) {\n\t\t\tpolicy = token;\n\t\t}\n\t}\n\n\t// 4. Return policy.\n\treturn policy;\n}\n","/**\n * Request.js\n *\n * Request class contains server only options\n *\n * All spec algorithm step numbers are based on https://fetch.spec.whatwg.org/commit-snapshots/ae716822cb3a61843226cd090eefc6589446c1d2/.\n */\n\nimport {format as formatUrl} from 'node:url';\nimport {deprecate} from 'node:util';\nimport Headers from './headers.js';\nimport Body, {clone, extractContentType, getTotalBytes} from './body.js';\nimport {isAbortSignal} from './utils/is.js';\nimport {getSearch} from './utils/get-search.js';\nimport {\n\tvalidateReferrerPolicy, determineRequestsReferrer, DEFAULT_REFERRER_POLICY\n} from './utils/referrer.js';\n\nconst INTERNALS = Symbol('Request internals');\n\n/**\n * Check if `obj` is an instance of Request.\n *\n * @param {*} object\n * @return {boolean}\n */\nconst isRequest = object => {\n\treturn (\n\t\ttypeof object === 'object' &&\n\t\ttypeof object[INTERNALS] === 'object'\n\t);\n};\n\nconst doBadDataWarn = deprecate(() => {},\n\t'.data is not a valid RequestInit property, use .body instead',\n\t'https://github.com/node-fetch/node-fetch/issues/1000 (request)');\n\n/**\n * Request class\n *\n * Ref: https://fetch.spec.whatwg.org/#request-class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nexport default class Request extends Body {\n\tconstructor(input, init = {}) {\n\t\tlet parsedURL;\n\n\t\t// Normalize input and force URL to be encoded as UTF-8 (https://github.com/node-fetch/node-fetch/issues/245)\n\t\tif (isRequest(input)) {\n\t\t\tparsedURL = new URL(input.url);\n\t\t} else {\n\t\t\tparsedURL = new URL(input);\n\t\t\tinput = {};\n\t\t}\n\n\t\tif (parsedURL.username !== '' || parsedURL.password !== '') {\n\t\t\tthrow new TypeError(`${parsedURL} is an url with embedded credentials.`);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tif (/^(delete|get|head|options|post|put)$/i.test(method)) {\n\t\t\tmethod = method.toUpperCase();\n\t\t}\n\n\t\tif (!isRequest(init) && 'data' in init) {\n\t\t\tdoBadDataWarn();\n\t\t}\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tif ((init.body != null || (isRequest(input) && input.body !== null)) &&\n\t\t\t(method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tconst inputBody = init.body ?\n\t\t\tinit.body :\n\t\t\t(isRequest(input) && input.body !== null ?\n\t\t\t\tclone(input) :\n\t\t\t\tnull);\n\n\t\tsuper(inputBody, {\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody !== null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody, this);\n\t\t\tif (contentType) {\n\t\t\t\theaders.set('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ?\n\t\t\tinput.signal :\n\t\t\tnull;\n\t\tif ('signal' in init) {\n\t\t\tsignal = init.signal;\n\t\t}\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal or EventTarget');\n\t\t}\n\n\t\t// §5.4, Request constructor steps, step 15.1\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tlet referrer = init.referrer == null ? input.referrer : init.referrer;\n\t\tif (referrer === '') {\n\t\t\t// §5.4, Request constructor steps, step 15.2\n\t\t\treferrer = 'no-referrer';\n\t\t} else if (referrer) {\n\t\t\t// §5.4, Request constructor steps, step 15.3.1, 15.3.2\n\t\t\tconst parsedReferrer = new URL(referrer);\n\t\t\t// §5.4, Request constructor steps, step 15.3.3, 15.3.4\n\t\t\treferrer = /^about:(\\/\\/)?client$/.test(parsedReferrer) ? 'client' : parsedReferrer;\n\t\t} else {\n\t\t\treferrer = undefined;\n\t\t}\n\n\t\tthis[INTERNALS] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal,\n\t\t\treferrer\n\t\t};\n\n\t\t// Node-fetch-only options\n\t\tthis.follow = init.follow === undefined ? (input.follow === undefined ? 20 : input.follow) : init.follow;\n\t\tthis.compress = init.compress === undefined ? (input.compress === undefined ? true : input.compress) : init.compress;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t\tthis.highWaterMark = init.highWaterMark || input.highWaterMark || 16384;\n\t\tthis.insecureHTTPParser = init.insecureHTTPParser || input.insecureHTTPParser || false;\n\n\t\t// §5.4, Request constructor steps, step 16.\n\t\t// Default is empty string per https://fetch.spec.whatwg.org/#concept-request-referrer-policy\n\t\tthis.referrerPolicy = init.referrerPolicy || input.referrerPolicy || '';\n\t}\n\n\t/** @returns {string} */\n\tget method() {\n\t\treturn this[INTERNALS].method;\n\t}\n\n\t/** @returns {string} */\n\tget url() {\n\t\treturn formatUrl(this[INTERNALS].parsedURL);\n\t}\n\n\t/** @returns {Headers} */\n\tget headers() {\n\t\treturn this[INTERNALS].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS].redirect;\n\t}\n\n\t/** @returns {AbortSignal} */\n\tget signal() {\n\t\treturn this[INTERNALS].signal;\n\t}\n\n\t// https://fetch.spec.whatwg.org/#dom-request-referrer\n\tget referrer() {\n\t\tif (this[INTERNALS].referrer === 'no-referrer') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (this[INTERNALS].referrer === 'client') {\n\t\t\treturn 'about:client';\n\t\t}\n\n\t\tif (this[INTERNALS].referrer) {\n\t\t\treturn this[INTERNALS].referrer.toString();\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tget referrerPolicy() {\n\t\treturn this[INTERNALS].referrerPolicy;\n\t}\n\n\tset referrerPolicy(referrerPolicy) {\n\t\tthis[INTERNALS].referrerPolicy = validateReferrerPolicy(referrerPolicy);\n\t}\n\n\t/**\n\t * Clone this request\n\t *\n\t * @return Request\n\t */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Request';\n\t}\n}\n\nObject.defineProperties(Request.prototype, {\n\tmethod: {enumerable: true},\n\turl: {enumerable: true},\n\theaders: {enumerable: true},\n\tredirect: {enumerable: true},\n\tclone: {enumerable: true},\n\tsignal: {enumerable: true},\n\treferrer: {enumerable: true},\n\treferrerPolicy: {enumerable: true}\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param {Request} request - A Request instance\n * @return The options object to be passed to http.request\n */\nexport const getNodeRequestOptions = request => {\n\tconst {parsedURL} = request[INTERNALS];\n\tconst headers = new Headers(request[INTERNALS].headers);\n\n\t// Fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body === null && /^(post|put)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\n\tif (request.body !== null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\t// Set Content-Length if totalBytes is a number (that is not NaN)\n\t\tif (typeof totalBytes === 'number' && !Number.isNaN(totalBytes)) {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// 4.1. Main fetch, step 2.6\n\t// > If request's referrer policy is the empty string, then set request's referrer policy to the\n\t// > default referrer policy.\n\tif (request.referrerPolicy === '') {\n\t\trequest.referrerPolicy = DEFAULT_REFERRER_POLICY;\n\t}\n\n\t// 4.1. Main fetch, step 2.7\n\t// > If request's referrer is not \"no-referrer\", set request's referrer to the result of invoking\n\t// > determine request's referrer.\n\tif (request.referrer && request.referrer !== 'no-referrer') {\n\t\trequest[INTERNALS].referrer = determineRequestsReferrer(request);\n\t} else {\n\t\trequest[INTERNALS].referrer = 'no-referrer';\n\t}\n\n\t// 4.5. HTTP-network-or-cache fetch, step 6.9\n\t// > If httpRequest's referrer is a URL, then append `Referer`/httpRequest's referrer, serialized\n\t// > and isomorphic encoded, to httpRequest's header list.\n\tif (request[INTERNALS].referrer instanceof URL) {\n\t\theaders.set('Referer', request.referrer);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip, deflate, br');\n\t}\n\n\tlet {agent} = request;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\tconst search = getSearch(parsedURL);\n\n\t// Pass the full URL directly to request(), but overwrite the following\n\t// options:\n\tconst options = {\n\t\t// Overwrite search to retain trailing ? (issue #776)\n\t\tpath: parsedURL.pathname + search,\n\t\t// The following options are not expressed in the URL\n\t\tmethod: request.method,\n\t\theaders: headers[Symbol.for('nodejs.util.inspect.custom')](),\n\t\tinsecureHTTPParser: request.insecureHTTPParser,\n\t\tagent\n\t};\n\n\treturn {\n\t\t/** @type {URL} */\n\t\tparsedURL,\n\t\toptions\n\t};\n};\n","import {FetchBaseError} from './base.js';\n\n/**\n * AbortError interface for cancelled requests\n */\nexport class AbortError extends FetchBaseError {\n\tconstructor(message, type = 'aborted') {\n\t\tsuper(message, type);\n\t}\n}\n","/*! node-domexception. MIT License. Jimmy Wärting */\n\nif (!globalThis.DOMException) {\n try {\n const { MessageChannel } = require('worker_threads'),\n port = new MessageChannel().port1,\n ab = new ArrayBuffer()\n port.postMessage(ab, [ab, ab])\n } catch (err) {\n err.constructor.name === 'DOMException' && (\n globalThis.DOMException = err.constructor\n )\n }\n}\n\nmodule.exports = globalThis.DOMException\n","import { statSync, createReadStream, promises as fs } from 'node:fs'\nimport { basename } from 'node:path'\nimport DOMException from 'node-domexception'\n\nimport File from './file.js'\nimport Blob from './index.js'\n\nconst { stat } = fs\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n */\nconst blobFromSync = (path, type) => fromBlob(statSync(path), path, type)\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n * @returns {Promise}\n */\nconst blobFrom = (path, type) => stat(path).then(stat => fromBlob(stat, path, type))\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n * @returns {Promise}\n */\nconst fileFrom = (path, type) => stat(path).then(stat => fromFile(stat, path, type))\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n */\nconst fileFromSync = (path, type) => fromFile(statSync(path), path, type)\n\n// @ts-ignore\nconst fromBlob = (stat, path, type = '') => new Blob([new BlobDataItem({\n path,\n size: stat.size,\n lastModified: stat.mtimeMs,\n start: 0\n})], { type })\n\n// @ts-ignore\nconst fromFile = (stat, path, type = '') => new File([new BlobDataItem({\n path,\n size: stat.size,\n lastModified: stat.mtimeMs,\n start: 0\n})], basename(path), { type, lastModified: stat.mtimeMs })\n\n/**\n * This is a blob backed up by a file on the disk\n * with minium requirement. Its wrapped around a Blob as a blobPart\n * so you have no direct access to this.\n *\n * @private\n */\nclass BlobDataItem {\n #path\n #start\n\n constructor (options) {\n this.#path = options.path\n this.#start = options.start\n this.size = options.size\n this.lastModified = options.lastModified\n }\n\n /**\n * Slicing arguments is first validated and formatted\n * to not be out of range by Blob.prototype.slice\n */\n slice (start, end) {\n return new BlobDataItem({\n path: this.#path,\n lastModified: this.lastModified,\n size: end - start,\n start: this.#start + start\n })\n }\n\n async * stream () {\n const { mtimeMs } = await stat(this.#path)\n if (mtimeMs > this.lastModified) {\n throw new DOMException('The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.', 'NotReadableError')\n }\n yield * createReadStream(this.#path, {\n start: this.#start,\n end: this.#start + this.size - 1\n })\n }\n\n get [Symbol.toStringTag] () {\n return 'Blob'\n }\n}\n\nexport default blobFromSync\nexport { File, Blob, blobFrom, blobFromSync, fileFrom, fileFromSync }\n","/**\n * Index.js\n *\n * a request API compatible with window.fetch\n *\n * All spec algorithm step numbers are based on https://fetch.spec.whatwg.org/commit-snapshots/ae716822cb3a61843226cd090eefc6589446c1d2/.\n */\n\nimport http from 'node:http';\nimport https from 'node:https';\nimport zlib from 'node:zlib';\nimport Stream, {PassThrough, pipeline as pump} from 'node:stream';\nimport {Buffer} from 'node:buffer';\n\nimport dataUriToBuffer from 'data-uri-to-buffer';\n\nimport {writeToStream, clone} from './body.js';\nimport Response from './response.js';\nimport Headers, {fromRawHeaders} from './headers.js';\nimport Request, {getNodeRequestOptions} from './request.js';\nimport {FetchError} from './errors/fetch-error.js';\nimport {AbortError} from './errors/abort-error.js';\nimport {isRedirect} from './utils/is-redirect.js';\nimport {FormData} from 'formdata-polyfill/esm.min.js';\nimport {isDomainOrSubdomain, isSameProtocol} from './utils/is.js';\nimport {parseReferrerPolicyFromHeader} from './utils/referrer.js';\nimport {\n\tBlob,\n\tFile,\n\tfileFromSync,\n\tfileFrom,\n\tblobFromSync,\n\tblobFrom\n} from 'fetch-blob/from.js';\n\nexport {FormData, Headers, Request, Response, FetchError, AbortError, isRedirect};\nexport {Blob, File, fileFromSync, fileFrom, blobFromSync, blobFrom};\n\nconst supportedSchemas = new Set(['data:', 'http:', 'https:']);\n\n/**\n * Fetch function\n *\n * @param {string | URL | import('./request').default} url - Absolute url or Request instance\n * @param {*} [options_] - Fetch options\n * @return {Promise}\n */\nexport default async function fetch(url, options_) {\n\treturn new Promise((resolve, reject) => {\n\t\t// Build request object\n\t\tconst request = new Request(url, options_);\n\t\tconst {parsedURL, options} = getNodeRequestOptions(request);\n\t\tif (!supportedSchemas.has(parsedURL.protocol)) {\n\t\t\tthrow new TypeError(`node-fetch cannot load ${url}. URL scheme \"${parsedURL.protocol.replace(/:$/, '')}\" is not supported.`);\n\t\t}\n\n\t\tif (parsedURL.protocol === 'data:') {\n\t\t\tconst data = dataUriToBuffer(request.url);\n\t\t\tconst response = new Response(data, {headers: {'Content-Type': data.typeFull}});\n\t\t\tresolve(response);\n\t\t\treturn;\n\t\t}\n\n\t\t// Wrap http.request into fetch\n\t\tconst send = (parsedURL.protocol === 'https:' ? https : http).request;\n\t\tconst {signal} = request;\n\t\tlet response = null;\n\n\t\tconst abort = () => {\n\t\t\tconst error = new AbortError('The operation was aborted.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\n\t\t\tif (!response || !response.body) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = () => {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// Send request\n\t\tconst request_ = send(parsedURL.toString(), options);\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tconst finalize = () => {\n\t\t\trequest_.abort();\n\t\t\tif (signal) {\n\t\t\t\tsignal.removeEventListener('abort', abortAndFinalize);\n\t\t\t}\n\t\t};\n\n\t\trequest_.on('error', error => {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${error.message}`, 'system', error));\n\t\t\tfinalize();\n\t\t});\n\n\t\tfixResponseChunkedTransferBadEnding(request_, error => {\n\t\t\tif (response && response.body) {\n\t\t\t\tresponse.body.destroy(error);\n\t\t\t}\n\t\t});\n\n\t\t/* c8 ignore next 18 */\n\t\tif (process.version < 'v14') {\n\t\t\t// Before Node.js 14, pipeline() does not fully support async iterators and does not always\n\t\t\t// properly handle when the socket close/end events are out of order.\n\t\t\trequest_.on('socket', s => {\n\t\t\t\tlet endedWithEventsCount;\n\t\t\t\ts.prependListener('end', () => {\n\t\t\t\t\tendedWithEventsCount = s._eventsCount;\n\t\t\t\t});\n\t\t\t\ts.prependListener('close', hadError => {\n\t\t\t\t\t// if end happened before close but the socket didn't emit an error, do it now\n\t\t\t\t\tif (response && endedWithEventsCount < s._eventsCount && !hadError) {\n\t\t\t\t\t\tconst error = new Error('Premature close');\n\t\t\t\t\t\terror.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\t\t\tresponse.body.emit('error', error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\trequest_.on('response', response_ => {\n\t\t\trequest_.setTimeout(0);\n\t\t\tconst headers = fromRawHeaders(response_.rawHeaders);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (isRedirect(response_.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tlet locationURL = null;\n\t\t\t\ttry {\n\t\t\t\t\tlocationURL = location === null ? null : new URL(location, request.url);\n\t\t\t\t} catch {\n\t\t\t\t\t// error here can only be invalid URL in Location: header\n\t\t\t\t\t// do not throw when options.redirect == manual\n\t\t\t\t\t// let the user extract the errorneous redirect URL\n\t\t\t\t\tif (request.redirect !== 'manual') {\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// Nothing to do\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow': {\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOptions = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: clone(request),\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\tsize: request.size,\n\t\t\t\t\t\t\treferrer: request.referrer,\n\t\t\t\t\t\t\treferrerPolicy: request.referrerPolicy\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// when forwarding sensitive headers like \"Authorization\",\n\t\t\t\t\t\t// \"WWW-Authenticate\", and \"Cookie\" to untrusted targets,\n\t\t\t\t\t\t// headers will be ignored when following a redirect to a domain\n\t\t\t\t\t\t// that is not a subdomain match or exact match of the initial domain.\n\t\t\t\t\t\t// For example, a redirect from \"foo.com\" to either \"foo.com\" or \"sub.foo.com\"\n\t\t\t\t\t\t// will forward the sensitive headers, but a redirect to \"bar.com\" will not.\n\t\t\t\t\t\t// headers will also be ignored when following a redirect to a domain using\n\t\t\t\t\t\t// a different protocol. For example, a redirect from \"https://foo.com\" to \"http://foo.com\"\n\t\t\t\t\t\t// will not forward the sensitive headers\n\t\t\t\t\t\tif (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {\n\t\t\t\t\t\t\tfor (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {\n\t\t\t\t\t\t\t\trequestOptions.headers.delete(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (response_.statusCode !== 303 && request.body && options_.body instanceof Stream.Readable) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (response_.statusCode === 303 || ((response_.statusCode === 301 || response_.statusCode === 302) && request.method === 'POST')) {\n\t\t\t\t\t\t\trequestOptions.method = 'GET';\n\t\t\t\t\t\t\trequestOptions.body = undefined;\n\t\t\t\t\t\t\trequestOptions.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 14\n\t\t\t\t\t\tconst responseReferrerPolicy = parseReferrerPolicyFromHeader(headers);\n\t\t\t\t\t\tif (responseReferrerPolicy) {\n\t\t\t\t\t\t\trequestOptions.referrerPolicy = responseReferrerPolicy;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOptions)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn reject(new TypeError(`Redirect option '${request.redirect}' is not a valid value of RequestRedirect`));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Prepare response\n\t\t\tif (signal) {\n\t\t\t\tresponse_.once('end', () => {\n\t\t\t\t\tsignal.removeEventListener('abort', abortAndFinalize);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tlet body = pump(response_, new PassThrough(), error => {\n\t\t\t\tif (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t});\n\t\t\t// see https://github.com/nodejs/node/pull/29376\n\t\t\t/* c8 ignore next 3 */\n\t\t\tif (process.version < 'v12.10') {\n\t\t\t\tresponse_.on('aborted', abortAndFinalize);\n\t\t\t}\n\n\t\t\tconst responseOptions = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: response_.statusCode,\n\t\t\t\tstatusText: response_.statusMessage,\n\t\t\t\theaders,\n\t\t\t\tsize: request.size,\n\t\t\t\tcounter: request.counter,\n\t\t\t\thighWaterMark: request.highWaterMark\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || response_.statusCode === 204 || response_.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// For gzip\n\t\t\tif (codings === 'gzip' || codings === 'x-gzip') {\n\t\t\t\tbody = pump(body, zlib.createGunzip(zlibOptions), error => {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For deflate\n\t\t\tif (codings === 'deflate' || codings === 'x-deflate') {\n\t\t\t\t// Handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = pump(response_, new PassThrough(), error => {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\traw.once('data', chunk => {\n\t\t\t\t\t// See http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = pump(body, zlib.createInflate(), error => {\n\t\t\t\t\t\t\tif (error) {\n\t\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = pump(body, zlib.createInflateRaw(), error => {\n\t\t\t\t\t\t\tif (error) {\n\t\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\traw.once('end', () => {\n\t\t\t\t\t// Some old IIS servers return zero-length OK deflate responses, so\n\t\t\t\t\t// 'data' is never emitted. See https://github.com/node-fetch/node-fetch/pull/903\n\t\t\t\t\tif (!response) {\n\t\t\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For br\n\t\t\tif (codings === 'br') {\n\t\t\t\tbody = pump(body, zlib.createBrotliDecompress(), error => {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Otherwise, use response as-is\n\t\t\tresponse = new Response(body, responseOptions);\n\t\t\tresolve(response);\n\t\t});\n\n\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\twriteToStream(request_, request).catch(reject);\n\t});\n}\n\nfunction fixResponseChunkedTransferBadEnding(request, errorCallback) {\n\tconst LAST_CHUNK = Buffer.from('0\\r\\n\\r\\n');\n\n\tlet isChunkedTransfer = false;\n\tlet properLastChunkReceived = false;\n\tlet previousChunk;\n\n\trequest.on('response', response => {\n\t\tconst {headers} = response;\n\t\tisChunkedTransfer = headers['transfer-encoding'] === 'chunked' && !headers['content-length'];\n\t});\n\n\trequest.on('socket', socket => {\n\t\tconst onSocketClose = () => {\n\t\t\tif (isChunkedTransfer && !properLastChunkReceived) {\n\t\t\t\tconst error = new Error('Premature close');\n\t\t\t\terror.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\terrorCallback(error);\n\t\t\t}\n\t\t};\n\n\t\tconst onData = buf => {\n\t\t\tproperLastChunkReceived = Buffer.compare(buf.slice(-5), LAST_CHUNK) === 0;\n\n\t\t\t// Sometimes final 0-length chunk and end of message code are in separate packets\n\t\t\tif (!properLastChunkReceived && previousChunk) {\n\t\t\t\tproperLastChunkReceived = (\n\t\t\t\t\tBuffer.compare(previousChunk.slice(-3), LAST_CHUNK.slice(0, 3)) === 0 &&\n\t\t\t\t\tBuffer.compare(buf.slice(-2), LAST_CHUNK.slice(3)) === 0\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tpreviousChunk = buf;\n\t\t};\n\n\t\tsocket.prependListener('close', onSocketClose);\n\t\tsocket.on('data', onData);\n\n\t\trequest.on('close', () => {\n\t\t\tsocket.removeListener('close', onSocketClose);\n\t\t\tsocket.removeListener('data', onData);\n\t\t});\n\t});\n}\n"],"names":["exports","this","global","require$$2","F","C","promisify","INTERNALS","Buffer","types","deprecate","PassThrough","isIP","formatUrl","fs","pump"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC,GAAG,EAAE;AACrC,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AAC9B,QAAQ,MAAM,IAAI,SAAS,CAAC,kEAAkE,CAAC;AAC/F,IAAI;AACJ;AACA,IAAI,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;AACnC;AACA,IAAI,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,C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AAE,MAAM;AAC5B,GAAG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,aAAa,CAAC;AAChD,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC;AACxC,EAAE,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AACH;;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]} \ No newline at end of file diff --git a/dist/index.cjs b/dist/index.cjs index f7d5ad8..2203461 100644 --- a/dist/index.cjs +++ b/dist/index.cjs @@ -3,37 +3,38 @@ Object.defineProperty(exports, '__esModule', { value: true }); var require$$0$4 = require('os'); -var require$$0$5 = require('fs'); -var require$$0$e = require('path'); -var require$$2$5 = require('http'); +var require$$0$5 = require('crypto'); +var require$$0$6 = require('fs'); +var require$$1$6 = require('path'); +var require$$2$4 = require('http'); var require$$1$1 = require('https'); -var require$$0$9 = require('net'); +var require$$0$a = require('net'); var require$$1$2 = require('tls'); -var require$$0$6 = require('events'); -var require$$0$8 = require('assert'); +var require$$0$7 = require('events'); +var require$$0$9 = require('assert'); var require$$4$4 = require('util'); -var require$$0$a = require('stream'); -var require$$0$7 = require('buffer'); +var require$$0$b = require('stream'); +var require$$0$8 = require('buffer'); var require$$8 = require('querystring'); var require$$14 = require('stream/web'); var Stream = require('node:stream'); var require$$1$3 = require('node:util'); -var require$$0$b = require('node:events'); -var require$$0$c = require('worker_threads'); -var require$$2$6 = require('perf_hooks'); +var require$$0$c = require('node:events'); +var require$$0$d = require('worker_threads'); +var require$$2$5 = require('perf_hooks'); var require$$5$3 = require('util/types'); var require$$4$5 = require('async_hooks'); var require$$1$4 = require('console'); var require$$1$5 = require('url'); var require$$3$4 = require('zlib'); -var require$$6$2 = require('string_decoder'); -var require$$0$d = require('diagnostics_channel'); -var require$$0$f = require('crypto'); +var require$$0$e = require('string_decoder'); +var require$$0$f = require('diagnostics_channel'); +var require$$2$6 = require('child_process'); +var require$$6$2 = require('timers'); var promises = require('fs/promises'); -var require$$1$6 = require('process'); +var require$$1$7 = require('process'); var require$$0$g = require('http2'); -var require$$1$7 = require('dns'); -var require$$1$8 = require('child_process'); +var require$$1$8 = require('dns'); var node_crypto = require('node:crypto'); var node_path = require('node:path'); @@ -72,21 +73,22 @@ function getAugmentedNamespace(n) { return a; } -var core = {}; +var core$1 = {}; -var command = {}; +var command$1 = {}; -var utils$3 = {}; +var utils$4 = {}; -var hasRequiredUtils$3; +var hasRequiredUtils$4; -function requireUtils$3 () { - if (hasRequiredUtils$3) return utils$3; - hasRequiredUtils$3 = 1; +function requireUtils$4 () { + if (hasRequiredUtils$4) return utils$4; + hasRequiredUtils$4 = 1; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ - Object.defineProperty(utils$3, "__esModule", { value: true }); - utils$3.toCommandProperties = utils$3.toCommandValue = void 0; + Object.defineProperty(utils$4, "__esModule", { value: true }); + utils$4.toCommandValue = toCommandValue; + utils$4.toCommandProperties = toCommandProperties; /** * Sanitizes an input into a string so it can be passed into issueCommand safely * @param input input to sanitize into a string @@ -100,7 +102,6 @@ function requireUtils$3 () { } return JSON.stringify(input); } - utils$3.toCommandValue = toCommandValue; /** * * @param annotationProperties @@ -120,58 +121,93 @@ function requireUtils$3 () { endColumn: annotationProperties.endColumn }; } - utils$3.toCommandProperties = toCommandProperties; - return utils$3; + return utils$4; } -var hasRequiredCommand; +var hasRequiredCommand$1; -function requireCommand () { - if (hasRequiredCommand) return command; - hasRequiredCommand = 1; - var __createBinding = (command && command.__createBinding) || (Object.create ? (function(o, m, k, k2) { +function requireCommand$1 () { + if (hasRequiredCommand$1) return command$1; + hasRequiredCommand$1 = 1; + var __createBinding = (command$1 && command$1.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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 = (command && command.__setModuleDefault) || (Object.create ? (function(o, v) { + var __setModuleDefault = (command$1 && command$1.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); - var __importStar = (command && command.__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; - }; - Object.defineProperty(command, "__esModule", { value: true }); - command.issue = command.issueCommand = void 0; + var __importStar = (command$1 && command$1.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; + })(); + Object.defineProperty(command$1, "__esModule", { value: true }); + command$1.issueCommand = issueCommand; + command$1.issue = issue; const os = __importStar(require$$0$4); - const utils_1 = requireUtils$3(); + const utils_1 = requireUtils$4(); /** - * Commands + * Issues a command to the GitHub Actions runner + * + * @param command - The command name to issue + * @param properties - Additional properties for the command (key-value pairs) + * @param message - The message to include with the command + * @remarks + * This function outputs a specially formatted string to stdout that the Actions + * runner interprets as a command. These commands can control workflow behavior, + * set outputs, create annotations, mask values, and more. * * Command Format: * ::name key=value,key=value::message * - * Examples: - * ::warning::This is the message - * ::set-env name=MY_VAR::some value + * @example + * ```typescript + * // Issue a warning annotation + * issueCommand('warning', {}, 'This is a warning message'); + * // Output: ::warning::This is a warning message + * + * // Set an environment variable + * issueCommand('set-env', { name: 'MY_VAR' }, 'some value'); + * // Output: ::set-env name=MY_VAR::some value + * + * // Add a secret mask + * issueCommand('add-mask', {}, 'secretValue123'); + * // Output: ::add-mask::secretValue123 + * ``` + * + * @internal + * This is an internal utility function that powers the public API functions + * such as setSecret, warning, error, and exportVariable. */ function issueCommand(command, properties, message) { const cmd = new Command(command, properties, message); process.stdout.write(cmd.toString() + os.EOL); } - command.issueCommand = issueCommand; function issue(name, message = '') { issueCommand(name, {}, message); } - command.issue = issue; const CMD_STRING = '::'; class Command { constructor(command, properties, message) { @@ -207,13 +243,13 @@ function requireCommand () { } } function escapeData(s) { - return utils_1.toCommandValue(s) + return (0, utils_1.toCommandValue)(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A'); } function escapeProperty(s) { - return utils_1.toCommandValue(s) + return (0, utils_1.toCommandValue)(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A') @@ -221,642 +257,59 @@ function requireCommand () { .replace(/,/g, '%2C'); } - return command; -} - -var fileCommand = {}; - -// Unique ID creation requires a high quality random # generator. In the browser we therefore -// require the crypto API and do not support built-in fallback to lower quality random number -// generators (like Math.random()). -var getRandomValues; -var rnds8 = new Uint8Array(16); -function rng() { - // lazy load so that environments that need to polyfill have a chance to do so - if (!getRandomValues) { - // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also, - // find the complete implementation of crypto (msCrypto) on IE11. - getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); - - if (!getRandomValues) { - throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); - } - } - - return getRandomValues(rnds8); -} - -var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; - -function validate(uuid) { - return typeof uuid === 'string' && REGEX.test(uuid); -} - -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ - -var byteToHex = []; - -for (var i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).substr(1)); -} - -function stringify$3(arr) { - var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields - - if (!validate(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - - return uuid; -} - -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html - -var _nodeId; - -var _clockseq; // Previous uuid creation time - - -var _lastMSecs = 0; -var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details - -function v1$1(options, buf, offset) { - var i = buf && offset || 0; - var b = buf || new Array(16); - options = options || {}; - var node = options.node || _nodeId; - var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not - // specified. We do this lazily to minimize issues related to insufficient - // system entropy. See #189 - - if (node == null || clockseq == null) { - var seedBytes = options.random || (options.rng || rng)(); - - if (node == null) { - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; - } - } // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - - - var msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - - var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) - - var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression - - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - - - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } // Per 4.2.1.2 Throw error if too many uuids are requested - - - if (nsecs >= 10000) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - - msecs += 12219292800000; // `time_low` - - var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; // `time_mid` - - var tmh = msecs / 0x100000000 * 10000 & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; // `time_high_and_version` - - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - - b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - - b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` - - b[i++] = clockseq & 0xff; // `node` - - for (var n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - - return buf || stringify$3(b); -} - -function parse$4(uuid) { - if (!validate(uuid)) { - throw TypeError('Invalid UUID'); - } - - var v; - var arr = new Uint8Array(16); // Parse ########-....-....-....-............ - - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 0xff; - arr[2] = v >>> 8 & 0xff; - arr[3] = v & 0xff; // Parse ........-####-....-....-............ - - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 0xff; // Parse ........-....-####-....-............ - - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 0xff; // Parse ........-....-....-####-............ - - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 0xff; // Parse ........-....-....-....-############ - // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) - - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; - arr[11] = v / 0x100000000 & 0xff; - arr[12] = v >>> 24 & 0xff; - arr[13] = v >>> 16 & 0xff; - arr[14] = v >>> 8 & 0xff; - arr[15] = v & 0xff; - return arr; -} - -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); // UTF8 escape - - var bytes = []; - - for (var i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } - - return bytes; -} - -var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; -var URL$1 = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; -function v35 (name, version, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - if (typeof value === 'string') { - value = stringToBytes(value); - } - - if (typeof namespace === 'string') { - namespace = parse$4(namespace); - } - - if (namespace.length !== 16) { - throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); - } // Compute hash of namespace and value, Per 4.3 - // Future: Use spread syntax when supported on all platforms, e.g. `bytes = - // hashfunc([...namespace, ... value])` - - - var bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 0x0f | version; - bytes[8] = bytes[8] & 0x3f | 0x80; - - if (buf) { - offset = offset || 0; - - for (var i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; - } - - return buf; - } - - return stringify$3(bytes); - } // Function#name is not settable on some platforms (#270) - - - try { - generateUUID.name = name; // eslint-disable-next-line no-empty - } catch (err) {} // For CommonJS default export support - - - generateUUID.DNS = DNS; - generateUUID.URL = URL$1; - return generateUUID; -} - -/* - * Browser-compatible JavaScript MD5 - * - * Modification of JavaScript MD5 - * https://github.com/blueimp/JavaScript-MD5 - * - * Copyright 2011, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - * - * Based on - * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message - * Digest Algorithm, as defined in RFC 1321. - * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * See http://pajhome.org.uk/crypt/md5 for more info. - */ -function md5(bytes) { - if (typeof bytes === 'string') { - var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape - - bytes = new Uint8Array(msg.length); - - for (var i = 0; i < msg.length; ++i) { - bytes[i] = msg.charCodeAt(i); - } - } - - return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); -} -/* - * Convert an array of little-endian words to an array of bytes - */ - - -function md5ToHexEncodedArray(input) { - var output = []; - var length32 = input.length * 32; - var hexTab = '0123456789abcdef'; - - for (var i = 0; i < length32; i += 8) { - var x = input[i >> 5] >>> i % 32 & 0xff; - var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16); - output.push(hex); - } - - return output; -} -/** - * Calculate output length with padding and bit length - */ - - -function getOutputLength(inputLength8) { - return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; -} -/* - * Calculate the MD5 of an array of little-endian words, and a bit length. - */ - - -function wordsToMd5(x, len) { - /* append padding */ - x[len >> 5] |= 0x80 << len % 32; - x[getOutputLength(len) - 1] = len; - var a = 1732584193; - var b = -271733879; - var c = -1732584194; - var d = 271733878; - - for (var i = 0; i < x.length; i += 16) { - var olda = a; - var oldb = b; - var oldc = c; - var oldd = d; - a = md5ff(a, b, c, d, x[i], 7, -680876936); - d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); - c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); - b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); - a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); - d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); - c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); - b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); - a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); - d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); - c = md5ff(c, d, a, b, x[i + 10], 17, -42063); - b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); - a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); - d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); - c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); - b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); - a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); - d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); - c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); - b = md5gg(b, c, d, a, x[i], 20, -373897302); - a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); - d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); - c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); - b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); - a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); - d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); - c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); - b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); - a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); - d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); - c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); - b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); - a = md5hh(a, b, c, d, x[i + 5], 4, -378558); - d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); - c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); - b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); - a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); - d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); - c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); - b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); - a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); - d = md5hh(d, a, b, c, x[i], 11, -358537222); - c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); - b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); - a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); - d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); - c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); - b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); - a = md5ii(a, b, c, d, x[i], 6, -198630844); - d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); - c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); - b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); - a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); - d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); - c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); - b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); - a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); - d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); - c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); - b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); - a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); - d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); - c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); - b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); - a = safeAdd(a, olda); - b = safeAdd(b, oldb); - c = safeAdd(c, oldc); - d = safeAdd(d, oldd); - } - - return [a, b, c, d]; -} -/* - * Convert an array bytes to an array of little-endian words - * Characters >255 have their high-byte silently ignored. - */ - - -function bytesToWords(input) { - if (input.length === 0) { - return []; - } - - var length8 = input.length * 8; - var output = new Uint32Array(getOutputLength(length8)); - - for (var i = 0; i < length8; i += 8) { - output[i >> 5] |= (input[i / 8] & 0xff) << i % 32; - } - - return output; -} -/* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ - - -function safeAdd(x, y) { - var lsw = (x & 0xffff) + (y & 0xffff); - var msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return msw << 16 | lsw & 0xffff; -} -/* - * Bitwise rotate a 32-bit number to the left. - */ - - -function bitRotateLeft(num, cnt) { - return num << cnt | num >>> 32 - cnt; -} -/* - * These functions implement the four basic operations the algorithm uses. - */ - - -function md5cmn(q, a, b, x, s, t) { - return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); -} - -function md5ff(a, b, c, d, x, s, t) { - return md5cmn(b & c | ~b & d, a, b, x, s, t); -} - -function md5gg(a, b, c, d, x, s, t) { - return md5cmn(b & d | c & ~d, a, b, x, s, t); -} - -function md5hh(a, b, c, d, x, s, t) { - return md5cmn(b ^ c ^ d, a, b, x, s, t); -} - -function md5ii(a, b, c, d, x, s, t) { - return md5cmn(c ^ (b | ~d), a, b, x, s, t); -} - -var v3 = v35('v3', 0x30, md5); - -function v4(options, buf, offset) { - options = options || {}; - var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided - - if (buf) { - offset = offset || 0; - - for (var i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - - return buf; - } - - return stringify$3(rnds); -} - -// Adapted from Chris Veness' SHA1 code at -// http://www.movable-type.co.uk/scripts/sha1.html -function f(s, x, y, z) { - switch (s) { - case 0: - return x & y ^ ~x & z; - - case 1: - return x ^ y ^ z; - - case 2: - return x & y ^ x & z ^ y & z; - - case 3: - return x ^ y ^ z; - } -} - -function ROTL(x, n) { - return x << n | x >>> 32 - n; -} - -function sha1(bytes) { - var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; - var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; - - if (typeof bytes === 'string') { - var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape - - bytes = []; - - for (var i = 0; i < msg.length; ++i) { - bytes.push(msg.charCodeAt(i)); - } - } else if (!Array.isArray(bytes)) { - // Convert Array-like to Array - bytes = Array.prototype.slice.call(bytes); - } - - bytes.push(0x80); - var l = bytes.length / 4 + 2; - var N = Math.ceil(l / 16); - var M = new Array(N); - - for (var _i = 0; _i < N; ++_i) { - var arr = new Uint32Array(16); - - for (var j = 0; j < 16; ++j) { - arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3]; - } - - M[_i] = arr; - } - - M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); - M[N - 1][14] = Math.floor(M[N - 1][14]); - M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff; - - for (var _i2 = 0; _i2 < N; ++_i2) { - var W = new Uint32Array(80); - - for (var t = 0; t < 16; ++t) { - W[t] = M[_i2][t]; - } - - for (var _t = 16; _t < 80; ++_t) { - W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1); - } - - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - var e = H[4]; - - for (var _t2 = 0; _t2 < 80; ++_t2) { - var s = Math.floor(_t2 / 20); - var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0; - e = d; - d = c; - c = ROTL(b, 30) >>> 0; - b = a; - a = T; - } - - H[0] = H[0] + a >>> 0; - H[1] = H[1] + b >>> 0; - H[2] = H[2] + c >>> 0; - H[3] = H[3] + d >>> 0; - H[4] = H[4] + e >>> 0; - } - - return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff]; + return command$1; } -var v5 = v35('v5', 0x50, sha1); - -var nil = '00000000-0000-0000-0000-000000000000'; - -function version$5(uuid) { - if (!validate(uuid)) { - throw TypeError('Invalid UUID'); - } - - return parseInt(uuid.substr(14, 1), 16); -} +var fileCommand$1 = {}; -var esmBrowser = /*#__PURE__*/Object.freeze({ - __proto__: null, - NIL: nil, - parse: parse$4, - stringify: stringify$3, - v1: v1$1, - v3: v3, - v4: v4, - v5: v5, - validate: validate, - version: version$5 -}); +var hasRequiredFileCommand$1; -var require$$2$4 = /*@__PURE__*/getAugmentedNamespace(esmBrowser); - -var hasRequiredFileCommand; - -function requireFileCommand () { - if (hasRequiredFileCommand) return fileCommand; - hasRequiredFileCommand = 1; +function requireFileCommand$1 () { + if (hasRequiredFileCommand$1) return fileCommand$1; + hasRequiredFileCommand$1 = 1; // For internal use, subject to change. - var __createBinding = (fileCommand && fileCommand.__createBinding) || (Object.create ? (function(o, m, k, k2) { + var __createBinding = (fileCommand$1 && fileCommand$1.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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 = (fileCommand && fileCommand.__setModuleDefault) || (Object.create ? (function(o, v) { + var __setModuleDefault = (fileCommand$1 && fileCommand$1.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); - var __importStar = (fileCommand && fileCommand.__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; - }; - Object.defineProperty(fileCommand, "__esModule", { value: true }); - fileCommand.prepareKeyValueMessage = fileCommand.issueFileCommand = void 0; + var __importStar = (fileCommand$1 && fileCommand$1.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; + })(); + Object.defineProperty(fileCommand$1, "__esModule", { value: true }); + fileCommand$1.issueFileCommand = issueFileCommand; + fileCommand$1.prepareKeyValueMessage = prepareKeyValueMessage; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ - const fs = __importStar(require$$0$5); + const crypto = __importStar(require$$0$5); + const fs = __importStar(require$$0$6); const os = __importStar(require$$0$4); - const uuid_1 = require$$2$4; - const utils_1 = requireUtils$3(); + const utils_1 = requireUtils$4(); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { @@ -865,14 +318,13 @@ function requireFileCommand () { if (!fs.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { + fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { encoding: 'utf8' }); } - fileCommand.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${uuid_1.v4()}`; - const convertedValue = utils_1.toCommandValue(value); + const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); // These should realistically never happen, but just in case someone finds a // way to exploit uuid generation let's not allow keys or values that contain // the delimiter. @@ -884,24 +336,24 @@ function requireFileCommand () { } return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; } - fileCommand.prepareKeyValueMessage = prepareKeyValueMessage; - return fileCommand; + return fileCommand$1; } -var oidcUtils = {}; +var oidcUtils$1 = {}; -var lib = {}; +var lib$1 = {}; -var proxy = {}; +var proxy$1 = {}; -var hasRequiredProxy; +var hasRequiredProxy$1; -function requireProxy () { - if (hasRequiredProxy) return proxy; - hasRequiredProxy = 1; - Object.defineProperty(proxy, "__esModule", { value: true }); - proxy.checkBypass = proxy.getProxyUrl = void 0; +function requireProxy$1 () { + if (hasRequiredProxy$1) return proxy$1; + hasRequiredProxy$1 = 1; + Object.defineProperty(proxy$1, "__esModule", { value: true }); + proxy$1.getProxyUrl = getProxyUrl; + proxy$1.checkBypass = checkBypass; function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === 'https:'; if (checkBypass(reqUrl)) { @@ -917,18 +369,17 @@ function requireProxy () { })(); if (proxyVar) { try { - return new URL(proxyVar); + return new DecodedURL(proxyVar); } catch (_a) { if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) - return new URL(`http://${proxyVar}`); + return new DecodedURL(`http://${proxyVar}`); } } else { return undefined; } } - proxy.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; @@ -972,7 +423,6 @@ function requireProxy () { } return false; } - proxy.checkBypass = checkBypass; function isLoopbackAddress(host) { const hostLower = host.toLowerCase(); return (hostLower === 'localhost' || @@ -980,8 +430,21 @@ function requireProxy () { hostLower.startsWith('[::1]') || hostLower.startsWith('[0:0:0:0:0:0:0:1]')); } + class DecodedURL extends URL { + constructor(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } + } - return proxy; + return proxy$1; } var tunnel$1 = {}; @@ -992,9 +455,9 @@ function requireTunnel$1 () { if (hasRequiredTunnel$1) return tunnel$1; hasRequiredTunnel$1 = 1; var tls = require$$1$2; - var http = require$$2$5; + var http = require$$2$4; var https = require$$1$1; - var events = require$$0$6; + var events = require$$0$7; var util = require$$4$4; @@ -1709,13 +1172,13 @@ function requireUtil$c () { if (hasRequiredUtil$c) return util$c; hasRequiredUtil$c = 1; - const assert = require$$0$8; + const assert = require$$0$9; const { kDestroyed, kBodyUsed } = requireSymbols$4(); - const { IncomingMessage } = require$$2$5; - const stream = require$$0$a; - const net = require$$0$9; + const { IncomingMessage } = require$$2$4; + const stream = require$$0$b; + const net = require$$0$a; const { InvalidArgumentError } = requireErrors$1(); - const { Blob } = require$$0$7; + const { Blob } = require$$0$8; const nodeUtil = require$$4$4; const { stringify } = require$$8; const { headerNameLowerCasedRecord } = requireConstants$5(); @@ -2372,7 +1835,7 @@ function requireSbmh () { * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool */ - const EventEmitter = require$$0$b.EventEmitter; + const EventEmitter = require$$0$c.EventEmitter; const inherits = require$$1$3.inherits; function SBMH (needle) { @@ -2627,7 +2090,7 @@ function requireHeaderParser () { if (hasRequiredHeaderParser) return HeaderParser_1; hasRequiredHeaderParser = 1; - const EventEmitter = require$$0$b.EventEmitter; + const EventEmitter = require$$0$c.EventEmitter; const inherits = require$$1$3.inherits; const getLimit = requireGetLimit(); @@ -3767,7 +3230,7 @@ function requireConstants$4 () { if (hasRequiredConstants$4) return constants$4; hasRequiredConstants$4 = 1; - const { MessageChannel, receiveMessageOnPort } = require$$0$c; + const { MessageChannel, receiveMessageOnPort } = require$$0$d; const corsSafeListedMethods = ['GET', 'HEAD', 'POST']; const corsSafeListedMethodsSet = new Set(corsSafeListedMethods); @@ -3976,9 +3439,9 @@ function requireUtil$b () { const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = requireConstants$4(); const { getGlobalOrigin } = requireGlobal$1(); - const { performance } = require$$2$6; + const { performance } = require$$2$5; const { isBlobLike, toUSVString, ReadableStreamFrom } = requireUtil$c(); - const assert = require$$0$8; + const assert = require$$0$9; const { isUint8Array } = require$$5$3; let supportedHashes = []; @@ -5796,8 +5259,8 @@ var hasRequiredDataURL; function requireDataURL () { if (hasRequiredDataURL) return dataURL; hasRequiredDataURL = 1; - const assert = require$$0$8; - const { atob } = require$$0$7; + const assert = require$$0$9; + const { atob } = require$$0$8; const { isomorphicDecode } = requireUtil$b(); const encoder = new TextEncoder(); @@ -6433,7 +5896,7 @@ function requireFile () { if (hasRequiredFile) return file; hasRequiredFile = 1; - const { Blob, File: NativeFile } = require$$0$7; + const { Blob, File: NativeFile } = require$$0$8; const { types } = require$$4$4; const { kState } = requireSymbols$3(); const { isBlobLike } = requireUtil$b(); @@ -6789,7 +6252,7 @@ function requireFormdata () { const { kState } = requireSymbols$3(); const { File: UndiciFile, FileLike, isFileLike } = requireFile(); const { webidl } = requireWebidl(); - const { Blob, File: NativeFile } = require$$0$7; + const { Blob, File: NativeFile } = require$$0$8; /** @type {globalThis['File']} */ const File = NativeFile ?? UndiciFile; @@ -7072,9 +6535,9 @@ function requireBody () { const { kState } = requireSymbols$3(); const { webidl } = requireWebidl(); const { DOMException, structuredClone } = requireConstants$4(); - const { Blob, File: NativeFile } = require$$0$7; + const { Blob, File: NativeFile } = require$$0$8; const { kBodyUsed } = requireSymbols$4(); - const assert = require$$0$8; + const assert = require$$0$9; const { isErrored } = requireUtil$c(); const { isUint8Array, isArrayBuffer } = require$$5$3; const { File: UndiciFile } = requireFile(); @@ -7683,7 +7146,7 @@ function requireRequest$1 () { InvalidArgumentError, NotSupportedError } = requireErrors$1(); - const assert = require$$0$8; + const assert = require$$0$9; const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = requireSymbols$4(); const util = requireUtil$c(); @@ -8186,7 +7649,7 @@ function requireDispatcher () { if (hasRequiredDispatcher) return dispatcher; hasRequiredDispatcher = 1; - const EventEmitter = require$$0$6; + const EventEmitter = require$$0$7; class Dispatcher extends EventEmitter { dispatch () { @@ -8413,8 +7876,8 @@ function requireConnect () { if (hasRequiredConnect) return connect; hasRequiredConnect = 1; - const net = require$$0$9; - const assert = require$$0$8; + const net = require$$0$a; + const assert = require$$0$9; const util = requireUtil$c(); const { InvalidArgumentError, ConnectTimeoutError } = requireErrors$1(); @@ -8605,15 +8068,15 @@ function requireConnect () { var constants$3 = {}; -var utils$2 = {}; +var utils$3 = {}; -var hasRequiredUtils$2; +var hasRequiredUtils$3; -function requireUtils$2 () { - if (hasRequiredUtils$2) return utils$2; - hasRequiredUtils$2 = 1; - Object.defineProperty(utils$2, "__esModule", { value: true }); - utils$2.enumToMap = void 0; +function requireUtils$3 () { + if (hasRequiredUtils$3) return utils$3; + hasRequiredUtils$3 = 1; + Object.defineProperty(utils$3, "__esModule", { value: true }); + utils$3.enumToMap = void 0; function enumToMap(obj) { const res = {}; Object.keys(obj).forEach((key) => { @@ -8624,9 +8087,9 @@ function requireUtils$2 () { }); return res; } - utils$2.enumToMap = enumToMap; + utils$3.enumToMap = enumToMap; - return utils$2; + return utils$3; } var hasRequiredConstants$3; @@ -8637,7 +8100,7 @@ function requireConstants$3 () { (function (exports$1) { Object.defineProperty(exports$1, "__esModule", { value: true }); exports$1.SPECIAL_HEADERS = exports$1.HEADER_STATE = exports$1.MINOR = exports$1.MAJOR = exports$1.CONNECTION_TOKEN_CHARS = exports$1.HEADER_CHARS = exports$1.TOKEN = exports$1.STRICT_TOKEN = exports$1.HEX = exports$1.URL_CHAR = exports$1.STRICT_URL_CHAR = exports$1.USERINFO_CHARS = exports$1.MARK = exports$1.ALPHANUM = exports$1.NUM = exports$1.HEX_MAP = exports$1.NUM_MAP = exports$1.ALPHA = exports$1.FINISH = exports$1.H_METHOD_MAP = exports$1.METHOD_MAP = exports$1.METHODS_RTSP = exports$1.METHODS_ICE = exports$1.METHODS_HTTP = exports$1.METHODS = exports$1.LENIENT_FLAGS = exports$1.FLAGS = exports$1.TYPE = exports$1.ERROR = void 0; - const utils_1 = requireUtils$2(); + const utils_1 = requireUtils$3(); (function (ERROR) { ERROR[ERROR["OK"] = 0] = "OK"; ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL"; @@ -8919,9 +8382,9 @@ function requireRedirectHandler () { const util = requireUtil$c(); const { kBodyUsed } = requireSymbols$4(); - const assert = require$$0$8; + const assert = require$$0$9; const { InvalidArgumentError } = requireErrors$1(); - const EE = require$$0$6; + const EE = require$$0$7; const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; @@ -9179,10 +8642,10 @@ function requireClient$1 () { /* global WebAssembly */ - const assert = require$$0$8; - const net = require$$0$9; - const http = require$$2$5; - const { pipeline } = require$$0$a; + const assert = require$$0$9; + const net = require$$0$a; + const http = require$$2$4; + const { pipeline } = require$$0$b; const util = requireUtil$c(); const timers = requireTimers(); const Request = requireRequest$1(); @@ -12364,8 +11827,8 @@ function requireReadable$1 () { if (hasRequiredReadable$1) return readable$1; hasRequiredReadable$1 = 1; - const assert = require$$0$8; - const { Readable } = require$$0$a; + const assert = require$$0$9; + const { Readable } = require$$0$b; const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = requireErrors$1(); const util = requireUtil$c(); const { ReadableStreamFrom, toUSVString } = requireUtil$c(); @@ -12691,7 +12154,7 @@ var hasRequiredUtil$a; function requireUtil$a () { if (hasRequiredUtil$a) return util$a; hasRequiredUtil$a = 1; - const assert = require$$0$8; + const assert = require$$0$9; const { ResponseStatusCodeError } = requireErrors$1(); @@ -12997,7 +12460,7 @@ function requireApiStream () { if (hasRequiredApiStream) return apiStream; hasRequiredApiStream = 1; - const { finished, PassThrough } = require$$0$a; + const { finished, PassThrough } = require$$0$b; const { InvalidArgumentError, InvalidReturnValueError, @@ -13229,7 +12692,7 @@ function requireApiPipeline () { Readable, Duplex, PassThrough - } = require$$0$a; + } = require$$0$b; const { InvalidArgumentError, InvalidReturnValueError, @@ -13238,7 +12701,7 @@ function requireApiPipeline () { const util = requireUtil$c(); const { AsyncResource } = require$$4$5; const { addSignal, removeSignal } = requireAbortSignal(); - const assert = require$$0$8; + const assert = require$$0$9; const kResume = Symbol('resume'); @@ -13486,7 +12949,7 @@ function requireApiUpgrade () { const { AsyncResource } = require$$4$5; const util = requireUtil$c(); const { addSignal, removeSignal } = requireAbortSignal(); - const assert = require$$0$8; + const assert = require$$0$9; class UpgradeHandler extends AsyncResource { constructor (opts, callback) { @@ -13786,7 +13249,7 @@ function requireMockUtils () { kGetNetConnect } = requireMockSymbols(); const { buildURL, nop } = requireUtil$c(); - const { STATUS_CODES } = require$$2$5; + const { STATUS_CODES } = require$$2$4; const { types: { isPromise @@ -14522,7 +13985,7 @@ function requirePendingInterceptorsFormatter () { if (hasRequiredPendingInterceptorsFormatter) return pendingInterceptorsFormatter; hasRequiredPendingInterceptorsFormatter = 1; - const { Transform } = require$$0$a; + const { Transform } = require$$0$b; const { Console } = require$$1$4; /** @@ -14945,7 +14408,7 @@ var hasRequiredRetryHandler; function requireRetryHandler () { if (hasRequiredRetryHandler) return RetryHandler_1; hasRequiredRetryHandler = 1; - const assert = require$$0$8; + const assert = require$$0$9; const { kRetryHandlerDefaultRetry } = requireSymbols$4(); const { RequestRetryError } = requireErrors$1(); @@ -15384,7 +14847,7 @@ function requireHeaders () { } = requireUtil$b(); const util = require$$4$4; const { webidl } = requireWebidl(); - const assert = require$$0$8; + const assert = require$$0$9; const kHeadersMap = Symbol('headers map'); const kHeadersSortedMap = Symbol('headers map sorted'); @@ -15990,7 +15453,7 @@ function requireResponse () { const { getGlobalOrigin } = requireGlobal$1(); const { URLSerializer } = requireDataURL(); const { kHeadersList, kConstruct } = requireSymbols$4(); - const assert = require$$0$8; + const assert = require$$0$9; const { types } = require$$4$4; const ReadableStream = globalThis.ReadableStream || require$$14.ReadableStream; @@ -16574,8 +16037,8 @@ function requireRequest () { const { getGlobalOrigin } = requireGlobal$1(); const { URLSerializer } = requireDataURL(); const { kHeadersList, kConstruct } = requireSymbols$4(); - const assert = require$$0$8; - const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require$$0$6; + const assert = require$$0$9; + const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require$$0$7; let TransformStream = globalThis.TransformStream; @@ -17540,7 +17003,7 @@ function requireFetch$1 () { urlHasHttpsScheme } = requireUtil$b(); const { kState, kHeaders, kGuard, kRealm } = requireSymbols$3(); - const assert = require$$0$8; + const assert = require$$0$9; const { safelyExtractBody } = requireBody(); const { redirectStatusSet, @@ -17551,14 +17014,14 @@ function requireFetch$1 () { DOMException } = requireConstants$4(); const { kHeadersList } = requireSymbols$4(); - const EE = require$$0$6; - const { Readable, pipeline } = require$$0$a; + const EE = require$$0$7; + const { Readable, pipeline } = require$$0$b; const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = requireUtil$c(); const { dataURLProcessor, serializeAMimeType } = requireDataURL(); const { TransformStream } = require$$14; const { getGlobalDispatcher } = requireGlobal(); const { webidl } = requireWebidl(); - const { STATUS_CODES } = require$$2$5; + const { STATUS_CODES } = require$$2$4; const GET_OR_HEAD = ['GET', 'HEAD']; /** @type {import('buffer').resolveObjectURL} */ @@ -18285,7 +17748,7 @@ function requireFetch$1 () { } case 'blob:': { if (!resolveObjectURL) { - resolveObjectURL = require$$0$7.resolveObjectURL; + resolveObjectURL = require$$0$8.resolveObjectURL; } // 1. Let blobURLEntry be request’s current URL’s blob URL entry. @@ -19993,8 +19456,8 @@ function requireUtil$9 () { const { DOMException } = requireConstants$4(); const { serializeAMimeType, parseMIMEType } = requireDataURL(); const { types } = require$$4$4; - const { StringDecoder } = require$$6$2; - const { btoa } = require$$0$7; + const { StringDecoder } = require$$0$e; + const { btoa } = require$$0$8; /** @type {PropertyDescriptor} */ const staticPropertyDescriptors = { @@ -20746,7 +20209,7 @@ function requireUtil$8 () { if (hasRequiredUtil$8) return util$8; hasRequiredUtil$8 = 1; - const assert = require$$0$8; + const assert = require$$0$9; const { URLSerializer } = requireDataURL(); const { isValidHeaderName } = requireUtil$b(); @@ -20813,7 +20276,7 @@ function requireCache () { const { kState, kHeaders, kGuard, kRealm } = requireSymbols$3(); const { fetching } = requireFetch$1(); const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = requireUtil$b(); - const assert = require$$0$8; + const assert = require$$0$9; const { getGlobalDispatcher } = requireGlobal(); /** @@ -22106,7 +21569,7 @@ function requireParse$2 () { const { maxNameValuePairSize, maxAttributeValueSize } = requireConstants$2(); const { isCTLExcludingHtab } = requireUtil$7(); const { collectASequenceOfCodePointsFast } = requireDataURL(); - const assert = require$$0$8; + const assert = require$$0$9; /** * @description Parses the field-value attributes of a set-cookie header string. @@ -22700,7 +22163,7 @@ function requireEvents () { const { webidl } = requireWebidl(); const { kEnumerableProperty } = requireUtil$c(); - const { MessagePort } = require$$0$c; + const { MessagePort } = require$$0$d; /** * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent @@ -23217,7 +22680,7 @@ function requireConnection () { if (hasRequiredConnection) return connection; hasRequiredConnection = 1; - const diagnosticsChannel = require$$0$d; + const diagnosticsChannel = require$$0$f; const { uid, states } = requireConstants$1(); const { kReadyState, @@ -23597,8 +23060,8 @@ function requireReceiver () { if (hasRequiredReceiver) return receiver; hasRequiredReceiver = 1; - const { Writable } = require$$0$a; - const diagnosticsChannel = require$$0$d; + const { Writable } = require$$0$b; + const diagnosticsChannel = require$$0$f; const { parserStates, opcodes, states, emptyBuffer } = requireConstants$1(); const { kReadyState, kSentClose, kResponse, kReceivedClose } = requireSymbols(); const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = requireUtil$6(); @@ -24762,13 +24225,13 @@ function requireUndici () { return undici; } -var hasRequiredLib; +var hasRequiredLib$1; -function requireLib () { - if (hasRequiredLib) return lib; - hasRequiredLib = 1; +function requireLib$1 () { + if (hasRequiredLib$1) return lib$1; + hasRequiredLib$1 = 1; /* eslint-disable @typescript-eslint/no-explicit-any */ - var __createBinding = (lib && lib.__createBinding) || (Object.create ? (function(o, m, k, k2) { + var __createBinding = (lib$1 && lib$1.__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)) { @@ -24779,19 +24242,29 @@ function requireLib () { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault = (lib && lib.__setModuleDefault) || (Object.create ? (function(o, v) { + var __setModuleDefault = (lib$1 && lib$1.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); - var __importStar = (lib && lib.__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 __awaiter = (lib && lib.__awaiter) || function (thisArg, _arguments, P, generator) { + var __importStar = (lib$1 && lib$1.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; + })(); + var __awaiter = (lib$1 && lib$1.__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); } } @@ -24800,11 +24273,13 @@ function requireLib () { step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Object.defineProperty(lib, "__esModule", { value: true }); - lib.HttpClient = lib.isHttps = lib.HttpClientResponse = lib.HttpClientError = lib.getProxyUrl = lib.MediaTypes = lib.Headers = lib.HttpCodes = void 0; - const http = __importStar(require$$2$5); + Object.defineProperty(lib$1, "__esModule", { value: true }); + lib$1.HttpClient = lib$1.HttpClientResponse = lib$1.HttpClientError = lib$1.MediaTypes = lib$1.Headers = lib$1.HttpCodes = void 0; + lib$1.getProxyUrl = getProxyUrl; + lib$1.isHttps = isHttps; + const http = __importStar(require$$2$4); const https = __importStar(require$$1$1); - const pm = __importStar(requireProxy()); + const pm = __importStar(requireProxy$1()); const tunnel = __importStar(requireTunnel()); const undici_1 = requireUndici(); var HttpCodes; @@ -24836,16 +24311,16 @@ function requireLib () { HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; - })(HttpCodes || (lib.HttpCodes = HttpCodes = {})); + })(HttpCodes || (lib$1.HttpCodes = HttpCodes = {})); var Headers; (function (Headers) { Headers["Accept"] = "accept"; Headers["ContentType"] = "content-type"; - })(Headers || (lib.Headers = Headers = {})); + })(Headers || (lib$1.Headers = Headers = {})); var MediaTypes; (function (MediaTypes) { MediaTypes["ApplicationJson"] = "application/json"; - })(MediaTypes || (lib.MediaTypes = MediaTypes = {})); + })(MediaTypes || (lib$1.MediaTypes = 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 @@ -24854,7 +24329,6 @@ function requireLib () { const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ''; } - lib.getProxyUrl = getProxyUrl; const HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, @@ -24878,7 +24352,7 @@ function requireLib () { Object.setPrototypeOf(this, HttpClientError.prototype); } } - lib.HttpClientError = HttpClientError; + lib$1.HttpClientError = HttpClientError; class HttpClientResponse { constructor(message) { this.message = message; @@ -24910,12 +24384,11 @@ function requireLib () { }); } } - lib.HttpClientResponse = HttpClientResponse; + lib$1.HttpClientResponse = HttpClientResponse; function isHttps(requestUrl) { const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === 'https:'; } - lib.isHttps = isHttps; class HttpClient { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; @@ -24926,7 +24399,7 @@ function requireLib () { this._maxRetries = 1; this._keepAlive = false; this._disposed = false; - this.userAgent = userAgent; + this.userAgent = this._getUserAgentWithOrchestrationId(userAgent); this.handlers = handlers || []; this.requestOptions = requestOptions; if (requestOptions) { @@ -24998,36 +24471,39 @@ function requireLib () { * 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* () { + getJson(requestUrl_1) { + return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) { 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* () { + postJson(requestUrl_1, obj_1) { + return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { 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); + additionalHeaders[Headers.ContentType] = + this._getExistingOrDefaultContentTypeHeader(additionalHeaders, 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* () { + putJson(requestUrl_1, obj_1) { + return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { 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); + additionalHeaders[Headers.ContentType] = + this._getExistingOrDefaultContentTypeHeader(additionalHeaders, 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* () { + patchJson(requestUrl_1, obj_1) { + return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { 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); + additionalHeaders[Headers.ContentType] = + this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); @@ -25256,12 +24732,73 @@ function requireLib () { } return lowercaseKeys(headers || {}); } + /** + * Gets an existing header value or returns a default. + * Handles converting number header values to strings since HTTP headers must be strings. + * Note: This returns string | string[] since some headers can have multiple values. + * For headers that must always be a single string (like Content-Type), use the + * specialized _getExistingOrDefaultContentTypeHeader method instead. + */ _getExistingOrDefaultHeader(additionalHeaders, header, _default) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; + if (headerValue) { + clientHeader = + typeof headerValue === 'number' ? headerValue.toString() : headerValue; + } } - return additionalHeaders[header] || clientHeader || _default; + const additionalValue = additionalHeaders[header]; + if (additionalValue !== undefined) { + return typeof additionalValue === 'number' + ? additionalValue.toString() + : additionalValue; + } + if (clientHeader !== undefined) { + return clientHeader; + } + return _default; + } + /** + * Specialized version of _getExistingOrDefaultHeader for Content-Type header. + * Always returns a single string (not an array) since Content-Type should be a single value. + * Converts arrays to comma-separated strings and numbers to strings to ensure type safety. + * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers + * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]). + */ + _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType]; + if (headerValue) { + if (typeof headerValue === 'number') { + clientHeader = String(headerValue); + } + else if (Array.isArray(headerValue)) { + clientHeader = headerValue.join(', '); + } + else { + clientHeader = headerValue; + } + } + } + const additionalValue = additionalHeaders[Headers.ContentType]; + // Return the first non-undefined value, converting numbers or arrays to strings if necessary + if (additionalValue !== undefined) { + if (typeof additionalValue === 'number') { + return String(additionalValue); + } + else if (Array.isArray(additionalValue)) { + return additionalValue.join(', '); + } + else { + return additionalValue; + } + } + if (clientHeader !== undefined) { + return clientHeader; + } + return _default; } _getAgent(parsedUrl) { let agent; @@ -25270,7 +24807,7 @@ function requireLib () { if (this._keepAlive && useProxy) { agent = this._proxyAgent; } - if (this._keepAlive && !useProxy) { + if (!useProxy) { agent = this._agent; } // if agent is already assigned use that agent. @@ -25302,16 +24839,12 @@ function requireLib () { 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) { + // if tunneling agent isn't assigned create a new agent + if (!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 @@ -25333,7 +24866,7 @@ function requireLib () { } const usingSsl = parsedUrl.protocol === 'https:'; proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && { - token: `${proxyUrl.username}:${proxyUrl.password}` + token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}` }))); this._proxyAgentDispatcher = proxyAgent; if (usingSsl && this._ignoreSslError) { @@ -25346,6 +24879,17 @@ function requireLib () { } return proxyAgent; } + _getUserAgentWithOrchestrationId(userAgent) { + const baseUserAgent = userAgent || 'actions/http-client'; + const orchId = process.env['ACTIONS_ORCHESTRATION_ID']; + if (orchId) { + // Sanitize the orchestration ID to ensure it contains only valid characters + // Valid characters: 0-9, a-z, _, -, . + const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_'); + return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`; + } + return baseUserAgent; + } _performExponentialBackoff(retryNumber) { return __awaiter(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); @@ -25419,20 +24963,20 @@ function requireLib () { }); } } - lib.HttpClient = HttpClient; + lib$1.HttpClient = HttpClient; const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); - return lib; + return lib$1; } -var auth$1 = {}; +var auth$2 = {}; -var hasRequiredAuth; +var hasRequiredAuth$1; -function requireAuth () { - if (hasRequiredAuth) return auth$1; - hasRequiredAuth = 1; - var __awaiter = (auth$1 && auth$1.__awaiter) || function (thisArg, _arguments, P, generator) { +function requireAuth$1 () { + if (hasRequiredAuth$1) return auth$2; + hasRequiredAuth$1 = 1; + var __awaiter = (auth$2 && auth$2.__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); } } @@ -25441,8 +24985,8 @@ function requireAuth () { step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Object.defineProperty(auth$1, "__esModule", { value: true }); - auth$1.PersonalAccessTokenCredentialHandler = auth$1.BearerCredentialHandler = auth$1.BasicCredentialHandler = void 0; + Object.defineProperty(auth$2, "__esModule", { value: true }); + auth$2.PersonalAccessTokenCredentialHandler = auth$2.BearerCredentialHandler = auth$2.BasicCredentialHandler = void 0; class BasicCredentialHandler { constructor(username, password) { this.username = username; @@ -25464,7 +25008,7 @@ function requireAuth () { }); } } - auth$1.BasicCredentialHandler = BasicCredentialHandler; + auth$2.BasicCredentialHandler = BasicCredentialHandler; class BearerCredentialHandler { constructor(token) { this.token = token; @@ -25487,7 +25031,7 @@ function requireAuth () { }); } } - auth$1.BearerCredentialHandler = BearerCredentialHandler; + auth$2.BearerCredentialHandler = BearerCredentialHandler; class PersonalAccessTokenCredentialHandler { constructor(token) { this.token = token; @@ -25510,17 +25054,17 @@ function requireAuth () { }); } } - auth$1.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + auth$2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - return auth$1; + return auth$2; } -var hasRequiredOidcUtils; +var hasRequiredOidcUtils$1; -function requireOidcUtils () { - if (hasRequiredOidcUtils) return oidcUtils; - hasRequiredOidcUtils = 1; - var __awaiter = (oidcUtils && oidcUtils.__awaiter) || function (thisArg, _arguments, P, generator) { +function requireOidcUtils$1 () { + if (hasRequiredOidcUtils$1) return oidcUtils$1; + hasRequiredOidcUtils$1 = 1; + var __awaiter = (oidcUtils$1 && oidcUtils$1.__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); } } @@ -25529,11 +25073,11 @@ function requireOidcUtils () { step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Object.defineProperty(oidcUtils, "__esModule", { value: true }); - oidcUtils.OidcClient = void 0; - const http_client_1 = requireLib(); - const auth_1 = requireAuth(); - const core_1 = requireCore(); + Object.defineProperty(oidcUtils$1, "__esModule", { value: true }); + oidcUtils$1.OidcClient = void 0; + const http_client_1 = requireLib$1(); + const auth_1 = requireAuth$1(); + const core_1 = requireCore$1(); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { @@ -25557,8 +25101,8 @@ function requireOidcUtils () { return runtimeUrl; } static getCall(id_token_url) { - var _a; return __awaiter(this, void 0, void 0, function* () { + var _a; const httpclient = OidcClient.createHttpClient(); const res = yield httpclient .getJson(id_token_url) @@ -25583,9 +25127,9 @@ function requireOidcUtils () { const encodedAudience = encodeURIComponent(audience); id_token_url = `${id_token_url}&audience=${encodedAudience}`; } - core_1.debug(`ID token url is ${id_token_url}`); + (0, core_1.debug)(`ID token url is ${id_token_url}`); const id_token = yield OidcClient.getCall(id_token_url); - core_1.setSecret(id_token); + (0, core_1.setSecret)(id_token); return id_token; } catch (error) { @@ -25594,20 +25138,20 @@ function requireOidcUtils () { }); } } - oidcUtils.OidcClient = OidcClient; + oidcUtils$1.OidcClient = OidcClient; - return oidcUtils; + return oidcUtils$1; } -var summary = {}; +var summary$1 = {}; -var hasRequiredSummary; +var hasRequiredSummary$1; -function requireSummary () { - if (hasRequiredSummary) return summary; - hasRequiredSummary = 1; +function requireSummary$1 () { + if (hasRequiredSummary$1) return summary$1; + hasRequiredSummary$1 = 1; (function (exports$1) { - var __awaiter = (summary && summary.__awaiter) || function (thisArg, _arguments, P, generator) { + var __awaiter = (summary$1 && summary$1.__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); } } @@ -25619,7 +25163,7 @@ function requireSummary () { Object.defineProperty(exports$1, "__esModule", { value: true }); exports$1.summary = exports$1.markdownSummary = exports$1.SUMMARY_DOCS_URL = exports$1.SUMMARY_ENV_VAR = void 0; const os_1 = require$$0$4; - const fs_1 = require$$0$5; + const fs_1 = require$$0$6; const { access, appendFile, writeFile } = fs_1.promises; exports$1.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; exports$1.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; @@ -25889,39 +25433,55 @@ function requireSummary () { exports$1.markdownSummary = _summary; exports$1.summary = _summary; - } (summary)); - return summary; + } (summary$1)); + return summary$1; } -var pathUtils = {}; +var pathUtils$1 = {}; -var hasRequiredPathUtils; +var hasRequiredPathUtils$1; -function requirePathUtils () { - if (hasRequiredPathUtils) return pathUtils; - hasRequiredPathUtils = 1; - var __createBinding = (pathUtils && pathUtils.__createBinding) || (Object.create ? (function(o, m, k, k2) { +function requirePathUtils$1 () { + if (hasRequiredPathUtils$1) return pathUtils$1; + hasRequiredPathUtils$1 = 1; + var __createBinding = (pathUtils$1 && pathUtils$1.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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 = (pathUtils && pathUtils.__setModuleDefault) || (Object.create ? (function(o, v) { + var __setModuleDefault = (pathUtils$1 && pathUtils$1.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); - var __importStar = (pathUtils && pathUtils.__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; - }; - Object.defineProperty(pathUtils, "__esModule", { value: true }); - pathUtils.toPlatformPath = pathUtils.toWin32Path = pathUtils.toPosixPath = void 0; - const path = __importStar(require$$0$e); + var __importStar = (pathUtils$1 && pathUtils$1.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; + })(); + Object.defineProperty(pathUtils$1, "__esModule", { value: true }); + pathUtils$1.toPosixPath = toPosixPath; + pathUtils$1.toWin32Path = toWin32Path; + pathUtils$1.toPlatformPath = toPlatformPath; + const path = __importStar(require$$1$6); /** * toPosixPath converts the given path to the posix form. On Windows, \\ will be * replaced with /. @@ -25932,7 +25492,6 @@ function requirePathUtils () { function toPosixPath(pth) { return pth.replace(/[\\]/g, '/'); } - pathUtils.toPosixPath = toPosixPath; /** * toWin32Path converts the given path to the win32 form. On Linux, / will be * replaced with \\. @@ -25943,7 +25502,6 @@ function requirePathUtils () { function toWin32Path(pth) { return pth.replace(/[/]/g, '\\'); } - pathUtils.toWin32Path = toWin32Path; /** * toPlatformPath converts the given path to a platform-specific path. It does * this by replacing instances of / and \ with the platform-specific path @@ -25955,37 +25513,1367 @@ function requirePathUtils () { function toPlatformPath(pth) { return pth.replace(/[/\\]/g, path.sep); } - pathUtils.toPlatformPath = toPlatformPath; - return pathUtils; + return pathUtils$1; } -var hasRequiredCore; +var platform$1 = {}; -function requireCore () { - if (hasRequiredCore) return core; - hasRequiredCore = 1; +var exec$1 = {}; + +var toolrunner$1 = {}; + +var io$1 = {}; + +var ioUtil$1 = {}; + +var hasRequiredIoUtil$1; + +function requireIoUtil$1 () { + if (hasRequiredIoUtil$1) return ioUtil$1; + hasRequiredIoUtil$1 = 1; (function (exports$1) { - var __createBinding = (core && core.__createBinding) || (Object.create ? (function(o, m, k, k2) { + var __createBinding = (ioUtil$1 && ioUtil$1.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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 = (core && core.__setModuleDefault) || (Object.create ? (function(o, v) { + var __setModuleDefault = (ioUtil$1 && ioUtil$1.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); - var __importStar = (core && core.__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 __importStar = (ioUtil$1 && ioUtil$1.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; + })(); + var __awaiter = (ioUtil$1 && ioUtil$1.__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 __awaiter = (core && core.__awaiter) || function (thisArg, _arguments, P, generator) { + var _a; + Object.defineProperty(exports$1, "__esModule", { value: true }); + exports$1.READONLY = exports$1.UV_FS_O_EXLOCK = exports$1.IS_WINDOWS = exports$1.unlink = exports$1.symlink = exports$1.stat = exports$1.rmdir = exports$1.rm = exports$1.rename = exports$1.readdir = exports$1.open = exports$1.mkdir = exports$1.lstat = exports$1.copyFile = exports$1.chmod = void 0; + exports$1.readlink = readlink; + exports$1.exists = exists; + exports$1.isDirectory = isDirectory; + exports$1.isRooted = isRooted; + exports$1.tryGetExecutablePath = tryGetExecutablePath; + exports$1.getCmdPath = getCmdPath; + const fs = __importStar(require$$0$6); + const path = __importStar(require$$1$6); + _a = fs.promises + // export const {open} = 'fs' + , exports$1.chmod = _a.chmod, exports$1.copyFile = _a.copyFile, exports$1.lstat = _a.lstat, exports$1.mkdir = _a.mkdir, exports$1.open = _a.open, exports$1.readdir = _a.readdir, exports$1.rename = _a.rename, exports$1.rm = _a.rm, exports$1.rmdir = _a.rmdir, exports$1.stat = _a.stat, exports$1.symlink = _a.symlink, exports$1.unlink = _a.unlink; + // export const {open} = 'fs' + exports$1.IS_WINDOWS = process.platform === 'win32'; + /** + * Custom implementation of readlink to ensure Windows junctions + * maintain trailing backslash for backward compatibility with Node.js < 24 + * + * In Node.js 20, Windows junctions (directory symlinks) always returned paths + * with trailing backslashes. Node.js 24 removed this behavior, which breaks + * code that relied on this format for path operations. + * + * This implementation restores the Node 20 behavior by adding a trailing + * backslash to all junction results on Windows. + */ + function readlink(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + const result = yield fs.promises.readlink(fsPath); + // On Windows, restore Node 20 behavior: add trailing backslash to all results + // since junctions on Windows are always directory links + if (exports$1.IS_WINDOWS && !result.endsWith('\\')) { + return `${result}\\`; + } + return result; + }); + } + // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 + exports$1.UV_FS_O_EXLOCK = 0x10000000; + exports$1.READONLY = fs.constants.O_RDONLY; + function exists(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield (0, exports$1.stat)(fsPath); + } + catch (err) { + if (err.code === 'ENOENT') { + return false; + } + throw err; + } + return true; + }); + } + function isDirectory(fsPath_1) { + return __awaiter(this, arguments, void 0, function* (fsPath, useStat = false) { + const stats = useStat ? yield (0, exports$1.stat)(fsPath) : yield (0, exports$1.lstat)(fsPath); + return stats.isDirectory(); + }); + } + /** + * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: + * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). + */ + function isRooted(p) { + p = normalizeSeparators(p); + if (!p) { + throw new Error('isRooted() parameter "p" cannot be empty'); + } + if (exports$1.IS_WINDOWS) { + return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello + ); // e.g. C: or C:\hello + } + return p.startsWith('/'); + } + /** + * Best effort attempt to determine whether a file exists and is executable. + * @param filePath file path to check + * @param extensions additional file extensions to try + * @return if file exists and is executable, returns the file path. otherwise empty string. + */ + function tryGetExecutablePath(filePath, extensions) { + return __awaiter(this, void 0, void 0, function* () { + let stats = undefined; + try { + // test file exists + stats = yield (0, exports$1.stat)(filePath); + } + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (exports$1.IS_WINDOWS) { + // on Windows, test for valid extension + const upperExt = path.extname(filePath).toUpperCase(); + if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { + return filePath; + } + } + else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + // try each extension + const originalFilePath = filePath; + for (const extension of extensions) { + filePath = originalFilePath + extension; + stats = undefined; + try { + stats = yield (0, exports$1.stat)(filePath); + } + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (exports$1.IS_WINDOWS) { + // preserve the case of the actual file (since an extension was appended) + try { + const directory = path.dirname(filePath); + const upperName = path.basename(filePath).toUpperCase(); + for (const actualName of yield (0, exports$1.readdir)(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path.join(directory, actualName); + break; + } + } + } + catch (err) { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); + } + return filePath; + } + else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + } + return ''; + }); + } + function normalizeSeparators(p) { + p = p || ''; + if (exports$1.IS_WINDOWS) { + // convert slashes on Windows + p = p.replace(/\//g, '\\'); + // remove redundant slashes + return p.replace(/\\\\+/g, '\\'); + } + // remove redundant slashes + return p.replace(/\/\/+/g, '/'); + } + // on Mac/Linux, test the execute bit + // R W X R W X R W X + // 256 128 64 32 16 8 4 2 1 + function isUnixExecutable(stats) { + return ((stats.mode & 1) > 0 || + ((stats.mode & 8) > 0 && + process.getgid !== undefined && + stats.gid === process.getgid()) || + ((stats.mode & 64) > 0 && + process.getuid !== undefined && + stats.uid === process.getuid())); + } + // Get the path of cmd.exe in windows + function getCmdPath() { + var _a; + return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`; + } + + } (ioUtil$1)); + return ioUtil$1; +} + +var hasRequiredIo$1; + +function requireIo$1 () { + if (hasRequiredIo$1) return io$1; + hasRequiredIo$1 = 1; + var __createBinding = (io$1 && io$1.__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 = (io$1 && io$1.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = (io$1 && io$1.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; + })(); + var __awaiter = (io$1 && io$1.__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(io$1, "__esModule", { value: true }); + io$1.cp = cp; + io$1.mv = mv; + io$1.rmRF = rmRF; + io$1.mkdirP = mkdirP; + io$1.which = which; + io$1.findInPath = findInPath; + const assert_1 = require$$0$9; + const path = __importStar(require$$1$6); + const ioUtil = __importStar(requireIoUtil$1()); + /** + * Copies a file or folder. + * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js + * + * @param source source path + * @param dest destination path + * @param options optional. See CopyOptions. + */ + function cp(source_1, dest_1) { + return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) { + const { force, recursive, copySourceDirectory } = readCopyOptions(options); + const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; + // Dest is an existing file, but not forcing + if (destStat && destStat.isFile() && !force) { + return; + } + // If dest is an existing directory, should copy inside. + const newDest = destStat && destStat.isDirectory() && copySourceDirectory + ? path.join(dest, path.basename(source)) + : dest; + if (!(yield ioUtil.exists(source))) { + throw new Error(`no such file or directory: ${source}`); + } + const sourceStat = yield ioUtil.stat(source); + if (sourceStat.isDirectory()) { + if (!recursive) { + throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); + } + else { + yield cpDirRecursive(source, newDest, 0, force); + } + } + else { + if (path.relative(source, newDest) === '') { + // a file cannot be copied to itself + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); + } + }); + } + /** + * Moves a path. + * + * @param source source path + * @param dest destination path + * @param options optional. See MoveOptions. + */ + function mv(source_1, dest_1) { + return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) { + if (yield ioUtil.exists(dest)) { + let destExists = true; + if (yield ioUtil.isDirectory(dest)) { + // If dest is directory copy src into dest + dest = path.join(dest, path.basename(source)); + destExists = yield ioUtil.exists(dest); + } + if (destExists) { + if (options.force == null || options.force) { + yield rmRF(dest); + } + else { + throw new Error('Destination already exists'); + } + } + } + yield mkdirP(path.dirname(dest)); + yield ioUtil.rename(source, dest); + }); + } + /** + * Remove a path recursively with force + * + * @param inputPath path to remove + */ + function rmRF(inputPath) { + return __awaiter(this, void 0, void 0, function* () { + if (ioUtil.IS_WINDOWS) { + // Check for invalid characters + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + if (/[*"<>|]/.test(inputPath)) { + throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + } + } + try { + // note if path does not exist, error is silent + yield ioUtil.rm(inputPath, { + force: true, + maxRetries: 3, + recursive: true, + retryDelay: 300 + }); + } + catch (err) { + throw new Error(`File was unable to be removed ${err}`); + } + }); + } + /** + * Make a directory. Creates the full path with folders in between + * Will throw if it fails + * + * @param fsPath path to create + * @returns Promise + */ + function mkdirP(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + (0, assert_1.ok)(fsPath, 'a path argument must be provided'); + yield ioUtil.mkdir(fsPath, { recursive: true }); + }); + } + /** + * Returns path of a tool had the tool actually been invoked. Resolves via paths. + * If you check and the tool does not exist, it will throw. + * + * @param tool name of the tool + * @param check whether to check if tool exists + * @returns Promise path to tool + */ + function which(tool, check) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + // recursive when check=true + if (check) { + const result = yield which(tool, false); + if (!result) { + if (ioUtil.IS_WINDOWS) { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); + } + else { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); + } + } + return result; + } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ''; + }); + } + /** + * Returns a list of all occurrences of the given tool on the system path. + * + * @returns Promise the paths of the tool + */ + function findInPath(tool) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + // build the list of extensions to try + const extensions = []; + if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { + for (const extension of process.env['PATHEXT'].split(path.delimiter)) { + if (extension) { + extensions.push(extension); + } + } + } + // if it's rooted, return it if exists. otherwise return empty. + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; + } + return []; + } + // if any path separators, return empty + if (tool.includes(path.sep)) { + return []; + } + // build the list of directories + // + // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, + // it feels like we should not do this. Checking the current directory seems like more of a use + // case of a shell, and the which() function exposed by the toolkit should strive for consistency + // across platforms. + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path.delimiter)) { + if (p) { + directories.push(p); + } + } + } + // find all matches + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } + } + return matches; + }); + } + function readCopyOptions(options) { + const force = options.force == null ? true : options.force; + const recursive = Boolean(options.recursive); + const copySourceDirectory = options.copySourceDirectory == null + ? true + : Boolean(options.copySourceDirectory); + return { force, recursive, copySourceDirectory }; + } + function cpDirRecursive(sourceDir, destDir, currentDepth, force) { + return __awaiter(this, void 0, void 0, function* () { + // Ensure there is not a run away recursive copy + if (currentDepth >= 255) + return; + currentDepth++; + yield mkdirP(destDir); + const files = yield ioUtil.readdir(sourceDir); + for (const fileName of files) { + const srcFile = `${sourceDir}/${fileName}`; + const destFile = `${destDir}/${fileName}`; + const srcFileStat = yield ioUtil.lstat(srcFile); + if (srcFileStat.isDirectory()) { + // Recurse + yield cpDirRecursive(srcFile, destFile, currentDepth, force); + } + else { + yield copyFile(srcFile, destFile, force); + } + } + // Change the mode for the newly created directory + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); + } + // Buffered file copy + function copyFile(srcFile, destFile, force) { + return __awaiter(this, void 0, void 0, function* () { + if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { + // unlink/re-link it + try { + yield ioUtil.lstat(destFile); + yield ioUtil.unlink(destFile); + } + catch (e) { + // Try to override file permission + if (e.code === 'EPERM') { + yield ioUtil.chmod(destFile, '0666'); + yield ioUtil.unlink(destFile); + } + // other errors = it doesn't exist, no work to do + } + // Copy over symlink + const symlinkFull = yield ioUtil.readlink(srcFile); + yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); + } + else if (!(yield ioUtil.exists(destFile)) || force) { + yield ioUtil.copyFile(srcFile, destFile); + } + }); + } + + return io$1; +} + +var hasRequiredToolrunner$1; + +function requireToolrunner$1 () { + if (hasRequiredToolrunner$1) return toolrunner$1; + hasRequiredToolrunner$1 = 1; + var __createBinding = (toolrunner$1 && toolrunner$1.__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 = (toolrunner$1 && toolrunner$1.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = (toolrunner$1 && toolrunner$1.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; + })(); + var __awaiter = (toolrunner$1 && toolrunner$1.__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(toolrunner$1, "__esModule", { value: true }); + toolrunner$1.ToolRunner = void 0; + toolrunner$1.argStringToArray = argStringToArray; + const os = __importStar(require$$0$4); + const events = __importStar(require$$0$7); + const child = __importStar(require$$2$6); + const path = __importStar(require$$1$6); + const io = __importStar(requireIo$1()); + const ioUtil = __importStar(requireIoUtil$1()); + const timers_1 = require$$6$2; + /* eslint-disable @typescript-eslint/unbound-method */ + const IS_WINDOWS = process.platform === 'win32'; + /* + * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. + */ + class ToolRunner extends events.EventEmitter { + constructor(toolPath, args, options) { + super(); + if (!toolPath) { + throw new Error("Parameter 'toolPath' cannot be null or empty."); + } + this.toolPath = toolPath; + this.args = args || []; + this.options = options || {}; + } + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } + } + _getCommandString(options, noPrefix) { + const toolPath = this._getSpawnFileName(); + const args = this._getSpawnArgs(options); + let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool + if (IS_WINDOWS) { + // Windows + cmd file + if (this._isCmdFile()) { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows + verbatim + else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows (regular) + else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; + } + } + } + else { + // OSX/Linux - this can likely be improved with some form of quoting. + // creating processes on Unix is fundamentally different than Windows. + // on Unix, execvp() takes an arg array. + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + return cmd; + } + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + // the rest of the string ... + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); + } + return s; + } + catch (err) { + // streaming lines to console is best effort. Don't fail a build. + this._debug(`error processing line. Failed with error ${err}`); + return ''; + } + } + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env['COMSPEC'] || 'cmd.exe'; + } + } + return this.toolPath; + } + _getSpawnArgs(options) { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + for (const a of this.args) { + argline += ' '; + argline += options.windowsVerbatimArguments + ? a + : this._windowsQuoteCmdArg(a); + } + argline += '"'; + return [argline]; + } + } + return this.args; + } + _endsWith(str, end) { + return str.endsWith(end); + } + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return (this._endsWith(upperToolPath, '.CMD') || + this._endsWith(upperToolPath, '.BAT')); + } + _windowsQuoteCmdArg(arg) { + // for .exe, apply the normal quoting rules that libuv applies + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); + } + // otherwise apply quoting rules specific to the cmd.exe command line parser. + // the libuv rules are generic and are not designed specifically for cmd.exe + // command line parser. + // + // for a detailed description of the cmd.exe command line parser, refer to + // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 + // need quotes for empty arg + if (!arg) { + return '""'; + } + // determine whether the arg needs to be quoted + const cmdSpecialChars = [ + ' ', + '\t', + '&', + '(', + ')', + '[', + ']', + '{', + '}', + '^', + '=', + ';', + '!', + "'", + '+', + ',', + '`', + '~', + '|', + '<', + '>', + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some(x => x === char)) { + needsQuotes = true; + break; + } + } + // short-circuit if quotes not needed + if (!needsQuotes) { + return arg; + } + // the following quoting rules are very similar to the rules that by libuv applies. + // + // 1) wrap the string in quotes + // + // 2) double-up quotes - i.e. " => "" + // + // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately + // doesn't work well with a cmd.exe command line. + // + // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. + // for example, the command line: + // foo.exe "myarg:""my val""" + // is parsed by a .NET console app into an arg array: + // [ "myarg:\"my val\"" ] + // which is the same end result when applying libuv quoting rules. although the actual + // command line from libuv quoting rules would look like: + // foo.exe "myarg:\"my val\"" + // + // 3) double-up slashes that precede a quote, + // e.g. hello \world => "hello \world" + // hello\"world => "hello\\""world" + // hello\\"world => "hello\\\\""world" + // hello world\ => "hello world\\" + // + // technically this is not required for a cmd.exe command line, or the batch argument parser. + // the reasons for including this as a .cmd quoting rule are: + // + // a) this is optimized for the scenario where the argument is passed from the .cmd file to an + // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. + // + // b) it's what we've been doing previously (by deferring to node default behavior) and we + // haven't heard any complaints about that aspect. + // + // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be + // escaped when used on the command line directly - even though within a .cmd file % can be escaped + // by using %%. + // + // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts + // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. + // + // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would + // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the + // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args + // to an external program. + // + // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. + // % can be escaped within a .cmd file. + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; // double the slash + } + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '"'; // double the quote + } + else { + quoteHit = false; + } + } + reverse += '"'; + return reverse.split('').reverse().join(''); + } + _uvQuoteCmdArg(arg) { + // Tool runner wraps child_process.spawn() and needs to apply the same quoting as + // Node in certain cases where the undocumented spawn option windowsVerbatimArguments + // is used. + // + // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, + // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), + // pasting copyright notice from Node within this function: + // + // Copyright Joyent, Inc. and other Node contributors. All rights reserved. + // + // 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. + if (!arg) { + // Need double quotation for empty argument + return '""'; + } + if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { + // No quotation needed + return arg; + } + if (!arg.includes('"') && !arg.includes('\\')) { + // No embedded double quotes or backslashes, so I can just wrap + // quote marks around the whole thing. + return `"${arg}"`; + } + // Expected input/output: + // input : hello"world + // output: "hello\"world" + // input : hello""world + // output: "hello\"\"world" + // input : hello\world + // output: hello\world + // input : hello\\world + // output: hello\\world + // input : hello\"world + // output: "hello\\\"world" + // input : hello\\"world + // output: "hello\\\\\"world" + // input : hello world\ + // output: "hello world\\" - note the comment in libuv actually reads "hello world\" + // but it appears the comment is wrong, it should be "hello world\\" + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; + } + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '\\'; + } + else { + quoteHit = false; + } + } + reverse += '"'; + return reverse.split('').reverse().join(''); + } + _cloneExecOptions(options) { + options = options || {}; + const result = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + windowsVerbatimArguments: options.windowsVerbatimArguments || false, + failOnStdErr: options.failOnStdErr || false, + ignoreReturnCode: options.ignoreReturnCode || false, + delay: options.delay || 10000 + }; + result.outStream = options.outStream || process.stdout; + result.errStream = options.errStream || process.stderr; + return result; + } + _getSpawnOptions(options, toolPath) { + options = options || {}; + const result = {}; + result.cwd = options.cwd; + result.env = options.env; + result['windowsVerbatimArguments'] = + options.windowsVerbatimArguments || this._isCmdFile(); + if (options.windowsVerbatimArguments) { + result.argv0 = `"${toolPath}"`; + } + return result; + } + /** + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See ExecOptions + * @returns number + */ + exec() { + return __awaiter(this, void 0, void 0, function* () { + // root the tool path if it is unrooted and contains relative pathing + if (!ioUtil.isRooted(this.toolPath) && + (this.toolPath.includes('/') || + (IS_WINDOWS && this.toolPath.includes('\\')))) { + // prefer options.cwd if it is specified, however options.cwd may also need to be rooted + this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + // if the tool is only a file name, then resolve it from the PATH + // otherwise verify it exists (add extension on Windows if necessary) + this.toolPath = yield io.which(this.toolPath, true); + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + this._debug(`exec tool: ${this.toolPath}`); + this._debug('arguments:'); + for (const arg of this.args) { + this._debug(` ${arg}`); + } + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); + } + const state = new ExecState(optionsNonNull, this.toolPath); + state.on('debug', (message) => { + this._debug(message); + }); + if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { + return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); + } + const fileName = this._getSpawnFileName(); + const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); + let stdbuffer = ''; + if (cp.stdout) { + cp.stdout.on('data', (data) => { + if (this.options.listeners && this.options.listeners.stdout) { + this.options.listeners.stdout(data); + } + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(data); + } + stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { + if (this.options.listeners && this.options.listeners.stdline) { + this.options.listeners.stdline(line); + } + }); + }); + } + let errbuffer = ''; + if (cp.stderr) { + cp.stderr.on('data', (data) => { + state.processStderr = true; + if (this.options.listeners && this.options.listeners.stderr) { + this.options.listeners.stderr(data); + } + if (!optionsNonNull.silent && + optionsNonNull.errStream && + optionsNonNull.outStream) { + const s = optionsNonNull.failOnStdErr + ? optionsNonNull.errStream + : optionsNonNull.outStream; + s.write(data); + } + errbuffer = this._processLineBuffer(data, errbuffer, (line) => { + if (this.options.listeners && this.options.listeners.errline) { + this.options.listeners.errline(line); + } + }); + }); + } + cp.on('error', (err) => { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); + }); + cp.on('exit', (code) => { + state.processExitCode = code; + state.processExited = true; + this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); + state.CheckComplete(); + }); + cp.on('close', (code) => { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); + state.CheckComplete(); + }); + state.on('done', (error, exitCode) => { + if (stdbuffer.length > 0) { + this.emit('stdline', stdbuffer); + } + if (errbuffer.length > 0) { + this.emit('errline', errbuffer); + } + cp.removeAllListeners(); + if (error) { + reject(error); + } + else { + resolve(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error('child process missing stdin'); + } + cp.stdin.end(this.options.input); + } + })); + }); + } + } + toolrunner$1.ToolRunner = ToolRunner; + /** + * Convert an arg string to an array of args. Handles escaping + * + * @param argString string of arguments + * @returns string[] array of arguments + */ + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ''; + function append(c) { + // we only escape double quotes. + if (escaped && c !== '"') { + arg += '\\'; + } + arg += c; + escaped = false; + } + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } + else { + append(c); + } + continue; + } + if (c === '\\' && escaped) { + append(c); + continue; + } + if (c === '\\' && inQuotes) { + escaped = true; + continue; + } + if (c === ' ' && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ''; + } + continue; + } + append(c); + } + if (arg.length > 0) { + args.push(arg.trim()); + } + return args; + } + class ExecState extends events.EventEmitter { + constructor(options, toolPath) { + super(); + this.processClosed = false; // tracks whether the process has exited and stdio is closed + this.processError = ''; + this.processExitCode = 0; + this.processExited = false; // tracks whether the process has exited + this.processStderr = false; // tracks whether stderr was written to + this.delay = 10000; // 10 seconds + this.done = false; + this.timeout = null; + if (!toolPath) { + throw new Error('toolPath must not be empty'); + } + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; + } + } + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } + else if (this.processExited) { + this.timeout = (0, timers_1.setTimeout)(ExecState.HandleTimeout, this.delay, this); + } + } + _debug(message) { + this.emit('debug', message); + } + _setResult() { + // determine whether there is an error + let error; + if (this.processExited) { + if (this.processError) { + error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); + } + else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { + error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + } + else if (this.processStderr && this.options.failOnStdErr) { + error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + } + } + // clear the timeout + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit('done', error, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) { + return; + } + if (!state.processClosed && state.processExited) { + const message = `The STDIO streams did not close within ${state.delay / 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + state._debug(message); + } + state._setResult(); + } + } + + return toolrunner$1; +} + +var hasRequiredExec$1; + +function requireExec$1 () { + if (hasRequiredExec$1) return exec$1; + hasRequiredExec$1 = 1; + var __createBinding = (exec$1 && exec$1.__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 = (exec$1 && exec$1.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = (exec$1 && exec$1.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; + })(); + var __awaiter = (exec$1 && exec$1.__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(exec$1, "__esModule", { value: true }); + exec$1.exec = exec; + exec$1.getExecOutput = getExecOutput; + const string_decoder_1 = require$$0$e; + const tr = __importStar(requireToolrunner$1()); + /** + * Exec a command. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code + */ + function exec(commandLine, args, options) { + return __awaiter(this, void 0, void 0, function* () { + const commandArgs = tr.argStringToArray(commandLine); + if (commandArgs.length === 0) { + throw new Error(`Parameter 'commandLine' cannot be null or empty.`); + } + // Path to tool to execute should be first arg + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); + } + /** + * Exec a command and get the output. + * Output will be streamed to the live console. + * Returns promise with the exit code and collected stdout and stderr + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code, stdout, and stderr + */ + function getExecOutput(commandLine, args, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b; + let stdout = ''; + let stderr = ''; + //Using string decoder covers the case where a mult-byte character is split + const stdoutDecoder = new string_decoder_1.StringDecoder('utf8'); + const stderrDecoder = new string_decoder_1.StringDecoder('utf8'); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; + const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; + const stdErrListener = (data) => { + stderr += stderrDecoder.write(data); + if (originalStdErrListener) { + originalStdErrListener(data); + } + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); + } + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + //flush any remaining characters + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); + } + + return exec$1; +} + +var hasRequiredPlatform$1; + +function requirePlatform$1 () { + if (hasRequiredPlatform$1) return platform$1; + hasRequiredPlatform$1 = 1; + (function (exports$1) { + var __createBinding = (platform$1 && platform$1.__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 = (platform$1 && platform$1.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = (platform$1 && platform$1.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; + })(); + var __awaiter = (platform$1 && platform$1.__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); } } @@ -25994,14 +26882,148 @@ function requireCore () { step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; + var __importDefault = (platform$1 && platform$1.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; Object.defineProperty(exports$1, "__esModule", { value: true }); - exports$1.getIDToken = exports$1.getState = exports$1.saveState = exports$1.group = exports$1.endGroup = exports$1.startGroup = exports$1.info = exports$1.notice = exports$1.warning = exports$1.error = exports$1.debug = exports$1.isDebug = exports$1.setFailed = exports$1.setCommandEcho = exports$1.setOutput = exports$1.getBooleanInput = exports$1.getMultilineInput = exports$1.getInput = exports$1.addPath = exports$1.setSecret = exports$1.exportVariable = exports$1.ExitCode = void 0; - const command_1 = requireCommand(); - const file_command_1 = requireFileCommand(); - const utils_1 = requireUtils$3(); + exports$1.isLinux = exports$1.isMacOS = exports$1.isWindows = exports$1.arch = exports$1.platform = void 0; + exports$1.getDetails = getDetails; + const os_1 = __importDefault(require$$0$4); + const exec = __importStar(requireExec$1()); + const getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', undefined, { + silent: true + }); + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', undefined, { + silent: true + }); + return { + name: name.trim(), + version: version.trim() + }; + }); + const getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () { + var _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput('sw_vers', undefined, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ''; + const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : ''; + return { + name, + version + }; + }); + const getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () { + const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], { + silent: true + }); + const [name, version] = stdout.trim().split('\n'); + return { + name, + version + }; + }); + exports$1.platform = os_1.default.platform(); + exports$1.arch = os_1.default.arch(); + exports$1.isWindows = exports$1.platform === 'win32'; + exports$1.isMacOS = exports$1.platform === 'darwin'; + exports$1.isLinux = exports$1.platform === 'linux'; + function getDetails() { + return __awaiter(this, void 0, void 0, function* () { + return Object.assign(Object.assign({}, (yield (exports$1.isWindows + ? getWindowsInfo() + : exports$1.isMacOS + ? getMacOsInfo() + : getLinuxInfo()))), { platform: exports$1.platform, + arch: exports$1.arch, + isWindows: exports$1.isWindows, + isMacOS: exports$1.isMacOS, + isLinux: exports$1.isLinux }); + }); + } + + } (platform$1)); + return platform$1; +} + +var hasRequiredCore$1; + +function requireCore$1 () { + if (hasRequiredCore$1) return core$1; + hasRequiredCore$1 = 1; + (function (exports$1) { + var __createBinding = (core$1 && core$1.__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 = (core$1 && core$1.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = (core$1 && core$1.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; + })(); + var __awaiter = (core$1 && core$1.__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$1, "__esModule", { value: true }); + exports$1.platform = exports$1.toPlatformPath = exports$1.toWin32Path = exports$1.toPosixPath = exports$1.markdownSummary = exports$1.summary = exports$1.ExitCode = void 0; + exports$1.exportVariable = exportVariable; + exports$1.setSecret = setSecret; + exports$1.addPath = addPath; + exports$1.getInput = getInput; + exports$1.getMultilineInput = getMultilineInput; + exports$1.getBooleanInput = getBooleanInput; + exports$1.setOutput = setOutput; + exports$1.setCommandEcho = setCommandEcho; + exports$1.setFailed = setFailed; + exports$1.isDebug = isDebug; + exports$1.debug = debug; + exports$1.error = error; + exports$1.warning = warning; + exports$1.notice = notice; + exports$1.info = info; + exports$1.startGroup = startGroup; + exports$1.endGroup = endGroup; + exports$1.group = group; + exports$1.saveState = saveState; + exports$1.getState = getState; + exports$1.getIDToken = getIDToken; + const command_1 = requireCommand$1(); + const file_command_1 = requireFileCommand$1(); + const utils_1 = requireUtils$4(); const os = __importStar(require$$0$4); - const path = __importStar(require$$0$e); - const oidc_utils_1 = requireOidcUtils(); + const path = __importStar(require$$1$6); + const oidc_utils_1 = requireOidcUtils$1(); /** * The code to exit an action */ @@ -26015,7 +27037,7 @@ function requireCore () { * A code indicating that the action was a failure */ ExitCode[ExitCode["Failure"] = 1] = "Failure"; - })(ExitCode = exports$1.ExitCode || (exports$1.ExitCode = {})); + })(ExitCode || (exports$1.ExitCode = ExitCode = {})); //----------------------------------------------------------------------- // Variables //----------------------------------------------------------------------- @@ -26026,23 +27048,46 @@ function requireCore () { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function exportVariable(name, val) { - const convertedVal = utils_1.toCommandValue(val); + const convertedVal = (0, utils_1.toCommandValue)(val); process.env[name] = convertedVal; const filePath = process.env['GITHUB_ENV'] || ''; if (filePath) { - return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val)); + return (0, file_command_1.issueFileCommand)('ENV', (0, file_command_1.prepareKeyValueMessage)(name, val)); } - command_1.issueCommand('set-env', { name }, convertedVal); + (0, command_1.issueCommand)('set-env', { name }, convertedVal); } - exports$1.exportVariable = exportVariable; /** * Registers a secret which will get masked from logs - * @param secret value of the secret + * + * @param secret - Value of the secret to be masked + * @remarks + * This function instructs the Actions runner to mask the specified value in any + * logs produced during the workflow run. Once registered, the secret value will + * be replaced with asterisks (***) whenever it appears in console output, logs, + * or error messages. + * + * This is useful for protecting sensitive information such as: + * - API keys + * - Access tokens + * - Authentication credentials + * - URL parameters containing signatures (SAS tokens) + * + * Note that masking only affects future logs; any previous appearances of the + * secret in logs before calling this function will remain unmasked. + * + * @example + * ```typescript + * // Register an API token as a secret + * const apiToken = "abc123xyz456"; + * setSecret(apiToken); + * + * // Now any logs containing this value will show *** instead + * console.log(`Using token: ${apiToken}`); // Outputs: "Using token: ***" + * ``` */ function setSecret(secret) { - command_1.issueCommand('add-mask', {}, secret); + (0, command_1.issueCommand)('add-mask', {}, secret); } - exports$1.setSecret = setSecret; /** * Prepends inputPath to the PATH (for this action and future actions) * @param inputPath @@ -26050,14 +27095,13 @@ function requireCore () { function addPath(inputPath) { const filePath = process.env['GITHUB_PATH'] || ''; if (filePath) { - file_command_1.issueFileCommand('PATH', inputPath); + (0, file_command_1.issueFileCommand)('PATH', inputPath); } else { - command_1.issueCommand('add-path', {}, inputPath); + (0, command_1.issueCommand)('add-path', {}, inputPath); } process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; } - exports$1.addPath = addPath; /** * Gets the value of an input. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. @@ -26077,7 +27121,6 @@ function requireCore () { } return val.trim(); } - exports$1.getInput = getInput; /** * Gets the values of an multiline input. Each value is also trimmed. * @@ -26095,7 +27138,6 @@ function requireCore () { } return inputs.map(input => input.trim()); } - exports$1.getMultilineInput = getMultilineInput; /** * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. * Support boolean input list: `true | True | TRUE | false | False | FALSE` . @@ -26117,7 +27159,6 @@ function requireCore () { throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` + `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } - exports$1.getBooleanInput = getBooleanInput; /** * Sets the value of an output. * @@ -26128,21 +27169,19 @@ function requireCore () { function setOutput(name, value) { const filePath = process.env['GITHUB_OUTPUT'] || ''; if (filePath) { - return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value)); + return (0, file_command_1.issueFileCommand)('OUTPUT', (0, file_command_1.prepareKeyValueMessage)(name, value)); } process.stdout.write(os.EOL); - command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value)); + (0, command_1.issueCommand)('set-output', { name }, (0, utils_1.toCommandValue)(value)); } - exports$1.setOutput = setOutput; /** * Enables or disables the echoing of commands into stdout for the rest of the step. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. * */ function setCommandEcho(enabled) { - command_1.issue('echo', enabled ? 'on' : 'off'); + (0, command_1.issue)('echo', enabled ? 'on' : 'off'); } - exports$1.setCommandEcho = setCommandEcho; //----------------------------------------------------------------------- // Results //----------------------------------------------------------------------- @@ -26155,7 +27194,6 @@ function requireCore () { process.exitCode = ExitCode.Failure; error(message); } - exports$1.setFailed = setFailed; //----------------------------------------------------------------------- // Logging Commands //----------------------------------------------------------------------- @@ -26165,42 +27203,37 @@ function requireCore () { function isDebug() { return process.env['RUNNER_DEBUG'] === '1'; } - exports$1.isDebug = isDebug; /** * Writes debug message to user log * @param message debug message */ function debug(message) { - command_1.issueCommand('debug', {}, message); + (0, command_1.issueCommand)('debug', {}, message); } - exports$1.debug = debug; /** * Adds an error issue * @param message error issue message. Errors will be converted to string via toString() * @param properties optional properties to add to the annotation. */ function error(message, properties = {}) { - command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + (0, command_1.issueCommand)('error', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports$1.error = error; /** * Adds a warning issue * @param message warning issue message. Errors will be converted to string via toString() * @param properties optional properties to add to the annotation. */ function warning(message, properties = {}) { - command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + (0, command_1.issueCommand)('warning', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports$1.warning = warning; /** * Adds a notice issue * @param message notice issue message. Errors will be converted to string via toString() * @param properties optional properties to add to the annotation. */ function notice(message, properties = {}) { - command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + (0, command_1.issueCommand)('notice', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports$1.notice = notice; /** * Writes info to log with console.log. * @param message info message @@ -26208,7 +27241,6 @@ function requireCore () { function info(message) { process.stdout.write(message + os.EOL); } - exports$1.info = info; /** * Begin an output group. * @@ -26217,16 +27249,14 @@ function requireCore () { * @param name The name of the output group */ function startGroup(name) { - command_1.issue('group', name); + (0, command_1.issue)('group', name); } - exports$1.startGroup = startGroup; /** * End an output group. */ function endGroup() { - command_1.issue('endgroup'); + (0, command_1.issue)('endgroup'); } - exports$1.endGroup = endGroup; /** * Wrap an asynchronous function call in a group. * @@ -26248,7 +27278,6 @@ function requireCore () { return result; }); } - exports$1.group = group; //----------------------------------------------------------------------- // Wrapper action state //----------------------------------------------------------------------- @@ -26262,11 +27291,10 @@ function requireCore () { function saveState(name, value) { const filePath = process.env['GITHUB_STATE'] || ''; if (filePath) { - return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value)); + return (0, file_command_1.issueFileCommand)('STATE', (0, file_command_1.prepareKeyValueMessage)(name, value)); } - command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value)); + (0, command_1.issueCommand)('save-state', { name }, (0, utils_1.toCommandValue)(value)); } - exports$1.saveState = saveState; /** * Gets the value of an state set by this action's main execution. * @@ -26276,36 +27304,38 @@ function requireCore () { function getState(name) { return process.env[`STATE_${name}`] || ''; } - exports$1.getState = getState; function getIDToken(aud) { return __awaiter(this, void 0, void 0, function* () { return yield oidc_utils_1.OidcClient.getIDToken(aud); }); } - exports$1.getIDToken = getIDToken; /** * Summary exports */ - var summary_1 = requireSummary(); + var summary_1 = requireSummary$1(); Object.defineProperty(exports$1, "summary", { enumerable: true, get: function () { return summary_1.summary; } }); /** * @deprecated use core.summary */ - var summary_2 = requireSummary(); + var summary_2 = requireSummary$1(); Object.defineProperty(exports$1, "markdownSummary", { enumerable: true, get: function () { return summary_2.markdownSummary; } }); /** * Path exports */ - var path_utils_1 = requirePathUtils(); + var path_utils_1 = requirePathUtils$1(); Object.defineProperty(exports$1, "toPosixPath", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } }); Object.defineProperty(exports$1, "toWin32Path", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } }); Object.defineProperty(exports$1, "toPlatformPath", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }); + /** + * Platform utilities exports + */ + exports$1.platform = __importStar(requirePlatform$1()); - } (core)); - return core; + } (core$1)); + return core$1; } -var coreExports = requireCore(); +var coreExports = requireCore$1(); var github = {}; @@ -26318,7 +27348,7 @@ function requireContext () { hasRequiredContext = 1; Object.defineProperty(context, "__esModule", { value: true }); context.Context = void 0; - const fs_1 = require$$0$5; + const fs_1 = require$$0$6; const os_1 = require$$0$4; class Context { /** @@ -26373,16 +27403,110 @@ function requireContext () { return context; } +var utils$2 = {}; + var utils$1 = {}; -var utils = {}; +var lib = {}; -var hasRequiredUtils$1; +var proxy = {}; -function requireUtils$1 () { - if (hasRequiredUtils$1) return utils; - hasRequiredUtils$1 = 1; - var __createBinding = (utils && utils.__createBinding) || (Object.create ? (function(o, m, k, k2) { +var hasRequiredProxy; + +function requireProxy () { + if (hasRequiredProxy) return proxy; + hasRequiredProxy = 1; + Object.defineProperty(proxy, "__esModule", { value: true }); + proxy.checkBypass = proxy.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) { + try { + return new URL(proxyVar); + } + catch (_a) { + if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) + return new URL(`http://${proxyVar}`); + } + } + else { + return undefined; + } + } + proxy.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; + } + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; + } + 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 (upperNoProxyItem === '*' || + upperReqHosts.some(x => x === upperNoProxyItem || + x.endsWith(`.${upperNoProxyItem}`) || + (upperNoProxyItem.startsWith('.') && + x.endsWith(`${upperNoProxyItem}`)))) { + return true; + } + } + return false; + } + proxy.checkBypass = checkBypass; + function isLoopbackAddress(host) { + const hostLower = host.toLowerCase(); + return (hostLower === 'localhost' || + hostLower.startsWith('127.') || + hostLower.startsWith('[::1]') || + hostLower.startsWith('[0:0:0:0:0:0:0:1]')); + } + + return proxy; +} + +var hasRequiredLib; + +function requireLib () { + if (hasRequiredLib) return lib; + hasRequiredLib = 1; + /* eslint-disable @typescript-eslint/no-explicit-any */ + var __createBinding = (lib && lib.__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)) { @@ -26393,19 +27517,19 @@ function requireUtils$1 () { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault = (utils && utils.__setModuleDefault) || (Object.create ? (function(o, v) { + var __setModuleDefault = (lib && lib.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); - var __importStar = (utils && utils.__importStar) || function (mod) { + var __importStar = (lib && lib.__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 __awaiter = (utils && utils.__awaiter) || function (thisArg, _arguments, P, generator) { + var __awaiter = (lib && lib.__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); } } @@ -26414,8 +27538,670 @@ function requireUtils$1 () { step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Object.defineProperty(utils, "__esModule", { value: true }); - utils.getApiBaseUrl = utils.getProxyFetch = utils.getProxyAgentDispatcher = utils.getProxyAgent = utils.getAuthString = void 0; + Object.defineProperty(lib, "__esModule", { value: true }); + lib.HttpClient = lib.isHttps = lib.HttpClientResponse = lib.HttpClientError = lib.getProxyUrl = lib.MediaTypes = lib.Headers = lib.HttpCodes = void 0; + const http = __importStar(require$$2$4); + const https = __importStar(require$$1$1); + const pm = __importStar(requireProxy()); + const tunnel = __importStar(requireTunnel()); + const undici_1 = requireUndici(); + 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 || (lib.HttpCodes = HttpCodes = {})); + var Headers; + (function (Headers) { + Headers["Accept"] = "accept"; + Headers["ContentType"] = "content-type"; + })(Headers || (lib.Headers = Headers = {})); + var MediaTypes; + (function (MediaTypes) { + MediaTypes["ApplicationJson"] = "application/json"; + })(MediaTypes || (lib.MediaTypes = 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 : ''; + } + lib.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); + } + } + lib.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()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + const chunks = []; + this.message.on('data', (chunk) => { + chunks.push(chunk); + }); + this.message.on('end', () => { + resolve(Buffer.concat(chunks)); + }); + })); + }); + } + } + lib.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === 'https:'; + } + lib.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; + } + } + } + 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 || {}); + }); + } + del(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + }); + } + post(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('POST', requestUrl, data, additionalHeaders || {}); + }); + } + patch(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + }); + } + put(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); + }); + } + head(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + }); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, additionalHeaders); + }); + } + /** + * 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); + } + getAgentDispatcher(serverUrl) { + const parsedUrl = new URL(serverUrl); + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (!useProxy) { + return; + } + return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + } + _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; + } + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { + let proxyAgent; + if (this._keepAlive) { + proxyAgent = this._proxyAgentDispatcher; + } + // if agent is already assigned use that agent. + if (proxyAgent) { + return proxyAgent; + } + const usingSsl = parsedUrl.protocol === 'https:'; + proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && { + token: `${proxyUrl.username}:${proxyUrl.password}` + }))); + this._proxyAgentDispatcher = proxyAgent; + 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 + proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { + rejectUnauthorized: false + }); + } + return proxyAgent; + } + _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); + } + })); + }); + } + } + lib.HttpClient = HttpClient; + const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); + + return lib; +} + +var hasRequiredUtils$2; + +function requireUtils$2 () { + if (hasRequiredUtils$2) return utils$1; + hasRequiredUtils$2 = 1; + var __createBinding = (utils$1 && utils$1.__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 = (utils$1 && utils$1.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = (utils$1 && utils$1.__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 __awaiter = (utils$1 && utils$1.__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(utils$1, "__esModule", { value: true }); + utils$1.getApiBaseUrl = utils$1.getProxyFetch = utils$1.getProxyAgentDispatcher = utils$1.getProxyAgent = utils$1.getAuthString = void 0; const httpClient = __importStar(requireLib()); const undici_1 = requireUndici(); function getAuthString(token, options) { @@ -26427,17 +28213,17 @@ function requireUtils$1 () { } return typeof options.auth === 'string' ? options.auth : `token ${token}`; } - utils.getAuthString = getAuthString; + utils$1.getAuthString = getAuthString; function getProxyAgent(destinationUrl) { const hc = new httpClient.HttpClient(); return hc.getAgent(destinationUrl); } - utils.getProxyAgent = getProxyAgent; + utils$1.getProxyAgent = getProxyAgent; function getProxyAgentDispatcher(destinationUrl) { const hc = new httpClient.HttpClient(); return hc.getAgentDispatcher(destinationUrl); } - utils.getProxyAgentDispatcher = getProxyAgentDispatcher; + utils$1.getProxyAgentDispatcher = getProxyAgentDispatcher; function getProxyFetch(destinationUrl) { const httpDispatcher = getProxyAgentDispatcher(destinationUrl); const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () { @@ -26445,13 +28231,13 @@ function requireUtils$1 () { }); return proxyFetch; } - utils.getProxyFetch = getProxyFetch; + utils$1.getProxyFetch = getProxyFetch; function getApiBaseUrl() { return process.env['GITHUB_API_URL'] || 'https://api.github.com'; } - utils.getApiBaseUrl = getApiBaseUrl; + utils$1.getApiBaseUrl = getApiBaseUrl; - return utils; + return utils$1; } function getUserAgent() { @@ -27451,7 +29237,7 @@ function withCustomRequest(customRequest) { const REGEX_IS_INSTALLATION_LEGACY = /^v1\./; const REGEX_IS_INSTALLATION = /^ghs_/; const REGEX_IS_USER_TO_SERVER = /^ghu_/; -async function auth(token) { +async function auth$1(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); @@ -27489,7 +29275,7 @@ const createTokenAuth = function createTokenAuth2(token) { ); } token = token.replace(/^(token|bearer) +/i, ""); - return Object.assign(auth.bind(null, token), { + return Object.assign(auth$1.bind(null, token), { hook: hook.bind(null, token) }); }; @@ -30150,13 +31936,13 @@ var distWeb = /*#__PURE__*/Object.freeze({ var require$$4$3 = /*@__PURE__*/getAugmentedNamespace(distWeb); -var hasRequiredUtils; +var hasRequiredUtils$1; -function requireUtils () { - if (hasRequiredUtils) return utils$1; - hasRequiredUtils = 1; +function requireUtils$1 () { + if (hasRequiredUtils$1) return utils$2; + hasRequiredUtils$1 = 1; (function (exports$1) { - var __createBinding = (utils$1 && utils$1.__createBinding) || (Object.create ? (function(o, m, k, k2) { + var __createBinding = (utils$2 && utils$2.__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)) { @@ -30167,12 +31953,12 @@ function requireUtils () { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault = (utils$1 && utils$1.__setModuleDefault) || (Object.create ? (function(o, v) { + var __setModuleDefault = (utils$2 && utils$2.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); - var __importStar = (utils$1 && utils$1.__importStar) || function (mod) { + var __importStar = (utils$2 && utils$2.__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); @@ -30182,7 +31968,7 @@ function requireUtils () { Object.defineProperty(exports$1, "__esModule", { value: true }); exports$1.getOctokitOptions = exports$1.GitHub = exports$1.defaults = exports$1.context = void 0; const Context = __importStar(requireContext()); - const Utils = __importStar(requireUtils$1()); + const Utils = __importStar(requireUtils$2()); // octokit + plugins const core_1 = require$$2$3; const plugin_rest_endpoint_methods_1 = require$$3$3; @@ -30214,8 +32000,8 @@ function requireUtils () { } exports$1.getOctokitOptions = getOctokitOptions; - } (utils$1)); - return utils$1; + } (utils$2)); + return utils$2; } var hasRequiredGithub; @@ -30249,7 +32035,7 @@ function requireGithub () { Object.defineProperty(github, "__esModule", { value: true }); github.getOctokit = github.context = void 0; const Context = __importStar(requireContext()); - const utils_1 = requireUtils(); + const utils_1 = requireUtils$1(); github.context = new Context.Context(); /** * Returns a hydrated octokit ready to use for GitHub Actions @@ -30272,6 +32058,2473 @@ var glob = {}; var internalGlobber = {}; +var core = {}; + +var command = {}; + +var utils = {}; + +var hasRequiredUtils; + +function requireUtils () { + if (hasRequiredUtils) return utils; + hasRequiredUtils = 1; + // We use any as a valid input type + /* eslint-disable @typescript-eslint/no-explicit-any */ + Object.defineProperty(utils, "__esModule", { value: true }); + utils.toCommandProperties = utils.toCommandValue = void 0; + /** + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string + */ + function toCommandValue(input) { + if (input === null || input === undefined) { + return ''; + } + else if (typeof input === 'string' || input instanceof String) { + return input; + } + return JSON.stringify(input); + } + utils.toCommandValue = toCommandValue; + /** + * + * @param annotationProperties + * @returns The command properties to send with the actual annotation command + * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646 + */ + function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; + } + return { + title: annotationProperties.title, + file: annotationProperties.file, + line: annotationProperties.startLine, + endLine: annotationProperties.endLine, + col: annotationProperties.startColumn, + endColumn: annotationProperties.endColumn + }; + } + utils.toCommandProperties = toCommandProperties; + + return utils; +} + +var hasRequiredCommand; + +function requireCommand () { + if (hasRequiredCommand) return command; + hasRequiredCommand = 1; + var __createBinding = (command && command.__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 = (command && command.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = (command && command.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + Object.defineProperty(command, "__esModule", { value: true }); + command.issue = command.issueCommand = void 0; + const os = __importStar(require$$0$4); + const utils_1 = requireUtils(); + /** + * Commands + * + * Command Format: + * ::name key=value,key=value::message + * + * Examples: + * ::warning::This is the message + * ::set-env name=MY_VAR::some value + */ + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os.EOL); + } + command.issueCommand = issueCommand; + function issue(name, message = '') { + issueCommand(name, {}, message); + } + command.issue = issue; + const CMD_STRING = '::'; + class Command { + constructor(command, properties, message) { + if (!command) { + command = 'missing.command'; + } + this.command = command; + this.properties = properties; + this.message = message; + } + toString() { + let cmdStr = CMD_STRING + this.command; + if (this.properties && Object.keys(this.properties).length > 0) { + cmdStr += ' '; + let first = true; + for (const key in this.properties) { + if (this.properties.hasOwnProperty(key)) { + const val = this.properties[key]; + if (val) { + if (first) { + first = false; + } + else { + cmdStr += ','; + } + cmdStr += `${key}=${escapeProperty(val)}`; + } + } + } + } + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; + } + } + function escapeData(s) { + return (0, utils_1.toCommandValue)(s) + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A'); + } + function escapeProperty(s) { + return (0, utils_1.toCommandValue)(s) + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A') + .replace(/:/g, '%3A') + .replace(/,/g, '%2C'); + } + + return command; +} + +var fileCommand = {}; + +var hasRequiredFileCommand; + +function requireFileCommand () { + if (hasRequiredFileCommand) return fileCommand; + hasRequiredFileCommand = 1; + // For internal use, subject to change. + var __createBinding = (fileCommand && fileCommand.__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 = (fileCommand && fileCommand.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = (fileCommand && fileCommand.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + Object.defineProperty(fileCommand, "__esModule", { value: true }); + fileCommand.prepareKeyValueMessage = fileCommand.issueFileCommand = void 0; + // We use any as a valid input type + /* eslint-disable @typescript-eslint/no-explicit-any */ + const crypto = __importStar(require$$0$5); + const fs = __importStar(require$$0$6); + const os = __importStar(require$$0$4); + const utils_1 = requireUtils(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); + } + if (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { + encoding: 'utf8' + }); + } + fileCommand.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + // These should realistically never happen, but just in case someone finds a + // way to exploit uuid generation let's not allow keys or values that contain + // the delimiter. + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); + } + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); + } + return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; + } + fileCommand.prepareKeyValueMessage = prepareKeyValueMessage; + + return fileCommand; +} + +var oidcUtils = {}; + +var auth = {}; + +var hasRequiredAuth; + +function requireAuth () { + if (hasRequiredAuth) return auth; + hasRequiredAuth = 1; + var __awaiter = (auth && auth.__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(auth, "__esModule", { value: true }); + auth.PersonalAccessTokenCredentialHandler = auth.BearerCredentialHandler = auth.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'); + }); + } + } + auth.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'); + }); + } + } + auth.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'); + }); + } + } + auth.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + + return auth; +} + +var hasRequiredOidcUtils; + +function requireOidcUtils () { + if (hasRequiredOidcUtils) return oidcUtils; + hasRequiredOidcUtils = 1; + var __awaiter = (oidcUtils && oidcUtils.__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(oidcUtils, "__esModule", { value: true }); + oidcUtils.OidcClient = void 0; + const http_client_1 = requireLib(); + const auth_1 = requireAuth(); + const core_1 = requireCore(); + class OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry + }; + return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions); + } + static getRequestToken() { + const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN']; + if (!token) { + throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable'); + } + return token; + } + static getIDTokenUrl() { + const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL']; + if (!runtimeUrl) { + throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable'); + } + return runtimeUrl; + } + static getCall(id_token_url) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + const httpclient = OidcClient.createHttpClient(); + const res = yield httpclient + .getJson(id_token_url) + .catch(error => { + throw new Error(`Failed to get ID Token. \n + Error Code : ${error.statusCode}\n + Error Message: ${error.message}`); + }); + const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error('Response json body do not have ID Token field'); + } + return id_token; + }); + } + static getIDToken(audience) { + return __awaiter(this, void 0, void 0, function* () { + try { + // New ID Token is requested from action service + let id_token_url = OidcClient.getIDTokenUrl(); + if (audience) { + const encodedAudience = encodeURIComponent(audience); + id_token_url = `${id_token_url}&audience=${encodedAudience}`; + } + (0, core_1.debug)(`ID token url is ${id_token_url}`); + const id_token = yield OidcClient.getCall(id_token_url); + (0, core_1.setSecret)(id_token); + return id_token; + } + catch (error) { + throw new Error(`Error message: ${error.message}`); + } + }); + } + } + oidcUtils.OidcClient = OidcClient; + + return oidcUtils; +} + +var summary = {}; + +var hasRequiredSummary; + +function requireSummary () { + if (hasRequiredSummary) return summary; + hasRequiredSummary = 1; + (function (exports$1) { + var __awaiter = (summary && summary.__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$1, "__esModule", { value: true }); + exports$1.summary = exports$1.markdownSummary = exports$1.SUMMARY_DOCS_URL = exports$1.SUMMARY_ENV_VAR = void 0; + const os_1 = require$$0$4; + const fs_1 = require$$0$6; + const { access, appendFile, writeFile } = fs_1.promises; + exports$1.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; + exports$1.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; + class Summary { + constructor() { + this._buffer = ''; + } + /** + * Finds the summary file path from the environment, rejects if env var is not found or file does not exist + * Also checks r/w permissions. + * + * @returns step summary file path + */ + filePath() { + return __awaiter(this, void 0, void 0, function* () { + if (this._filePath) { + return this._filePath; + } + const pathFromEnv = process.env[exports$1.SUMMARY_ENV_VAR]; + if (!pathFromEnv) { + throw new Error(`Unable to find environment variable for $${exports$1.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); + } + try { + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } + catch (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); + } + /** + * Wraps content in an HTML tag, adding any HTML attributes + * + * @param {string} tag HTML tag to wrap + * @param {string | null} content content within the tag + * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add + * + * @returns {string} content wrapped in HTML element + */ + wrap(tag, content, attrs = {}) { + const htmlAttrs = Object.entries(attrs) + .map(([key, value]) => ` ${key}="${value}"`) + .join(''); + if (!content) { + return `<${tag}${htmlAttrs}>`; + } + return `<${tag}${htmlAttrs}>${content}`; + } + /** + * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. + * + * @param {SummaryWriteOptions} [options] (optional) options for write operation + * + * @returns {Promise} summary instance + */ + write(options) { + return __awaiter(this, void 0, void 0, function* () { + const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); + const filePath = yield this.filePath(); + const writeFunc = overwrite ? writeFile : appendFile; + yield writeFunc(filePath, this._buffer, { encoding: 'utf8' }); + return this.emptyBuffer(); + }); + } + /** + * Clears the summary buffer and wipes the summary file + * + * @returns {Summary} summary instance + */ + clear() { + return __awaiter(this, void 0, void 0, function* () { + return this.emptyBuffer().write({ overwrite: true }); + }); + } + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; + } + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; + } + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ''; + return this; + } + /** + * Adds raw text to the summary buffer + * + * @param {string} text content to add + * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) + * + * @returns {Summary} summary instance + */ + addRaw(text, addEOL = false) { + this._buffer += text; + return addEOL ? this.addEOL() : this; + } + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); + } + /** + * Adds an HTML codeblock to the summary buffer + * + * @param {string} code content to render within fenced code block + * @param {string} lang (optional) language to syntax highlight code + * + * @returns {Summary} summary instance + */ + addCodeBlock(code, lang) { + const attrs = Object.assign({}, (lang && { lang })); + const element = this.wrap('pre', this.wrap('code', code), attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML list to the summary buffer + * + * @param {string[]} items list of items to render + * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) + * + * @returns {Summary} summary instance + */ + addList(items, ordered = false) { + const tag = ordered ? 'ol' : 'ul'; + const listItems = items.map(item => this.wrap('li', item)).join(''); + const element = this.wrap(tag, listItems); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML table to the summary buffer + * + * @param {SummaryTableCell[]} rows table rows + * + * @returns {Summary} summary instance + */ + addTable(rows) { + const tableBody = rows + .map(row => { + const cells = row + .map(cell => { + if (typeof cell === 'string') { + return this.wrap('td', cell); + } + const { header, data, colspan, rowspan } = cell; + const tag = header ? 'th' : 'td'; + const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan })); + return this.wrap(tag, data, attrs); + }) + .join(''); + return this.wrap('tr', cells); + }) + .join(''); + const element = this.wrap('table', tableBody); + return this.addRaw(element).addEOL(); + } + /** + * Adds a collapsable HTML details element to the summary buffer + * + * @param {string} label text for the closed state + * @param {string} content collapsable content + * + * @returns {Summary} summary instance + */ + addDetails(label, content) { + const element = this.wrap('details', this.wrap('summary', label) + content); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML image tag to the summary buffer + * + * @param {string} src path to the image you to embed + * @param {string} alt text description of the image + * @param {SummaryImageOptions} options (optional) addition image attributes + * + * @returns {Summary} summary instance + */ + addImage(src, alt, options) { + const { width, height } = options || {}; + const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height })); + const element = this.wrap('img', null, Object.assign({ src, alt }, attrs)); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML section heading element + * + * @param {string} text heading text + * @param {number | string} [level=1] (optional) the heading level, default: 1 + * + * @returns {Summary} summary instance + */ + addHeading(text, level) { + const tag = `h${level}`; + const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag) + ? tag + : 'h1'; + const element = this.wrap(allowedTag, text); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML thematic break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addSeparator() { + const element = this.wrap('hr', null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML line break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addBreak() { + const element = this.wrap('br', null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML blockquote to the summary buffer + * + * @param {string} text quote text + * @param {string} cite (optional) citation url + * + * @returns {Summary} summary instance + */ + addQuote(text, cite) { + const attrs = Object.assign({}, (cite && { cite })); + const element = this.wrap('blockquote', text, attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML anchor tag to the summary buffer + * + * @param {string} text link text/content + * @param {string} href hyperlink + * + * @returns {Summary} summary instance + */ + addLink(text, href) { + const element = this.wrap('a', text, { href }); + return this.addRaw(element).addEOL(); + } + } + const _summary = new Summary(); + /** + * @deprecated use `core.summary` + */ + exports$1.markdownSummary = _summary; + exports$1.summary = _summary; + + } (summary)); + return summary; +} + +var pathUtils = {}; + +var hasRequiredPathUtils; + +function requirePathUtils () { + if (hasRequiredPathUtils) return pathUtils; + hasRequiredPathUtils = 1; + var __createBinding = (pathUtils && pathUtils.__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 = (pathUtils && pathUtils.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = (pathUtils && pathUtils.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + Object.defineProperty(pathUtils, "__esModule", { value: true }); + pathUtils.toPlatformPath = pathUtils.toWin32Path = pathUtils.toPosixPath = void 0; + const path = __importStar(require$$1$6); + /** + * toPosixPath converts the given path to the posix form. On Windows, \\ will be + * replaced with /. + * + * @param pth. Path to transform. + * @return string Posix path. + */ + function toPosixPath(pth) { + return pth.replace(/[\\]/g, '/'); + } + pathUtils.toPosixPath = toPosixPath; + /** + * toWin32Path converts the given path to the win32 form. On Linux, / will be + * replaced with \\. + * + * @param pth. Path to transform. + * @return string Win32 path. + */ + function toWin32Path(pth) { + return pth.replace(/[/]/g, '\\'); + } + pathUtils.toWin32Path = toWin32Path; + /** + * toPlatformPath converts the given path to a platform-specific path. It does + * this by replacing instances of / and \ with the platform-specific path + * separator. + * + * @param pth The path to platformize. + * @return string The platform-specific path. + */ + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path.sep); + } + pathUtils.toPlatformPath = toPlatformPath; + + return pathUtils; +} + +var platform = {}; + +var exec = {}; + +var toolrunner = {}; + +var io = {}; + +var ioUtil = {}; + +var hasRequiredIoUtil; + +function requireIoUtil () { + if (hasRequiredIoUtil) return ioUtil; + hasRequiredIoUtil = 1; + (function (exports$1) { + var __createBinding = (ioUtil && ioUtil.__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 = (ioUtil && ioUtil.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = (ioUtil && ioUtil.__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 = (ioUtil && ioUtil.__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 _a; + Object.defineProperty(exports$1, "__esModule", { value: true }); + exports$1.getCmdPath = exports$1.tryGetExecutablePath = exports$1.isRooted = exports$1.isDirectory = exports$1.exists = exports$1.READONLY = exports$1.UV_FS_O_EXLOCK = exports$1.IS_WINDOWS = exports$1.unlink = exports$1.symlink = exports$1.stat = exports$1.rmdir = exports$1.rm = exports$1.rename = exports$1.readlink = exports$1.readdir = exports$1.open = exports$1.mkdir = exports$1.lstat = exports$1.copyFile = exports$1.chmod = void 0; + const fs = __importStar(require$$0$6); + const path = __importStar(require$$1$6); + _a = fs.promises + // export const {open} = 'fs' + , exports$1.chmod = _a.chmod, exports$1.copyFile = _a.copyFile, exports$1.lstat = _a.lstat, exports$1.mkdir = _a.mkdir, exports$1.open = _a.open, exports$1.readdir = _a.readdir, exports$1.readlink = _a.readlink, exports$1.rename = _a.rename, exports$1.rm = _a.rm, exports$1.rmdir = _a.rmdir, exports$1.stat = _a.stat, exports$1.symlink = _a.symlink, exports$1.unlink = _a.unlink; + // export const {open} = 'fs' + exports$1.IS_WINDOWS = process.platform === 'win32'; + // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 + exports$1.UV_FS_O_EXLOCK = 0x10000000; + exports$1.READONLY = fs.constants.O_RDONLY; + function exists(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield exports$1.stat(fsPath); + } + catch (err) { + if (err.code === 'ENOENT') { + return false; + } + throw err; + } + return true; + }); + } + exports$1.exists = exists; + function isDirectory(fsPath, useStat = false) { + return __awaiter(this, void 0, void 0, function* () { + const stats = useStat ? yield exports$1.stat(fsPath) : yield exports$1.lstat(fsPath); + return stats.isDirectory(); + }); + } + exports$1.isDirectory = isDirectory; + /** + * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: + * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). + */ + function isRooted(p) { + p = normalizeSeparators(p); + if (!p) { + throw new Error('isRooted() parameter "p" cannot be empty'); + } + if (exports$1.IS_WINDOWS) { + return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello + ); // e.g. C: or C:\hello + } + return p.startsWith('/'); + } + exports$1.isRooted = isRooted; + /** + * Best effort attempt to determine whether a file exists and is executable. + * @param filePath file path to check + * @param extensions additional file extensions to try + * @return if file exists and is executable, returns the file path. otherwise empty string. + */ + function tryGetExecutablePath(filePath, extensions) { + return __awaiter(this, void 0, void 0, function* () { + let stats = undefined; + try { + // test file exists + stats = yield exports$1.stat(filePath); + } + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (exports$1.IS_WINDOWS) { + // on Windows, test for valid extension + const upperExt = path.extname(filePath).toUpperCase(); + if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { + return filePath; + } + } + else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + // try each extension + const originalFilePath = filePath; + for (const extension of extensions) { + filePath = originalFilePath + extension; + stats = undefined; + try { + stats = yield exports$1.stat(filePath); + } + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (exports$1.IS_WINDOWS) { + // preserve the case of the actual file (since an extension was appended) + try { + const directory = path.dirname(filePath); + const upperName = path.basename(filePath).toUpperCase(); + for (const actualName of yield exports$1.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path.join(directory, actualName); + break; + } + } + } + catch (err) { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); + } + return filePath; + } + else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + } + return ''; + }); + } + exports$1.tryGetExecutablePath = tryGetExecutablePath; + function normalizeSeparators(p) { + p = p || ''; + if (exports$1.IS_WINDOWS) { + // convert slashes on Windows + p = p.replace(/\//g, '\\'); + // remove redundant slashes + return p.replace(/\\\\+/g, '\\'); + } + // remove redundant slashes + return p.replace(/\/\/+/g, '/'); + } + // on Mac/Linux, test the execute bit + // R W X R W X R W X + // 256 128 64 32 16 8 4 2 1 + function isUnixExecutable(stats) { + return ((stats.mode & 1) > 0 || + ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || + ((stats.mode & 64) > 0 && stats.uid === process.getuid())); + } + // Get the path of cmd.exe in windows + function getCmdPath() { + var _a; + return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`; + } + exports$1.getCmdPath = getCmdPath; + + } (ioUtil)); + return ioUtil; +} + +var hasRequiredIo; + +function requireIo () { + if (hasRequiredIo) return io; + hasRequiredIo = 1; + var __createBinding = (io && io.__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 = (io && io.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = (io && io.__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 = (io && io.__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(io, "__esModule", { value: true }); + io.findInPath = io.which = io.mkdirP = io.rmRF = io.mv = io.cp = void 0; + const assert_1 = require$$0$9; + const path = __importStar(require$$1$6); + const ioUtil = __importStar(requireIoUtil()); + /** + * Copies a file or folder. + * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js + * + * @param source source path + * @param dest destination path + * @param options optional. See CopyOptions. + */ + function cp(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + const { force, recursive, copySourceDirectory } = readCopyOptions(options); + const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; + // Dest is an existing file, but not forcing + if (destStat && destStat.isFile() && !force) { + return; + } + // If dest is an existing directory, should copy inside. + const newDest = destStat && destStat.isDirectory() && copySourceDirectory + ? path.join(dest, path.basename(source)) + : dest; + if (!(yield ioUtil.exists(source))) { + throw new Error(`no such file or directory: ${source}`); + } + const sourceStat = yield ioUtil.stat(source); + if (sourceStat.isDirectory()) { + if (!recursive) { + throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); + } + else { + yield cpDirRecursive(source, newDest, 0, force); + } + } + else { + if (path.relative(source, newDest) === '') { + // a file cannot be copied to itself + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); + } + }); + } + io.cp = cp; + /** + * Moves a path. + * + * @param source source path + * @param dest destination path + * @param options optional. See MoveOptions. + */ + function mv(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + if (yield ioUtil.exists(dest)) { + let destExists = true; + if (yield ioUtil.isDirectory(dest)) { + // If dest is directory copy src into dest + dest = path.join(dest, path.basename(source)); + destExists = yield ioUtil.exists(dest); + } + if (destExists) { + if (options.force == null || options.force) { + yield rmRF(dest); + } + else { + throw new Error('Destination already exists'); + } + } + } + yield mkdirP(path.dirname(dest)); + yield ioUtil.rename(source, dest); + }); + } + io.mv = mv; + /** + * Remove a path recursively with force + * + * @param inputPath path to remove + */ + function rmRF(inputPath) { + return __awaiter(this, void 0, void 0, function* () { + if (ioUtil.IS_WINDOWS) { + // Check for invalid characters + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + if (/[*"<>|]/.test(inputPath)) { + throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + } + } + try { + // note if path does not exist, error is silent + yield ioUtil.rm(inputPath, { + force: true, + maxRetries: 3, + recursive: true, + retryDelay: 300 + }); + } + catch (err) { + throw new Error(`File was unable to be removed ${err}`); + } + }); + } + io.rmRF = rmRF; + /** + * Make a directory. Creates the full path with folders in between + * Will throw if it fails + * + * @param fsPath path to create + * @returns Promise + */ + function mkdirP(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + assert_1.ok(fsPath, 'a path argument must be provided'); + yield ioUtil.mkdir(fsPath, { recursive: true }); + }); + } + io.mkdirP = mkdirP; + /** + * Returns path of a tool had the tool actually been invoked. Resolves via paths. + * If you check and the tool does not exist, it will throw. + * + * @param tool name of the tool + * @param check whether to check if tool exists + * @returns Promise path to tool + */ + function which(tool, check) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + // recursive when check=true + if (check) { + const result = yield which(tool, false); + if (!result) { + if (ioUtil.IS_WINDOWS) { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); + } + else { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); + } + } + return result; + } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ''; + }); + } + io.which = which; + /** + * Returns a list of all occurrences of the given tool on the system path. + * + * @returns Promise the paths of the tool + */ + function findInPath(tool) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + // build the list of extensions to try + const extensions = []; + if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { + for (const extension of process.env['PATHEXT'].split(path.delimiter)) { + if (extension) { + extensions.push(extension); + } + } + } + // if it's rooted, return it if exists. otherwise return empty. + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; + } + return []; + } + // if any path separators, return empty + if (tool.includes(path.sep)) { + return []; + } + // build the list of directories + // + // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, + // it feels like we should not do this. Checking the current directory seems like more of a use + // case of a shell, and the which() function exposed by the toolkit should strive for consistency + // across platforms. + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path.delimiter)) { + if (p) { + directories.push(p); + } + } + } + // find all matches + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } + } + return matches; + }); + } + io.findInPath = findInPath; + function readCopyOptions(options) { + const force = options.force == null ? true : options.force; + const recursive = Boolean(options.recursive); + const copySourceDirectory = options.copySourceDirectory == null + ? true + : Boolean(options.copySourceDirectory); + return { force, recursive, copySourceDirectory }; + } + function cpDirRecursive(sourceDir, destDir, currentDepth, force) { + return __awaiter(this, void 0, void 0, function* () { + // Ensure there is not a run away recursive copy + if (currentDepth >= 255) + return; + currentDepth++; + yield mkdirP(destDir); + const files = yield ioUtil.readdir(sourceDir); + for (const fileName of files) { + const srcFile = `${sourceDir}/${fileName}`; + const destFile = `${destDir}/${fileName}`; + const srcFileStat = yield ioUtil.lstat(srcFile); + if (srcFileStat.isDirectory()) { + // Recurse + yield cpDirRecursive(srcFile, destFile, currentDepth, force); + } + else { + yield copyFile(srcFile, destFile, force); + } + } + // Change the mode for the newly created directory + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); + } + // Buffered file copy + function copyFile(srcFile, destFile, force) { + return __awaiter(this, void 0, void 0, function* () { + if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { + // unlink/re-link it + try { + yield ioUtil.lstat(destFile); + yield ioUtil.unlink(destFile); + } + catch (e) { + // Try to override file permission + if (e.code === 'EPERM') { + yield ioUtil.chmod(destFile, '0666'); + yield ioUtil.unlink(destFile); + } + // other errors = it doesn't exist, no work to do + } + // Copy over symlink + const symlinkFull = yield ioUtil.readlink(srcFile); + yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); + } + else if (!(yield ioUtil.exists(destFile)) || force) { + yield ioUtil.copyFile(srcFile, destFile); + } + }); + } + + return io; +} + +var hasRequiredToolrunner; + +function requireToolrunner () { + if (hasRequiredToolrunner) return toolrunner; + hasRequiredToolrunner = 1; + var __createBinding = (toolrunner && toolrunner.__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 = (toolrunner && toolrunner.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = (toolrunner && toolrunner.__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 = (toolrunner && toolrunner.__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(toolrunner, "__esModule", { value: true }); + toolrunner.argStringToArray = toolrunner.ToolRunner = void 0; + const os = __importStar(require$$0$4); + const events = __importStar(require$$0$7); + const child = __importStar(require$$2$6); + const path = __importStar(require$$1$6); + const io = __importStar(requireIo()); + const ioUtil = __importStar(requireIoUtil()); + const timers_1 = require$$6$2; + /* eslint-disable @typescript-eslint/unbound-method */ + const IS_WINDOWS = process.platform === 'win32'; + /* + * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. + */ + class ToolRunner extends events.EventEmitter { + constructor(toolPath, args, options) { + super(); + if (!toolPath) { + throw new Error("Parameter 'toolPath' cannot be null or empty."); + } + this.toolPath = toolPath; + this.args = args || []; + this.options = options || {}; + } + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } + } + _getCommandString(options, noPrefix) { + const toolPath = this._getSpawnFileName(); + const args = this._getSpawnArgs(options); + let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool + if (IS_WINDOWS) { + // Windows + cmd file + if (this._isCmdFile()) { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows + verbatim + else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows (regular) + else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; + } + } + } + else { + // OSX/Linux - this can likely be improved with some form of quoting. + // creating processes on Unix is fundamentally different than Windows. + // on Unix, execvp() takes an arg array. + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + return cmd; + } + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + // the rest of the string ... + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); + } + return s; + } + catch (err) { + // streaming lines to console is best effort. Don't fail a build. + this._debug(`error processing line. Failed with error ${err}`); + return ''; + } + } + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env['COMSPEC'] || 'cmd.exe'; + } + } + return this.toolPath; + } + _getSpawnArgs(options) { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + for (const a of this.args) { + argline += ' '; + argline += options.windowsVerbatimArguments + ? a + : this._windowsQuoteCmdArg(a); + } + argline += '"'; + return [argline]; + } + } + return this.args; + } + _endsWith(str, end) { + return str.endsWith(end); + } + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return (this._endsWith(upperToolPath, '.CMD') || + this._endsWith(upperToolPath, '.BAT')); + } + _windowsQuoteCmdArg(arg) { + // for .exe, apply the normal quoting rules that libuv applies + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); + } + // otherwise apply quoting rules specific to the cmd.exe command line parser. + // the libuv rules are generic and are not designed specifically for cmd.exe + // command line parser. + // + // for a detailed description of the cmd.exe command line parser, refer to + // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 + // need quotes for empty arg + if (!arg) { + return '""'; + } + // determine whether the arg needs to be quoted + const cmdSpecialChars = [ + ' ', + '\t', + '&', + '(', + ')', + '[', + ']', + '{', + '}', + '^', + '=', + ';', + '!', + "'", + '+', + ',', + '`', + '~', + '|', + '<', + '>', + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some(x => x === char)) { + needsQuotes = true; + break; + } + } + // short-circuit if quotes not needed + if (!needsQuotes) { + return arg; + } + // the following quoting rules are very similar to the rules that by libuv applies. + // + // 1) wrap the string in quotes + // + // 2) double-up quotes - i.e. " => "" + // + // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately + // doesn't work well with a cmd.exe command line. + // + // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. + // for example, the command line: + // foo.exe "myarg:""my val""" + // is parsed by a .NET console app into an arg array: + // [ "myarg:\"my val\"" ] + // which is the same end result when applying libuv quoting rules. although the actual + // command line from libuv quoting rules would look like: + // foo.exe "myarg:\"my val\"" + // + // 3) double-up slashes that precede a quote, + // e.g. hello \world => "hello \world" + // hello\"world => "hello\\""world" + // hello\\"world => "hello\\\\""world" + // hello world\ => "hello world\\" + // + // technically this is not required for a cmd.exe command line, or the batch argument parser. + // the reasons for including this as a .cmd quoting rule are: + // + // a) this is optimized for the scenario where the argument is passed from the .cmd file to an + // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. + // + // b) it's what we've been doing previously (by deferring to node default behavior) and we + // haven't heard any complaints about that aspect. + // + // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be + // escaped when used on the command line directly - even though within a .cmd file % can be escaped + // by using %%. + // + // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts + // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. + // + // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would + // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the + // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args + // to an external program. + // + // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. + // % can be escaped within a .cmd file. + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; // double the slash + } + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '"'; // double the quote + } + else { + quoteHit = false; + } + } + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); + } + _uvQuoteCmdArg(arg) { + // Tool runner wraps child_process.spawn() and needs to apply the same quoting as + // Node in certain cases where the undocumented spawn option windowsVerbatimArguments + // is used. + // + // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, + // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), + // pasting copyright notice from Node within this function: + // + // Copyright Joyent, Inc. and other Node contributors. All rights reserved. + // + // 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. + if (!arg) { + // Need double quotation for empty argument + return '""'; + } + if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { + // No quotation needed + return arg; + } + if (!arg.includes('"') && !arg.includes('\\')) { + // No embedded double quotes or backslashes, so I can just wrap + // quote marks around the whole thing. + return `"${arg}"`; + } + // Expected input/output: + // input : hello"world + // output: "hello\"world" + // input : hello""world + // output: "hello\"\"world" + // input : hello\world + // output: hello\world + // input : hello\\world + // output: hello\\world + // input : hello\"world + // output: "hello\\\"world" + // input : hello\\"world + // output: "hello\\\\\"world" + // input : hello world\ + // output: "hello world\\" - note the comment in libuv actually reads "hello world\" + // but it appears the comment is wrong, it should be "hello world\\" + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; + } + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '\\'; + } + else { + quoteHit = false; + } + } + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); + } + _cloneExecOptions(options) { + options = options || {}; + const result = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + windowsVerbatimArguments: options.windowsVerbatimArguments || false, + failOnStdErr: options.failOnStdErr || false, + ignoreReturnCode: options.ignoreReturnCode || false, + delay: options.delay || 10000 + }; + result.outStream = options.outStream || process.stdout; + result.errStream = options.errStream || process.stderr; + return result; + } + _getSpawnOptions(options, toolPath) { + options = options || {}; + const result = {}; + result.cwd = options.cwd; + result.env = options.env; + result['windowsVerbatimArguments'] = + options.windowsVerbatimArguments || this._isCmdFile(); + if (options.windowsVerbatimArguments) { + result.argv0 = `"${toolPath}"`; + } + return result; + } + /** + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See ExecOptions + * @returns number + */ + exec() { + return __awaiter(this, void 0, void 0, function* () { + // root the tool path if it is unrooted and contains relative pathing + if (!ioUtil.isRooted(this.toolPath) && + (this.toolPath.includes('/') || + (IS_WINDOWS && this.toolPath.includes('\\')))) { + // prefer options.cwd if it is specified, however options.cwd may also need to be rooted + this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + // if the tool is only a file name, then resolve it from the PATH + // otherwise verify it exists (add extension on Windows if necessary) + this.toolPath = yield io.which(this.toolPath, true); + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + this._debug(`exec tool: ${this.toolPath}`); + this._debug('arguments:'); + for (const arg of this.args) { + this._debug(` ${arg}`); + } + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); + } + const state = new ExecState(optionsNonNull, this.toolPath); + state.on('debug', (message) => { + this._debug(message); + }); + if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { + return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); + } + const fileName = this._getSpawnFileName(); + const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); + let stdbuffer = ''; + if (cp.stdout) { + cp.stdout.on('data', (data) => { + if (this.options.listeners && this.options.listeners.stdout) { + this.options.listeners.stdout(data); + } + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(data); + } + stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { + if (this.options.listeners && this.options.listeners.stdline) { + this.options.listeners.stdline(line); + } + }); + }); + } + let errbuffer = ''; + if (cp.stderr) { + cp.stderr.on('data', (data) => { + state.processStderr = true; + if (this.options.listeners && this.options.listeners.stderr) { + this.options.listeners.stderr(data); + } + if (!optionsNonNull.silent && + optionsNonNull.errStream && + optionsNonNull.outStream) { + const s = optionsNonNull.failOnStdErr + ? optionsNonNull.errStream + : optionsNonNull.outStream; + s.write(data); + } + errbuffer = this._processLineBuffer(data, errbuffer, (line) => { + if (this.options.listeners && this.options.listeners.errline) { + this.options.listeners.errline(line); + } + }); + }); + } + cp.on('error', (err) => { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); + }); + cp.on('exit', (code) => { + state.processExitCode = code; + state.processExited = true; + this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); + state.CheckComplete(); + }); + cp.on('close', (code) => { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); + state.CheckComplete(); + }); + state.on('done', (error, exitCode) => { + if (stdbuffer.length > 0) { + this.emit('stdline', stdbuffer); + } + if (errbuffer.length > 0) { + this.emit('errline', errbuffer); + } + cp.removeAllListeners(); + if (error) { + reject(error); + } + else { + resolve(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error('child process missing stdin'); + } + cp.stdin.end(this.options.input); + } + })); + }); + } + } + toolrunner.ToolRunner = ToolRunner; + /** + * Convert an arg string to an array of args. Handles escaping + * + * @param argString string of arguments + * @returns string[] array of arguments + */ + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ''; + function append(c) { + // we only escape double quotes. + if (escaped && c !== '"') { + arg += '\\'; + } + arg += c; + escaped = false; + } + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } + else { + append(c); + } + continue; + } + if (c === '\\' && escaped) { + append(c); + continue; + } + if (c === '\\' && inQuotes) { + escaped = true; + continue; + } + if (c === ' ' && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ''; + } + continue; + } + append(c); + } + if (arg.length > 0) { + args.push(arg.trim()); + } + return args; + } + toolrunner.argStringToArray = argStringToArray; + class ExecState extends events.EventEmitter { + constructor(options, toolPath) { + super(); + this.processClosed = false; // tracks whether the process has exited and stdio is closed + this.processError = ''; + this.processExitCode = 0; + this.processExited = false; // tracks whether the process has exited + this.processStderr = false; // tracks whether stderr was written to + this.delay = 10000; // 10 seconds + this.done = false; + this.timeout = null; + if (!toolPath) { + throw new Error('toolPath must not be empty'); + } + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; + } + } + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } + else if (this.processExited) { + this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this); + } + } + _debug(message) { + this.emit('debug', message); + } + _setResult() { + // determine whether there is an error + let error; + if (this.processExited) { + if (this.processError) { + error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); + } + else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { + error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + } + else if (this.processStderr && this.options.failOnStdErr) { + error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + } + } + // clear the timeout + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit('done', error, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) { + return; + } + if (!state.processClosed && state.processExited) { + const message = `The STDIO streams did not close within ${state.delay / + 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + state._debug(message); + } + state._setResult(); + } + } + + return toolrunner; +} + +var hasRequiredExec; + +function requireExec () { + if (hasRequiredExec) return exec; + hasRequiredExec = 1; + var __createBinding = (exec && exec.__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 = (exec && exec.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = (exec && exec.__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 = (exec && exec.__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(exec, "__esModule", { value: true }); + exec.getExecOutput = exec.exec = void 0; + const string_decoder_1 = require$$0$e; + const tr = __importStar(requireToolrunner()); + /** + * Exec a command. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code + */ + function exec$1(commandLine, args, options) { + return __awaiter(this, void 0, void 0, function* () { + const commandArgs = tr.argStringToArray(commandLine); + if (commandArgs.length === 0) { + throw new Error(`Parameter 'commandLine' cannot be null or empty.`); + } + // Path to tool to execute should be first arg + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); + } + exec.exec = exec$1; + /** + * Exec a command and get the output. + * Output will be streamed to the live console. + * Returns promise with the exit code and collected stdout and stderr + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code, stdout, and stderr + */ + function getExecOutput(commandLine, args, options) { + var _a, _b; + return __awaiter(this, void 0, void 0, function* () { + let stdout = ''; + let stderr = ''; + //Using string decoder covers the case where a mult-byte character is split + const stdoutDecoder = new string_decoder_1.StringDecoder('utf8'); + const stderrDecoder = new string_decoder_1.StringDecoder('utf8'); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; + const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; + const stdErrListener = (data) => { + stderr += stderrDecoder.write(data); + if (originalStdErrListener) { + originalStdErrListener(data); + } + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); + } + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec$1(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + //flush any remaining characters + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); + } + exec.getExecOutput = getExecOutput; + + return exec; +} + +var hasRequiredPlatform; + +function requirePlatform () { + if (hasRequiredPlatform) return platform; + hasRequiredPlatform = 1; + (function (exports$1) { + var __createBinding = (platform && platform.__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 = (platform && platform.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = (platform && platform.__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 __awaiter = (platform && platform.__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 __importDefault = (platform && platform.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + Object.defineProperty(exports$1, "__esModule", { value: true }); + exports$1.getDetails = exports$1.isLinux = exports$1.isMacOS = exports$1.isWindows = exports$1.arch = exports$1.platform = void 0; + const os_1 = __importDefault(require$$0$4); + const exec = __importStar(requireExec()); + const getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', undefined, { + silent: true + }); + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', undefined, { + silent: true + }); + return { + name: name.trim(), + version: version.trim() + }; + }); + const getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () { + var _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput('sw_vers', undefined, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ''; + const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : ''; + return { + name, + version + }; + }); + const getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () { + const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], { + silent: true + }); + const [name, version] = stdout.trim().split('\n'); + return { + name, + version + }; + }); + exports$1.platform = os_1.default.platform(); + exports$1.arch = os_1.default.arch(); + exports$1.isWindows = exports$1.platform === 'win32'; + exports$1.isMacOS = exports$1.platform === 'darwin'; + exports$1.isLinux = exports$1.platform === 'linux'; + function getDetails() { + return __awaiter(this, void 0, void 0, function* () { + return Object.assign(Object.assign({}, (yield (exports$1.isWindows + ? getWindowsInfo() + : exports$1.isMacOS + ? getMacOsInfo() + : getLinuxInfo()))), { platform: exports$1.platform, + arch: exports$1.arch, + isWindows: exports$1.isWindows, + isMacOS: exports$1.isMacOS, + isLinux: exports$1.isLinux }); + }); + } + exports$1.getDetails = getDetails; + + } (platform)); + return platform; +} + +var hasRequiredCore; + +function requireCore () { + if (hasRequiredCore) return core; + hasRequiredCore = 1; + (function (exports$1) { + var __createBinding = (core && core.__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 = (core && core.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = (core && core.__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 __awaiter = (core && core.__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$1, "__esModule", { value: true }); + exports$1.platform = exports$1.toPlatformPath = exports$1.toWin32Path = exports$1.toPosixPath = exports$1.markdownSummary = exports$1.summary = exports$1.getIDToken = exports$1.getState = exports$1.saveState = exports$1.group = exports$1.endGroup = exports$1.startGroup = exports$1.info = exports$1.notice = exports$1.warning = exports$1.error = exports$1.debug = exports$1.isDebug = exports$1.setFailed = exports$1.setCommandEcho = exports$1.setOutput = exports$1.getBooleanInput = exports$1.getMultilineInput = exports$1.getInput = exports$1.addPath = exports$1.setSecret = exports$1.exportVariable = exports$1.ExitCode = void 0; + const command_1 = requireCommand(); + const file_command_1 = requireFileCommand(); + const utils_1 = requireUtils(); + const os = __importStar(require$$0$4); + const path = __importStar(require$$1$6); + const oidc_utils_1 = requireOidcUtils(); + /** + * The code to exit an action + */ + var ExitCode; + (function (ExitCode) { + /** + * A code indicating that the action was successful + */ + ExitCode[ExitCode["Success"] = 0] = "Success"; + /** + * A code indicating that the action was a failure + */ + ExitCode[ExitCode["Failure"] = 1] = "Failure"; + })(ExitCode || (exports$1.ExitCode = ExitCode = {})); + //----------------------------------------------------------------------- + // Variables + //----------------------------------------------------------------------- + /** + * Sets env variable for this action and future actions in the job + * @param name the name of the variable to set + * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function exportVariable(name, val) { + const convertedVal = (0, utils_1.toCommandValue)(val); + process.env[name] = convertedVal; + const filePath = process.env['GITHUB_ENV'] || ''; + if (filePath) { + return (0, file_command_1.issueFileCommand)('ENV', (0, file_command_1.prepareKeyValueMessage)(name, val)); + } + (0, command_1.issueCommand)('set-env', { name }, convertedVal); + } + exports$1.exportVariable = exportVariable; + /** + * Registers a secret which will get masked from logs + * @param secret value of the secret + */ + function setSecret(secret) { + (0, command_1.issueCommand)('add-mask', {}, secret); + } + exports$1.setSecret = setSecret; + /** + * Prepends inputPath to the PATH (for this action and future actions) + * @param inputPath + */ + function addPath(inputPath) { + const filePath = process.env['GITHUB_PATH'] || ''; + if (filePath) { + (0, file_command_1.issueFileCommand)('PATH', inputPath); + } + else { + (0, command_1.issueCommand)('add-path', {}, inputPath); + } + process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; + } + exports$1.addPath = addPath; + /** + * Gets the value of an input. + * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. + * Returns an empty string if the value is not defined. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string + */ + function getInput(name, options) { + const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; + if (options && options.required && !val) { + throw new Error(`Input required and not supplied: ${name}`); + } + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); + } + exports$1.getInput = getInput; + /** + * Gets the values of an multiline input. Each value is also trimmed. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string[] + * + */ + function getMultilineInput(name, options) { + const inputs = getInput(name, options) + .split('\n') + .filter(x => x !== ''); + if (options && options.trimWhitespace === false) { + return inputs; + } + return inputs.map(input => input.trim()); + } + exports$1.getMultilineInput = getMultilineInput; + /** + * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. + * Support boolean input list: `true | True | TRUE | false | False | FALSE` . + * The return value is also in boolean type. + * ref: https://yaml.org/spec/1.2/spec.html#id2804923 + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns boolean + */ + function getBooleanInput(name, options) { + const trueValue = ['true', 'True', 'TRUE']; + const falseValue = ['false', 'False', 'FALSE']; + const val = getInput(name, options); + if (trueValue.includes(val)) + return true; + if (falseValue.includes(val)) + return false; + throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` + + `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); + } + exports$1.getBooleanInput = getBooleanInput; + /** + * Sets the value of an output. + * + * @param name name of the output to set + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function setOutput(name, value) { + const filePath = process.env['GITHUB_OUTPUT'] || ''; + if (filePath) { + return (0, file_command_1.issueFileCommand)('OUTPUT', (0, file_command_1.prepareKeyValueMessage)(name, value)); + } + process.stdout.write(os.EOL); + (0, command_1.issueCommand)('set-output', { name }, (0, utils_1.toCommandValue)(value)); + } + exports$1.setOutput = setOutput; + /** + * Enables or disables the echoing of commands into stdout for the rest of the step. + * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. + * + */ + function setCommandEcho(enabled) { + (0, command_1.issue)('echo', enabled ? 'on' : 'off'); + } + exports$1.setCommandEcho = setCommandEcho; + //----------------------------------------------------------------------- + // Results + //----------------------------------------------------------------------- + /** + * Sets the action status to failed. + * When the action exits it will be with an exit code of 1 + * @param message add error issue message + */ + function setFailed(message) { + process.exitCode = ExitCode.Failure; + error(message); + } + exports$1.setFailed = setFailed; + //----------------------------------------------------------------------- + // Logging Commands + //----------------------------------------------------------------------- + /** + * Gets whether Actions Step Debug is on or not + */ + function isDebug() { + return process.env['RUNNER_DEBUG'] === '1'; + } + exports$1.isDebug = isDebug; + /** + * Writes debug message to user log + * @param message debug message + */ + function debug(message) { + (0, command_1.issueCommand)('debug', {}, message); + } + exports$1.debug = debug; + /** + * Adds an error issue + * @param message error issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ + function error(message, properties = {}) { + (0, command_1.issueCommand)('error', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports$1.error = error; + /** + * Adds a warning issue + * @param message warning issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ + function warning(message, properties = {}) { + (0, command_1.issueCommand)('warning', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports$1.warning = warning; + /** + * Adds a notice issue + * @param message notice issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ + function notice(message, properties = {}) { + (0, command_1.issueCommand)('notice', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports$1.notice = notice; + /** + * Writes info to log with console.log. + * @param message info message + */ + function info(message) { + process.stdout.write(message + os.EOL); + } + exports$1.info = info; + /** + * Begin an output group. + * + * Output until the next `groupEnd` will be foldable in this group + * + * @param name The name of the output group + */ + function startGroup(name) { + (0, command_1.issue)('group', name); + } + exports$1.startGroup = startGroup; + /** + * End an output group. + */ + function endGroup() { + (0, command_1.issue)('endgroup'); + } + exports$1.endGroup = endGroup; + /** + * Wrap an asynchronous function call in a group. + * + * Returns the same type as the function itself. + * + * @param name The name of the group + * @param fn The function to wrap in the group + */ + function group(name, fn) { + return __awaiter(this, void 0, void 0, function* () { + startGroup(name); + let result; + try { + result = yield fn(); + } + finally { + endGroup(); + } + return result; + }); + } + exports$1.group = group; + //----------------------------------------------------------------------- + // Wrapper action state + //----------------------------------------------------------------------- + /** + * Saves state for current action, the state can only be retrieved by this action's post job execution. + * + * @param name name of the state to store + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function saveState(name, value) { + const filePath = process.env['GITHUB_STATE'] || ''; + if (filePath) { + return (0, file_command_1.issueFileCommand)('STATE', (0, file_command_1.prepareKeyValueMessage)(name, value)); + } + (0, command_1.issueCommand)('save-state', { name }, (0, utils_1.toCommandValue)(value)); + } + exports$1.saveState = saveState; + /** + * Gets the value of an state set by this action's main execution. + * + * @param name name of the state to get + * @returns string + */ + function getState(name) { + return process.env[`STATE_${name}`] || ''; + } + exports$1.getState = getState; + function getIDToken(aud) { + return __awaiter(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); + } + exports$1.getIDToken = getIDToken; + /** + * Summary exports + */ + var summary_1 = requireSummary(); + Object.defineProperty(exports$1, "summary", { enumerable: true, get: function () { return summary_1.summary; } }); + /** + * @deprecated use core.summary + */ + var summary_2 = requireSummary(); + Object.defineProperty(exports$1, "markdownSummary", { enumerable: true, get: function () { return summary_2.markdownSummary; } }); + /** + * Path exports + */ + var path_utils_1 = requirePathUtils(); + Object.defineProperty(exports$1, "toPosixPath", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } }); + Object.defineProperty(exports$1, "toWin32Path", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } }); + Object.defineProperty(exports$1, "toPlatformPath", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }); + /** + * Platform utilities exports + */ + exports$1.platform = __importStar(requirePlatform()); + + } (core)); + return core; +} + var internalGlobOptionsHelper = {}; var hasRequiredInternalGlobOptionsHelper; @@ -30382,8 +34635,8 @@ function requireInternalPathHelper () { }; Object.defineProperty(internalPathHelper, "__esModule", { value: true }); internalPathHelper.safeTrimTrailingSeparator = internalPathHelper.normalizeSeparators = internalPathHelper.hasRoot = internalPathHelper.hasAbsoluteRoot = internalPathHelper.ensureAbsoluteRoot = internalPathHelper.dirname = void 0; - const path = __importStar(require$$0$e); - const assert_1 = __importDefault(require$$0$8); + const path = __importStar(require$$1$6); + const assert_1 = __importDefault(require$$0$9); const IS_WINDOWS = process.platform === 'win32'; /** * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths. @@ -31978,9 +36231,9 @@ function requireInternalPath () { }; Object.defineProperty(internalPath, "__esModule", { value: true }); internalPath.Path = void 0; - const path = __importStar(require$$0$e); + const path = __importStar(require$$1$6); const pathHelper = __importStar(requireInternalPathHelper()); - const assert_1 = __importDefault(require$$0$8); + const assert_1 = __importDefault(require$$0$9); const IS_WINDOWS = process.platform === 'win32'; /** * Helper class for parsing paths into segments @@ -32103,9 +36356,9 @@ function requireInternalPattern () { Object.defineProperty(internalPattern, "__esModule", { value: true }); internalPattern.Pattern = void 0; const os = __importStar(require$$0$4); - const path = __importStar(require$$0$e); + const path = __importStar(require$$1$6); const pathHelper = __importStar(requireInternalPathHelper()); - const assert_1 = __importDefault(require$$0$8); + const assert_1 = __importDefault(require$$0$9); const minimatch_1 = requireMinimatch(); const internal_match_kind_1 = requireInternalMatchKind(); const internal_path_1 = requireInternalPath(); @@ -32414,9 +36667,9 @@ function requireInternalGlobber () { Object.defineProperty(internalGlobber, "__esModule", { value: true }); internalGlobber.DefaultGlobber = void 0; const core = __importStar(requireCore()); - const fs = __importStar(require$$0$5); + const fs = __importStar(require$$0$6); const globOptionsHelper = __importStar(requireInternalGlobOptionsHelper()); - const path = __importStar(require$$0$e); + const path = __importStar(require$$1$6); const patternHelper = __importStar(requireInternalPatternHelper()); const internal_match_kind_1 = requireInternalMatchKind(); const internal_pattern_1 = requireInternalPattern(); @@ -32655,12 +36908,12 @@ function requireInternalHashFiles () { }; Object.defineProperty(internalHashFiles, "__esModule", { value: true }); internalHashFiles.hashFiles = void 0; - const crypto = __importStar(require$$0$f); + const crypto = __importStar(require$$0$5); const core = __importStar(requireCore()); - const fs = __importStar(require$$0$5); - const stream = __importStar(require$$0$a); + const fs = __importStar(require$$0$6); + const stream = __importStar(require$$0$b); const util = __importStar(require$$4$4); - const path = __importStar(require$$0$e); + const path = __importStar(require$$1$6); function hashFiles(globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; var _d; @@ -51647,7 +55900,7 @@ function requireLogging () { exports$1.trace = trace; exports$1.isTracerEnabled = isTracerEnabled; const constants_1 = requireConstants(); - const process_1 = require$$1$6; + const process_1 = require$$1$7; const clientVersion = require$$11.version; const DEFAULT_LOGGER = { error: (message, ...optionalParams) => { @@ -52244,7 +56497,7 @@ function requireTlsHelpers () { Object.defineProperty(tlsHelpers, "__esModule", { value: true }); tlsHelpers.CIPHER_SUITES = void 0; tlsHelpers.getDefaultRootsData = getDefaultRootsData; - const fs = require$$0$5; + const fs = require$$0$6; tlsHelpers.CIPHER_SUITES = process.env.GRPC_SSL_CIPHER_SUITES; const DEFAULT_ROOTS_FILE_PATH = process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH; let defaultRootsData = null; @@ -54439,7 +58692,7 @@ function requireSubchannelAddress () { subchannelAddress.endpointEqual = endpointEqual; subchannelAddress.endpointToString = endpointToString; subchannelAddress.endpointHasAddress = endpointHasAddress; - const net_1 = require$$0$9; + const net_1 = require$$0$a; function isTcpSubchannelAddress(address) { return 'port' in address; } @@ -55669,8 +59922,8 @@ function requireCall$1 () { Object.defineProperty(call$1, "__esModule", { value: true }); call$1.ClientDuplexStreamImpl = call$1.ClientWritableStreamImpl = call$1.ClientReadableStreamImpl = call$1.ClientUnaryCallImpl = void 0; call$1.callErrorFromStatus = callErrorFromStatus; - const events_1 = require$$0$6; - const stream_1 = require$$0$a; + const events_1 = require$$0$7; + const stream_1 = require$$0$b; const constants_1 = requireConstants(); /** * Construct a ServiceError from a StatusObject. This function exists primarily @@ -69435,8 +73688,8 @@ function requireUtil$4 () { */ Object.defineProperty(util$4, "__esModule", { value: true }); util$4.addCommonProtos = util$4.loadProtosWithOptionsSync = util$4.loadProtosWithOptions = void 0; - const fs = require$$0$5; - const path = require$$0$e; + const fs = require$$0$6; + const path = require$$1$6; const Protobuf = requireProtobufjs(); function addIncludePathResolver(root, includePaths) { const originalResolvePath = root.resolvePath; @@ -71410,7 +75663,7 @@ function requireChannelz () { channelz.getChannelzHandlers = getChannelzHandlers; channelz.getChannelzServiceDefinition = getChannelzServiceDefinition; channelz.setup = setup; - const net_1 = require$$0$9; + const net_1 = require$$0$a; const ordered_map_1 = require$$1; const connectivity_state_1 = requireConnectivityState(); const constants_1 = requireConstants(); @@ -72430,14 +76683,14 @@ function requireResolverDns () { exports$1.DEFAULT_PORT = void 0; exports$1.setup = setup; const resolver_1 = requireResolver(); - const dns_1 = require$$1$7; + const dns_1 = require$$1$8; const service_config_1 = requireServiceConfig(); const constants_1 = requireConstants(); const metadata_1 = requireMetadata(); const logging = requireLogging(); const constants_2 = requireConstants(); const uri_parser_1 = requireUriParser(); - const net_1 = require$$0$9; + const net_1 = require$$0$a; const backoff_timeout_1 = requireBackoffTimeout(); const environment_1 = requireEnvironment(); const TRACER_NAME = 'dns_resolver'; @@ -72790,8 +77043,8 @@ function requireHttp_proxy () { http_proxy.getProxiedConnection = getProxiedConnection; const logging_1 = requireLogging(); const constants_1 = requireConstants(); - const net_1 = require$$0$9; - const http = require$$2$5; + const net_1 = require$$0$a; + const http = require$$2$4; const logging = requireLogging(); const subchannel_address_1 = requireSubchannelAddress(); const uri_parser_1 = requireUriParser(); @@ -73768,7 +78021,7 @@ function requireTransport () { const resolver_1 = requireResolver(); const subchannel_address_1 = requireSubchannelAddress(); const uri_parser_1 = requireUriParser(); - const net = require$$0$9; + const net = require$$0$a; const subchannel_call_1 = requireSubchannelCall(); const call_number_1 = requireCallNumber(); const TRACER_NAME = 'transport'; @@ -77275,8 +81528,8 @@ function requireServerCall () { Object.defineProperty(serverCall, "__esModule", { value: true }); serverCall.ServerDuplexStreamImpl = serverCall.ServerWritableStreamImpl = serverCall.ServerReadableStreamImpl = serverCall.ServerUnaryCallImpl = void 0; serverCall.serverErrorToStatus = serverErrorToStatus; - const events_1 = require$$0$6; - const stream_1 = require$$0$a; + const events_1 = require$$0$7; + const stream_1 = require$$0$b; const constants_1 = requireConstants(); const metadata_1 = requireMetadata(); function serverErrorToStatus(error, overrideTrailers) { @@ -80347,7 +84600,7 @@ function requireLoadBalancerPickFirst () { const logging = requireLogging(); const constants_1 = requireConstants(); const subchannel_address_2 = requireSubchannelAddress(); - const net_1 = require$$0$9; + const net_1 = require$$0$a; const TRACER_NAME = 'pick_first'; function trace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); @@ -80846,7 +85099,7 @@ function requireCertificateProvider () { */ Object.defineProperty(certificateProvider, "__esModule", { value: true }); certificateProvider.FileWatcherCertificateProvider = void 0; - const fs = require$$0$5; + const fs = require$$0$6; const logging = requireLogging(); const constants_1 = requireConstants(); const util_1 = require$$4$4; @@ -81117,7 +85370,7 @@ function requireResolverIp () { */ Object.defineProperty(resolverIp, "__esModule", { value: true }); resolverIp.setup = setup; - const net_1 = require$$0$9; + const net_1 = require$$0$a; const constants_1 = requireConstants(); const metadata_1 = requireMetadata(); const resolver_1 = requireResolver(); @@ -82864,7 +87117,7 @@ function requireGaxios () { const url_1 = require$$1$5; const common_js_1 = requireCommon(); const retry_js_1 = requireRetry(); - const stream_1 = require$$0$a; + const stream_1 = require$$0$b; const interceptor_js_1 = requireInterceptor(); const randomUUID = async () => globalThis.crypto?.randomUUID() || (await import('crypto')).randomUUID(); class Gaxios { @@ -83349,7 +87602,7 @@ function requireGaxios () { const hasWindow = typeof window !== 'undefined' && !!window; this.#fetch ||= hasWindow ? window.fetch - : (await Promise.resolve().then(function () { return require('./index-FuldNPo7.cjs'); })).default; + : (await Promise.resolve().then(function () { return require('./index-OVNlT4CO.cjs'); })).default; return this.#fetch; } /** @@ -87259,7 +91512,7 @@ function requireGcpResidency () { exports$1.isGoogleComputeEngineMACAddress = isGoogleComputeEngineMACAddress; exports$1.isGoogleComputeEngine = isGoogleComputeEngine; exports$1.detectGCPResidency = detectGCPResidency; - const fs_1 = require$$0$5; + const fs_1 = require$$0$6; const os_1 = require$$0$4; /** * Known paths unique to Google Compute Engine Linux instances @@ -87507,8 +91760,8 @@ function requireLoggingUtils () { exports$1.getStructuredBackend = getStructuredBackend; exports$1.setBackend = setBackend; exports$1.log = log; - const events_1 = require$$0$6; - const process = __importStar(require$$1$6); + const events_1 = require$$0$7; + const process = __importStar(require$$1$7); const util = __importStar(require$$4$4); const colours_1 = requireColours(); // Some functions (as noted) are based on the Node standard library, from @@ -88682,7 +92935,7 @@ function requireCrypto$1 () { // limitations under the License. Object.defineProperty(crypto$1, "__esModule", { value: true }); crypto$1.NodeCrypto = void 0; - const crypto = require$$0$f; + const crypto = require$$0$5; class NodeCrypto { async sha256DigestBase64(str) { return crypto.createHash('sha256').update(str).digest('base64'); @@ -88830,7 +93083,7 @@ function requireSafeBuffer () { hasRequiredSafeBuffer = 1; (function (module, exports$1) { /* eslint-disable node/no-deprecated-api */ - var buffer = require$$0$7; + var buffer = require$$0$8; var Buffer = buffer.Buffer; // alternative to using Object.keys for old browsers @@ -89416,7 +93669,7 @@ function requireAuthclient () { // limitations under the License. Object.defineProperty(exports$1, "__esModule", { value: true }); exports$1.AuthClient = exports$1.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS = exports$1.DEFAULT_UNIVERSE = void 0; - const events_1 = require$$0$6; + const events_1 = require$$0$7; const gaxios_1 = requireSrc$7(); const util_1 = requireUtil$2(); const shared_cjs_1 = requireShared(); @@ -89641,7 +93894,7 @@ function requireOauth2client () { oauth2client.OAuth2Client = oauth2client.ClientAuthentication = oauth2client.CertificateFormat = oauth2client.CodeChallengeMethod = void 0; const gaxios_1 = requireSrc$7(); const querystring = require$$8; - const stream = require$$0$a; + const stream = require$$0$b; const formatEcdsa = requireEcdsaSigFormatter(); const crypto_1 = requireCrypto(); const authclient_1 = requireAuthclient(); @@ -90739,7 +94992,7 @@ function requireDataStream () { if (hasRequiredDataStream) return dataStream; hasRequiredDataStream = 1; var Buffer = requireSafeBuffer().Buffer; - var Stream = require$$0$a; + var Stream = require$$0$b; var util = require$$4$4; function DataStream(data) { @@ -90803,8 +95056,8 @@ var hasRequiredBufferEqualConstantTime; function requireBufferEqualConstantTime () { if (hasRequiredBufferEqualConstantTime) return bufferEqualConstantTime; hasRequiredBufferEqualConstantTime = 1; - var Buffer = require$$0$7.Buffer; // browserify - var SlowBuffer = require$$0$7.SlowBuffer; + var Buffer = require$$0$8.Buffer; // browserify + var SlowBuffer = require$$0$8.SlowBuffer; bufferEqualConstantTime = bufferEq; @@ -90853,7 +95106,7 @@ function requireJwa () { hasRequiredJwa = 1; var bufferEqual = requireBufferEqualConstantTime(); var Buffer = requireSafeBuffer().Buffer; - var crypto = require$$0$f; + var crypto = require$$0$5; var formatEcdsa = requireEcdsaSigFormatter(); var util = require$$4$4; @@ -91112,7 +95365,7 @@ var hasRequiredTostring; function requireTostring () { if (hasRequiredTostring) return tostring; hasRequiredTostring = 1; - var Buffer = require$$0$7.Buffer; + var Buffer = require$$0$8.Buffer; tostring = function toString(obj) { if (typeof obj === 'string') @@ -91135,7 +95388,7 @@ function requireSignStream () { var Buffer = requireSafeBuffer().Buffer; var DataStream = requireDataStream(); var jwa = requireJwa(); - var Stream = require$$0$a; + var Stream = require$$0$b; var toString = requireTostring(); var util = require$$4$4; @@ -91223,7 +95476,7 @@ function requireVerifyStream () { var Buffer = requireSafeBuffer().Buffer; var DataStream = requireDataStream(); var jwa = requireJwa(); - var Stream = require$$0$a; + var Stream = require$$0$b; var toString = requireTostring(); var util = require$$4$4; var JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/; @@ -91383,10 +95636,10 @@ function requireSrc$4 () { value: true }); src$1.GoogleToken = void 0; - var fs = _interopRequireWildcard(require$$0$5); + var fs = _interopRequireWildcard(require$$0$6); var _gaxios = requireSrc$7(); var jws = _interopRequireWildcard(requireJws()); - var path = _interopRequireWildcard(require$$0$e); + var path = _interopRequireWildcard(require$$1$6); var _util = require$$4$4; function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; } @@ -93062,7 +97315,7 @@ function requireBaseexternalclient () { Object.defineProperty(exports$1, "__esModule", { value: true }); exports$1.BaseExternalAccountClient = exports$1.CLOUD_RESOURCE_MANAGER = exports$1.EXTERNAL_ACCOUNT_TYPE = exports$1.EXPIRATION_TIME_OFFSET = void 0; const gaxios_1 = requireSrc$7(); - const stream = require$$0$a; + const stream = require$$0$b; const authclient_1 = requireAuthclient(); const sts = requireStscredentials(); const util_1 = requireUtil$2(); @@ -93541,7 +97794,7 @@ function requireFilesubjecttokensupplier () { Object.defineProperty(filesubjecttokensupplier, "__esModule", { value: true }); filesubjecttokensupplier.FileSubjectTokenSupplier = void 0; const util_1 = require$$4$4; - const fs = require$$0$5; + const fs = require$$0$6; // fs.readfile is undefined in browser karma tests causing // `npm run browser-test` to fail as test.oauth2.ts imports this file via // src/index.ts. @@ -94595,8 +98848,8 @@ function requirePluggableAuthHandler () { Object.defineProperty(pluggableAuthHandler, "__esModule", { value: true }); pluggableAuthHandler.PluggableAuthHandler = pluggableAuthHandler.ExecutableError = void 0; const executable_response_1 = requireExecutableResponse(); - const childProcess = require$$1$8; - const fs = require$$0$5; + const childProcess = require$$2$6; + const fs = require$$0$6; /** * Error thrown from the executable run by PluggableAuthClient. */ @@ -95076,7 +99329,7 @@ function requireExternalAccountAuthorizedUserClient () { const authclient_1 = requireAuthclient(); const oauth2common_1 = requireOauth2common(); const gaxios_1 = requireSrc$7(); - const stream = require$$0$a; + const stream = require$$0$b; const baseexternalclient_1 = requireBaseexternalclient(); /** * The credentials JSON file type for external account authorized user clients. @@ -95312,12 +99565,12 @@ function requireGoogleauth () { // limitations under the License. Object.defineProperty(exports$1, "__esModule", { value: true }); exports$1.GoogleAuth = exports$1.GoogleAuthExceptionMessages = void 0; - const child_process_1 = require$$1$8; - const fs = require$$0$5; + const child_process_1 = require$$2$6; + const fs = require$$0$6; const gaxios_1 = requireSrc$7(); const gcpMetadata = requireSrc$5(); const os = require$$0$4; - const path = require$$0$e; + const path = require$$1$6; const crypto_1 = requireCrypto(); const computeclient_1 = requireComputeclient(); const idtokenclient_1 = requireIdtokenclient(); @@ -96217,7 +100470,7 @@ function requireDownscopedclient () { Object.defineProperty(exports$1, "__esModule", { value: true }); exports$1.DownscopedClient = exports$1.EXPIRATION_TIME_OFFSET = exports$1.MAX_ACCESS_BOUNDARY_RULES_COUNT = void 0; const gaxios_1 = requireSrc$7(); - const stream = require$$0$a; + const stream = require$$0$b; const authclient_1 = requireAuthclient(); const sts = requireStscredentials(); /** @@ -96631,7 +100884,7 @@ function requireObjectHash () { hasRequiredObjectHash = 1; (function (module, exports$1) { - var crypto = require$$0$f; + var crypto = require$$0$5; /** * Exported function @@ -97211,7 +101464,7 @@ function requireUtil$1 () { * See the License for the specific language governing permissions and * limitations under the License. */ - const randomUUID = () => globalThis.crypto?.randomUUID() || require$$0$f.randomUUID(); + const randomUUID = () => globalThis.crypto?.randomUUID() || require$$0$5.randomUUID(); function words(str, normalize = false) { if (normalize) { // strings like somethingABCSomething are special case for protobuf.js, @@ -98223,13 +102476,13 @@ function requireGrpc () { Object.defineProperty(grpc, "__esModule", { value: true }); grpc.GoogleProtoFilesRoot = grpc.GrpcClient = grpc.ClientStub = void 0; const grpcProtoLoader = __importStar(requireSrc$9()); - const child_process_1 = require$$1$8; - const fs = __importStar(require$$0$5); + const child_process_1 = require$$2$6; + const fs = __importStar(require$$0$6); const google_auth_library_1 = requireSrc$3(); const grpc$1 = __importStar(requireSrc$8()); const os = __importStar(require$$0$4); - const path_1 = require$$0$e; - const path = __importStar(require$$0$e); + const path_1 = require$$1$6; + const path = __importStar(require$$1$6); const protobuf = __importStar(requireProtobufjs()); const object_hash_1 = __importDefault(requireObjectHash()); const gax = __importStar(requireGax()); @@ -101201,7 +105454,7 @@ function requireStreamArrayParser () { Object.defineProperty(streamArrayParser, "__esModule", { value: true }); streamArrayParser.StreamArrayParser = void 0; const abort_controller_1 = require$$0; - const stream_1 = require$$0$a; + const stream_1 = require$$0$b; const fallbackRest_1 = requireFallbackRest(); const featureDetection_1 = requireFeatureDetection(); class StreamArrayParser extends stream_1.Transform { @@ -101368,8 +105621,8 @@ function requireFallbackServiceStub () { const google_auth_library_1 = requireSrc$3(); const featureDetection_1 = requireFeatureDetection(); const streamArrayParser_1 = requireStreamArrayParser(); - const stream_1 = require$$0$a; - const fetchNode = (...args) => Promise.resolve().then(function () { return require('./index-FuldNPo7.cjs'); }).then(({ default: fetch }) => fetch(...args)); + const stream_1 = require$$0$b; + const fetchNode = (...args) => Promise.resolve().then(function () { return require('./index-OVNlT4CO.cjs'); }).then(({ default: fetch }) => fetch(...args)); // Node.js before v19 does not enable keepalive by default. // We'll try to enable it very carefully to make sure we don't break possible non-Node use cases. // TODO: remove this after Node 18 is EOL. @@ -101378,7 +105631,7 @@ function requireFallbackServiceStub () { // - https://github.com/googleapis/gax-nodejs/pull/1534 let agentOption = null; if ((0, featureDetection_1.isNodeJS)()) { - const http = require$$2$5; + const http = require$$2$4; const https = require$$1$1; const httpAgent = new http.Agent({ keepAlive: true }); const httpsAgent = new https.Agent({ keepAlive: true }); @@ -101529,7 +105782,7 @@ var hasRequiredStream; function requireStream () { if (hasRequiredStream) return stream; hasRequiredStream = 1; - stream = require$$0$a; + stream = require$$0$b; return stream; } @@ -101548,7 +105801,7 @@ function requireBuffer_list () { function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (String )(input); } - var _require = require$$0$7, + var _require = require$$0$8, Buffer = _require.Buffer; var _require2 = require$$4$4, inspect = _require2.inspect; @@ -102090,7 +106343,7 @@ function require_stream_writable () { var Stream = requireStream(); /**/ - var Buffer = require$$0$7.Buffer; + var Buffer = require$$0$8.Buffer; var OurUint8Array = (typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); @@ -103415,7 +107668,7 @@ function require_stream_readable () { Readable.ReadableState = ReadableState; /**/ - require$$0$6.EventEmitter; + require$$0$7.EventEmitter; var EElistenerCount = function EElistenerCount(emitter, type) { return emitter.listeners(type).length; }; @@ -103425,7 +107678,7 @@ function require_stream_readable () { var Stream = requireStream(); /**/ - var Buffer = require$$0$7.Buffer; + var Buffer = require$$0$8.Buffer; var OurUint8Array = (typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); @@ -104665,7 +108918,7 @@ function requireReadable () { if (hasRequiredReadable) return readable.exports; hasRequiredReadable = 1; (function (module, exports$1) { - var Stream = require$$0$a; + var Stream = require$$0$b; if (process.env.READABLE_STREAM === 'disable' && Stream) { module.exports = Stream.Readable; Object.assign(module.exports, Stream); @@ -105073,7 +109326,7 @@ function requireRetryRequest () { if (hasRequiredRetryRequest) return retryRequest.exports; hasRequiredRetryRequest = 1; - const {PassThrough} = require$$0$a; + const {PassThrough} = require$$0$b; const extend = requireExtend(); let debug = () => {}; @@ -105392,7 +109645,7 @@ function requireStreaming () { const gax_1 = requireGax(); const googleError_1 = requireGoogleError(); const status_1 = requireStatus(); - const stream_1 = require$$0$a; + const stream_1 = require$$0$b; // eslint-disable-next-line @typescript-eslint/no-var-requires const duplexify = requireDuplexify(); // eslint-disable-next-line @typescript-eslint/no-var-requires @@ -106157,7 +110410,7 @@ function requireLongrunning () { Object.defineProperty(longrunning, "__esModule", { value: true }); longrunning.Operation = void 0; longrunning.operation = operation; - const events_1 = require$$0$6; + const events_1 = require$$0$7; const status_1 = requireStatus(); const googleError_1 = requireGoogleError(); const operationProtos = __importStar(requireOperations()); @@ -106810,7 +111063,7 @@ function requirePageDescriptor () { */ Object.defineProperty(pageDescriptor, "__esModule", { value: true }); pageDescriptor.PageDescriptor = void 0; - const stream_1 = require$$0$a; + const stream_1 = require$$0$b; const normalApiCaller_1 = requireNormalApiCaller(); const warnings_1 = requireWarnings(); const pagedApiCaller_1 = requirePagedApiCaller(); @@ -193435,8 +197688,8 @@ function resolveSymlinkTarget(symlinkPath, target) { throw new Error(`Symlink at ${symlinkPath} has absolute target ${target}, which is not supported`); } // Get the parent directory of the symlink and join with the target. - const parentDir = require$$0$e.posix.dirname(symlinkPath); - const resolved = require$$0$e.posix.join(parentDir, target); + const parentDir = require$$1$6.posix.dirname(symlinkPath); + const resolved = require$$1$6.posix.join(parentDir, target); // If the resolved path escapes the repo root, posixPath.join will return // a path starting with ".." if (resolved.startsWith("..")) { @@ -211736,7 +215989,7 @@ function requireRe2$1 () { if (ENVIRONMENT_IS_NODE) { if (ENVIRONMENT_IS_WORKER) { - scriptDirectory = require$$0$e.dirname(scriptDirectory) + '/'; + scriptDirectory = require$$1$6.dirname(scriptDirectory) + '/'; } else { scriptDirectory = __dirname + '/'; } @@ -211745,8 +215998,8 @@ function requireRe2$1 () { read_ = function shell_read(filename, binary) { - if (!nodeFS) nodeFS = require$$0$5; - if (!nodePath) nodePath = require$$0$e; + if (!nodeFS) nodeFS = require$$0$6; + if (!nodePath) nodePath = require$$1$6; filename = nodePath['normalize'](filename); return nodeFS['readFileSync'](filename, binary ? null : 'utf8'); }; diff --git a/dist/index.cjs.map b/dist/index.cjs.map index 1663940..c6b5ff9 100644 --- a/dist/index.cjs.map +++ b/dist/index.cjs.map @@ -1 +1 @@ -{"version":3,"file":"index.cjs","sources":["../node_modules/@actions/core/lib/utils.js","../node_modules/@actions/core/lib/command.js","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/regex.js","../node_modules/uuid/dist/esm-browser/validate.js","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/v1.js","../node_modules/uuid/dist/esm-browser/parse.js","../node_modules/uuid/dist/esm-browser/v35.js","../node_modules/uuid/dist/esm-browser/md5.js","../node_modules/uuid/dist/esm-browser/v3.js","../node_modules/uuid/dist/esm-browser/v4.js","../node_modules/uuid/dist/esm-browser/sha1.js","../node_modules/uuid/dist/esm-browser/v5.js","../node_modules/uuid/dist/esm-browser/nil.js","../node_modules/uuid/dist/esm-browser/version.js","../node_modules/@actions/core/lib/file-command.js","../node_modules/@actions/http-client/lib/proxy.js","../node_modules/tunnel/lib/tunnel.js","../node_modules/tunnel/index.js","../node_modules/undici/lib/core/symbols.js","../node_modules/undici/lib/core/errors.js","../node_modules/undici/lib/core/constants.js","../node_modules/undici/lib/core/util.js","../node_modules/undici/lib/timers.js","../node_modules/@fastify/busboy/deps/streamsearch/sbmh.js","../node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js","../node_modules/@fastify/busboy/lib/utils/getLimit.js","../node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js","../node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js","../node_modules/@fastify/busboy/lib/utils/decodeText.js","../node_modules/@fastify/busboy/lib/utils/parseParams.js","../node_modules/@fastify/busboy/lib/utils/basename.js","../node_modules/@fastify/busboy/lib/types/multipart.js","../node_modules/@fastify/busboy/lib/utils/Decoder.js","../node_modules/@fastify/busboy/lib/types/urlencoded.js","../node_modules/@fastify/busboy/lib/main.js","../node_modules/undici/lib/fetch/constants.js","../node_modules/undici/lib/fetch/global.js","../node_modules/undici/lib/fetch/util.js","../node_modules/undici/lib/fetch/symbols.js","../node_modules/undici/lib/fetch/webidl.js","../node_modules/undici/lib/fetch/dataURL.js","../node_modules/undici/lib/fetch/file.js","../node_modules/undici/lib/fetch/formdata.js","../node_modules/undici/lib/fetch/body.js","../node_modules/undici/lib/core/request.js","../node_modules/undici/lib/dispatcher.js","../node_modules/undici/lib/dispatcher-base.js","../node_modules/undici/lib/core/connect.js","../node_modules/undici/lib/llhttp/utils.js","../node_modules/undici/lib/llhttp/constants.js","../node_modules/undici/lib/handler/RedirectHandler.js","../node_modules/undici/lib/interceptor/redirectInterceptor.js","../node_modules/undici/lib/llhttp/llhttp-wasm.js","../node_modules/undici/lib/llhttp/llhttp_simd-wasm.js","../node_modules/undici/lib/client.js","../node_modules/undici/lib/node/fixed-queue.js","../node_modules/undici/lib/pool-stats.js","../node_modules/undici/lib/pool-base.js","../node_modules/undici/lib/pool.js","../node_modules/undici/lib/balanced-pool.js","../node_modules/undici/lib/compat/dispatcher-weakref.js","../node_modules/undici/lib/agent.js","../node_modules/undici/lib/api/readable.js","../node_modules/undici/lib/api/util.js","../node_modules/undici/lib/api/abort-signal.js","../node_modules/undici/lib/api/api-request.js","../node_modules/undici/lib/api/api-stream.js","../node_modules/undici/lib/api/api-pipeline.js","../node_modules/undici/lib/api/api-upgrade.js","../node_modules/undici/lib/api/api-connect.js","../node_modules/undici/lib/api/index.js","../node_modules/undici/lib/mock/mock-errors.js","../node_modules/undici/lib/mock/mock-symbols.js","../node_modules/undici/lib/mock/mock-utils.js","../node_modules/undici/lib/mock/mock-interceptor.js","../node_modules/undici/lib/mock/mock-client.js","../node_modules/undici/lib/mock/mock-pool.js","../node_modules/undici/lib/mock/pluralizer.js","../node_modules/undici/lib/mock/pending-interceptors-formatter.js","../node_modules/undici/lib/mock/mock-agent.js","../node_modules/undici/lib/proxy-agent.js","../node_modules/undici/lib/handler/RetryHandler.js","../node_modules/undici/lib/global.js","../node_modules/undici/lib/handler/DecoratorHandler.js","../node_modules/undici/lib/fetch/headers.js","../node_modules/undici/lib/fetch/response.js","../node_modules/undici/lib/fetch/request.js","../node_modules/undici/lib/fetch/index.js","../node_modules/undici/lib/fileapi/symbols.js","../node_modules/undici/lib/fileapi/progressevent.js","../node_modules/undici/lib/fileapi/encoding.js","../node_modules/undici/lib/fileapi/util.js","../node_modules/undici/lib/fileapi/filereader.js","../node_modules/undici/lib/cache/symbols.js","../node_modules/undici/lib/cache/util.js","../node_modules/undici/lib/cache/cache.js","../node_modules/undici/lib/cache/cachestorage.js","../node_modules/undici/lib/cookies/constants.js","../node_modules/undici/lib/cookies/util.js","../node_modules/undici/lib/cookies/parse.js","../node_modules/undici/lib/cookies/index.js","../node_modules/undici/lib/websocket/constants.js","../node_modules/undici/lib/websocket/symbols.js","../node_modules/undici/lib/websocket/events.js","../node_modules/undici/lib/websocket/util.js","../node_modules/undici/lib/websocket/connection.js","../node_modules/undici/lib/websocket/frame.js","../node_modules/undici/lib/websocket/receiver.js","../node_modules/undici/lib/websocket/websocket.js","../node_modules/undici/index.js","../node_modules/@actions/http-client/lib/index.js","../node_modules/@actions/http-client/lib/auth.js","../node_modules/@actions/core/lib/oidc-utils.js","../node_modules/@actions/core/lib/summary.js","../node_modules/@actions/core/lib/path-utils.js","../node_modules/@actions/core/lib/core.js","../node_modules/@actions/github/lib/context.js","../node_modules/@actions/github/lib/internal/utils.js","../node_modules/@actions/github/node_modules/universal-user-agent/dist-web/index.js","../node_modules/@actions/github/node_modules/before-after-hook/lib/register.js","../node_modules/@actions/github/node_modules/before-after-hook/lib/add.js","../node_modules/@actions/github/node_modules/before-after-hook/lib/remove.js","../node_modules/@actions/github/node_modules/before-after-hook/index.js","../node_modules/@actions/github/node_modules/@octokit/endpoint/dist-src/version.js","../node_modules/@actions/github/node_modules/@octokit/endpoint/dist-src/defaults.js","../node_modules/@actions/github/node_modules/@octokit/endpoint/dist-src/util/lowercase-keys.js","../node_modules/@actions/github/node_modules/@octokit/endpoint/dist-src/util/is-plain-object.js","../node_modules/@actions/github/node_modules/@octokit/endpoint/dist-src/util/merge-deep.js","../node_modules/@actions/github/node_modules/@octokit/endpoint/dist-src/util/remove-undefined-properties.js","../node_modules/@actions/github/node_modules/@octokit/endpoint/dist-src/merge.js","../node_modules/@actions/github/node_modules/@octokit/endpoint/dist-src/util/add-query-parameters.js","../node_modules/@actions/github/node_modules/@octokit/endpoint/dist-src/util/extract-url-variable-names.js","../node_modules/@actions/github/node_modules/@octokit/endpoint/dist-src/util/omit.js","../node_modules/@actions/github/node_modules/@octokit/endpoint/dist-src/util/url-template.js","../node_modules/@actions/github/node_modules/@octokit/endpoint/dist-src/parse.js","../node_modules/@actions/github/node_modules/@octokit/endpoint/dist-src/endpoint-with-defaults.js","../node_modules/@actions/github/node_modules/@octokit/endpoint/dist-src/with-defaults.js","../node_modules/@actions/github/node_modules/@octokit/endpoint/dist-src/index.js","../node_modules/@actions/github/node_modules/@octokit/request/dist-src/version.js","../node_modules/@actions/github/node_modules/@octokit/request/dist-src/is-plain-object.js","../node_modules/deprecation/dist-web/index.js","../node_modules/wrappy/wrappy.js","../node_modules/once/once.js","../node_modules/@actions/github/node_modules/@octokit/request-error/dist-src/index.js","../node_modules/@actions/github/node_modules/@octokit/request/dist-src/get-buffer-response.js","../node_modules/@actions/github/node_modules/@octokit/request/dist-src/fetch-wrapper.js","../node_modules/@actions/github/node_modules/@octokit/request/dist-src/with-defaults.js","../node_modules/@actions/github/node_modules/@octokit/request/dist-src/index.js","../node_modules/@actions/github/node_modules/@octokit/graphql/dist-web/index.js","../node_modules/@actions/github/node_modules/@octokit/auth-token/dist-src/auth.js","../node_modules/@actions/github/node_modules/@octokit/auth-token/dist-src/with-authorization-prefix.js","../node_modules/@actions/github/node_modules/@octokit/auth-token/dist-src/hook.js","../node_modules/@actions/github/node_modules/@octokit/auth-token/dist-src/index.js","../node_modules/@actions/github/node_modules/@octokit/core/dist-web/index.js","../node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js","../node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js","../node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js","../node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js","../node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js","../node_modules/@actions/github/lib/utils.js","../node_modules/@actions/github/lib/github.js","../node_modules/@actions/glob/lib/internal-glob-options-helper.js","../node_modules/@actions/glob/lib/internal-path-helper.js","../node_modules/@actions/glob/lib/internal-match-kind.js","../node_modules/@actions/glob/lib/internal-pattern-helper.js","../node_modules/concat-map/index.js","../node_modules/balanced-match/index.js","../node_modules/brace-expansion/index.js","../node_modules/minimatch/minimatch.js","../node_modules/@actions/glob/lib/internal-path.js","../node_modules/@actions/glob/lib/internal-pattern.js","../node_modules/@actions/glob/lib/internal-search-state.js","../node_modules/@actions/glob/lib/internal-globber.js","../node_modules/@actions/glob/lib/internal-hash-files.js","../node_modules/@actions/glob/lib/glob.js","../node_modules/yaml/browser/dist/nodes/identity.js","../node_modules/yaml/browser/dist/visit.js","../node_modules/yaml/browser/dist/doc/directives.js","../node_modules/yaml/browser/dist/doc/anchors.js","../node_modules/yaml/browser/dist/doc/applyReviver.js","../node_modules/yaml/browser/dist/nodes/toJS.js","../node_modules/yaml/browser/dist/nodes/Node.js","../node_modules/yaml/browser/dist/nodes/Alias.js","../node_modules/yaml/browser/dist/nodes/Scalar.js","../node_modules/yaml/browser/dist/doc/createNode.js","../node_modules/yaml/browser/dist/nodes/Collection.js","../node_modules/yaml/browser/dist/stringify/stringifyComment.js","../node_modules/yaml/browser/dist/stringify/foldFlowLines.js","../node_modules/yaml/browser/dist/stringify/stringifyString.js","../node_modules/yaml/browser/dist/stringify/stringify.js","../node_modules/yaml/browser/dist/stringify/stringifyPair.js","../node_modules/yaml/browser/dist/log.js","../node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js","../node_modules/yaml/browser/dist/nodes/addPairToJSMap.js","../node_modules/yaml/browser/dist/nodes/Pair.js","../node_modules/yaml/browser/dist/stringify/stringifyCollection.js","../node_modules/yaml/browser/dist/nodes/YAMLMap.js","../node_modules/yaml/browser/dist/schema/common/map.js","../node_modules/yaml/browser/dist/nodes/YAMLSeq.js","../node_modules/yaml/browser/dist/schema/common/seq.js","../node_modules/yaml/browser/dist/schema/common/string.js","../node_modules/yaml/browser/dist/schema/common/null.js","../node_modules/yaml/browser/dist/schema/core/bool.js","../node_modules/yaml/browser/dist/stringify/stringifyNumber.js","../node_modules/yaml/browser/dist/schema/core/float.js","../node_modules/yaml/browser/dist/schema/core/int.js","../node_modules/yaml/browser/dist/schema/core/schema.js","../node_modules/yaml/browser/dist/schema/json/schema.js","../node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js","../node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js","../node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js","../node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js","../node_modules/yaml/browser/dist/schema/yaml-1.1/float.js","../node_modules/yaml/browser/dist/schema/yaml-1.1/int.js","../node_modules/yaml/browser/dist/schema/yaml-1.1/set.js","../node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js","../node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js","../node_modules/yaml/browser/dist/schema/tags.js","../node_modules/yaml/browser/dist/schema/Schema.js","../node_modules/yaml/browser/dist/stringify/stringifyDocument.js","../node_modules/yaml/browser/dist/doc/Document.js","../node_modules/yaml/browser/dist/errors.js","../node_modules/yaml/browser/dist/compose/resolve-props.js","../node_modules/yaml/browser/dist/compose/util-contains-newline.js","../node_modules/yaml/browser/dist/compose/util-flow-indent-check.js","../node_modules/yaml/browser/dist/compose/util-map-includes.js","../node_modules/yaml/browser/dist/compose/resolve-block-map.js","../node_modules/yaml/browser/dist/compose/resolve-block-seq.js","../node_modules/yaml/browser/dist/compose/resolve-end.js","../node_modules/yaml/browser/dist/compose/resolve-flow-collection.js","../node_modules/yaml/browser/dist/compose/compose-collection.js","../node_modules/yaml/browser/dist/compose/resolve-block-scalar.js","../node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js","../node_modules/yaml/browser/dist/compose/compose-scalar.js","../node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js","../node_modules/yaml/browser/dist/compose/compose-node.js","../node_modules/yaml/browser/dist/compose/compose-doc.js","../node_modules/yaml/browser/dist/compose/composer.js","../node_modules/yaml/browser/dist/parse/cst-scalar.js","../node_modules/yaml/browser/dist/parse/cst-stringify.js","../node_modules/yaml/browser/dist/parse/cst.js","../node_modules/yaml/browser/dist/parse/lexer.js","../node_modules/yaml/browser/dist/parse/line-counter.js","../node_modules/yaml/browser/dist/parse/parser.js","../node_modules/yaml/browser/dist/public-api.js","../node_modules/bottleneck/light.js","../node_modules/@octokit/plugin-throttling/dist-bundle/index.js","../node_modules/async/dist/async.mjs","../node_modules/@grpc/grpc-js/build/src/constants.js","../node_modules/@grpc/grpc-js/build/src/logging.js","../node_modules/@grpc/grpc-js/build/src/error.js","../node_modules/@grpc/grpc-js/build/src/metadata.js","../node_modules/@grpc/grpc-js/build/src/call-credentials.js","../node_modules/@grpc/grpc-js/build/src/tls-helpers.js","../node_modules/@grpc/grpc-js/build/src/uri-parser.js","../node_modules/@grpc/grpc-js/build/src/resolver.js","../node_modules/@grpc/grpc-js/build/src/channel-credentials.js","../node_modules/@grpc/grpc-js/build/src/load-balancer.js","../node_modules/@grpc/grpc-js/build/src/service-config.js","../node_modules/@grpc/grpc-js/build/src/connectivity-state.js","../node_modules/@grpc/grpc-js/build/src/picker.js","../node_modules/@grpc/grpc-js/build/src/backoff-timeout.js","../node_modules/@grpc/grpc-js/build/src/load-balancer-child-handler.js","../node_modules/@grpc/grpc-js/build/src/resolving-load-balancer.js","../node_modules/@grpc/grpc-js/build/src/channel-options.js","../node_modules/@grpc/grpc-js/build/src/subchannel-address.js","../node_modules/@js-sdsl/ordered-map/dist/esm/index.js","../node_modules/@grpc/grpc-js/build/src/admin.js","../node_modules/@grpc/grpc-js/build/src/call.js","../node_modules/@grpc/grpc-js/build/src/call-interface.js","../node_modules/@grpc/grpc-js/build/src/client-interceptors.js","../node_modules/@grpc/grpc-js/build/src/client.js","../node_modules/@grpc/grpc-js/build/src/make-client.js","../node_modules/lodash.camelcase/index.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/utf8/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/protobufjs/src/util/longbits.js","../node_modules/protobufjs/src/util/minimal.js","../node_modules/protobufjs/src/writer.js","../node_modules/protobufjs/src/writer_buffer.js","../node_modules/protobufjs/src/reader.js","../node_modules/protobufjs/src/reader_buffer.js","../node_modules/protobufjs/src/rpc/service.js","../node_modules/protobufjs/src/rpc.js","../node_modules/protobufjs/src/roots.js","../node_modules/protobufjs/src/index-minimal.js","../node_modules/@protobufjs/codegen/index.js","../node_modules/@protobufjs/fetch/index.js","../node_modules/@protobufjs/path/index.js","../node_modules/protobufjs/src/namespace.js","../node_modules/protobufjs/src/mapfield.js","../node_modules/protobufjs/src/method.js","../node_modules/protobufjs/src/service.js","../node_modules/protobufjs/src/message.js","../node_modules/protobufjs/src/decoder.js","../node_modules/protobufjs/src/verifier.js","../node_modules/protobufjs/src/converter.js","../node_modules/protobufjs/src/wrappers.js","../node_modules/protobufjs/src/type.js","../node_modules/protobufjs/src/root.js","../node_modules/protobufjs/src/util.js","../node_modules/protobufjs/src/types.js","../node_modules/protobufjs/src/field.js","../node_modules/protobufjs/src/oneof.js","../node_modules/protobufjs/src/object.js","../node_modules/protobufjs/src/enum.js","../node_modules/protobufjs/src/encoder.js","../node_modules/protobufjs/src/index-light.js","../node_modules/protobufjs/src/tokenize.js","../node_modules/protobufjs/src/parse.js","../node_modules/protobufjs/src/common.js","../node_modules/protobufjs/src/index.js","../node_modules/protobufjs/index.js","../node_modules/protobufjs/ext/descriptor/index.js","../node_modules/@grpc/proto-loader/build/src/util.js","../node_modules/long/umd/index.js","../node_modules/@grpc/proto-loader/build/src/index.js","../node_modules/@grpc/grpc-js/build/src/channelz.js","../node_modules/@grpc/grpc-js/build/src/subchannel.js","../node_modules/@grpc/grpc-js/build/src/environment.js","../node_modules/@grpc/grpc-js/build/src/resolver-dns.js","../node_modules/@grpc/grpc-js/build/src/http_proxy.js","../node_modules/@grpc/grpc-js/build/src/stream-decoder.js","../node_modules/@grpc/grpc-js/build/src/subchannel-call.js","../node_modules/@grpc/grpc-js/build/src/call-number.js","../node_modules/@grpc/grpc-js/build/src/transport.js","../node_modules/@grpc/grpc-js/build/src/subchannel-pool.js","../node_modules/@grpc/grpc-js/build/src/filter-stack.js","../node_modules/@grpc/grpc-js/build/src/compression-algorithms.js","../node_modules/@grpc/grpc-js/build/src/filter.js","../node_modules/@grpc/grpc-js/build/src/compression-filter.js","../node_modules/@grpc/grpc-js/build/src/deadline.js","../node_modules/@grpc/grpc-js/build/src/control-plane-status.js","../node_modules/@grpc/grpc-js/build/src/load-balancing-call.js","../node_modules/@grpc/grpc-js/build/src/resolving-call.js","../node_modules/@grpc/grpc-js/build/src/retrying-call.js","../node_modules/@grpc/grpc-js/build/src/subchannel-interface.js","../node_modules/@grpc/grpc-js/build/src/internal-channel.js","../node_modules/@grpc/grpc-js/build/src/channel.js","../node_modules/@grpc/grpc-js/build/src/server-call.js","../node_modules/@grpc/grpc-js/build/src/server-credentials.js","../node_modules/@grpc/grpc-js/build/src/server-interceptors.js","../node_modules/@grpc/grpc-js/build/src/server.js","../node_modules/@grpc/grpc-js/build/src/status-builder.js","../node_modules/@grpc/grpc-js/build/src/duration.js","../node_modules/@grpc/grpc-js/build/src/load-balancer-pick-first.js","../node_modules/@grpc/grpc-js/build/src/certificate-provider.js","../node_modules/@grpc/grpc-js/build/src/experimental.js","../node_modules/@grpc/grpc-js/build/src/resolver-uds.js","../node_modules/@grpc/grpc-js/build/src/resolver-ip.js","../node_modules/@grpc/grpc-js/build/src/load-balancer-round-robin.js","../node_modules/@grpc/grpc-js/build/src/load-balancer-outlier-detection.js","../node_modules/@grpc/grpc-js/build/src/index.js","../node_modules/extend/index.js","../node_modules/gaxios/build/cjs/src/util.cjs","../node_modules/gaxios/build/cjs/src/common.js","../node_modules/gaxios/build/cjs/src/retry.js","../node_modules/gaxios/build/cjs/src/interceptor.js","../node_modules/gaxios/build/cjs/src/gaxios.js","../node_modules/gaxios/build/cjs/src/index.js","../node_modules/bignumber.js/bignumber.js","../node_modules/json-bigint/lib/stringify.js","../node_modules/json-bigint/lib/parse.js","../node_modules/json-bigint/index.js","../node_modules/gcp-metadata/build/src/gcp-residency.js","../node_modules/google-logging-utils/build/src/colours.js","../node_modules/google-logging-utils/build/src/logging-utils.js","../node_modules/google-logging-utils/build/src/index.js","../node_modules/gcp-metadata/build/src/index.js","../node_modules/base64-js/index.js","../node_modules/google-auth-library/build/src/crypto/shared.js","../node_modules/google-auth-library/build/src/crypto/browser/crypto.js","../node_modules/google-auth-library/build/src/crypto/node/crypto.js","../node_modules/google-auth-library/build/src/crypto/crypto.js","../node_modules/safe-buffer/index.js","../node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js","../node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js","../node_modules/google-auth-library/build/src/util.js","../node_modules/google-auth-library/build/src/shared.cjs","../node_modules/google-auth-library/build/src/auth/authclient.js","../node_modules/google-auth-library/build/src/auth/loginticket.js","../node_modules/google-auth-library/build/src/auth/oauth2client.js","../node_modules/google-auth-library/build/src/auth/computeclient.js","../node_modules/google-auth-library/build/src/auth/idtokenclient.js","../node_modules/google-auth-library/build/src/auth/envDetect.js","../node_modules/jws/lib/data-stream.js","../node_modules/buffer-equal-constant-time/index.js","../node_modules/jwa/index.js","../node_modules/jws/lib/tostring.js","../node_modules/jws/lib/sign-stream.js","../node_modules/jws/lib/verify-stream.js","../node_modules/jws/index.js","../node_modules/gtoken/build/cjs/src/index.cjs","../node_modules/google-auth-library/build/src/auth/jwtaccess.js","../node_modules/google-auth-library/build/src/auth/jwtclient.js","../node_modules/google-auth-library/build/src/auth/refreshclient.js","../node_modules/google-auth-library/build/src/auth/impersonated.js","../node_modules/google-auth-library/build/src/auth/oauth2common.js","../node_modules/google-auth-library/build/src/auth/stscredentials.js","../node_modules/google-auth-library/build/src/auth/baseexternalclient.js","../node_modules/google-auth-library/build/src/auth/filesubjecttokensupplier.js","../node_modules/google-auth-library/build/src/auth/urlsubjecttokensupplier.js","../node_modules/google-auth-library/build/src/auth/identitypoolclient.js","../node_modules/google-auth-library/build/src/auth/awsrequestsigner.js","../node_modules/google-auth-library/build/src/auth/defaultawssecuritycredentialssupplier.js","../node_modules/google-auth-library/build/src/auth/awsclient.js","../node_modules/google-auth-library/build/src/auth/executable-response.js","../node_modules/google-auth-library/build/src/auth/pluggable-auth-handler.js","../node_modules/google-auth-library/build/src/auth/pluggable-auth-client.js","../node_modules/google-auth-library/build/src/auth/externalclient.js","../node_modules/google-auth-library/build/src/auth/externalAccountAuthorizedUserClient.js","../node_modules/google-auth-library/build/src/auth/googleauth.js","../node_modules/google-auth-library/build/src/auth/iam.js","../node_modules/google-auth-library/build/src/auth/downscopedclient.js","../node_modules/google-auth-library/build/src/auth/passthrough.js","../node_modules/google-auth-library/build/src/index.js","../node_modules/object-hash/index.js","../node_modules/google-gax/build/src/featureDetection.js","../node_modules/google-gax/build/src/warnings.js","../node_modules/google-gax/build/src/util.js","../node_modules/google-gax/build/src/status.js","../node_modules/google-gax/build/src/gax.js","../node_modules/google-gax/build/src/grpc.js","../node_modules/protobufjs/minimal.js","../node_modules/google-gax/build/protos/iam_service.js","../node_modules/google-gax/build/protos/locations.js","../node_modules/google-gax/build/protos/operations.js","../node_modules/proto3-json-serializer/build/src/bytes.js","../node_modules/proto3-json-serializer/build/src/enum.js","../node_modules/proto3-json-serializer/build/src/util.js","../node_modules/proto3-json-serializer/build/src/value.js","../node_modules/proto3-json-serializer/build/src/duration.js","../node_modules/proto3-json-serializer/build/src/timestamp.js","../node_modules/proto3-json-serializer/build/src/wrappers.js","../node_modules/proto3-json-serializer/build/src/fieldmask.js","../node_modules/proto3-json-serializer/build/src/fromproto3json.js","../node_modules/proto3-json-serializer/build/src/any.js","../node_modules/proto3-json-serializer/build/src/toproto3json.js","../node_modules/proto3-json-serializer/build/src/index.js","../node_modules/google-gax/build/src/routingHeader.js","../node_modules/google-gax/build/src/transcoding.js","../node_modules/google-gax/build/src/fallbackRest.js","../node_modules/event-target-shim/dist/event-target-shim.mjs","../node_modules/abort-controller/dist/abort-controller.mjs","../node_modules/google-gax/build/src/streamArrayParser.js","../node_modules/google-gax/build/src/fallbackServiceStub.js","../node_modules/readable-stream/lib/internal/streams/stream.js","../node_modules/readable-stream/lib/internal/streams/buffer_list.js","../node_modules/readable-stream/lib/internal/streams/destroy.js","../node_modules/readable-stream/errors.js","../node_modules/readable-stream/lib/internal/streams/state.js","../node_modules/inherits/inherits_browser.js","../node_modules/inherits/inherits.js","../node_modules/util-deprecate/node.js","../node_modules/readable-stream/lib/_stream_writable.js","../node_modules/readable-stream/lib/_stream_duplex.js","../node_modules/string_decoder/lib/string_decoder.js","../node_modules/readable-stream/lib/internal/streams/end-of-stream.js","../node_modules/readable-stream/lib/internal/streams/async_iterator.js","../node_modules/readable-stream/lib/internal/streams/from.js","../node_modules/readable-stream/lib/_stream_readable.js","../node_modules/readable-stream/lib/_stream_transform.js","../node_modules/readable-stream/lib/_stream_passthrough.js","../node_modules/readable-stream/lib/internal/streams/pipeline.js","../node_modules/readable-stream/readable.js","../node_modules/end-of-stream/index.js","../node_modules/stream-shift/index.js","../node_modules/duplexify/index.js","../node_modules/retry-request/index.js","../node_modules/google-gax/build/src/streamingCalls/streaming.js","../node_modules/google-gax/build/src/pathTemplate.js","../node_modules/google-gax/build/src/longRunningCalls/longrunning.js","../node_modules/google-gax/build/src/longRunningCalls/longRunningApiCaller.js","../node_modules/google-gax/build/src/longRunningCalls/longRunningDescriptor.js","../node_modules/google-gax/build/src/paginationCalls/resourceCollector.js","../node_modules/google-gax/build/src/paginationCalls/pagedApiCaller.js","../node_modules/google-gax/build/src/paginationCalls/pageDescriptor.js","../node_modules/google-gax/build/src/streamingCalls/streamingApiCaller.js","../node_modules/google-gax/build/src/streamingCalls/streamDescriptor.js","../node_modules/google-gax/build/src/bundlingCalls/bundleApiCaller.js","../node_modules/google-gax/build/src/bundlingCalls/bundlingUtils.js","../node_modules/google-gax/build/src/bundlingCalls/task.js","../node_modules/google-gax/build/src/bundlingCalls/bundleExecutor.js","../node_modules/google-gax/build/src/bundlingCalls/bundleDescriptor.js","../node_modules/google-gax/build/src/descriptor.js","../node_modules/google-gax/build/src/iamService.js","../node_modules/google-gax/build/src/locationService.js","../node_modules/google-gax/build/src/fallback.js","../node_modules/google-gax/build/src/googleError.js","../node_modules/google-gax/build/src/call.js","../node_modules/google-gax/build/src/normalCalls/normalApiCaller.js","../node_modules/google-gax/build/src/apiCaller.js","../node_modules/google-gax/build/src/normalCalls/timeout.js","../node_modules/google-gax/build/src/normalCalls/retries.js","../node_modules/google-gax/build/src/createApiCall.js","../node_modules/google-gax/build/src/operationsClient.js","../node_modules/google-gax/build/src/index.js","../node_modules/@google-cloud/artifact-registry/build/src/v1/artifact_registry_client.js","../node_modules/@google-cloud/artifact-registry/build/src/v1/index.js","../node_modules/@google-cloud/artifact-registry/build/src/v1beta2/artifact_registry_client.js","../node_modules/@google-cloud/artifact-registry/build/src/v1beta2/index.js","../node_modules/google-gax/build/src/protobuf.js","../node_modules/@google-cloud/artifact-registry/build/protos/protos.js","../node_modules/@google-cloud/artifact-registry/build/src/index.js","../node_modules/lru-cache/dist/esm/index.js","../src/promotionInfo.ts","../src/artifactRegistry.ts","../src/github.ts","../node_modules/lodash/lodash.js","../src/yaml.ts","../src/annotatedError.ts","../src/update-docker-tags.ts","../src/update-graph-artifact-refs.ts","../src/update-git-refs.ts","../node_modules/re2-wasm/build/wasm/re2.js","../node_modules/re2-wasm/build/src/re2.js","../src/templates.ts","../node_modules/@ark/util/out/arrays.js","../node_modules/@ark/util/out/domain.js","../node_modules/@ark/util/out/errors.js","../node_modules/@ark/util/out/flatMorph.js","../node_modules/@ark/util/out/records.js","../node_modules/@ark/util/out/objectKinds.js","../node_modules/@ark/util/out/clone.js","../node_modules/@ark/util/out/functions.js","../node_modules/@ark/util/out/hkt.js","../node_modules/@ark/util/out/isomorphic.js","../node_modules/@ark/util/out/strings.js","../node_modules/@ark/util/out/numbers.js","../node_modules/@ark/util/out/registry.js","../node_modules/@ark/util/out/primitive.js","../node_modules/@ark/util/out/serialize.js","../node_modules/@ark/util/out/path.js","../node_modules/@ark/util/out/scanner.js","../node_modules/@ark/schema/out/shared/registry.js","../node_modules/@ark/schema/out/shared/compile.js","../node_modules/@ark/schema/out/shared/utils.js","../node_modules/@ark/schema/out/shared/implement.js","../node_modules/@ark/schema/out/shared/toJsonSchema.js","../node_modules/@ark/schema/out/config.js","../node_modules/@ark/schema/out/shared/errors.js","../node_modules/@ark/schema/out/shared/traversal.js","../node_modules/@ark/schema/out/node.js","../node_modules/@ark/schema/out/shared/disjoint.js","../node_modules/@ark/schema/out/shared/intersections.js","../node_modules/@ark/schema/out/constraint.js","../node_modules/@ark/schema/out/generic.js","../node_modules/@ark/schema/out/predicate.js","../node_modules/@ark/schema/out/refinements/divisor.js","../node_modules/@ark/schema/out/refinements/range.js","../node_modules/@ark/schema/out/refinements/after.js","../node_modules/@ark/schema/out/refinements/before.js","../node_modules/@ark/schema/out/refinements/exactLength.js","../node_modules/@ark/schema/out/refinements/max.js","../node_modules/@ark/schema/out/refinements/maxLength.js","../node_modules/@ark/schema/out/refinements/min.js","../node_modules/@ark/schema/out/refinements/minLength.js","../node_modules/@ark/schema/out/refinements/kinds.js","../node_modules/@ark/schema/out/refinements/pattern.js","../node_modules/@ark/schema/out/parse.js","../node_modules/@ark/schema/out/structure/prop.js","../node_modules/@ark/schema/out/structure/optional.js","../node_modules/@ark/schema/out/roots/root.js","../node_modules/@ark/schema/out/roots/utils.js","../node_modules/@ark/schema/out/roots/alias.js","../node_modules/@ark/schema/out/roots/basis.js","../node_modules/@ark/schema/out/roots/domain.js","../node_modules/@ark/schema/out/roots/intersection.js","../node_modules/@ark/schema/out/roots/morph.js","../node_modules/@ark/schema/out/roots/proto.js","../node_modules/@ark/schema/out/roots/union.js","../node_modules/@ark/schema/out/roots/unit.js","../node_modules/@ark/schema/out/structure/index.js","../node_modules/@ark/schema/out/structure/required.js","../node_modules/@ark/schema/out/structure/sequence.js","../node_modules/@ark/schema/out/structure/structure.js","../node_modules/@ark/schema/out/kinds.js","../node_modules/@ark/schema/out/module.js","../node_modules/@ark/schema/out/scope.js","../node_modules/@ark/schema/out/structure/shared.js","../node_modules/@ark/schema/out/intrinsic.js","../node_modules/arkregex/out/regex.js","../node_modules/arktype/out/parser/shift/operand/date.js","../node_modules/arktype/out/parser/shift/operand/enclosed.js","../node_modules/arktype/out/parser/ast/validate.js","../node_modules/arktype/out/parser/shift/tokens.js","../node_modules/arktype/out/parser/shift/operand/genericArgs.js","../node_modules/arktype/out/parser/shift/operand/unenclosed.js","../node_modules/arktype/out/parser/shift/operand/operand.js","../node_modules/arktype/out/parser/reduce/shared.js","../node_modules/arktype/out/parser/shift/operator/bounds.js","../node_modules/arktype/out/parser/shift/operator/brand.js","../node_modules/arktype/out/parser/shift/operator/divisor.js","../node_modules/arktype/out/parser/shift/operator/operator.js","../node_modules/arktype/out/parser/shift/operator/default.js","../node_modules/arktype/out/parser/string.js","../node_modules/arktype/out/parser/reduce/dynamic.js","../node_modules/arktype/out/generic.js","../node_modules/arktype/out/fn.js","../node_modules/arktype/out/match.js","../node_modules/arktype/out/parser/property.js","../node_modules/arktype/out/parser/objectLiteral.js","../node_modules/arktype/out/parser/tupleExpressions.js","../node_modules/arktype/out/parser/tupleLiteral.js","../node_modules/arktype/out/parser/definition.js","../node_modules/arktype/out/type.js","../node_modules/arktype/out/scope.js","../node_modules/arktype/out/keywords/builtins.js","../node_modules/arktype/out/keywords/Array.js","../node_modules/arktype/out/keywords/FormData.js","../node_modules/arktype/out/keywords/TypedArray.js","../node_modules/arktype/out/keywords/constructors.js","../node_modules/arktype/out/keywords/number.js","../node_modules/arktype/out/keywords/string.js","../node_modules/arktype/out/keywords/ts.js","../node_modules/arktype/out/keywords/keywords.js","../src/update-promoted-values.ts","../src/log.ts","../src/promotion-metadata-types.ts","../src/format-promoted-commits.ts","../src/format-cleanup-changes.ts","../src/update-closed-prs.ts","../src/index.ts"],"sourcesContent":["\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import rng from './rng.js';\nimport stringify from './stringify.js'; // **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\n\nvar _clockseq; // Previous uuid creation time\n\n\nvar _lastMSecs = 0;\nvar _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || new Array(16);\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n var seedBytes = options.random || (options.rng || rng)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n var msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || stringify(b);\n}\n\nexport default v1;","import validate from './validate.js';\n\nfunction parse(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n var v;\n var arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nexport default parse;","import stringify from './stringify.js';\nimport parse from './parse.js';\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n var bytes = [];\n\n for (var i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nexport var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexport var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexport default function (name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = parse(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n var bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return stringify(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","/*\n * Browser-compatible JavaScript MD5\n *\n * Modification of JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\nfunction md5(bytes) {\n if (typeof bytes === 'string') {\n var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = new Uint8Array(msg.length);\n\n for (var i = 0; i < msg.length; ++i) {\n bytes[i] = msg.charCodeAt(i);\n }\n }\n\n return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));\n}\n/*\n * Convert an array of little-endian words to an array of bytes\n */\n\n\nfunction md5ToHexEncodedArray(input) {\n var output = [];\n var length32 = input.length * 32;\n var hexTab = '0123456789abcdef';\n\n for (var i = 0; i < length32; i += 8) {\n var x = input[i >> 5] >>> i % 32 & 0xff;\n var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);\n output.push(hex);\n }\n\n return output;\n}\n/**\n * Calculate output length with padding and bit length\n */\n\n\nfunction getOutputLength(inputLength8) {\n return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;\n}\n/*\n * Calculate the MD5 of an array of little-endian words, and a bit length.\n */\n\n\nfunction wordsToMd5(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << len % 32;\n x[getOutputLength(len) - 1] = len;\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n\n for (var i = 0; i < x.length; i += 16) {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n a = md5ff(a, b, c, d, x[i], 7, -680876936);\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063);\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);\n b = md5gg(b, c, d, a, x[i], 20, -373897302);\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558);\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);\n d = md5hh(d, a, b, c, x[i], 11, -358537222);\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);\n a = md5ii(a, b, c, d, x[i], 6, -198630844);\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);\n a = safeAdd(a, olda);\n b = safeAdd(b, oldb);\n c = safeAdd(c, oldc);\n d = safeAdd(d, oldd);\n }\n\n return [a, b, c, d];\n}\n/*\n * Convert an array bytes to an array of little-endian words\n * Characters >255 have their high-byte silently ignored.\n */\n\n\nfunction bytesToWords(input) {\n if (input.length === 0) {\n return [];\n }\n\n var length8 = input.length * 8;\n var output = new Uint32Array(getOutputLength(length8));\n\n for (var i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}\n/*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\n\n\nfunction safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}\n/*\n * Bitwise rotate a 32-bit number to the left.\n */\n\n\nfunction bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}\n/*\n * These functions implement the four basic operations the algorithm uses.\n */\n\n\nfunction md5cmn(q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);\n}\n\nfunction md5ff(a, b, c, d, x, s, t) {\n return md5cmn(b & c | ~b & d, a, b, x, s, t);\n}\n\nfunction md5gg(a, b, c, d, x, s, t) {\n return md5cmn(b & d | c & ~d, a, b, x, s, t);\n}\n\nfunction md5hh(a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t);\n}\n\nfunction md5ii(a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t);\n}\n\nexport default md5;","import v35 from './v35.js';\nimport md5 from './md5.js';\nvar v3 = v35('v3', 0x30, md5);\nexport default v3;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","// Adapted from Chris Veness' SHA1 code at\n// http://www.movable-type.co.uk/scripts/sha1.html\nfunction f(s, x, y, z) {\n switch (s) {\n case 0:\n return x & y ^ ~x & z;\n\n case 1:\n return x ^ y ^ z;\n\n case 2:\n return x & y ^ x & z ^ y & z;\n\n case 3:\n return x ^ y ^ z;\n }\n}\n\nfunction ROTL(x, n) {\n return x << n | x >>> 32 - n;\n}\n\nfunction sha1(bytes) {\n var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n\n if (typeof bytes === 'string') {\n var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = [];\n\n for (var i = 0; i < msg.length; ++i) {\n bytes.push(msg.charCodeAt(i));\n }\n } else if (!Array.isArray(bytes)) {\n // Convert Array-like to Array\n bytes = Array.prototype.slice.call(bytes);\n }\n\n bytes.push(0x80);\n var l = bytes.length / 4 + 2;\n var N = Math.ceil(l / 16);\n var M = new Array(N);\n\n for (var _i = 0; _i < N; ++_i) {\n var arr = new Uint32Array(16);\n\n for (var j = 0; j < 16; ++j) {\n arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3];\n }\n\n M[_i] = arr;\n }\n\n M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;\n\n for (var _i2 = 0; _i2 < N; ++_i2) {\n var W = new Uint32Array(80);\n\n for (var t = 0; t < 16; ++t) {\n W[t] = M[_i2][t];\n }\n\n for (var _t = 16; _t < 80; ++_t) {\n W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1);\n }\n\n var a = H[0];\n var b = H[1];\n var c = H[2];\n var d = H[3];\n var e = H[4];\n\n for (var _t2 = 0; _t2 < 80; ++_t2) {\n var s = Math.floor(_t2 / 20);\n var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n\n H[0] = H[0] + a >>> 0;\n H[1] = H[1] + b >>> 0;\n H[2] = H[2] + c >>> 0;\n H[3] = H[3] + d >>> 0;\n H[4] = H[4] + e >>> 0;\n }\n\n return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];\n}\n\nexport default sha1;","import v35 from './v35.js';\nimport sha1 from './sha1.js';\nvar v5 = v35('v5', 0x50, sha1);\nexport default v5;","export default '00000000-0000-0000-0000-000000000000';","import validate from './validate.js';\n\nfunction version(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nexport default version;","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.prepareKeyValueMessage = exports.issueFileCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst uuid_1 = require(\"uuid\");\nconst utils_1 = require(\"./utils\");\nfunction issueFileCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueFileCommand = issueFileCommand;\nfunction prepareKeyValueMessage(key, value) {\n const delimiter = `ghadelimiter_${uuid_1.v4()}`;\n const convertedValue = utils_1.toCommandValue(value);\n // These should realistically never happen, but just in case someone finds a\n // way to exploit uuid generation let's not allow keys or values that contain\n // the delimiter.\n if (key.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedValue.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\nexports.prepareKeyValueMessage = prepareKeyValueMessage;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkBypass = exports.getProxyUrl = void 0;\nfunction getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n try {\n return new URL(proxyVar);\n }\n catch (_a) {\n if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))\n return new URL(`http://${proxyVar}`);\n }\n }\n else {\n return undefined;\n }\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const reqHost = reqUrl.hostname;\n if (isLoopbackAddress(reqHost)) {\n return true;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperNoProxyItem === '*' ||\n upperReqHosts.some(x => x === upperNoProxyItem ||\n x.endsWith(`.${upperNoProxyItem}`) ||\n (upperNoProxyItem.startsWith('.') &&\n x.endsWith(`${upperNoProxyItem}`)))) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\nfunction isLoopbackAddress(host) {\n const hostLower = host.toLowerCase();\n return (hostLower === 'localhost' ||\n hostLower.startsWith('127.') ||\n hostLower.startsWith('[::1]') ||\n hostLower.startsWith('[0:0:0:0:0:0:0:1]'));\n}\n//# sourceMappingURL=proxy.js.map","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","module.exports = require('./lib/tunnel');\n","module.exports = {\n kClose: Symbol('close'),\n kDestroy: Symbol('destroy'),\n kDispatch: Symbol('dispatch'),\n kUrl: Symbol('url'),\n kWriting: Symbol('writing'),\n kResuming: Symbol('resuming'),\n kQueue: Symbol('queue'),\n kConnect: Symbol('connect'),\n kConnecting: Symbol('connecting'),\n kHeadersList: Symbol('headers list'),\n kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),\n kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),\n kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),\n kKeepAliveTimeoutValue: Symbol('keep alive timeout'),\n kKeepAlive: Symbol('keep alive'),\n kHeadersTimeout: Symbol('headers timeout'),\n kBodyTimeout: Symbol('body timeout'),\n kServerName: Symbol('server name'),\n kLocalAddress: Symbol('local address'),\n kHost: Symbol('host'),\n kNoRef: Symbol('no ref'),\n kBodyUsed: Symbol('used'),\n kRunning: Symbol('running'),\n kBlocking: Symbol('blocking'),\n kPending: Symbol('pending'),\n kSize: Symbol('size'),\n kBusy: Symbol('busy'),\n kQueued: Symbol('queued'),\n kFree: Symbol('free'),\n kConnected: Symbol('connected'),\n kClosed: Symbol('closed'),\n kNeedDrain: Symbol('need drain'),\n kReset: Symbol('reset'),\n kDestroyed: Symbol.for('nodejs.stream.destroyed'),\n kMaxHeadersSize: Symbol('max headers size'),\n kRunningIdx: Symbol('running index'),\n kPendingIdx: Symbol('pending index'),\n kError: Symbol('error'),\n kClients: Symbol('clients'),\n kClient: Symbol('client'),\n kParser: Symbol('parser'),\n kOnDestroyed: Symbol('destroy callbacks'),\n kPipelining: Symbol('pipelining'),\n kSocket: Symbol('socket'),\n kHostHeader: Symbol('host header'),\n kConnector: Symbol('connector'),\n kStrictContentLength: Symbol('strict content length'),\n kMaxRedirections: Symbol('maxRedirections'),\n kMaxRequests: Symbol('maxRequestsPerClient'),\n kProxy: Symbol('proxy agent options'),\n kCounter: Symbol('socket request counter'),\n kInterceptors: Symbol('dispatch interceptors'),\n kMaxResponseSize: Symbol('max response size'),\n kHTTP2Session: Symbol('http2Session'),\n kHTTP2SessionState: Symbol('http2Session state'),\n kHTTP2BuildRequest: Symbol('http2 build request'),\n kHTTP1BuildRequest: Symbol('http1 build request'),\n kHTTP2CopyHeaders: Symbol('http2 copy headers'),\n kHTTPConnVersion: Symbol('http connection version'),\n kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),\n kConstruct: Symbol('constructable')\n}\n","'use strict'\n\nclass UndiciError extends Error {\n constructor (message) {\n super(message)\n this.name = 'UndiciError'\n this.code = 'UND_ERR'\n }\n}\n\nclass ConnectTimeoutError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, ConnectTimeoutError)\n this.name = 'ConnectTimeoutError'\n this.message = message || 'Connect Timeout Error'\n this.code = 'UND_ERR_CONNECT_TIMEOUT'\n }\n}\n\nclass HeadersTimeoutError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, HeadersTimeoutError)\n this.name = 'HeadersTimeoutError'\n this.message = message || 'Headers Timeout Error'\n this.code = 'UND_ERR_HEADERS_TIMEOUT'\n }\n}\n\nclass HeadersOverflowError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, HeadersOverflowError)\n this.name = 'HeadersOverflowError'\n this.message = message || 'Headers Overflow Error'\n this.code = 'UND_ERR_HEADERS_OVERFLOW'\n }\n}\n\nclass BodyTimeoutError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, BodyTimeoutError)\n this.name = 'BodyTimeoutError'\n this.message = message || 'Body Timeout Error'\n this.code = 'UND_ERR_BODY_TIMEOUT'\n }\n}\n\nclass ResponseStatusCodeError extends UndiciError {\n constructor (message, statusCode, headers, body) {\n super(message)\n Error.captureStackTrace(this, ResponseStatusCodeError)\n this.name = 'ResponseStatusCodeError'\n this.message = message || 'Response Status Code Error'\n this.code = 'UND_ERR_RESPONSE_STATUS_CODE'\n this.body = body\n this.status = statusCode\n this.statusCode = statusCode\n this.headers = headers\n }\n}\n\nclass InvalidArgumentError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, InvalidArgumentError)\n this.name = 'InvalidArgumentError'\n this.message = message || 'Invalid Argument Error'\n this.code = 'UND_ERR_INVALID_ARG'\n }\n}\n\nclass InvalidReturnValueError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, InvalidReturnValueError)\n this.name = 'InvalidReturnValueError'\n this.message = message || 'Invalid Return Value Error'\n this.code = 'UND_ERR_INVALID_RETURN_VALUE'\n }\n}\n\nclass RequestAbortedError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, RequestAbortedError)\n this.name = 'AbortError'\n this.message = message || 'Request aborted'\n this.code = 'UND_ERR_ABORTED'\n }\n}\n\nclass InformationalError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, InformationalError)\n this.name = 'InformationalError'\n this.message = message || 'Request information'\n this.code = 'UND_ERR_INFO'\n }\n}\n\nclass RequestContentLengthMismatchError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, RequestContentLengthMismatchError)\n this.name = 'RequestContentLengthMismatchError'\n this.message = message || 'Request body length does not match content-length header'\n this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'\n }\n}\n\nclass ResponseContentLengthMismatchError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, ResponseContentLengthMismatchError)\n this.name = 'ResponseContentLengthMismatchError'\n this.message = message || 'Response body length does not match content-length header'\n this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'\n }\n}\n\nclass ClientDestroyedError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, ClientDestroyedError)\n this.name = 'ClientDestroyedError'\n this.message = message || 'The client is destroyed'\n this.code = 'UND_ERR_DESTROYED'\n }\n}\n\nclass ClientClosedError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, ClientClosedError)\n this.name = 'ClientClosedError'\n this.message = message || 'The client is closed'\n this.code = 'UND_ERR_CLOSED'\n }\n}\n\nclass SocketError extends UndiciError {\n constructor (message, socket) {\n super(message)\n Error.captureStackTrace(this, SocketError)\n this.name = 'SocketError'\n this.message = message || 'Socket error'\n this.code = 'UND_ERR_SOCKET'\n this.socket = socket\n }\n}\n\nclass NotSupportedError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, NotSupportedError)\n this.name = 'NotSupportedError'\n this.message = message || 'Not supported error'\n this.code = 'UND_ERR_NOT_SUPPORTED'\n }\n}\n\nclass BalancedPoolMissingUpstreamError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, NotSupportedError)\n this.name = 'MissingUpstreamError'\n this.message = message || 'No upstream has been added to the BalancedPool'\n this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'\n }\n}\n\nclass HTTPParserError extends Error {\n constructor (message, code, data) {\n super(message)\n Error.captureStackTrace(this, HTTPParserError)\n this.name = 'HTTPParserError'\n this.code = code ? `HPE_${code}` : undefined\n this.data = data ? data.toString() : undefined\n }\n}\n\nclass ResponseExceededMaxSizeError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, ResponseExceededMaxSizeError)\n this.name = 'ResponseExceededMaxSizeError'\n this.message = message || 'Response content exceeded max size'\n this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'\n }\n}\n\nclass RequestRetryError extends UndiciError {\n constructor (message, code, { headers, data }) {\n super(message)\n Error.captureStackTrace(this, RequestRetryError)\n this.name = 'RequestRetryError'\n this.message = message || 'Request retry error'\n this.code = 'UND_ERR_REQ_RETRY'\n this.statusCode = code\n this.data = data\n this.headers = headers\n }\n}\n\nmodule.exports = {\n HTTPParserError,\n UndiciError,\n HeadersTimeoutError,\n HeadersOverflowError,\n BodyTimeoutError,\n RequestContentLengthMismatchError,\n ConnectTimeoutError,\n ResponseStatusCodeError,\n InvalidArgumentError,\n InvalidReturnValueError,\n RequestAbortedError,\n ClientDestroyedError,\n ClientClosedError,\n InformationalError,\n SocketError,\n NotSupportedError,\n ResponseContentLengthMismatchError,\n BalancedPoolMissingUpstreamError,\n ResponseExceededMaxSizeError,\n RequestRetryError\n}\n","'use strict'\n\n/** @type {Record} */\nconst headerNameLowerCasedRecord = {}\n\n// https://developer.mozilla.org/docs/Web/HTTP/Headers\nconst wellknownHeaderNames = [\n 'Accept',\n 'Accept-Encoding',\n 'Accept-Language',\n 'Accept-Ranges',\n 'Access-Control-Allow-Credentials',\n 'Access-Control-Allow-Headers',\n 'Access-Control-Allow-Methods',\n 'Access-Control-Allow-Origin',\n 'Access-Control-Expose-Headers',\n 'Access-Control-Max-Age',\n 'Access-Control-Request-Headers',\n 'Access-Control-Request-Method',\n 'Age',\n 'Allow',\n 'Alt-Svc',\n 'Alt-Used',\n 'Authorization',\n 'Cache-Control',\n 'Clear-Site-Data',\n 'Connection',\n 'Content-Disposition',\n 'Content-Encoding',\n 'Content-Language',\n 'Content-Length',\n 'Content-Location',\n 'Content-Range',\n 'Content-Security-Policy',\n 'Content-Security-Policy-Report-Only',\n 'Content-Type',\n 'Cookie',\n 'Cross-Origin-Embedder-Policy',\n 'Cross-Origin-Opener-Policy',\n 'Cross-Origin-Resource-Policy',\n 'Date',\n 'Device-Memory',\n 'Downlink',\n 'ECT',\n 'ETag',\n 'Expect',\n 'Expect-CT',\n 'Expires',\n 'Forwarded',\n 'From',\n 'Host',\n 'If-Match',\n 'If-Modified-Since',\n 'If-None-Match',\n 'If-Range',\n 'If-Unmodified-Since',\n 'Keep-Alive',\n 'Last-Modified',\n 'Link',\n 'Location',\n 'Max-Forwards',\n 'Origin',\n 'Permissions-Policy',\n 'Pragma',\n 'Proxy-Authenticate',\n 'Proxy-Authorization',\n 'RTT',\n 'Range',\n 'Referer',\n 'Referrer-Policy',\n 'Refresh',\n 'Retry-After',\n 'Sec-WebSocket-Accept',\n 'Sec-WebSocket-Extensions',\n 'Sec-WebSocket-Key',\n 'Sec-WebSocket-Protocol',\n 'Sec-WebSocket-Version',\n 'Server',\n 'Server-Timing',\n 'Service-Worker-Allowed',\n 'Service-Worker-Navigation-Preload',\n 'Set-Cookie',\n 'SourceMap',\n 'Strict-Transport-Security',\n 'Supports-Loading-Mode',\n 'TE',\n 'Timing-Allow-Origin',\n 'Trailer',\n 'Transfer-Encoding',\n 'Upgrade',\n 'Upgrade-Insecure-Requests',\n 'User-Agent',\n 'Vary',\n 'Via',\n 'WWW-Authenticate',\n 'X-Content-Type-Options',\n 'X-DNS-Prefetch-Control',\n 'X-Frame-Options',\n 'X-Permitted-Cross-Domain-Policies',\n 'X-Powered-By',\n 'X-Requested-With',\n 'X-XSS-Protection'\n]\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n const key = wellknownHeaderNames[i]\n const lowerCasedKey = key.toLowerCase()\n headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =\n lowerCasedKey\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(headerNameLowerCasedRecord, null)\n\nmodule.exports = {\n wellknownHeaderNames,\n headerNameLowerCasedRecord\n}\n","'use strict'\n\nconst assert = require('assert')\nconst { kDestroyed, kBodyUsed } = require('./symbols')\nconst { IncomingMessage } = require('http')\nconst stream = require('stream')\nconst net = require('net')\nconst { InvalidArgumentError } = require('./errors')\nconst { Blob } = require('buffer')\nconst nodeUtil = require('util')\nconst { stringify } = require('querystring')\nconst { headerNameLowerCasedRecord } = require('./constants')\n\nconst [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))\n\nfunction nop () {}\n\nfunction isStream (obj) {\n return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'\n}\n\n// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)\nfunction isBlobLike (object) {\n return (Blob && object instanceof Blob) || (\n object &&\n typeof object === 'object' &&\n (typeof object.stream === 'function' ||\n typeof object.arrayBuffer === 'function') &&\n /^(Blob|File)$/.test(object[Symbol.toStringTag])\n )\n}\n\nfunction buildURL (url, queryParams) {\n if (url.includes('?') || url.includes('#')) {\n throw new Error('Query params cannot be passed when url already contains \"?\" or \"#\".')\n }\n\n const stringified = stringify(queryParams)\n\n if (stringified) {\n url += '?' + stringified\n }\n\n return url\n}\n\nfunction parseURL (url) {\n if (typeof url === 'string') {\n url = new URL(url)\n\n if (!/^https?:/.test(url.origin || url.protocol)) {\n throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n }\n\n return url\n }\n\n if (!url || typeof url !== 'object') {\n throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')\n }\n\n if (!/^https?:/.test(url.origin || url.protocol)) {\n throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n }\n\n if (!(url instanceof URL)) {\n if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {\n throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')\n }\n\n if (url.path != null && typeof url.path !== 'string') {\n throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')\n }\n\n if (url.pathname != null && typeof url.pathname !== 'string') {\n throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')\n }\n\n if (url.hostname != null && typeof url.hostname !== 'string') {\n throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')\n }\n\n if (url.origin != null && typeof url.origin !== 'string') {\n throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')\n }\n\n const port = url.port != null\n ? url.port\n : (url.protocol === 'https:' ? 443 : 80)\n let origin = url.origin != null\n ? url.origin\n : `${url.protocol}//${url.hostname}:${port}`\n let path = url.path != null\n ? url.path\n : `${url.pathname || ''}${url.search || ''}`\n\n if (origin.endsWith('/')) {\n origin = origin.substring(0, origin.length - 1)\n }\n\n if (path && !path.startsWith('/')) {\n path = `/${path}`\n }\n // new URL(path, origin) is unsafe when `path` contains an absolute URL\n // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:\n // If first parameter is a relative URL, second param is required, and will be used as the base URL.\n // If first parameter is an absolute URL, a given second param will be ignored.\n url = new URL(origin + path)\n }\n\n return url\n}\n\nfunction parseOrigin (url) {\n url = parseURL(url)\n\n if (url.pathname !== '/' || url.search || url.hash) {\n throw new InvalidArgumentError('invalid url')\n }\n\n return url\n}\n\nfunction getHostname (host) {\n if (host[0] === '[') {\n const idx = host.indexOf(']')\n\n assert(idx !== -1)\n return host.substring(1, idx)\n }\n\n const idx = host.indexOf(':')\n if (idx === -1) return host\n\n return host.substring(0, idx)\n}\n\n// IP addresses are not valid server names per RFC6066\n// > Currently, the only server names supported are DNS hostnames\nfunction getServerName (host) {\n if (!host) {\n return null\n }\n\n assert.strictEqual(typeof host, 'string')\n\n const servername = getHostname(host)\n if (net.isIP(servername)) {\n return ''\n }\n\n return servername\n}\n\nfunction deepClone (obj) {\n return JSON.parse(JSON.stringify(obj))\n}\n\nfunction isAsyncIterable (obj) {\n return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')\n}\n\nfunction isIterable (obj) {\n return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))\n}\n\nfunction bodyLength (body) {\n if (body == null) {\n return 0\n } else if (isStream(body)) {\n const state = body._readableState\n return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)\n ? state.length\n : null\n } else if (isBlobLike(body)) {\n return body.size != null ? body.size : null\n } else if (isBuffer(body)) {\n return body.byteLength\n }\n\n return null\n}\n\nfunction isDestroyed (stream) {\n return !stream || !!(stream.destroyed || stream[kDestroyed])\n}\n\nfunction isReadableAborted (stream) {\n const state = stream && stream._readableState\n return isDestroyed(stream) && state && !state.endEmitted\n}\n\nfunction destroy (stream, err) {\n if (stream == null || !isStream(stream) || isDestroyed(stream)) {\n return\n }\n\n if (typeof stream.destroy === 'function') {\n if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {\n // See: https://github.com/nodejs/node/pull/38505/files\n stream.socket = null\n }\n\n stream.destroy(err)\n } else if (err) {\n process.nextTick((stream, err) => {\n stream.emit('error', err)\n }, stream, err)\n }\n\n if (stream.destroyed !== true) {\n stream[kDestroyed] = true\n }\n}\n\nconst KEEPALIVE_TIMEOUT_EXPR = /timeout=(\\d+)/\nfunction parseKeepAliveTimeout (val) {\n const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)\n return m ? parseInt(m[1], 10) * 1000 : null\n}\n\n/**\n * Retrieves a header name and returns its lowercase value.\n * @param {string | Buffer} value Header name\n * @returns {string}\n */\nfunction headerNameToString (value) {\n return headerNameLowerCasedRecord[value] || value.toLowerCase()\n}\n\nfunction parseHeaders (headers, obj = {}) {\n // For H2 support\n if (!Array.isArray(headers)) return headers\n\n for (let i = 0; i < headers.length; i += 2) {\n const key = headers[i].toString().toLowerCase()\n let val = obj[key]\n\n if (!val) {\n if (Array.isArray(headers[i + 1])) {\n obj[key] = headers[i + 1].map(x => x.toString('utf8'))\n } else {\n obj[key] = headers[i + 1].toString('utf8')\n }\n } else {\n if (!Array.isArray(val)) {\n val = [val]\n obj[key] = val\n }\n val.push(headers[i + 1].toString('utf8'))\n }\n }\n\n // See https://github.com/nodejs/node/pull/46528\n if ('content-length' in obj && 'content-disposition' in obj) {\n obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')\n }\n\n return obj\n}\n\nfunction parseRawHeaders (headers) {\n const ret = []\n let hasContentLength = false\n let contentDispositionIdx = -1\n\n for (let n = 0; n < headers.length; n += 2) {\n const key = headers[n + 0].toString()\n const val = headers[n + 1].toString('utf8')\n\n if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {\n ret.push(key, val)\n hasContentLength = true\n } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {\n contentDispositionIdx = ret.push(key, val) - 1\n } else {\n ret.push(key, val)\n }\n }\n\n // See https://github.com/nodejs/node/pull/46528\n if (hasContentLength && contentDispositionIdx !== -1) {\n ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')\n }\n\n return ret\n}\n\nfunction isBuffer (buffer) {\n // See, https://github.com/mcollina/undici/pull/319\n return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)\n}\n\nfunction validateHandler (handler, method, upgrade) {\n if (!handler || typeof handler !== 'object') {\n throw new InvalidArgumentError('handler must be an object')\n }\n\n if (typeof handler.onConnect !== 'function') {\n throw new InvalidArgumentError('invalid onConnect method')\n }\n\n if (typeof handler.onError !== 'function') {\n throw new InvalidArgumentError('invalid onError method')\n }\n\n if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {\n throw new InvalidArgumentError('invalid onBodySent method')\n }\n\n if (upgrade || method === 'CONNECT') {\n if (typeof handler.onUpgrade !== 'function') {\n throw new InvalidArgumentError('invalid onUpgrade method')\n }\n } else {\n if (typeof handler.onHeaders !== 'function') {\n throw new InvalidArgumentError('invalid onHeaders method')\n }\n\n if (typeof handler.onData !== 'function') {\n throw new InvalidArgumentError('invalid onData method')\n }\n\n if (typeof handler.onComplete !== 'function') {\n throw new InvalidArgumentError('invalid onComplete method')\n }\n }\n}\n\n// A body is disturbed if it has been read from and it cannot\n// be re-used without losing state or data.\nfunction isDisturbed (body) {\n return !!(body && (\n stream.isDisturbed\n ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?\n : body[kBodyUsed] ||\n body.readableDidRead ||\n (body._readableState && body._readableState.dataEmitted) ||\n isReadableAborted(body)\n ))\n}\n\nfunction isErrored (body) {\n return !!(body && (\n stream.isErrored\n ? stream.isErrored(body)\n : /state: 'errored'/.test(nodeUtil.inspect(body)\n )))\n}\n\nfunction isReadable (body) {\n return !!(body && (\n stream.isReadable\n ? stream.isReadable(body)\n : /state: 'readable'/.test(nodeUtil.inspect(body)\n )))\n}\n\nfunction getSocketInfo (socket) {\n return {\n localAddress: socket.localAddress,\n localPort: socket.localPort,\n remoteAddress: socket.remoteAddress,\n remotePort: socket.remotePort,\n remoteFamily: socket.remoteFamily,\n timeout: socket.timeout,\n bytesWritten: socket.bytesWritten,\n bytesRead: socket.bytesRead\n }\n}\n\nasync function * convertIterableToBuffer (iterable) {\n for await (const chunk of iterable) {\n yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)\n }\n}\n\nlet ReadableStream\nfunction ReadableStreamFrom (iterable) {\n if (!ReadableStream) {\n ReadableStream = require('stream/web').ReadableStream\n }\n\n if (ReadableStream.from) {\n return ReadableStream.from(convertIterableToBuffer(iterable))\n }\n\n let iterator\n return new ReadableStream(\n {\n async start () {\n iterator = iterable[Symbol.asyncIterator]()\n },\n async pull (controller) {\n const { done, value } = await iterator.next()\n if (done) {\n queueMicrotask(() => {\n controller.close()\n })\n } else {\n const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)\n controller.enqueue(new Uint8Array(buf))\n }\n return controller.desiredSize > 0\n },\n async cancel (reason) {\n await iterator.return()\n }\n },\n 0\n )\n}\n\n// The chunk should be a FormData instance and contains\n// all the required methods.\nfunction isFormDataLike (object) {\n return (\n object &&\n typeof object === 'object' &&\n typeof object.append === 'function' &&\n typeof object.delete === 'function' &&\n typeof object.get === 'function' &&\n typeof object.getAll === 'function' &&\n typeof object.has === 'function' &&\n typeof object.set === 'function' &&\n object[Symbol.toStringTag] === 'FormData'\n )\n}\n\nfunction throwIfAborted (signal) {\n if (!signal) { return }\n if (typeof signal.throwIfAborted === 'function') {\n signal.throwIfAborted()\n } else {\n if (signal.aborted) {\n // DOMException not available < v17.0.0\n const err = new Error('The operation was aborted')\n err.name = 'AbortError'\n throw err\n }\n }\n}\n\nfunction addAbortListener (signal, listener) {\n if ('addEventListener' in signal) {\n signal.addEventListener('abort', listener, { once: true })\n return () => signal.removeEventListener('abort', listener)\n }\n signal.addListener('abort', listener)\n return () => signal.removeListener('abort', listener)\n}\n\nconst hasToWellFormed = !!String.prototype.toWellFormed\n\n/**\n * @param {string} val\n */\nfunction toUSVString (val) {\n if (hasToWellFormed) {\n return `${val}`.toWellFormed()\n } else if (nodeUtil.toUSVString) {\n return nodeUtil.toUSVString(val)\n }\n\n return `${val}`\n}\n\n// Parsed accordingly to RFC 9110\n// https://www.rfc-editor.org/rfc/rfc9110#field.content-range\nfunction parseRangeHeader (range) {\n if (range == null || range === '') return { start: 0, end: null, size: null }\n\n const m = range ? range.match(/^bytes (\\d+)-(\\d+)\\/(\\d+)?$/) : null\n return m\n ? {\n start: parseInt(m[1]),\n end: m[2] ? parseInt(m[2]) : null,\n size: m[3] ? parseInt(m[3]) : null\n }\n : null\n}\n\nconst kEnumerableProperty = Object.create(null)\nkEnumerableProperty.enumerable = true\n\nmodule.exports = {\n kEnumerableProperty,\n nop,\n isDisturbed,\n isErrored,\n isReadable,\n toUSVString,\n isReadableAborted,\n isBlobLike,\n parseOrigin,\n parseURL,\n getServerName,\n isStream,\n isIterable,\n isAsyncIterable,\n isDestroyed,\n headerNameToString,\n parseRawHeaders,\n parseHeaders,\n parseKeepAliveTimeout,\n destroy,\n bodyLength,\n deepClone,\n ReadableStreamFrom,\n isBuffer,\n validateHandler,\n getSocketInfo,\n isFormDataLike,\n buildURL,\n throwIfAborted,\n addAbortListener,\n parseRangeHeader,\n nodeMajor,\n nodeMinor,\n nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),\n safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']\n}\n","'use strict'\n\nlet fastNow = Date.now()\nlet fastNowTimeout\n\nconst fastTimers = []\n\nfunction onTimeout () {\n fastNow = Date.now()\n\n let len = fastTimers.length\n let idx = 0\n while (idx < len) {\n const timer = fastTimers[idx]\n\n if (timer.state === 0) {\n timer.state = fastNow + timer.delay\n } else if (timer.state > 0 && fastNow >= timer.state) {\n timer.state = -1\n timer.callback(timer.opaque)\n }\n\n if (timer.state === -1) {\n timer.state = -2\n if (idx !== len - 1) {\n fastTimers[idx] = fastTimers.pop()\n } else {\n fastTimers.pop()\n }\n len -= 1\n } else {\n idx += 1\n }\n }\n\n if (fastTimers.length > 0) {\n refreshTimeout()\n }\n}\n\nfunction refreshTimeout () {\n if (fastNowTimeout && fastNowTimeout.refresh) {\n fastNowTimeout.refresh()\n } else {\n clearTimeout(fastNowTimeout)\n fastNowTimeout = setTimeout(onTimeout, 1e3)\n if (fastNowTimeout.unref) {\n fastNowTimeout.unref()\n }\n }\n}\n\nclass Timeout {\n constructor (callback, delay, opaque) {\n this.callback = callback\n this.delay = delay\n this.opaque = opaque\n\n // -2 not in timer list\n // -1 in timer list but inactive\n // 0 in timer list waiting for time\n // > 0 in timer list waiting for time to expire\n this.state = -2\n\n this.refresh()\n }\n\n refresh () {\n if (this.state === -2) {\n fastTimers.push(this)\n if (!fastNowTimeout || fastTimers.length === 1) {\n refreshTimeout()\n }\n }\n\n this.state = 0\n }\n\n clear () {\n this.state = -1\n }\n}\n\nmodule.exports = {\n setTimeout (callback, delay, opaque) {\n return delay < 1e3\n ? setTimeout(callback, delay, opaque)\n : new Timeout(callback, delay, opaque)\n },\n clearTimeout (timeout) {\n if (timeout instanceof Timeout) {\n timeout.clear()\n } else {\n clearTimeout(timeout)\n }\n }\n}\n","'use strict'\n\n/**\n * Copyright Brian White. All rights reserved.\n *\n * @see https://github.com/mscdex/streamsearch\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n *\n * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation\n * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool\n */\nconst EventEmitter = require('node:events').EventEmitter\nconst inherits = require('node:util').inherits\n\nfunction SBMH (needle) {\n if (typeof needle === 'string') {\n needle = Buffer.from(needle)\n }\n\n if (!Buffer.isBuffer(needle)) {\n throw new TypeError('The needle has to be a String or a Buffer.')\n }\n\n const needleLength = needle.length\n\n if (needleLength === 0) {\n throw new Error('The needle cannot be an empty String/Buffer.')\n }\n\n if (needleLength > 256) {\n throw new Error('The needle cannot have a length bigger than 256.')\n }\n\n this.maxMatches = Infinity\n this.matches = 0\n\n this._occ = new Array(256)\n .fill(needleLength) // Initialize occurrence table.\n this._lookbehind_size = 0\n this._needle = needle\n this._bufpos = 0\n\n this._lookbehind = Buffer.alloc(needleLength)\n\n // Populate occurrence table with analysis of the needle,\n // ignoring last letter.\n for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var\n this._occ[needle[i]] = needleLength - 1 - i\n }\n}\ninherits(SBMH, EventEmitter)\n\nSBMH.prototype.reset = function () {\n this._lookbehind_size = 0\n this.matches = 0\n this._bufpos = 0\n}\n\nSBMH.prototype.push = function (chunk, pos) {\n if (!Buffer.isBuffer(chunk)) {\n chunk = Buffer.from(chunk, 'binary')\n }\n const chlen = chunk.length\n this._bufpos = pos || 0\n let r\n while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }\n return r\n}\n\nSBMH.prototype._sbmh_feed = function (data) {\n const len = data.length\n const needle = this._needle\n const needleLength = needle.length\n const lastNeedleChar = needle[needleLength - 1]\n\n // Positive: points to a position in `data`\n // pos == 3 points to data[3]\n // Negative: points to a position in the lookbehind buffer\n // pos == -2 points to lookbehind[lookbehind_size - 2]\n let pos = -this._lookbehind_size\n let ch\n\n if (pos < 0) {\n // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool\n // search with character lookup code that considers both the\n // lookbehind buffer and the current round's haystack data.\n //\n // Loop until\n // there is a match.\n // or until\n // we've moved past the position that requires the\n // lookbehind buffer. In this case we switch to the\n // optimized loop.\n // or until\n // the character to look at lies outside the haystack.\n while (pos < 0 && pos <= len - needleLength) {\n ch = this._sbmh_lookup_char(data, pos + needleLength - 1)\n\n if (\n ch === lastNeedleChar &&\n this._sbmh_memcmp(data, pos, needleLength - 1)\n ) {\n this._lookbehind_size = 0\n ++this.matches\n this.emit('info', true)\n\n return (this._bufpos = pos + needleLength)\n }\n pos += this._occ[ch]\n }\n\n // No match.\n\n if (pos < 0) {\n // There's too few data for Boyer-Moore-Horspool to run,\n // so let's use a different algorithm to skip as much as\n // we can.\n // Forward pos until\n // the trailing part of lookbehind + data\n // looks like the beginning of the needle\n // or until\n // pos == 0\n while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }\n }\n\n if (pos >= 0) {\n // Discard lookbehind buffer.\n this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)\n this._lookbehind_size = 0\n } else {\n // Cut off part of the lookbehind buffer that has\n // been processed and append the entire haystack\n // into it.\n const bytesToCutOff = this._lookbehind_size + pos\n if (bytesToCutOff > 0) {\n // The cut off data is guaranteed not to contain the needle.\n this.emit('info', false, this._lookbehind, 0, bytesToCutOff)\n }\n\n this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,\n this._lookbehind_size - bytesToCutOff)\n this._lookbehind_size -= bytesToCutOff\n\n data.copy(this._lookbehind, this._lookbehind_size)\n this._lookbehind_size += len\n\n this._bufpos = len\n return len\n }\n }\n\n pos += (pos >= 0) * this._bufpos\n\n // Lookbehind buffer is now empty. We only need to check if the\n // needle is in the haystack.\n if (data.indexOf(needle, pos) !== -1) {\n pos = data.indexOf(needle, pos)\n ++this.matches\n if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }\n\n return (this._bufpos = pos + needleLength)\n } else {\n pos = len - needleLength\n }\n\n // There was no match. If there's trailing haystack data that we cannot\n // match yet using the Boyer-Moore-Horspool algorithm (because the trailing\n // data is less than the needle size) then match using a modified\n // algorithm that starts matching from the beginning instead of the end.\n // Whatever trailing data is left after running this algorithm is added to\n // the lookbehind buffer.\n while (\n pos < len &&\n (\n data[pos] !== needle[0] ||\n (\n (Buffer.compare(\n data.subarray(pos, pos + len - pos),\n needle.subarray(0, len - pos)\n ) !== 0)\n )\n )\n ) {\n ++pos\n }\n if (pos < len) {\n data.copy(this._lookbehind, 0, pos, pos + (len - pos))\n this._lookbehind_size = len - pos\n }\n\n // Everything until pos is guaranteed not to contain needle data.\n if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }\n\n this._bufpos = len\n return len\n}\n\nSBMH.prototype._sbmh_lookup_char = function (data, pos) {\n return (pos < 0)\n ? this._lookbehind[this._lookbehind_size + pos]\n : data[pos]\n}\n\nSBMH.prototype._sbmh_memcmp = function (data, pos, len) {\n for (var i = 0; i < len; ++i) { // eslint-disable-line no-var\n if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }\n }\n return true\n}\n\nmodule.exports = SBMH\n","'use strict'\n\nconst inherits = require('node:util').inherits\nconst ReadableStream = require('node:stream').Readable\n\nfunction PartStream (opts) {\n ReadableStream.call(this, opts)\n}\ninherits(PartStream, ReadableStream)\n\nPartStream.prototype._read = function (n) {}\n\nmodule.exports = PartStream\n","'use strict'\n\nmodule.exports = function getLimit (limits, name, defaultLimit) {\n if (\n !limits ||\n limits[name] === undefined ||\n limits[name] === null\n ) { return defaultLimit }\n\n if (\n typeof limits[name] !== 'number' ||\n isNaN(limits[name])\n ) { throw new TypeError('Limit ' + name + ' is not a valid number') }\n\n return limits[name]\n}\n","'use strict'\n\nconst EventEmitter = require('node:events').EventEmitter\nconst inherits = require('node:util').inherits\nconst getLimit = require('../../../lib/utils/getLimit')\n\nconst StreamSearch = require('../../streamsearch/sbmh')\n\nconst B_DCRLF = Buffer.from('\\r\\n\\r\\n')\nconst RE_CRLF = /\\r\\n/g\nconst RE_HDR = /^([^:]+):[ \\t]?([\\x00-\\xFF]+)?$/ // eslint-disable-line no-control-regex\n\nfunction HeaderParser (cfg) {\n EventEmitter.call(this)\n\n cfg = cfg || {}\n const self = this\n this.nread = 0\n this.maxed = false\n this.npairs = 0\n this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)\n this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)\n this.buffer = ''\n this.header = {}\n this.finished = false\n this.ss = new StreamSearch(B_DCRLF)\n this.ss.on('info', function (isMatch, data, start, end) {\n if (data && !self.maxed) {\n if (self.nread + end - start >= self.maxHeaderSize) {\n end = self.maxHeaderSize - self.nread + start\n self.nread = self.maxHeaderSize\n self.maxed = true\n } else { self.nread += (end - start) }\n\n self.buffer += data.toString('binary', start, end)\n }\n if (isMatch) { self._finish() }\n })\n}\ninherits(HeaderParser, EventEmitter)\n\nHeaderParser.prototype.push = function (data) {\n const r = this.ss.push(data)\n if (this.finished) { return r }\n}\n\nHeaderParser.prototype.reset = function () {\n this.finished = false\n this.buffer = ''\n this.header = {}\n this.ss.reset()\n}\n\nHeaderParser.prototype._finish = function () {\n if (this.buffer) { this._parseHeader() }\n this.ss.matches = this.ss.maxMatches\n const header = this.header\n this.header = {}\n this.buffer = ''\n this.finished = true\n this.nread = this.npairs = 0\n this.maxed = false\n this.emit('header', header)\n}\n\nHeaderParser.prototype._parseHeader = function () {\n if (this.npairs === this.maxHeaderPairs) { return }\n\n const lines = this.buffer.split(RE_CRLF)\n const len = lines.length\n let m, h\n\n for (var i = 0; i < len; ++i) { // eslint-disable-line no-var\n if (lines[i].length === 0) { continue }\n if (lines[i][0] === '\\t' || lines[i][0] === ' ') {\n // folded header content\n // RFC2822 says to just remove the CRLF and not the whitespace following\n // it, so we follow the RFC and include the leading whitespace ...\n if (h) {\n this.header[h][this.header[h].length - 1] += lines[i]\n continue\n }\n }\n\n const posColon = lines[i].indexOf(':')\n if (\n posColon === -1 ||\n posColon === 0\n ) {\n return\n }\n m = RE_HDR.exec(lines[i])\n h = m[1].toLowerCase()\n this.header[h] = this.header[h] || []\n this.header[h].push((m[2] || ''))\n if (++this.npairs === this.maxHeaderPairs) { break }\n }\n}\n\nmodule.exports = HeaderParser\n","'use strict'\n\nconst WritableStream = require('node:stream').Writable\nconst inherits = require('node:util').inherits\n\nconst StreamSearch = require('../../streamsearch/sbmh')\n\nconst PartStream = require('./PartStream')\nconst HeaderParser = require('./HeaderParser')\n\nconst DASH = 45\nconst B_ONEDASH = Buffer.from('-')\nconst B_CRLF = Buffer.from('\\r\\n')\nconst EMPTY_FN = function () {}\n\nfunction Dicer (cfg) {\n if (!(this instanceof Dicer)) { return new Dicer(cfg) }\n WritableStream.call(this, cfg)\n\n if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }\n\n if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }\n\n this._headerFirst = cfg.headerFirst\n\n this._dashes = 0\n this._parts = 0\n this._finished = false\n this._realFinish = false\n this._isPreamble = true\n this._justMatched = false\n this._firstWrite = true\n this._inHeader = true\n this._part = undefined\n this._cb = undefined\n this._ignoreData = false\n this._partOpts = { highWaterMark: cfg.partHwm }\n this._pause = false\n\n const self = this\n this._hparser = new HeaderParser(cfg)\n this._hparser.on('header', function (header) {\n self._inHeader = false\n self._part.emit('header', header)\n })\n}\ninherits(Dicer, WritableStream)\n\nDicer.prototype.emit = function (ev) {\n if (ev === 'finish' && !this._realFinish) {\n if (!this._finished) {\n const self = this\n process.nextTick(function () {\n self.emit('error', new Error('Unexpected end of multipart data'))\n if (self._part && !self._ignoreData) {\n const type = (self._isPreamble ? 'Preamble' : 'Part')\n self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))\n self._part.push(null)\n process.nextTick(function () {\n self._realFinish = true\n self.emit('finish')\n self._realFinish = false\n })\n return\n }\n self._realFinish = true\n self.emit('finish')\n self._realFinish = false\n })\n }\n } else { WritableStream.prototype.emit.apply(this, arguments) }\n}\n\nDicer.prototype._write = function (data, encoding, cb) {\n // ignore unexpected data (e.g. extra trailer data after finished)\n if (!this._hparser && !this._bparser) { return cb() }\n\n if (this._headerFirst && this._isPreamble) {\n if (!this._part) {\n this._part = new PartStream(this._partOpts)\n if (this._events.preamble) { this.emit('preamble', this._part) } else { this._ignore() }\n }\n const r = this._hparser.push(data)\n if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }\n }\n\n // allows for \"easier\" testing\n if (this._firstWrite) {\n this._bparser.push(B_CRLF)\n this._firstWrite = false\n }\n\n this._bparser.push(data)\n\n if (this._pause) { this._cb = cb } else { cb() }\n}\n\nDicer.prototype.reset = function () {\n this._part = undefined\n this._bparser = undefined\n this._hparser = undefined\n}\n\nDicer.prototype.setBoundary = function (boundary) {\n const self = this\n this._bparser = new StreamSearch('\\r\\n--' + boundary)\n this._bparser.on('info', function (isMatch, data, start, end) {\n self._oninfo(isMatch, data, start, end)\n })\n}\n\nDicer.prototype._ignore = function () {\n if (this._part && !this._ignoreData) {\n this._ignoreData = true\n this._part.on('error', EMPTY_FN)\n // we must perform some kind of read on the stream even though we are\n // ignoring the data, otherwise node's Readable stream will not emit 'end'\n // after pushing null to the stream\n this._part.resume()\n }\n}\n\nDicer.prototype._oninfo = function (isMatch, data, start, end) {\n let buf; const self = this; let i = 0; let r; let shouldWriteMore = true\n\n if (!this._part && this._justMatched && data) {\n while (this._dashes < 2 && (start + i) < end) {\n if (data[start + i] === DASH) {\n ++i\n ++this._dashes\n } else {\n if (this._dashes) { buf = B_ONEDASH }\n this._dashes = 0\n break\n }\n }\n if (this._dashes === 2) {\n if ((start + i) < end && this._events.trailer) { this.emit('trailer', data.slice(start + i, end)) }\n this.reset()\n this._finished = true\n // no more parts will be added\n if (self._parts === 0) {\n self._realFinish = true\n self.emit('finish')\n self._realFinish = false\n }\n }\n if (this._dashes) { return }\n }\n if (this._justMatched) { this._justMatched = false }\n if (!this._part) {\n this._part = new PartStream(this._partOpts)\n this._part._read = function (n) {\n self._unpause()\n }\n if (this._isPreamble && this._events.preamble) { this.emit('preamble', this._part) } else if (this._isPreamble !== true && this._events.part) { this.emit('part', this._part) } else { this._ignore() }\n if (!this._isPreamble) { this._inHeader = true }\n }\n if (data && start < end && !this._ignoreData) {\n if (this._isPreamble || !this._inHeader) {\n if (buf) { shouldWriteMore = this._part.push(buf) }\n shouldWriteMore = this._part.push(data.slice(start, end))\n if (!shouldWriteMore) { this._pause = true }\n } else if (!this._isPreamble && this._inHeader) {\n if (buf) { this._hparser.push(buf) }\n r = this._hparser.push(data.slice(start, end))\n if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }\n }\n }\n if (isMatch) {\n this._hparser.reset()\n if (this._isPreamble) { this._isPreamble = false } else {\n if (start !== end) {\n ++this._parts\n this._part.on('end', function () {\n if (--self._parts === 0) {\n if (self._finished) {\n self._realFinish = true\n self.emit('finish')\n self._realFinish = false\n } else {\n self._unpause()\n }\n }\n })\n }\n }\n this._part.push(null)\n this._part = undefined\n this._ignoreData = false\n this._justMatched = true\n this._dashes = 0\n }\n}\n\nDicer.prototype._unpause = function () {\n if (!this._pause) { return }\n\n this._pause = false\n if (this._cb) {\n const cb = this._cb\n this._cb = undefined\n cb()\n }\n}\n\nmodule.exports = Dicer\n","'use strict'\n\n// Node has always utf-8\nconst utf8Decoder = new TextDecoder('utf-8')\nconst textDecoders = new Map([\n ['utf-8', utf8Decoder],\n ['utf8', utf8Decoder]\n])\n\nfunction decodeText (text, textEncoding, destEncoding) {\n if (text) {\n if (textDecoders.has(destEncoding)) {\n try {\n return textDecoders.get(destEncoding).decode(Buffer.from(text, textEncoding))\n } catch (e) { }\n } else {\n try {\n textDecoders.set(destEncoding, new TextDecoder(destEncoding))\n return textDecoders.get(destEncoding).decode(Buffer.from(text, textEncoding))\n } catch (e) { }\n }\n }\n return text\n}\n\nmodule.exports = decodeText\n","'use strict'\n\nconst decodeText = require('./decodeText')\n\nconst RE_ENCODED = /%([a-fA-F0-9]{2})/g\n\nfunction encodedReplacer (match, byte) {\n return String.fromCharCode(parseInt(byte, 16))\n}\n\nfunction parseParams (str) {\n const res = []\n let state = 'key'\n let charset = ''\n let inquote = false\n let escaping = false\n let p = 0\n let tmp = ''\n\n for (var i = 0, len = str.length; i < len; ++i) { // eslint-disable-line no-var\n const char = str[i]\n if (char === '\\\\' && inquote) {\n if (escaping) { escaping = false } else {\n escaping = true\n continue\n }\n } else if (char === '\"') {\n if (!escaping) {\n if (inquote) {\n inquote = false\n state = 'key'\n } else { inquote = true }\n continue\n } else { escaping = false }\n } else {\n if (escaping && inquote) { tmp += '\\\\' }\n escaping = false\n if ((state === 'charset' || state === 'lang') && char === \"'\") {\n if (state === 'charset') {\n state = 'lang'\n charset = tmp.substring(1)\n } else { state = 'value' }\n tmp = ''\n continue\n } else if (state === 'key' &&\n (char === '*' || char === '=') &&\n res.length) {\n if (char === '*') { state = 'charset' } else { state = 'value' }\n res[p] = [tmp, undefined]\n tmp = ''\n continue\n } else if (!inquote && char === ';') {\n state = 'key'\n if (charset) {\n if (tmp.length) {\n tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),\n 'binary',\n charset)\n }\n charset = ''\n } else if (tmp.length) {\n tmp = decodeText(tmp, 'binary', 'utf8')\n }\n if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }\n tmp = ''\n ++p\n continue\n } else if (!inquote && (char === ' ' || char === '\\t')) { continue }\n }\n tmp += char\n }\n if (charset && tmp.length) {\n tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),\n 'binary',\n charset)\n } else if (tmp) {\n tmp = decodeText(tmp, 'binary', 'utf8')\n }\n\n if (res[p] === undefined) {\n if (tmp) { res[p] = tmp }\n } else { res[p][1] = tmp }\n\n return res\n}\n\nmodule.exports = parseParams\n","'use strict'\n\nmodule.exports = function basename (path) {\n if (typeof path !== 'string') { return '' }\n for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var\n switch (path.charCodeAt(i)) {\n case 0x2F: // '/'\n case 0x5C: // '\\'\n path = path.slice(i + 1)\n return (path === '..' || path === '.' ? '' : path)\n }\n }\n return (path === '..' || path === '.' ? '' : path)\n}\n","'use strict'\n\n// TODO:\n// * support 1 nested multipart level\n// (see second multipart example here:\n// http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)\n// * support limits.fieldNameSize\n// -- this will require modifications to utils.parseParams\n\nconst { Readable } = require('node:stream')\nconst { inherits } = require('node:util')\n\nconst Dicer = require('../../deps/dicer/lib/Dicer')\n\nconst parseParams = require('../utils/parseParams')\nconst decodeText = require('../utils/decodeText')\nconst basename = require('../utils/basename')\nconst getLimit = require('../utils/getLimit')\n\nconst RE_BOUNDARY = /^boundary$/i\nconst RE_FIELD = /^form-data$/i\nconst RE_CHARSET = /^charset$/i\nconst RE_FILENAME = /^filename$/i\nconst RE_NAME = /^name$/i\n\nMultipart.detect = /^multipart\\/form-data/i\nfunction Multipart (boy, cfg) {\n let i\n let len\n const self = this\n let boundary\n const limits = cfg.limits\n const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))\n const parsedConType = cfg.parsedConType || []\n const defCharset = cfg.defCharset || 'utf8'\n const preservePath = cfg.preservePath\n const fileOpts = { highWaterMark: cfg.fileHwm }\n\n for (i = 0, len = parsedConType.length; i < len; ++i) {\n if (Array.isArray(parsedConType[i]) &&\n RE_BOUNDARY.test(parsedConType[i][0])) {\n boundary = parsedConType[i][1]\n break\n }\n }\n\n function checkFinished () {\n if (nends === 0 && finished && !boy._done) {\n finished = false\n self.end()\n }\n }\n\n if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }\n\n const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)\n const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)\n const filesLimit = getLimit(limits, 'files', Infinity)\n const fieldsLimit = getLimit(limits, 'fields', Infinity)\n const partsLimit = getLimit(limits, 'parts', Infinity)\n const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)\n const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)\n\n let nfiles = 0\n let nfields = 0\n let nends = 0\n let curFile\n let curField\n let finished = false\n\n this._needDrain = false\n this._pause = false\n this._cb = undefined\n this._nparts = 0\n this._boy = boy\n\n const parserCfg = {\n boundary,\n maxHeaderPairs: headerPairsLimit,\n maxHeaderSize: headerSizeLimit,\n partHwm: fileOpts.highWaterMark,\n highWaterMark: cfg.highWaterMark\n }\n\n this.parser = new Dicer(parserCfg)\n this.parser.on('drain', function () {\n self._needDrain = false\n if (self._cb && !self._pause) {\n const cb = self._cb\n self._cb = undefined\n cb()\n }\n }).on('part', function onPart (part) {\n if (++self._nparts > partsLimit) {\n self.parser.removeListener('part', onPart)\n self.parser.on('part', skipPart)\n boy.hitPartsLimit = true\n boy.emit('partsLimit')\n return skipPart(part)\n }\n\n // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let\n // us emit 'end' early since we know the part has ended if we are already\n // seeing the next part\n if (curField) {\n const field = curField\n field.emit('end')\n field.removeAllListeners('end')\n }\n\n part.on('header', function (header) {\n let contype\n let fieldname\n let parsed\n let charset\n let encoding\n let filename\n let nsize = 0\n\n if (header['content-type']) {\n parsed = parseParams(header['content-type'][0])\n if (parsed[0]) {\n contype = parsed[0].toLowerCase()\n for (i = 0, len = parsed.length; i < len; ++i) {\n if (RE_CHARSET.test(parsed[i][0])) {\n charset = parsed[i][1].toLowerCase()\n break\n }\n }\n }\n }\n\n if (contype === undefined) { contype = 'text/plain' }\n if (charset === undefined) { charset = defCharset }\n\n if (header['content-disposition']) {\n parsed = parseParams(header['content-disposition'][0])\n if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }\n for (i = 0, len = parsed.length; i < len; ++i) {\n if (RE_NAME.test(parsed[i][0])) {\n fieldname = parsed[i][1]\n } else if (RE_FILENAME.test(parsed[i][0])) {\n filename = parsed[i][1]\n if (!preservePath) { filename = basename(filename) }\n }\n }\n } else { return skipPart(part) }\n\n if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }\n\n let onData,\n onEnd\n\n if (isPartAFile(fieldname, contype, filename)) {\n // file/binary field\n if (nfiles === filesLimit) {\n if (!boy.hitFilesLimit) {\n boy.hitFilesLimit = true\n boy.emit('filesLimit')\n }\n return skipPart(part)\n }\n\n ++nfiles\n\n if (!boy._events.file) {\n self.parser._ignore()\n return\n }\n\n ++nends\n const file = new FileStream(fileOpts)\n curFile = file\n file.on('end', function () {\n --nends\n self._pause = false\n checkFinished()\n if (self._cb && !self._needDrain) {\n const cb = self._cb\n self._cb = undefined\n cb()\n }\n })\n file._read = function (n) {\n if (!self._pause) { return }\n self._pause = false\n if (self._cb && !self._needDrain) {\n const cb = self._cb\n self._cb = undefined\n cb()\n }\n }\n boy.emit('file', fieldname, file, filename, encoding, contype)\n\n onData = function (data) {\n if ((nsize += data.length) > fileSizeLimit) {\n const extralen = fileSizeLimit - nsize + data.length\n if (extralen > 0) { file.push(data.slice(0, extralen)) }\n file.truncated = true\n file.bytesRead = fileSizeLimit\n part.removeAllListeners('data')\n file.emit('limit')\n return\n } else if (!file.push(data)) { self._pause = true }\n\n file.bytesRead = nsize\n }\n\n onEnd = function () {\n curFile = undefined\n file.push(null)\n }\n } else {\n // non-file field\n if (nfields === fieldsLimit) {\n if (!boy.hitFieldsLimit) {\n boy.hitFieldsLimit = true\n boy.emit('fieldsLimit')\n }\n return skipPart(part)\n }\n\n ++nfields\n ++nends\n let buffer = ''\n let truncated = false\n curField = part\n\n onData = function (data) {\n if ((nsize += data.length) > fieldSizeLimit) {\n const extralen = (fieldSizeLimit - (nsize - data.length))\n buffer += data.toString('binary', 0, extralen)\n truncated = true\n part.removeAllListeners('data')\n } else { buffer += data.toString('binary') }\n }\n\n onEnd = function () {\n curField = undefined\n if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }\n boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)\n --nends\n checkFinished()\n }\n }\n\n /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become\n broken. Streams2/streams3 is a huge black box of confusion, but\n somehow overriding the sync state seems to fix things again (and still\n seems to work for previous node versions).\n */\n part._readableState.sync = false\n\n part.on('data', onData)\n part.on('end', onEnd)\n }).on('error', function (err) {\n if (curFile) { curFile.emit('error', err) }\n })\n }).on('error', function (err) {\n boy.emit('error', err)\n }).on('finish', function () {\n finished = true\n checkFinished()\n })\n}\n\nMultipart.prototype.write = function (chunk, cb) {\n const r = this.parser.write(chunk)\n if (r && !this._pause) {\n cb()\n } else {\n this._needDrain = !r\n this._cb = cb\n }\n}\n\nMultipart.prototype.end = function () {\n const self = this\n\n if (self.parser.writable) {\n self.parser.end()\n } else if (!self._boy._done) {\n process.nextTick(function () {\n self._boy._done = true\n self._boy.emit('finish')\n })\n }\n}\n\nfunction skipPart (part) {\n part.resume()\n}\n\nfunction FileStream (opts) {\n Readable.call(this, opts)\n\n this.bytesRead = 0\n\n this.truncated = false\n}\n\ninherits(FileStream, Readable)\n\nFileStream.prototype._read = function (n) {}\n\nmodule.exports = Multipart\n","'use strict'\n\nconst RE_PLUS = /\\+/g\n\nconst HEX = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,\n 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n]\n\nfunction Decoder () {\n this.buffer = undefined\n}\nDecoder.prototype.write = function (str) {\n // Replace '+' with ' ' before decoding\n str = str.replace(RE_PLUS, ' ')\n let res = ''\n let i = 0; let p = 0; const len = str.length\n for (; i < len; ++i) {\n if (this.buffer !== undefined) {\n if (!HEX[str.charCodeAt(i)]) {\n res += '%' + this.buffer\n this.buffer = undefined\n --i // retry character\n } else {\n this.buffer += str[i]\n ++p\n if (this.buffer.length === 2) {\n res += String.fromCharCode(parseInt(this.buffer, 16))\n this.buffer = undefined\n }\n }\n } else if (str[i] === '%') {\n if (i > p) {\n res += str.substring(p, i)\n p = i\n }\n this.buffer = ''\n ++p\n }\n }\n if (p < len && this.buffer === undefined) { res += str.substring(p) }\n return res\n}\nDecoder.prototype.reset = function () {\n this.buffer = undefined\n}\n\nmodule.exports = Decoder\n","'use strict'\n\nconst Decoder = require('../utils/Decoder')\nconst decodeText = require('../utils/decodeText')\nconst getLimit = require('../utils/getLimit')\n\nconst RE_CHARSET = /^charset$/i\n\nUrlEncoded.detect = /^application\\/x-www-form-urlencoded/i\nfunction UrlEncoded (boy, cfg) {\n const limits = cfg.limits\n const parsedConType = cfg.parsedConType\n this.boy = boy\n\n this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)\n this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)\n this.fieldsLimit = getLimit(limits, 'fields', Infinity)\n\n let charset\n for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var\n if (Array.isArray(parsedConType[i]) &&\n RE_CHARSET.test(parsedConType[i][0])) {\n charset = parsedConType[i][1].toLowerCase()\n break\n }\n }\n\n if (charset === undefined) { charset = cfg.defCharset || 'utf8' }\n\n this.decoder = new Decoder()\n this.charset = charset\n this._fields = 0\n this._state = 'key'\n this._checkingBytes = true\n this._bytesKey = 0\n this._bytesVal = 0\n this._key = ''\n this._val = ''\n this._keyTrunc = false\n this._valTrunc = false\n this._hitLimit = false\n}\n\nUrlEncoded.prototype.write = function (data, cb) {\n if (this._fields === this.fieldsLimit) {\n if (!this.boy.hitFieldsLimit) {\n this.boy.hitFieldsLimit = true\n this.boy.emit('fieldsLimit')\n }\n return cb()\n }\n\n let idxeq; let idxamp; let i; let p = 0; const len = data.length\n\n while (p < len) {\n if (this._state === 'key') {\n idxeq = idxamp = undefined\n for (i = p; i < len; ++i) {\n if (!this._checkingBytes) { ++p }\n if (data[i] === 0x3D/* = */) {\n idxeq = i\n break\n } else if (data[i] === 0x26/* & */) {\n idxamp = i\n break\n }\n if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {\n this._hitLimit = true\n break\n } else if (this._checkingBytes) { ++this._bytesKey }\n }\n\n if (idxeq !== undefined) {\n // key with assignment\n if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }\n this._state = 'val'\n\n this._hitLimit = false\n this._checkingBytes = true\n this._val = ''\n this._bytesVal = 0\n this._valTrunc = false\n this.decoder.reset()\n\n p = idxeq + 1\n } else if (idxamp !== undefined) {\n // key with no assignment\n ++this._fields\n let key; const keyTrunc = this._keyTrunc\n if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }\n\n this._hitLimit = false\n this._checkingBytes = true\n this._key = ''\n this._bytesKey = 0\n this._keyTrunc = false\n this.decoder.reset()\n\n if (key.length) {\n this.boy.emit('field', decodeText(key, 'binary', this.charset),\n '',\n keyTrunc,\n false)\n }\n\n p = idxamp + 1\n if (this._fields === this.fieldsLimit) { return cb() }\n } else if (this._hitLimit) {\n // we may not have hit the actual limit if there are encoded bytes...\n if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }\n p = i\n if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {\n // yep, we actually did hit the limit\n this._checkingBytes = false\n this._keyTrunc = true\n }\n } else {\n if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }\n p = len\n }\n } else {\n idxamp = undefined\n for (i = p; i < len; ++i) {\n if (!this._checkingBytes) { ++p }\n if (data[i] === 0x26/* & */) {\n idxamp = i\n break\n }\n if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {\n this._hitLimit = true\n break\n } else if (this._checkingBytes) { ++this._bytesVal }\n }\n\n if (idxamp !== undefined) {\n ++this._fields\n if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }\n this.boy.emit('field', decodeText(this._key, 'binary', this.charset),\n decodeText(this._val, 'binary', this.charset),\n this._keyTrunc,\n this._valTrunc)\n this._state = 'key'\n\n this._hitLimit = false\n this._checkingBytes = true\n this._key = ''\n this._bytesKey = 0\n this._keyTrunc = false\n this.decoder.reset()\n\n p = idxamp + 1\n if (this._fields === this.fieldsLimit) { return cb() }\n } else if (this._hitLimit) {\n // we may not have hit the actual limit if there are encoded bytes...\n if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }\n p = i\n if ((this._val === '' && this.fieldSizeLimit === 0) ||\n (this._bytesVal = this._val.length) === this.fieldSizeLimit) {\n // yep, we actually did hit the limit\n this._checkingBytes = false\n this._valTrunc = true\n }\n } else {\n if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }\n p = len\n }\n }\n }\n cb()\n}\n\nUrlEncoded.prototype.end = function () {\n if (this.boy._done) { return }\n\n if (this._state === 'key' && this._key.length > 0) {\n this.boy.emit('field', decodeText(this._key, 'binary', this.charset),\n '',\n this._keyTrunc,\n false)\n } else if (this._state === 'val') {\n this.boy.emit('field', decodeText(this._key, 'binary', this.charset),\n decodeText(this._val, 'binary', this.charset),\n this._keyTrunc,\n this._valTrunc)\n }\n this.boy._done = true\n this.boy.emit('finish')\n}\n\nmodule.exports = UrlEncoded\n","'use strict'\n\nconst WritableStream = require('node:stream').Writable\nconst { inherits } = require('node:util')\nconst Dicer = require('../deps/dicer/lib/Dicer')\n\nconst MultipartParser = require('./types/multipart')\nconst UrlencodedParser = require('./types/urlencoded')\nconst parseParams = require('./utils/parseParams')\n\nfunction Busboy (opts) {\n if (!(this instanceof Busboy)) { return new Busboy(opts) }\n\n if (typeof opts !== 'object') {\n throw new TypeError('Busboy expected an options-Object.')\n }\n if (typeof opts.headers !== 'object') {\n throw new TypeError('Busboy expected an options-Object with headers-attribute.')\n }\n if (typeof opts.headers['content-type'] !== 'string') {\n throw new TypeError('Missing Content-Type-header.')\n }\n\n const {\n headers,\n ...streamOptions\n } = opts\n\n this.opts = {\n autoDestroy: false,\n ...streamOptions\n }\n WritableStream.call(this, this.opts)\n\n this._done = false\n this._parser = this.getParserByHeaders(headers)\n this._finished = false\n}\ninherits(Busboy, WritableStream)\n\nBusboy.prototype.emit = function (ev) {\n if (ev === 'finish') {\n if (!this._done) {\n this._parser?.end()\n return\n } else if (this._finished) {\n return\n }\n this._finished = true\n }\n WritableStream.prototype.emit.apply(this, arguments)\n}\n\nBusboy.prototype.getParserByHeaders = function (headers) {\n const parsed = parseParams(headers['content-type'])\n\n const cfg = {\n defCharset: this.opts.defCharset,\n fileHwm: this.opts.fileHwm,\n headers,\n highWaterMark: this.opts.highWaterMark,\n isPartAFile: this.opts.isPartAFile,\n limits: this.opts.limits,\n parsedConType: parsed,\n preservePath: this.opts.preservePath\n }\n\n if (MultipartParser.detect.test(parsed[0])) {\n return new MultipartParser(this, cfg)\n }\n if (UrlencodedParser.detect.test(parsed[0])) {\n return new UrlencodedParser(this, cfg)\n }\n throw new Error('Unsupported Content-Type.')\n}\n\nBusboy.prototype._write = function (chunk, encoding, cb) {\n this._parser.write(chunk, cb)\n}\n\nmodule.exports = Busboy\nmodule.exports.default = Busboy\nmodule.exports.Busboy = Busboy\n\nmodule.exports.Dicer = Dicer\n","'use strict'\n\nconst { MessageChannel, receiveMessageOnPort } = require('worker_threads')\n\nconst corsSafeListedMethods = ['GET', 'HEAD', 'POST']\nconst corsSafeListedMethodsSet = new Set(corsSafeListedMethods)\n\nconst nullBodyStatus = [101, 204, 205, 304]\n\nconst redirectStatus = [301, 302, 303, 307, 308]\nconst redirectStatusSet = new Set(redirectStatus)\n\n// https://fetch.spec.whatwg.org/#block-bad-port\nconst badPorts = [\n '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',\n '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',\n '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',\n '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',\n '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',\n '10080'\n]\n\nconst badPortsSet = new Set(badPorts)\n\n// https://w3c.github.io/webappsec-referrer-policy/#referrer-policies\nconst referrerPolicy = [\n '',\n 'no-referrer',\n 'no-referrer-when-downgrade',\n 'same-origin',\n 'origin',\n 'strict-origin',\n 'origin-when-cross-origin',\n 'strict-origin-when-cross-origin',\n 'unsafe-url'\n]\nconst referrerPolicySet = new Set(referrerPolicy)\n\nconst requestRedirect = ['follow', 'manual', 'error']\n\nconst safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']\nconst safeMethodsSet = new Set(safeMethods)\n\nconst requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']\n\nconst requestCredentials = ['omit', 'same-origin', 'include']\n\nconst requestCache = [\n 'default',\n 'no-store',\n 'reload',\n 'no-cache',\n 'force-cache',\n 'only-if-cached'\n]\n\n// https://fetch.spec.whatwg.org/#request-body-header-name\nconst requestBodyHeader = [\n 'content-encoding',\n 'content-language',\n 'content-location',\n 'content-type',\n // See https://github.com/nodejs/undici/issues/2021\n // 'Content-Length' is a forbidden header name, which is typically\n // removed in the Headers implementation. However, undici doesn't\n // filter out headers, so we add it here.\n 'content-length'\n]\n\n// https://fetch.spec.whatwg.org/#enumdef-requestduplex\nconst requestDuplex = [\n 'half'\n]\n\n// http://fetch.spec.whatwg.org/#forbidden-method\nconst forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']\nconst forbiddenMethodsSet = new Set(forbiddenMethods)\n\nconst subresource = [\n 'audio',\n 'audioworklet',\n 'font',\n 'image',\n 'manifest',\n 'paintworklet',\n 'script',\n 'style',\n 'track',\n 'video',\n 'xslt',\n ''\n]\nconst subresourceSet = new Set(subresource)\n\n/** @type {globalThis['DOMException']} */\nconst DOMException = globalThis.DOMException ?? (() => {\n // DOMException was only made a global in Node v17.0.0,\n // but fetch supports >= v16.8.\n try {\n atob('~')\n } catch (err) {\n return Object.getPrototypeOf(err).constructor\n }\n})()\n\nlet channel\n\n/** @type {globalThis['structuredClone']} */\nconst structuredClone =\n globalThis.structuredClone ??\n // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js\n // structuredClone was added in v17.0.0, but fetch supports v16.8\n function structuredClone (value, options = undefined) {\n if (arguments.length === 0) {\n throw new TypeError('missing argument')\n }\n\n if (!channel) {\n channel = new MessageChannel()\n }\n channel.port1.unref()\n channel.port2.unref()\n channel.port1.postMessage(value, options?.transfer)\n return receiveMessageOnPort(channel.port2).message\n }\n\nmodule.exports = {\n DOMException,\n structuredClone,\n subresource,\n forbiddenMethods,\n requestBodyHeader,\n referrerPolicy,\n requestRedirect,\n requestMode,\n requestCredentials,\n requestCache,\n redirectStatus,\n corsSafeListedMethods,\n nullBodyStatus,\n safeMethods,\n badPorts,\n requestDuplex,\n subresourceSet,\n badPortsSet,\n redirectStatusSet,\n corsSafeListedMethodsSet,\n safeMethodsSet,\n forbiddenMethodsSet,\n referrerPolicySet\n}\n","'use strict'\n\n// In case of breaking changes, increase the version\n// number to avoid conflicts.\nconst globalOrigin = Symbol.for('undici.globalOrigin.1')\n\nfunction getGlobalOrigin () {\n return globalThis[globalOrigin]\n}\n\nfunction setGlobalOrigin (newOrigin) {\n if (newOrigin === undefined) {\n Object.defineProperty(globalThis, globalOrigin, {\n value: undefined,\n writable: true,\n enumerable: false,\n configurable: false\n })\n\n return\n }\n\n const parsedURL = new URL(newOrigin)\n\n if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {\n throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)\n }\n\n Object.defineProperty(globalThis, globalOrigin, {\n value: parsedURL,\n writable: true,\n enumerable: false,\n configurable: false\n })\n}\n\nmodule.exports = {\n getGlobalOrigin,\n setGlobalOrigin\n}\n","'use strict'\n\nconst { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require('./constants')\nconst { getGlobalOrigin } = require('./global')\nconst { performance } = require('perf_hooks')\nconst { isBlobLike, toUSVString, ReadableStreamFrom } = require('../core/util')\nconst assert = require('assert')\nconst { isUint8Array } = require('util/types')\n\nlet supportedHashes = []\n\n// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable\n/** @type {import('crypto')|undefined} */\nlet crypto\n\ntry {\n crypto = require('crypto')\n const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']\n supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))\n/* c8 ignore next 3 */\n} catch {\n}\n\nfunction responseURL (response) {\n // https://fetch.spec.whatwg.org/#responses\n // A response has an associated URL. It is a pointer to the last URL\n // in response’s URL list and null if response’s URL list is empty.\n const urlList = response.urlList\n const length = urlList.length\n return length === 0 ? null : urlList[length - 1].toString()\n}\n\n// https://fetch.spec.whatwg.org/#concept-response-location-url\nfunction responseLocationURL (response, requestFragment) {\n // 1. If response’s status is not a redirect status, then return null.\n if (!redirectStatusSet.has(response.status)) {\n return null\n }\n\n // 2. Let location be the result of extracting header list values given\n // `Location` and response’s header list.\n let location = response.headersList.get('location')\n\n // 3. If location is a header value, then set location to the result of\n // parsing location with response’s URL.\n if (location !== null && isValidHeaderValue(location)) {\n location = new URL(location, responseURL(response))\n }\n\n // 4. If location is a URL whose fragment is null, then set location’s\n // fragment to requestFragment.\n if (location && !location.hash) {\n location.hash = requestFragment\n }\n\n // 5. Return location.\n return location\n}\n\n/** @returns {URL} */\nfunction requestCurrentURL (request) {\n return request.urlList[request.urlList.length - 1]\n}\n\nfunction requestBadPort (request) {\n // 1. Let url be request’s current URL.\n const url = requestCurrentURL(request)\n\n // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,\n // then return blocked.\n if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {\n return 'blocked'\n }\n\n // 3. Return allowed.\n return 'allowed'\n}\n\nfunction isErrorLike (object) {\n return object instanceof Error || (\n object?.constructor?.name === 'Error' ||\n object?.constructor?.name === 'DOMException'\n )\n}\n\n// Check whether |statusText| is a ByteString and\n// matches the Reason-Phrase token production.\n// RFC 2616: https://tools.ietf.org/html/rfc2616\n// RFC 7230: https://tools.ietf.org/html/rfc7230\n// \"reason-phrase = *( HTAB / SP / VCHAR / obs-text )\"\n// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116\nfunction isValidReasonPhrase (statusText) {\n for (let i = 0; i < statusText.length; ++i) {\n const c = statusText.charCodeAt(i)\n if (\n !(\n (\n c === 0x09 || // HTAB\n (c >= 0x20 && c <= 0x7e) || // SP / VCHAR\n (c >= 0x80 && c <= 0xff)\n ) // obs-text\n )\n ) {\n return false\n }\n }\n return true\n}\n\n/**\n * @see https://tools.ietf.org/html/rfc7230#section-3.2.6\n * @param {number} c\n */\nfunction isTokenCharCode (c) {\n switch (c) {\n case 0x22:\n case 0x28:\n case 0x29:\n case 0x2c:\n case 0x2f:\n case 0x3a:\n case 0x3b:\n case 0x3c:\n case 0x3d:\n case 0x3e:\n case 0x3f:\n case 0x40:\n case 0x5b:\n case 0x5c:\n case 0x5d:\n case 0x7b:\n case 0x7d:\n // DQUOTE and \"(),/:;<=>?@[\\]{}\"\n return false\n default:\n // VCHAR %x21-7E\n return c >= 0x21 && c <= 0x7e\n }\n}\n\n/**\n * @param {string} characters\n */\nfunction isValidHTTPToken (characters) {\n if (characters.length === 0) {\n return false\n }\n for (let i = 0; i < characters.length; ++i) {\n if (!isTokenCharCode(characters.charCodeAt(i))) {\n return false\n }\n }\n return true\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-name\n * @param {string} potentialValue\n */\nfunction isValidHeaderName (potentialValue) {\n return isValidHTTPToken(potentialValue)\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value\n * @param {string} potentialValue\n */\nfunction isValidHeaderValue (potentialValue) {\n // - Has no leading or trailing HTTP tab or space bytes.\n // - Contains no 0x00 (NUL) or HTTP newline bytes.\n if (\n potentialValue.startsWith('\\t') ||\n potentialValue.startsWith(' ') ||\n potentialValue.endsWith('\\t') ||\n potentialValue.endsWith(' ')\n ) {\n return false\n }\n\n if (\n potentialValue.includes('\\0') ||\n potentialValue.includes('\\r') ||\n potentialValue.includes('\\n')\n ) {\n return false\n }\n\n return true\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect\nfunction setRequestReferrerPolicyOnRedirect (request, actualResponse) {\n // Given a request request and a response actualResponse, this algorithm\n // updates request’s referrer policy according to the Referrer-Policy\n // header (if any) in actualResponse.\n\n // 1. Let policy be the result of executing § 8.1 Parse a referrer policy\n // from a Referrer-Policy header on actualResponse.\n\n // 8.1 Parse a referrer policy from a Referrer-Policy header\n // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.\n const { headersList } = actualResponse\n // 2. Let policy be the empty string.\n // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token.\n // 4. Return policy.\n const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')\n\n // Note: As the referrer-policy can contain multiple policies\n // separated by comma, we need to loop through all of them\n // and pick the first valid one.\n // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy\n let policy = ''\n if (policyHeader.length > 0) {\n // The right-most policy takes precedence.\n // The left-most policy is the fallback.\n for (let i = policyHeader.length; i !== 0; i--) {\n const token = policyHeader[i - 1].trim()\n if (referrerPolicyTokens.has(token)) {\n policy = token\n break\n }\n }\n }\n\n // 2. If policy is not the empty string, then set request’s referrer policy to policy.\n if (policy !== '') {\n request.referrerPolicy = policy\n }\n}\n\n// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check\nfunction crossOriginResourcePolicyCheck () {\n // TODO\n return 'allowed'\n}\n\n// https://fetch.spec.whatwg.org/#concept-cors-check\nfunction corsCheck () {\n // TODO\n return 'success'\n}\n\n// https://fetch.spec.whatwg.org/#concept-tao-check\nfunction TAOCheck () {\n // TODO\n return 'success'\n}\n\nfunction appendFetchMetadata (httpRequest) {\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header\n // TODO\n\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header\n\n // 1. Assert: r’s url is a potentially trustworthy URL.\n // TODO\n\n // 2. Let header be a Structured Header whose value is a token.\n let header = null\n\n // 3. Set header’s value to r’s mode.\n header = httpRequest.mode\n\n // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.\n httpRequest.headersList.set('sec-fetch-mode', header)\n\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header\n // TODO\n\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header\n // TODO\n}\n\n// https://fetch.spec.whatwg.org/#append-a-request-origin-header\nfunction appendRequestOriginHeader (request) {\n // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.\n let serializedOrigin = request.origin\n\n // 2. If request’s response tainting is \"cors\" or request’s mode is \"websocket\", then append (`Origin`, serializedOrigin) to request’s header list.\n if (request.responseTainting === 'cors' || request.mode === 'websocket') {\n if (serializedOrigin) {\n request.headersList.append('origin', serializedOrigin)\n }\n\n // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:\n } else if (request.method !== 'GET' && request.method !== 'HEAD') {\n // 1. Switch on request’s referrer policy:\n switch (request.referrerPolicy) {\n case 'no-referrer':\n // Set serializedOrigin to `null`.\n serializedOrigin = null\n break\n case 'no-referrer-when-downgrade':\n case 'strict-origin':\n case 'strict-origin-when-cross-origin':\n // If request’s origin is a tuple origin, its scheme is \"https\", and request’s current URL’s scheme is not \"https\", then set serializedOrigin to `null`.\n if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {\n serializedOrigin = null\n }\n break\n case 'same-origin':\n // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.\n if (!sameOrigin(request, requestCurrentURL(request))) {\n serializedOrigin = null\n }\n break\n default:\n // Do nothing.\n }\n\n if (serializedOrigin) {\n // 2. Append (`Origin`, serializedOrigin) to request’s header list.\n request.headersList.append('origin', serializedOrigin)\n }\n }\n}\n\nfunction coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {\n // TODO\n return performance.now()\n}\n\n// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info\nfunction createOpaqueTimingInfo (timingInfo) {\n return {\n startTime: timingInfo.startTime ?? 0,\n redirectStartTime: 0,\n redirectEndTime: 0,\n postRedirectStartTime: timingInfo.startTime ?? 0,\n finalServiceWorkerStartTime: 0,\n finalNetworkResponseStartTime: 0,\n finalNetworkRequestStartTime: 0,\n endTime: 0,\n encodedBodySize: 0,\n decodedBodySize: 0,\n finalConnectionTimingInfo: null\n }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#policy-container\nfunction makePolicyContainer () {\n // Note: the fetch spec doesn't make use of embedder policy or CSP list\n return {\n referrerPolicy: 'strict-origin-when-cross-origin'\n }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container\nfunction clonePolicyContainer (policyContainer) {\n return {\n referrerPolicy: policyContainer.referrerPolicy\n }\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer\nfunction determineRequestsReferrer (request) {\n // 1. Let policy be request's referrer policy.\n const policy = request.referrerPolicy\n\n // Note: policy cannot (shouldn't) be null or an empty string.\n assert(policy)\n\n // 2. Let environment be request’s client.\n\n let referrerSource = null\n\n // 3. Switch on request’s referrer:\n if (request.referrer === 'client') {\n // Note: node isn't a browser and doesn't implement document/iframes,\n // so we bypass this step and replace it with our own.\n\n const globalOrigin = getGlobalOrigin()\n\n if (!globalOrigin || globalOrigin.origin === 'null') {\n return 'no-referrer'\n }\n\n // note: we need to clone it as it's mutated\n referrerSource = new URL(globalOrigin)\n } else if (request.referrer instanceof URL) {\n // Let referrerSource be request’s referrer.\n referrerSource = request.referrer\n }\n\n // 4. Let request’s referrerURL be the result of stripping referrerSource for\n // use as a referrer.\n let referrerURL = stripURLForReferrer(referrerSource)\n\n // 5. Let referrerOrigin be the result of stripping referrerSource for use as\n // a referrer, with the origin-only flag set to true.\n const referrerOrigin = stripURLForReferrer(referrerSource, true)\n\n // 6. If the result of serializing referrerURL is a string whose length is\n // greater than 4096, set referrerURL to referrerOrigin.\n if (referrerURL.toString().length > 4096) {\n referrerURL = referrerOrigin\n }\n\n const areSameOrigin = sameOrigin(request, referrerURL)\n const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&\n !isURLPotentiallyTrustworthy(request.url)\n\n // 8. Execute the switch statements corresponding to the value of policy:\n switch (policy) {\n case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)\n case 'unsafe-url': return referrerURL\n case 'same-origin':\n return areSameOrigin ? referrerOrigin : 'no-referrer'\n case 'origin-when-cross-origin':\n return areSameOrigin ? referrerURL : referrerOrigin\n case 'strict-origin-when-cross-origin': {\n const currentURL = requestCurrentURL(request)\n\n // 1. If the origin of referrerURL and the origin of request’s current\n // URL are the same, then return referrerURL.\n if (sameOrigin(referrerURL, currentURL)) {\n return referrerURL\n }\n\n // 2. If referrerURL is a potentially trustworthy URL and request’s\n // current URL is not a potentially trustworthy URL, then return no\n // referrer.\n if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {\n return 'no-referrer'\n }\n\n // 3. Return referrerOrigin.\n return referrerOrigin\n }\n case 'strict-origin': // eslint-disable-line\n /**\n * 1. If referrerURL is a potentially trustworthy URL and\n * request’s current URL is not a potentially trustworthy URL,\n * then return no referrer.\n * 2. Return referrerOrigin\n */\n case 'no-referrer-when-downgrade': // eslint-disable-line\n /**\n * 1. If referrerURL is a potentially trustworthy URL and\n * request’s current URL is not a potentially trustworthy URL,\n * then return no referrer.\n * 2. Return referrerOrigin\n */\n\n default: // eslint-disable-line\n return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin\n }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url\n * @param {URL} url\n * @param {boolean|undefined} originOnly\n */\nfunction stripURLForReferrer (url, originOnly) {\n // 1. Assert: url is a URL.\n assert(url instanceof URL)\n\n // 2. If url’s scheme is a local scheme, then return no referrer.\n if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {\n return 'no-referrer'\n }\n\n // 3. Set url’s username to the empty string.\n url.username = ''\n\n // 4. Set url’s password to the empty string.\n url.password = ''\n\n // 5. Set url’s fragment to null.\n url.hash = ''\n\n // 6. If the origin-only flag is true, then:\n if (originOnly) {\n // 1. Set url’s path to « the empty string ».\n url.pathname = ''\n\n // 2. Set url’s query to null.\n url.search = ''\n }\n\n // 7. Return url.\n return url\n}\n\nfunction isURLPotentiallyTrustworthy (url) {\n if (!(url instanceof URL)) {\n return false\n }\n\n // If child of about, return true\n if (url.href === 'about:blank' || url.href === 'about:srcdoc') {\n return true\n }\n\n // If scheme is data, return true\n if (url.protocol === 'data:') return true\n\n // If file, return true\n if (url.protocol === 'file:') return true\n\n return isOriginPotentiallyTrustworthy(url.origin)\n\n function isOriginPotentiallyTrustworthy (origin) {\n // If origin is explicitly null, return false\n if (origin == null || origin === 'null') return false\n\n const originAsURL = new URL(origin)\n\n // If secure, return true\n if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {\n return true\n }\n\n // If localhost or variants, return true\n if (/^127(?:\\.[0-9]+){0,2}\\.[0-9]+$|^\\[(?:0*:)*?:?0*1\\]$/.test(originAsURL.hostname) ||\n (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||\n (originAsURL.hostname.endsWith('.localhost'))) {\n return true\n }\n\n // If any other, return false\n return false\n }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist\n * @param {Uint8Array} bytes\n * @param {string} metadataList\n */\nfunction bytesMatch (bytes, metadataList) {\n // If node is not built with OpenSSL support, we cannot check\n // a request's integrity, so allow it by default (the spec will\n // allow requests if an invalid hash is given, as precedence).\n /* istanbul ignore if: only if node is built with --without-ssl */\n if (crypto === undefined) {\n return true\n }\n\n // 1. Let parsedMetadata be the result of parsing metadataList.\n const parsedMetadata = parseMetadata(metadataList)\n\n // 2. If parsedMetadata is no metadata, return true.\n if (parsedMetadata === 'no metadata') {\n return true\n }\n\n // 3. If response is not eligible for integrity validation, return false.\n // TODO\n\n // 4. If parsedMetadata is the empty set, return true.\n if (parsedMetadata.length === 0) {\n return true\n }\n\n // 5. Let metadata be the result of getting the strongest\n // metadata from parsedMetadata.\n const strongest = getStrongestMetadata(parsedMetadata)\n const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)\n\n // 6. For each item in metadata:\n for (const item of metadata) {\n // 1. Let algorithm be the alg component of item.\n const algorithm = item.algo\n\n // 2. Let expectedValue be the val component of item.\n const expectedValue = item.hash\n\n // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e\n // \"be liberal with padding\". This is annoying, and it's not even in the spec.\n\n // 3. Let actualValue be the result of applying algorithm to bytes.\n let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')\n\n if (actualValue[actualValue.length - 1] === '=') {\n if (actualValue[actualValue.length - 2] === '=') {\n actualValue = actualValue.slice(0, -2)\n } else {\n actualValue = actualValue.slice(0, -1)\n }\n }\n\n // 4. If actualValue is a case-sensitive match for expectedValue,\n // return true.\n if (compareBase64Mixed(actualValue, expectedValue)) {\n return true\n }\n }\n\n // 7. Return false.\n return false\n}\n\n// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options\n// https://www.w3.org/TR/CSP2/#source-list-syntax\n// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1\nconst parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\\s|$)( +[!-~]*)?)?/i\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata\n * @param {string} metadata\n */\nfunction parseMetadata (metadata) {\n // 1. Let result be the empty set.\n /** @type {{ algo: string, hash: string }[]} */\n const result = []\n\n // 2. Let empty be equal to true.\n let empty = true\n\n // 3. For each token returned by splitting metadata on spaces:\n for (const token of metadata.split(' ')) {\n // 1. Set empty to false.\n empty = false\n\n // 2. Parse token as a hash-with-options.\n const parsedToken = parseHashWithOptions.exec(token)\n\n // 3. If token does not parse, continue to the next token.\n if (\n parsedToken === null ||\n parsedToken.groups === undefined ||\n parsedToken.groups.algo === undefined\n ) {\n // Note: Chromium blocks the request at this point, but Firefox\n // gives a warning that an invalid integrity was given. The\n // correct behavior is to ignore these, and subsequently not\n // check the integrity of the resource.\n continue\n }\n\n // 4. Let algorithm be the hash-algo component of token.\n const algorithm = parsedToken.groups.algo.toLowerCase()\n\n // 5. If algorithm is a hash function recognized by the user\n // agent, add the parsed token to result.\n if (supportedHashes.includes(algorithm)) {\n result.push(parsedToken.groups)\n }\n }\n\n // 4. Return no metadata if empty is true, otherwise return result.\n if (empty === true) {\n return 'no metadata'\n }\n\n return result\n}\n\n/**\n * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList\n */\nfunction getStrongestMetadata (metadataList) {\n // Let algorithm be the algo component of the first item in metadataList.\n // Can be sha256\n let algorithm = metadataList[0].algo\n // If the algorithm is sha512, then it is the strongest\n // and we can return immediately\n if (algorithm[3] === '5') {\n return algorithm\n }\n\n for (let i = 1; i < metadataList.length; ++i) {\n const metadata = metadataList[i]\n // If the algorithm is sha512, then it is the strongest\n // and we can break the loop immediately\n if (metadata.algo[3] === '5') {\n algorithm = 'sha512'\n break\n // If the algorithm is sha384, then a potential sha256 or sha384 is ignored\n } else if (algorithm[3] === '3') {\n continue\n // algorithm is sha256, check if algorithm is sha384 and if so, set it as\n // the strongest\n } else if (metadata.algo[3] === '3') {\n algorithm = 'sha384'\n }\n }\n return algorithm\n}\n\nfunction filterMetadataListByAlgorithm (metadataList, algorithm) {\n if (metadataList.length === 1) {\n return metadataList\n }\n\n let pos = 0\n for (let i = 0; i < metadataList.length; ++i) {\n if (metadataList[i].algo === algorithm) {\n metadataList[pos++] = metadataList[i]\n }\n }\n\n metadataList.length = pos\n\n return metadataList\n}\n\n/**\n * Compares two base64 strings, allowing for base64url\n * in the second string.\n *\n* @param {string} actualValue always base64\n * @param {string} expectedValue base64 or base64url\n * @returns {boolean}\n */\nfunction compareBase64Mixed (actualValue, expectedValue) {\n if (actualValue.length !== expectedValue.length) {\n return false\n }\n for (let i = 0; i < actualValue.length; ++i) {\n if (actualValue[i] !== expectedValue[i]) {\n if (\n (actualValue[i] === '+' && expectedValue[i] === '-') ||\n (actualValue[i] === '/' && expectedValue[i] === '_')\n ) {\n continue\n }\n return false\n }\n }\n\n return true\n}\n\n// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request\nfunction tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {\n // TODO\n}\n\n/**\n * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}\n * @param {URL} A\n * @param {URL} B\n */\nfunction sameOrigin (A, B) {\n // 1. If A and B are the same opaque origin, then return true.\n if (A.origin === B.origin && A.origin === 'null') {\n return true\n }\n\n // 2. If A and B are both tuple origins and their schemes,\n // hosts, and port are identical, then return true.\n if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {\n return true\n }\n\n // 3. Return false.\n return false\n}\n\nfunction createDeferredPromise () {\n let res\n let rej\n const promise = new Promise((resolve, reject) => {\n res = resolve\n rej = reject\n })\n\n return { promise, resolve: res, reject: rej }\n}\n\nfunction isAborted (fetchParams) {\n return fetchParams.controller.state === 'aborted'\n}\n\nfunction isCancelled (fetchParams) {\n return fetchParams.controller.state === 'aborted' ||\n fetchParams.controller.state === 'terminated'\n}\n\nconst normalizeMethodRecord = {\n delete: 'DELETE',\n DELETE: 'DELETE',\n get: 'GET',\n GET: 'GET',\n head: 'HEAD',\n HEAD: 'HEAD',\n options: 'OPTIONS',\n OPTIONS: 'OPTIONS',\n post: 'POST',\n POST: 'POST',\n put: 'PUT',\n PUT: 'PUT'\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(normalizeMethodRecord, null)\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-method-normalize\n * @param {string} method\n */\nfunction normalizeMethod (method) {\n return normalizeMethodRecord[method.toLowerCase()] ?? method\n}\n\n// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string\nfunction serializeJavascriptValueToJSONString (value) {\n // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).\n const result = JSON.stringify(value)\n\n // 2. If result is undefined, then throw a TypeError.\n if (result === undefined) {\n throw new TypeError('Value is not JSON serializable')\n }\n\n // 3. Assert: result is a string.\n assert(typeof result === 'string')\n\n // 4. Return result.\n return result\n}\n\n// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object\nconst esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {() => unknown[]} iterator\n * @param {string} name name of the instance\n * @param {'key'|'value'|'key+value'} kind\n */\nfunction makeIterator (iterator, name, kind) {\n const object = {\n index: 0,\n kind,\n target: iterator\n }\n\n const i = {\n next () {\n // 1. Let interface be the interface for which the iterator prototype object exists.\n\n // 2. Let thisValue be the this value.\n\n // 3. Let object be ? ToObject(thisValue).\n\n // 4. If object is a platform object, then perform a security\n // check, passing:\n\n // 5. If object is not a default iterator object for interface,\n // then throw a TypeError.\n if (Object.getPrototypeOf(this) !== i) {\n throw new TypeError(\n `'next' called on an object that does not implement interface ${name} Iterator.`\n )\n }\n\n // 6. Let index be object’s index.\n // 7. Let kind be object’s kind.\n // 8. Let values be object’s target's value pairs to iterate over.\n const { index, kind, target } = object\n const values = target()\n\n // 9. Let len be the length of values.\n const len = values.length\n\n // 10. If index is greater than or equal to len, then return\n // CreateIterResultObject(undefined, true).\n if (index >= len) {\n return { value: undefined, done: true }\n }\n\n // 11. Let pair be the entry in values at index index.\n const pair = values[index]\n\n // 12. Set object’s index to index + 1.\n object.index = index + 1\n\n // 13. Return the iterator result for pair and kind.\n return iteratorResult(pair, kind)\n },\n // The class string of an iterator prototype object for a given interface is the\n // result of concatenating the identifier of the interface and the string \" Iterator\".\n [Symbol.toStringTag]: `${name} Iterator`\n }\n\n // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.\n Object.setPrototypeOf(i, esIteratorPrototype)\n // esIteratorPrototype needs to be the prototype of i\n // which is the prototype of an empty object. Yes, it's confusing.\n return Object.setPrototypeOf({}, i)\n}\n\n// https://webidl.spec.whatwg.org/#iterator-result\nfunction iteratorResult (pair, kind) {\n let result\n\n // 1. Let result be a value determined by the value of kind:\n switch (kind) {\n case 'key': {\n // 1. Let idlKey be pair’s key.\n // 2. Let key be the result of converting idlKey to an\n // ECMAScript value.\n // 3. result is key.\n result = pair[0]\n break\n }\n case 'value': {\n // 1. Let idlValue be pair’s value.\n // 2. Let value be the result of converting idlValue to\n // an ECMAScript value.\n // 3. result is value.\n result = pair[1]\n break\n }\n case 'key+value': {\n // 1. Let idlKey be pair’s key.\n // 2. Let idlValue be pair’s value.\n // 3. Let key be the result of converting idlKey to an\n // ECMAScript value.\n // 4. Let value be the result of converting idlValue to\n // an ECMAScript value.\n // 5. Let array be ! ArrayCreate(2).\n // 6. Call ! CreateDataProperty(array, \"0\", key).\n // 7. Call ! CreateDataProperty(array, \"1\", value).\n // 8. result is array.\n result = pair\n break\n }\n }\n\n // 2. Return CreateIterResultObject(result, false).\n return { value: result, done: false }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#body-fully-read\n */\nasync function fullyReadBody (body, processBody, processBodyError) {\n // 1. If taskDestination is null, then set taskDestination to\n // the result of starting a new parallel queue.\n\n // 2. Let successSteps given a byte sequence bytes be to queue a\n // fetch task to run processBody given bytes, with taskDestination.\n const successSteps = processBody\n\n // 3. Let errorSteps be to queue a fetch task to run processBodyError,\n // with taskDestination.\n const errorSteps = processBodyError\n\n // 4. Let reader be the result of getting a reader for body’s stream.\n // If that threw an exception, then run errorSteps with that\n // exception and return.\n let reader\n\n try {\n reader = body.stream.getReader()\n } catch (e) {\n errorSteps(e)\n return\n }\n\n // 5. Read all bytes from reader, given successSteps and errorSteps.\n try {\n const result = await readAllBytes(reader)\n successSteps(result)\n } catch (e) {\n errorSteps(e)\n }\n}\n\n/** @type {ReadableStream} */\nlet ReadableStream = globalThis.ReadableStream\n\nfunction isReadableStreamLike (stream) {\n if (!ReadableStream) {\n ReadableStream = require('stream/web').ReadableStream\n }\n\n return stream instanceof ReadableStream || (\n stream[Symbol.toStringTag] === 'ReadableStream' &&\n typeof stream.tee === 'function'\n )\n}\n\nconst MAXIMUM_ARGUMENT_LENGTH = 65535\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-decode\n * @param {number[]|Uint8Array} input\n */\nfunction isomorphicDecode (input) {\n // 1. To isomorphic decode a byte sequence input, return a string whose code point\n // length is equal to input’s length and whose code points have the same values\n // as the values of input’s bytes, in the same order.\n\n if (input.length < MAXIMUM_ARGUMENT_LENGTH) {\n return String.fromCharCode(...input)\n }\n\n return input.reduce((previous, current) => previous + String.fromCharCode(current), '')\n}\n\n/**\n * @param {ReadableStreamController} controller\n */\nfunction readableStreamClose (controller) {\n try {\n controller.close()\n } catch (err) {\n // TODO: add comment explaining why this error occurs.\n if (!err.message.includes('Controller is already closed')) {\n throw err\n }\n }\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-encode\n * @param {string} input\n */\nfunction isomorphicEncode (input) {\n // 1. Assert: input contains no code points greater than U+00FF.\n for (let i = 0; i < input.length; i++) {\n assert(input.charCodeAt(i) <= 0xFF)\n }\n\n // 2. Return a byte sequence whose length is equal to input’s code\n // point length and whose bytes have the same values as the\n // values of input’s code points, in the same order\n return input\n}\n\n/**\n * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes\n * @see https://streams.spec.whatwg.org/#read-loop\n * @param {ReadableStreamDefaultReader} reader\n */\nasync function readAllBytes (reader) {\n const bytes = []\n let byteLength = 0\n\n while (true) {\n const { done, value: chunk } = await reader.read()\n\n if (done) {\n // 1. Call successSteps with bytes.\n return Buffer.concat(bytes, byteLength)\n }\n\n // 1. If chunk is not a Uint8Array object, call failureSteps\n // with a TypeError and abort these steps.\n if (!isUint8Array(chunk)) {\n throw new TypeError('Received non-Uint8Array chunk')\n }\n\n // 2. Append the bytes represented by chunk to bytes.\n bytes.push(chunk)\n byteLength += chunk.length\n\n // 3. Read-loop given reader, bytes, successSteps, and failureSteps.\n }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#is-local\n * @param {URL} url\n */\nfunction urlIsLocal (url) {\n assert('protocol' in url) // ensure it's a url object\n\n const protocol = url.protocol\n\n return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'\n}\n\n/**\n * @param {string|URL} url\n */\nfunction urlHasHttpsScheme (url) {\n if (typeof url === 'string') {\n return url.startsWith('https:')\n }\n\n return url.protocol === 'https:'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-scheme\n * @param {URL} url\n */\nfunction urlIsHttpHttpsScheme (url) {\n assert('protocol' in url) // ensure it's a url object\n\n const protocol = url.protocol\n\n return protocol === 'http:' || protocol === 'https:'\n}\n\n/**\n * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.\n */\nconst hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))\n\nmodule.exports = {\n isAborted,\n isCancelled,\n createDeferredPromise,\n ReadableStreamFrom,\n toUSVString,\n tryUpgradeRequestToAPotentiallyTrustworthyURL,\n coarsenedSharedCurrentTime,\n determineRequestsReferrer,\n makePolicyContainer,\n clonePolicyContainer,\n appendFetchMetadata,\n appendRequestOriginHeader,\n TAOCheck,\n corsCheck,\n crossOriginResourcePolicyCheck,\n createOpaqueTimingInfo,\n setRequestReferrerPolicyOnRedirect,\n isValidHTTPToken,\n requestBadPort,\n requestCurrentURL,\n responseURL,\n responseLocationURL,\n isBlobLike,\n isURLPotentiallyTrustworthy,\n isValidReasonPhrase,\n sameOrigin,\n normalizeMethod,\n serializeJavascriptValueToJSONString,\n makeIterator,\n isValidHeaderName,\n isValidHeaderValue,\n hasOwn,\n isErrorLike,\n fullyReadBody,\n bytesMatch,\n isReadableStreamLike,\n readableStreamClose,\n isomorphicEncode,\n isomorphicDecode,\n urlIsLocal,\n urlHasHttpsScheme,\n urlIsHttpHttpsScheme,\n readAllBytes,\n normalizeMethodRecord,\n parseMetadata\n}\n","'use strict'\n\nmodule.exports = {\n kUrl: Symbol('url'),\n kHeaders: Symbol('headers'),\n kSignal: Symbol('signal'),\n kState: Symbol('state'),\n kGuard: Symbol('guard'),\n kRealm: Symbol('realm')\n}\n","'use strict'\n\nconst { types } = require('util')\nconst { hasOwn, toUSVString } = require('./util')\n\n/** @type {import('../../types/webidl').Webidl} */\nconst webidl = {}\nwebidl.converters = {}\nwebidl.util = {}\nwebidl.errors = {}\n\nwebidl.errors.exception = function (message) {\n return new TypeError(`${message.header}: ${message.message}`)\n}\n\nwebidl.errors.conversionFailed = function (context) {\n const plural = context.types.length === 1 ? '' : ' one of'\n const message =\n `${context.argument} could not be converted to` +\n `${plural}: ${context.types.join(', ')}.`\n\n return webidl.errors.exception({\n header: context.prefix,\n message\n })\n}\n\nwebidl.errors.invalidArgument = function (context) {\n return webidl.errors.exception({\n header: context.prefix,\n message: `\"${context.value}\" is an invalid ${context.type}.`\n })\n}\n\n// https://webidl.spec.whatwg.org/#implements\nwebidl.brandCheck = function (V, I, opts = undefined) {\n if (opts?.strict !== false && !(V instanceof I)) {\n throw new TypeError('Illegal invocation')\n } else {\n return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]\n }\n}\n\nwebidl.argumentLengthCheck = function ({ length }, min, ctx) {\n if (length < min) {\n throw webidl.errors.exception({\n message: `${min} argument${min !== 1 ? 's' : ''} required, ` +\n `but${length ? ' only' : ''} ${length} found.`,\n ...ctx\n })\n }\n}\n\nwebidl.illegalConstructor = function () {\n throw webidl.errors.exception({\n header: 'TypeError',\n message: 'Illegal constructor'\n })\n}\n\n// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values\nwebidl.util.Type = function (V) {\n switch (typeof V) {\n case 'undefined': return 'Undefined'\n case 'boolean': return 'Boolean'\n case 'string': return 'String'\n case 'symbol': return 'Symbol'\n case 'number': return 'Number'\n case 'bigint': return 'BigInt'\n case 'function':\n case 'object': {\n if (V === null) {\n return 'Null'\n }\n\n return 'Object'\n }\n }\n}\n\n// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint\nwebidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {\n let upperBound\n let lowerBound\n\n // 1. If bitLength is 64, then:\n if (bitLength === 64) {\n // 1. Let upperBound be 2^53 − 1.\n upperBound = Math.pow(2, 53) - 1\n\n // 2. If signedness is \"unsigned\", then let lowerBound be 0.\n if (signedness === 'unsigned') {\n lowerBound = 0\n } else {\n // 3. Otherwise let lowerBound be −2^53 + 1.\n lowerBound = Math.pow(-2, 53) + 1\n }\n } else if (signedness === 'unsigned') {\n // 2. Otherwise, if signedness is \"unsigned\", then:\n\n // 1. Let lowerBound be 0.\n lowerBound = 0\n\n // 2. Let upperBound be 2^bitLength − 1.\n upperBound = Math.pow(2, bitLength) - 1\n } else {\n // 3. Otherwise:\n\n // 1. Let lowerBound be -2^bitLength − 1.\n lowerBound = Math.pow(-2, bitLength) - 1\n\n // 2. Let upperBound be 2^bitLength − 1 − 1.\n upperBound = Math.pow(2, bitLength - 1) - 1\n }\n\n // 4. Let x be ? ToNumber(V).\n let x = Number(V)\n\n // 5. If x is −0, then set x to +0.\n if (x === 0) {\n x = 0\n }\n\n // 6. If the conversion is to an IDL type associated\n // with the [EnforceRange] extended attribute, then:\n if (opts.enforceRange === true) {\n // 1. If x is NaN, +∞, or −∞, then throw a TypeError.\n if (\n Number.isNaN(x) ||\n x === Number.POSITIVE_INFINITY ||\n x === Number.NEGATIVE_INFINITY\n ) {\n throw webidl.errors.exception({\n header: 'Integer conversion',\n message: `Could not convert ${V} to an integer.`\n })\n }\n\n // 2. Set x to IntegerPart(x).\n x = webidl.util.IntegerPart(x)\n\n // 3. If x < lowerBound or x > upperBound, then\n // throw a TypeError.\n if (x < lowerBound || x > upperBound) {\n throw webidl.errors.exception({\n header: 'Integer conversion',\n message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`\n })\n }\n\n // 4. Return x.\n return x\n }\n\n // 7. If x is not NaN and the conversion is to an IDL\n // type associated with the [Clamp] extended\n // attribute, then:\n if (!Number.isNaN(x) && opts.clamp === true) {\n // 1. Set x to min(max(x, lowerBound), upperBound).\n x = Math.min(Math.max(x, lowerBound), upperBound)\n\n // 2. Round x to the nearest integer, choosing the\n // even integer if it lies halfway between two,\n // and choosing +0 rather than −0.\n if (Math.floor(x) % 2 === 0) {\n x = Math.floor(x)\n } else {\n x = Math.ceil(x)\n }\n\n // 3. Return x.\n return x\n }\n\n // 8. If x is NaN, +0, +∞, or −∞, then return +0.\n if (\n Number.isNaN(x) ||\n (x === 0 && Object.is(0, x)) ||\n x === Number.POSITIVE_INFINITY ||\n x === Number.NEGATIVE_INFINITY\n ) {\n return 0\n }\n\n // 9. Set x to IntegerPart(x).\n x = webidl.util.IntegerPart(x)\n\n // 10. Set x to x modulo 2^bitLength.\n x = x % Math.pow(2, bitLength)\n\n // 11. If signedness is \"signed\" and x ≥ 2^bitLength − 1,\n // then return x − 2^bitLength.\n if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {\n return x - Math.pow(2, bitLength)\n }\n\n // 12. Otherwise, return x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart\nwebidl.util.IntegerPart = function (n) {\n // 1. Let r be floor(abs(n)).\n const r = Math.floor(Math.abs(n))\n\n // 2. If n < 0, then return -1 × r.\n if (n < 0) {\n return -1 * r\n }\n\n // 3. Otherwise, return r.\n return r\n}\n\n// https://webidl.spec.whatwg.org/#es-sequence\nwebidl.sequenceConverter = function (converter) {\n return (V) => {\n // 1. If Type(V) is not Object, throw a TypeError.\n if (webidl.util.Type(V) !== 'Object') {\n throw webidl.errors.exception({\n header: 'Sequence',\n message: `Value of type ${webidl.util.Type(V)} is not an Object.`\n })\n }\n\n // 2. Let method be ? GetMethod(V, @@iterator).\n /** @type {Generator} */\n const method = V?.[Symbol.iterator]?.()\n const seq = []\n\n // 3. If method is undefined, throw a TypeError.\n if (\n method === undefined ||\n typeof method.next !== 'function'\n ) {\n throw webidl.errors.exception({\n header: 'Sequence',\n message: 'Object is not an iterator.'\n })\n }\n\n // https://webidl.spec.whatwg.org/#create-sequence-from-iterable\n while (true) {\n const { done, value } = method.next()\n\n if (done) {\n break\n }\n\n seq.push(converter(value))\n }\n\n return seq\n }\n}\n\n// https://webidl.spec.whatwg.org/#es-to-record\nwebidl.recordConverter = function (keyConverter, valueConverter) {\n return (O) => {\n // 1. If Type(O) is not Object, throw a TypeError.\n if (webidl.util.Type(O) !== 'Object') {\n throw webidl.errors.exception({\n header: 'Record',\n message: `Value of type ${webidl.util.Type(O)} is not an Object.`\n })\n }\n\n // 2. Let result be a new empty instance of record.\n const result = {}\n\n if (!types.isProxy(O)) {\n // Object.keys only returns enumerable properties\n const keys = Object.keys(O)\n\n for (const key of keys) {\n // 1. Let typedKey be key converted to an IDL value of type K.\n const typedKey = keyConverter(key)\n\n // 2. Let value be ? Get(O, key).\n // 3. Let typedValue be value converted to an IDL value of type V.\n const typedValue = valueConverter(O[key])\n\n // 4. Set result[typedKey] to typedValue.\n result[typedKey] = typedValue\n }\n\n // 5. Return result.\n return result\n }\n\n // 3. Let keys be ? O.[[OwnPropertyKeys]]().\n const keys = Reflect.ownKeys(O)\n\n // 4. For each key of keys.\n for (const key of keys) {\n // 1. Let desc be ? O.[[GetOwnProperty]](key).\n const desc = Reflect.getOwnPropertyDescriptor(O, key)\n\n // 2. If desc is not undefined and desc.[[Enumerable]] is true:\n if (desc?.enumerable) {\n // 1. Let typedKey be key converted to an IDL value of type K.\n const typedKey = keyConverter(key)\n\n // 2. Let value be ? Get(O, key).\n // 3. Let typedValue be value converted to an IDL value of type V.\n const typedValue = valueConverter(O[key])\n\n // 4. Set result[typedKey] to typedValue.\n result[typedKey] = typedValue\n }\n }\n\n // 5. Return result.\n return result\n }\n}\n\nwebidl.interfaceConverter = function (i) {\n return (V, opts = {}) => {\n if (opts.strict !== false && !(V instanceof i)) {\n throw webidl.errors.exception({\n header: i.name,\n message: `Expected ${V} to be an instance of ${i.name}.`\n })\n }\n\n return V\n }\n}\n\nwebidl.dictionaryConverter = function (converters) {\n return (dictionary) => {\n const type = webidl.util.Type(dictionary)\n const dict = {}\n\n if (type === 'Null' || type === 'Undefined') {\n return dict\n } else if (type !== 'Object') {\n throw webidl.errors.exception({\n header: 'Dictionary',\n message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`\n })\n }\n\n for (const options of converters) {\n const { key, defaultValue, required, converter } = options\n\n if (required === true) {\n if (!hasOwn(dictionary, key)) {\n throw webidl.errors.exception({\n header: 'Dictionary',\n message: `Missing required key \"${key}\".`\n })\n }\n }\n\n let value = dictionary[key]\n const hasDefault = hasOwn(options, 'defaultValue')\n\n // Only use defaultValue if value is undefined and\n // a defaultValue options was provided.\n if (hasDefault && value !== null) {\n value = value ?? defaultValue\n }\n\n // A key can be optional and have no default value.\n // When this happens, do not perform a conversion,\n // and do not assign the key a value.\n if (required || hasDefault || value !== undefined) {\n value = converter(value)\n\n if (\n options.allowedValues &&\n !options.allowedValues.includes(value)\n ) {\n throw webidl.errors.exception({\n header: 'Dictionary',\n message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`\n })\n }\n\n dict[key] = value\n }\n }\n\n return dict\n }\n}\n\nwebidl.nullableConverter = function (converter) {\n return (V) => {\n if (V === null) {\n return V\n }\n\n return converter(V)\n }\n}\n\n// https://webidl.spec.whatwg.org/#es-DOMString\nwebidl.converters.DOMString = function (V, opts = {}) {\n // 1. If V is null and the conversion is to an IDL type\n // associated with the [LegacyNullToEmptyString]\n // extended attribute, then return the DOMString value\n // that represents the empty string.\n if (V === null && opts.legacyNullToEmptyString) {\n return ''\n }\n\n // 2. Let x be ? ToString(V).\n if (typeof V === 'symbol') {\n throw new TypeError('Could not convert argument of type symbol to string.')\n }\n\n // 3. Return the IDL DOMString value that represents the\n // same sequence of code units as the one the\n // ECMAScript String value x represents.\n return String(V)\n}\n\n// https://webidl.spec.whatwg.org/#es-ByteString\nwebidl.converters.ByteString = function (V) {\n // 1. Let x be ? ToString(V).\n // Note: DOMString converter perform ? ToString(V)\n const x = webidl.converters.DOMString(V)\n\n // 2. If the value of any element of x is greater than\n // 255, then throw a TypeError.\n for (let index = 0; index < x.length; index++) {\n if (x.charCodeAt(index) > 255) {\n throw new TypeError(\n 'Cannot convert argument to a ByteString because the character at ' +\n `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`\n )\n }\n }\n\n // 3. Return an IDL ByteString value whose length is the\n // length of x, and where the value of each element is\n // the value of the corresponding element of x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-USVString\nwebidl.converters.USVString = toUSVString\n\n// https://webidl.spec.whatwg.org/#es-boolean\nwebidl.converters.boolean = function (V) {\n // 1. Let x be the result of computing ToBoolean(V).\n const x = Boolean(V)\n\n // 2. Return the IDL boolean value that is the one that represents\n // the same truth value as the ECMAScript Boolean value x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-any\nwebidl.converters.any = function (V) {\n return V\n}\n\n// https://webidl.spec.whatwg.org/#es-long-long\nwebidl.converters['long long'] = function (V) {\n // 1. Let x be ? ConvertToInt(V, 64, \"signed\").\n const x = webidl.util.ConvertToInt(V, 64, 'signed')\n\n // 2. Return the IDL long long value that represents\n // the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long-long\nwebidl.converters['unsigned long long'] = function (V) {\n // 1. Let x be ? ConvertToInt(V, 64, \"unsigned\").\n const x = webidl.util.ConvertToInt(V, 64, 'unsigned')\n\n // 2. Return the IDL unsigned long long value that\n // represents the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long\nwebidl.converters['unsigned long'] = function (V) {\n // 1. Let x be ? ConvertToInt(V, 32, \"unsigned\").\n const x = webidl.util.ConvertToInt(V, 32, 'unsigned')\n\n // 2. Return the IDL unsigned long value that\n // represents the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-short\nwebidl.converters['unsigned short'] = function (V, opts) {\n // 1. Let x be ? ConvertToInt(V, 16, \"unsigned\").\n const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)\n\n // 2. Return the IDL unsigned short value that represents\n // the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#idl-ArrayBuffer\nwebidl.converters.ArrayBuffer = function (V, opts = {}) {\n // 1. If Type(V) is not Object, or V does not have an\n // [[ArrayBufferData]] internal slot, then throw a\n // TypeError.\n // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances\n // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances\n if (\n webidl.util.Type(V) !== 'Object' ||\n !types.isAnyArrayBuffer(V)\n ) {\n throw webidl.errors.conversionFailed({\n prefix: `${V}`,\n argument: `${V}`,\n types: ['ArrayBuffer']\n })\n }\n\n // 2. If the conversion is not to an IDL type associated\n // with the [AllowShared] extended attribute, and\n // IsSharedArrayBuffer(V) is true, then throw a\n // TypeError.\n if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'SharedArrayBuffer is not allowed.'\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V) is true, then throw a\n // TypeError.\n // Note: resizable ArrayBuffers are currently a proposal.\n\n // 4. Return the IDL ArrayBuffer value that is a\n // reference to the same object as V.\n return V\n}\n\nwebidl.converters.TypedArray = function (V, T, opts = {}) {\n // 1. Let T be the IDL type V is being converted to.\n\n // 2. If Type(V) is not Object, or V does not have a\n // [[TypedArrayName]] internal slot with a value\n // equal to T’s name, then throw a TypeError.\n if (\n webidl.util.Type(V) !== 'Object' ||\n !types.isTypedArray(V) ||\n V.constructor.name !== T.name\n ) {\n throw webidl.errors.conversionFailed({\n prefix: `${T.name}`,\n argument: `${V}`,\n types: [T.name]\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowShared] extended attribute, and\n // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is\n // true, then throw a TypeError.\n if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'SharedArrayBuffer is not allowed.'\n })\n }\n\n // 4. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n // true, then throw a TypeError.\n // Note: resizable array buffers are currently a proposal\n\n // 5. Return the IDL value of type T that is a reference\n // to the same object as V.\n return V\n}\n\nwebidl.converters.DataView = function (V, opts = {}) {\n // 1. If Type(V) is not Object, or V does not have a\n // [[DataView]] internal slot, then throw a TypeError.\n if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {\n throw webidl.errors.exception({\n header: 'DataView',\n message: 'Object is not a DataView.'\n })\n }\n\n // 2. If the conversion is not to an IDL type associated\n // with the [AllowShared] extended attribute, and\n // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,\n // then throw a TypeError.\n if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'SharedArrayBuffer is not allowed.'\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n // true, then throw a TypeError.\n // Note: resizable ArrayBuffers are currently a proposal\n\n // 4. Return the IDL DataView value that is a reference\n // to the same object as V.\n return V\n}\n\n// https://webidl.spec.whatwg.org/#BufferSource\nwebidl.converters.BufferSource = function (V, opts = {}) {\n if (types.isAnyArrayBuffer(V)) {\n return webidl.converters.ArrayBuffer(V, opts)\n }\n\n if (types.isTypedArray(V)) {\n return webidl.converters.TypedArray(V, V.constructor)\n }\n\n if (types.isDataView(V)) {\n return webidl.converters.DataView(V, opts)\n }\n\n throw new TypeError(`Could not convert ${V} to a BufferSource.`)\n}\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.ByteString\n)\n\nwebidl.converters['sequence>'] = webidl.sequenceConverter(\n webidl.converters['sequence']\n)\n\nwebidl.converters['record'] = webidl.recordConverter(\n webidl.converters.ByteString,\n webidl.converters.ByteString\n)\n\nmodule.exports = {\n webidl\n}\n","const assert = require('assert')\nconst { atob } = require('buffer')\nconst { isomorphicDecode } = require('./util')\n\nconst encoder = new TextEncoder()\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-token-code-point\n */\nconst HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/\nconst HTTP_WHITESPACE_REGEX = /(\\u000A|\\u000D|\\u0009|\\u0020)/ // eslint-disable-line\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point\n */\nconst HTTP_QUOTED_STRING_TOKENS = /[\\u0009|\\u0020-\\u007E|\\u0080-\\u00FF]/ // eslint-disable-line\n\n// https://fetch.spec.whatwg.org/#data-url-processor\n/** @param {URL} dataURL */\nfunction dataURLProcessor (dataURL) {\n // 1. Assert: dataURL’s scheme is \"data\".\n assert(dataURL.protocol === 'data:')\n\n // 2. Let input be the result of running the URL\n // serializer on dataURL with exclude fragment\n // set to true.\n let input = URLSerializer(dataURL, true)\n\n // 3. Remove the leading \"data:\" string from input.\n input = input.slice(5)\n\n // 4. Let position point at the start of input.\n const position = { position: 0 }\n\n // 5. Let mimeType be the result of collecting a\n // sequence of code points that are not equal\n // to U+002C (,), given position.\n let mimeType = collectASequenceOfCodePointsFast(\n ',',\n input,\n position\n )\n\n // 6. Strip leading and trailing ASCII whitespace\n // from mimeType.\n // Undici implementation note: we need to store the\n // length because if the mimetype has spaces removed,\n // the wrong amount will be sliced from the input in\n // step #9\n const mimeTypeLength = mimeType.length\n mimeType = removeASCIIWhitespace(mimeType, true, true)\n\n // 7. If position is past the end of input, then\n // return failure\n if (position.position >= input.length) {\n return 'failure'\n }\n\n // 8. Advance position by 1.\n position.position++\n\n // 9. Let encodedBody be the remainder of input.\n const encodedBody = input.slice(mimeTypeLength + 1)\n\n // 10. Let body be the percent-decoding of encodedBody.\n let body = stringPercentDecode(encodedBody)\n\n // 11. If mimeType ends with U+003B (;), followed by\n // zero or more U+0020 SPACE, followed by an ASCII\n // case-insensitive match for \"base64\", then:\n if (/;(\\u0020){0,}base64$/i.test(mimeType)) {\n // 1. Let stringBody be the isomorphic decode of body.\n const stringBody = isomorphicDecode(body)\n\n // 2. Set body to the forgiving-base64 decode of\n // stringBody.\n body = forgivingBase64(stringBody)\n\n // 3. If body is failure, then return failure.\n if (body === 'failure') {\n return 'failure'\n }\n\n // 4. Remove the last 6 code points from mimeType.\n mimeType = mimeType.slice(0, -6)\n\n // 5. Remove trailing U+0020 SPACE code points from mimeType,\n // if any.\n mimeType = mimeType.replace(/(\\u0020)+$/, '')\n\n // 6. Remove the last U+003B (;) code point from mimeType.\n mimeType = mimeType.slice(0, -1)\n }\n\n // 12. If mimeType starts with U+003B (;), then prepend\n // \"text/plain\" to mimeType.\n if (mimeType.startsWith(';')) {\n mimeType = 'text/plain' + mimeType\n }\n\n // 13. Let mimeTypeRecord be the result of parsing\n // mimeType.\n let mimeTypeRecord = parseMIMEType(mimeType)\n\n // 14. If mimeTypeRecord is failure, then set\n // mimeTypeRecord to text/plain;charset=US-ASCII.\n if (mimeTypeRecord === 'failure') {\n mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')\n }\n\n // 15. Return a new data: URL struct whose MIME\n // type is mimeTypeRecord and body is body.\n // https://fetch.spec.whatwg.org/#data-url-struct\n return { mimeType: mimeTypeRecord, body }\n}\n\n// https://url.spec.whatwg.org/#concept-url-serializer\n/**\n * @param {URL} url\n * @param {boolean} excludeFragment\n */\nfunction URLSerializer (url, excludeFragment = false) {\n if (!excludeFragment) {\n return url.href\n }\n\n const href = url.href\n const hashLength = url.hash.length\n\n return hashLength === 0 ? href : href.substring(0, href.length - hashLength)\n}\n\n// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points\n/**\n * @param {(char: string) => boolean} condition\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePoints (condition, input, position) {\n // 1. Let result be the empty string.\n let result = ''\n\n // 2. While position doesn’t point past the end of input and the\n // code point at position within input meets the condition condition:\n while (position.position < input.length && condition(input[position.position])) {\n // 1. Append that code point to the end of result.\n result += input[position.position]\n\n // 2. Advance position by 1.\n position.position++\n }\n\n // 3. Return result.\n return result\n}\n\n/**\n * A faster collectASequenceOfCodePoints that only works when comparing a single character.\n * @param {string} char\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePointsFast (char, input, position) {\n const idx = input.indexOf(char, position.position)\n const start = position.position\n\n if (idx === -1) {\n position.position = input.length\n return input.slice(start)\n }\n\n position.position = idx\n return input.slice(start, position.position)\n}\n\n// https://url.spec.whatwg.org/#string-percent-decode\n/** @param {string} input */\nfunction stringPercentDecode (input) {\n // 1. Let bytes be the UTF-8 encoding of input.\n const bytes = encoder.encode(input)\n\n // 2. Return the percent-decoding of bytes.\n return percentDecode(bytes)\n}\n\n// https://url.spec.whatwg.org/#percent-decode\n/** @param {Uint8Array} input */\nfunction percentDecode (input) {\n // 1. Let output be an empty byte sequence.\n /** @type {number[]} */\n const output = []\n\n // 2. For each byte byte in input:\n for (let i = 0; i < input.length; i++) {\n const byte = input[i]\n\n // 1. If byte is not 0x25 (%), then append byte to output.\n if (byte !== 0x25) {\n output.push(byte)\n\n // 2. Otherwise, if byte is 0x25 (%) and the next two bytes\n // after byte in input are not in the ranges\n // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),\n // and 0x61 (a) to 0x66 (f), all inclusive, append byte\n // to output.\n } else if (\n byte === 0x25 &&\n !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))\n ) {\n output.push(0x25)\n\n // 3. Otherwise:\n } else {\n // 1. Let bytePoint be the two bytes after byte in input,\n // decoded, and then interpreted as hexadecimal number.\n const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])\n const bytePoint = Number.parseInt(nextTwoBytes, 16)\n\n // 2. Append a byte whose value is bytePoint to output.\n output.push(bytePoint)\n\n // 3. Skip the next two bytes in input.\n i += 2\n }\n }\n\n // 3. Return output.\n return Uint8Array.from(output)\n}\n\n// https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n/** @param {string} input */\nfunction parseMIMEType (input) {\n // 1. Remove any leading and trailing HTTP whitespace\n // from input.\n input = removeHTTPWhitespace(input, true, true)\n\n // 2. Let position be a position variable for input,\n // initially pointing at the start of input.\n const position = { position: 0 }\n\n // 3. Let type be the result of collecting a sequence\n // of code points that are not U+002F (/) from\n // input, given position.\n const type = collectASequenceOfCodePointsFast(\n '/',\n input,\n position\n )\n\n // 4. If type is the empty string or does not solely\n // contain HTTP token code points, then return failure.\n // https://mimesniff.spec.whatwg.org/#http-token-code-point\n if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {\n return 'failure'\n }\n\n // 5. If position is past the end of input, then return\n // failure\n if (position.position > input.length) {\n return 'failure'\n }\n\n // 6. Advance position by 1. (This skips past U+002F (/).)\n position.position++\n\n // 7. Let subtype be the result of collecting a sequence of\n // code points that are not U+003B (;) from input, given\n // position.\n let subtype = collectASequenceOfCodePointsFast(\n ';',\n input,\n position\n )\n\n // 8. Remove any trailing HTTP whitespace from subtype.\n subtype = removeHTTPWhitespace(subtype, false, true)\n\n // 9. If subtype is the empty string or does not solely\n // contain HTTP token code points, then return failure.\n if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {\n return 'failure'\n }\n\n const typeLowercase = type.toLowerCase()\n const subtypeLowercase = subtype.toLowerCase()\n\n // 10. Let mimeType be a new MIME type record whose type\n // is type, in ASCII lowercase, and subtype is subtype,\n // in ASCII lowercase.\n // https://mimesniff.spec.whatwg.org/#mime-type\n const mimeType = {\n type: typeLowercase,\n subtype: subtypeLowercase,\n /** @type {Map} */\n parameters: new Map(),\n // https://mimesniff.spec.whatwg.org/#mime-type-essence\n essence: `${typeLowercase}/${subtypeLowercase}`\n }\n\n // 11. While position is not past the end of input:\n while (position.position < input.length) {\n // 1. Advance position by 1. (This skips past U+003B (;).)\n position.position++\n\n // 2. Collect a sequence of code points that are HTTP\n // whitespace from input given position.\n collectASequenceOfCodePoints(\n // https://fetch.spec.whatwg.org/#http-whitespace\n char => HTTP_WHITESPACE_REGEX.test(char),\n input,\n position\n )\n\n // 3. Let parameterName be the result of collecting a\n // sequence of code points that are not U+003B (;)\n // or U+003D (=) from input, given position.\n let parameterName = collectASequenceOfCodePoints(\n (char) => char !== ';' && char !== '=',\n input,\n position\n )\n\n // 4. Set parameterName to parameterName, in ASCII\n // lowercase.\n parameterName = parameterName.toLowerCase()\n\n // 5. If position is not past the end of input, then:\n if (position.position < input.length) {\n // 1. If the code point at position within input is\n // U+003B (;), then continue.\n if (input[position.position] === ';') {\n continue\n }\n\n // 2. Advance position by 1. (This skips past U+003D (=).)\n position.position++\n }\n\n // 6. If position is past the end of input, then break.\n if (position.position > input.length) {\n break\n }\n\n // 7. Let parameterValue be null.\n let parameterValue = null\n\n // 8. If the code point at position within input is\n // U+0022 (\"), then:\n if (input[position.position] === '\"') {\n // 1. Set parameterValue to the result of collecting\n // an HTTP quoted string from input, given position\n // and the extract-value flag.\n parameterValue = collectAnHTTPQuotedString(input, position, true)\n\n // 2. Collect a sequence of code points that are not\n // U+003B (;) from input, given position.\n collectASequenceOfCodePointsFast(\n ';',\n input,\n position\n )\n\n // 9. Otherwise:\n } else {\n // 1. Set parameterValue to the result of collecting\n // a sequence of code points that are not U+003B (;)\n // from input, given position.\n parameterValue = collectASequenceOfCodePointsFast(\n ';',\n input,\n position\n )\n\n // 2. Remove any trailing HTTP whitespace from parameterValue.\n parameterValue = removeHTTPWhitespace(parameterValue, false, true)\n\n // 3. If parameterValue is the empty string, then continue.\n if (parameterValue.length === 0) {\n continue\n }\n }\n\n // 10. If all of the following are true\n // - parameterName is not the empty string\n // - parameterName solely contains HTTP token code points\n // - parameterValue solely contains HTTP quoted-string token code points\n // - mimeType’s parameters[parameterName] does not exist\n // then set mimeType’s parameters[parameterName] to parameterValue.\n if (\n parameterName.length !== 0 &&\n HTTP_TOKEN_CODEPOINTS.test(parameterName) &&\n (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&\n !mimeType.parameters.has(parameterName)\n ) {\n mimeType.parameters.set(parameterName, parameterValue)\n }\n }\n\n // 12. Return mimeType.\n return mimeType\n}\n\n// https://infra.spec.whatwg.org/#forgiving-base64-decode\n/** @param {string} data */\nfunction forgivingBase64 (data) {\n // 1. Remove all ASCII whitespace from data.\n data = data.replace(/[\\u0009\\u000A\\u000C\\u000D\\u0020]/g, '') // eslint-disable-line\n\n // 2. If data’s code point length divides by 4 leaving\n // no remainder, then:\n if (data.length % 4 === 0) {\n // 1. If data ends with one or two U+003D (=) code points,\n // then remove them from data.\n data = data.replace(/=?=$/, '')\n }\n\n // 3. If data’s code point length divides by 4 leaving\n // a remainder of 1, then return failure.\n if (data.length % 4 === 1) {\n return 'failure'\n }\n\n // 4. If data contains a code point that is not one of\n // U+002B (+)\n // U+002F (/)\n // ASCII alphanumeric\n // then return failure.\n if (/[^+/0-9A-Za-z]/.test(data)) {\n return 'failure'\n }\n\n const binary = atob(data)\n const bytes = new Uint8Array(binary.length)\n\n for (let byte = 0; byte < binary.length; byte++) {\n bytes[byte] = binary.charCodeAt(byte)\n }\n\n return bytes\n}\n\n// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string\n// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string\n/**\n * @param {string} input\n * @param {{ position: number }} position\n * @param {boolean?} extractValue\n */\nfunction collectAnHTTPQuotedString (input, position, extractValue) {\n // 1. Let positionStart be position.\n const positionStart = position.position\n\n // 2. Let value be the empty string.\n let value = ''\n\n // 3. Assert: the code point at position within input\n // is U+0022 (\").\n assert(input[position.position] === '\"')\n\n // 4. Advance position by 1.\n position.position++\n\n // 5. While true:\n while (true) {\n // 1. Append the result of collecting a sequence of code points\n // that are not U+0022 (\") or U+005C (\\) from input, given\n // position, to value.\n value += collectASequenceOfCodePoints(\n (char) => char !== '\"' && char !== '\\\\',\n input,\n position\n )\n\n // 2. If position is past the end of input, then break.\n if (position.position >= input.length) {\n break\n }\n\n // 3. Let quoteOrBackslash be the code point at position within\n // input.\n const quoteOrBackslash = input[position.position]\n\n // 4. Advance position by 1.\n position.position++\n\n // 5. If quoteOrBackslash is U+005C (\\), then:\n if (quoteOrBackslash === '\\\\') {\n // 1. If position is past the end of input, then append\n // U+005C (\\) to value and break.\n if (position.position >= input.length) {\n value += '\\\\'\n break\n }\n\n // 2. Append the code point at position within input to value.\n value += input[position.position]\n\n // 3. Advance position by 1.\n position.position++\n\n // 6. Otherwise:\n } else {\n // 1. Assert: quoteOrBackslash is U+0022 (\").\n assert(quoteOrBackslash === '\"')\n\n // 2. Break.\n break\n }\n }\n\n // 6. If the extract-value flag is set, then return value.\n if (extractValue) {\n return value\n }\n\n // 7. Return the code points from positionStart to position,\n // inclusive, within input.\n return input.slice(positionStart, position.position)\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serializeAMimeType (mimeType) {\n assert(mimeType !== 'failure')\n const { parameters, essence } = mimeType\n\n // 1. Let serialization be the concatenation of mimeType’s\n // type, U+002F (/), and mimeType’s subtype.\n let serialization = essence\n\n // 2. For each name → value of mimeType’s parameters:\n for (let [name, value] of parameters.entries()) {\n // 1. Append U+003B (;) to serialization.\n serialization += ';'\n\n // 2. Append name to serialization.\n serialization += name\n\n // 3. Append U+003D (=) to serialization.\n serialization += '='\n\n // 4. If value does not solely contain HTTP token code\n // points or value is the empty string, then:\n if (!HTTP_TOKEN_CODEPOINTS.test(value)) {\n // 1. Precede each occurence of U+0022 (\") or\n // U+005C (\\) in value with U+005C (\\).\n value = value.replace(/(\\\\|\")/g, '\\\\$1')\n\n // 2. Prepend U+0022 (\") to value.\n value = '\"' + value\n\n // 3. Append U+0022 (\") to value.\n value += '\"'\n }\n\n // 5. Append value to serialization.\n serialization += value\n }\n\n // 3. Return serialization.\n return serialization\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {string} char\n */\nfunction isHTTPWhiteSpace (char) {\n return char === '\\r' || char === '\\n' || char === '\\t' || char === ' '\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {string} str\n */\nfunction removeHTTPWhitespace (str, leading = true, trailing = true) {\n let lead = 0\n let trail = str.length - 1\n\n if (leading) {\n for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);\n }\n\n if (trailing) {\n for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);\n }\n\n return str.slice(lead, trail + 1)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n * @param {string} char\n */\nfunction isASCIIWhitespace (char) {\n return char === '\\r' || char === '\\n' || char === '\\t' || char === '\\f' || char === ' '\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace\n */\nfunction removeASCIIWhitespace (str, leading = true, trailing = true) {\n let lead = 0\n let trail = str.length - 1\n\n if (leading) {\n for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);\n }\n\n if (trailing) {\n for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);\n }\n\n return str.slice(lead, trail + 1)\n}\n\nmodule.exports = {\n dataURLProcessor,\n URLSerializer,\n collectASequenceOfCodePoints,\n collectASequenceOfCodePointsFast,\n stringPercentDecode,\n parseMIMEType,\n collectAnHTTPQuotedString,\n serializeAMimeType\n}\n","'use strict'\n\nconst { Blob, File: NativeFile } = require('buffer')\nconst { types } = require('util')\nconst { kState } = require('./symbols')\nconst { isBlobLike } = require('./util')\nconst { webidl } = require('./webidl')\nconst { parseMIMEType, serializeAMimeType } = require('./dataURL')\nconst { kEnumerableProperty } = require('../core/util')\nconst encoder = new TextEncoder()\n\nclass File extends Blob {\n constructor (fileBits, fileName, options = {}) {\n // The File constructor is invoked with two or three parameters, depending\n // on whether the optional dictionary parameter is used. When the File()\n // constructor is invoked, user agents must run the following steps:\n webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })\n\n fileBits = webidl.converters['sequence'](fileBits)\n fileName = webidl.converters.USVString(fileName)\n options = webidl.converters.FilePropertyBag(options)\n\n // 1. Let bytes be the result of processing blob parts given fileBits and\n // options.\n // Note: Blob handles this for us\n\n // 2. Let n be the fileName argument to the constructor.\n const n = fileName\n\n // 3. Process FilePropertyBag dictionary argument by running the following\n // substeps:\n\n // 1. If the type member is provided and is not the empty string, let t\n // be set to the type dictionary member. If t contains any characters\n // outside the range U+0020 to U+007E, then set t to the empty string\n // and return from these substeps.\n // 2. Convert every character in t to ASCII lowercase.\n let t = options.type\n let d\n\n // eslint-disable-next-line no-labels\n substep: {\n if (t) {\n t = parseMIMEType(t)\n\n if (t === 'failure') {\n t = ''\n // eslint-disable-next-line no-labels\n break substep\n }\n\n t = serializeAMimeType(t).toLowerCase()\n }\n\n // 3. If the lastModified member is provided, let d be set to the\n // lastModified dictionary member. If it is not provided, set d to the\n // current date and time represented as the number of milliseconds since\n // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).\n d = options.lastModified\n }\n\n // 4. Return a new File object F such that:\n // F refers to the bytes byte sequence.\n // F.size is set to the number of total bytes in bytes.\n // F.name is set to n.\n // F.type is set to t.\n // F.lastModified is set to d.\n\n super(processBlobParts(fileBits, options), { type: t })\n this[kState] = {\n name: n,\n lastModified: d,\n type: t\n }\n }\n\n get name () {\n webidl.brandCheck(this, File)\n\n return this[kState].name\n }\n\n get lastModified () {\n webidl.brandCheck(this, File)\n\n return this[kState].lastModified\n }\n\n get type () {\n webidl.brandCheck(this, File)\n\n return this[kState].type\n }\n}\n\nclass FileLike {\n constructor (blobLike, fileName, options = {}) {\n // TODO: argument idl type check\n\n // The File constructor is invoked with two or three parameters, depending\n // on whether the optional dictionary parameter is used. When the File()\n // constructor is invoked, user agents must run the following steps:\n\n // 1. Let bytes be the result of processing blob parts given fileBits and\n // options.\n\n // 2. Let n be the fileName argument to the constructor.\n const n = fileName\n\n // 3. Process FilePropertyBag dictionary argument by running the following\n // substeps:\n\n // 1. If the type member is provided and is not the empty string, let t\n // be set to the type dictionary member. If t contains any characters\n // outside the range U+0020 to U+007E, then set t to the empty string\n // and return from these substeps.\n // TODO\n const t = options.type\n\n // 2. Convert every character in t to ASCII lowercase.\n // TODO\n\n // 3. If the lastModified member is provided, let d be set to the\n // lastModified dictionary member. If it is not provided, set d to the\n // current date and time represented as the number of milliseconds since\n // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).\n const d = options.lastModified ?? Date.now()\n\n // 4. Return a new File object F such that:\n // F refers to the bytes byte sequence.\n // F.size is set to the number of total bytes in bytes.\n // F.name is set to n.\n // F.type is set to t.\n // F.lastModified is set to d.\n\n this[kState] = {\n blobLike,\n name: n,\n type: t,\n lastModified: d\n }\n }\n\n stream (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.stream(...args)\n }\n\n arrayBuffer (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.arrayBuffer(...args)\n }\n\n slice (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.slice(...args)\n }\n\n text (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.text(...args)\n }\n\n get size () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.size\n }\n\n get type () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.type\n }\n\n get name () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].name\n }\n\n get lastModified () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].lastModified\n }\n\n get [Symbol.toStringTag] () {\n return 'File'\n }\n}\n\nObject.defineProperties(File.prototype, {\n [Symbol.toStringTag]: {\n value: 'File',\n configurable: true\n },\n name: kEnumerableProperty,\n lastModified: kEnumerableProperty\n})\n\nwebidl.converters.Blob = webidl.interfaceConverter(Blob)\n\nwebidl.converters.BlobPart = function (V, opts) {\n if (webidl.util.Type(V) === 'Object') {\n if (isBlobLike(V)) {\n return webidl.converters.Blob(V, { strict: false })\n }\n\n if (\n ArrayBuffer.isView(V) ||\n types.isAnyArrayBuffer(V)\n ) {\n return webidl.converters.BufferSource(V, opts)\n }\n }\n\n return webidl.converters.USVString(V, opts)\n}\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.BlobPart\n)\n\n// https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag\nwebidl.converters.FilePropertyBag = webidl.dictionaryConverter([\n {\n key: 'lastModified',\n converter: webidl.converters['long long'],\n get defaultValue () {\n return Date.now()\n }\n },\n {\n key: 'type',\n converter: webidl.converters.DOMString,\n defaultValue: ''\n },\n {\n key: 'endings',\n converter: (value) => {\n value = webidl.converters.DOMString(value)\n value = value.toLowerCase()\n\n if (value !== 'native') {\n value = 'transparent'\n }\n\n return value\n },\n defaultValue: 'transparent'\n }\n])\n\n/**\n * @see https://www.w3.org/TR/FileAPI/#process-blob-parts\n * @param {(NodeJS.TypedArray|Blob|string)[]} parts\n * @param {{ type: string, endings: string }} options\n */\nfunction processBlobParts (parts, options) {\n // 1. Let bytes be an empty sequence of bytes.\n /** @type {NodeJS.TypedArray[]} */\n const bytes = []\n\n // 2. For each element in parts:\n for (const element of parts) {\n // 1. If element is a USVString, run the following substeps:\n if (typeof element === 'string') {\n // 1. Let s be element.\n let s = element\n\n // 2. If the endings member of options is \"native\", set s\n // to the result of converting line endings to native\n // of element.\n if (options.endings === 'native') {\n s = convertLineEndingsNative(s)\n }\n\n // 3. Append the result of UTF-8 encoding s to bytes.\n bytes.push(encoder.encode(s))\n } else if (\n types.isAnyArrayBuffer(element) ||\n types.isTypedArray(element)\n ) {\n // 2. If element is a BufferSource, get a copy of the\n // bytes held by the buffer source, and append those\n // bytes to bytes.\n if (!element.buffer) { // ArrayBuffer\n bytes.push(new Uint8Array(element))\n } else {\n bytes.push(\n new Uint8Array(element.buffer, element.byteOffset, element.byteLength)\n )\n }\n } else if (isBlobLike(element)) {\n // 3. If element is a Blob, append the bytes it represents\n // to bytes.\n bytes.push(element)\n }\n }\n\n // 3. Return bytes.\n return bytes\n}\n\n/**\n * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native\n * @param {string} s\n */\nfunction convertLineEndingsNative (s) {\n // 1. Let native line ending be be the code point U+000A LF.\n let nativeLineEnding = '\\n'\n\n // 2. If the underlying platform’s conventions are to\n // represent newlines as a carriage return and line feed\n // sequence, set native line ending to the code point\n // U+000D CR followed by the code point U+000A LF.\n if (process.platform === 'win32') {\n nativeLineEnding = '\\r\\n'\n }\n\n return s.replace(/\\r?\\n/g, nativeLineEnding)\n}\n\n// If this function is moved to ./util.js, some tools (such as\n// rollup) will warn about circular dependencies. See:\n// https://github.com/nodejs/undici/issues/1629\nfunction isFileLike (object) {\n return (\n (NativeFile && object instanceof NativeFile) ||\n object instanceof File || (\n object &&\n (typeof object.stream === 'function' ||\n typeof object.arrayBuffer === 'function') &&\n object[Symbol.toStringTag] === 'File'\n )\n )\n}\n\nmodule.exports = { File, FileLike, isFileLike }\n","'use strict'\n\nconst { isBlobLike, toUSVString, makeIterator } = require('./util')\nconst { kState } = require('./symbols')\nconst { File: UndiciFile, FileLike, isFileLike } = require('./file')\nconst { webidl } = require('./webidl')\nconst { Blob, File: NativeFile } = require('buffer')\n\n/** @type {globalThis['File']} */\nconst File = NativeFile ?? UndiciFile\n\n// https://xhr.spec.whatwg.org/#formdata\nclass FormData {\n constructor (form) {\n if (form !== undefined) {\n throw webidl.errors.conversionFailed({\n prefix: 'FormData constructor',\n argument: 'Argument 1',\n types: ['undefined']\n })\n }\n\n this[kState] = []\n }\n\n append (name, value, filename = undefined) {\n webidl.brandCheck(this, FormData)\n\n webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })\n\n if (arguments.length === 3 && !isBlobLike(value)) {\n throw new TypeError(\n \"Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'\"\n )\n }\n\n // 1. Let value be value if given; otherwise blobValue.\n\n name = webidl.converters.USVString(name)\n value = isBlobLike(value)\n ? webidl.converters.Blob(value, { strict: false })\n : webidl.converters.USVString(value)\n filename = arguments.length === 3\n ? webidl.converters.USVString(filename)\n : undefined\n\n // 2. Let entry be the result of creating an entry with\n // name, value, and filename if given.\n const entry = makeEntry(name, value, filename)\n\n // 3. Append entry to this’s entry list.\n this[kState].push(entry)\n }\n\n delete (name) {\n webidl.brandCheck(this, FormData)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })\n\n name = webidl.converters.USVString(name)\n\n // The delete(name) method steps are to remove all entries whose name\n // is name from this’s entry list.\n this[kState] = this[kState].filter(entry => entry.name !== name)\n }\n\n get (name) {\n webidl.brandCheck(this, FormData)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })\n\n name = webidl.converters.USVString(name)\n\n // 1. If there is no entry whose name is name in this’s entry list,\n // then return null.\n const idx = this[kState].findIndex((entry) => entry.name === name)\n if (idx === -1) {\n return null\n }\n\n // 2. Return the value of the first entry whose name is name from\n // this’s entry list.\n return this[kState][idx].value\n }\n\n getAll (name) {\n webidl.brandCheck(this, FormData)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })\n\n name = webidl.converters.USVString(name)\n\n // 1. If there is no entry whose name is name in this’s entry list,\n // then return the empty list.\n // 2. Return the values of all entries whose name is name, in order,\n // from this’s entry list.\n return this[kState]\n .filter((entry) => entry.name === name)\n .map((entry) => entry.value)\n }\n\n has (name) {\n webidl.brandCheck(this, FormData)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })\n\n name = webidl.converters.USVString(name)\n\n // The has(name) method steps are to return true if there is an entry\n // whose name is name in this’s entry list; otherwise false.\n return this[kState].findIndex((entry) => entry.name === name) !== -1\n }\n\n set (name, value, filename = undefined) {\n webidl.brandCheck(this, FormData)\n\n webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })\n\n if (arguments.length === 3 && !isBlobLike(value)) {\n throw new TypeError(\n \"Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'\"\n )\n }\n\n // The set(name, value) and set(name, blobValue, filename) method steps\n // are:\n\n // 1. Let value be value if given; otherwise blobValue.\n\n name = webidl.converters.USVString(name)\n value = isBlobLike(value)\n ? webidl.converters.Blob(value, { strict: false })\n : webidl.converters.USVString(value)\n filename = arguments.length === 3\n ? toUSVString(filename)\n : undefined\n\n // 2. Let entry be the result of creating an entry with name, value, and\n // filename if given.\n const entry = makeEntry(name, value, filename)\n\n // 3. If there are entries in this’s entry list whose name is name, then\n // replace the first such entry with entry and remove the others.\n const idx = this[kState].findIndex((entry) => entry.name === name)\n if (idx !== -1) {\n this[kState] = [\n ...this[kState].slice(0, idx),\n entry,\n ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)\n ]\n } else {\n // 4. Otherwise, append entry to this’s entry list.\n this[kState].push(entry)\n }\n }\n\n entries () {\n webidl.brandCheck(this, FormData)\n\n return makeIterator(\n () => this[kState].map(pair => [pair.name, pair.value]),\n 'FormData',\n 'key+value'\n )\n }\n\n keys () {\n webidl.brandCheck(this, FormData)\n\n return makeIterator(\n () => this[kState].map(pair => [pair.name, pair.value]),\n 'FormData',\n 'key'\n )\n }\n\n values () {\n webidl.brandCheck(this, FormData)\n\n return makeIterator(\n () => this[kState].map(pair => [pair.name, pair.value]),\n 'FormData',\n 'value'\n )\n }\n\n /**\n * @param {(value: string, key: string, self: FormData) => void} callbackFn\n * @param {unknown} thisArg\n */\n forEach (callbackFn, thisArg = globalThis) {\n webidl.brandCheck(this, FormData)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })\n\n if (typeof callbackFn !== 'function') {\n throw new TypeError(\n \"Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'.\"\n )\n }\n\n for (const [key, value] of this) {\n callbackFn.apply(thisArg, [value, key, this])\n }\n }\n}\n\nFormData.prototype[Symbol.iterator] = FormData.prototype.entries\n\nObject.defineProperties(FormData.prototype, {\n [Symbol.toStringTag]: {\n value: 'FormData',\n configurable: true\n }\n})\n\n/**\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry\n * @param {string} name\n * @param {string|Blob} value\n * @param {?string} filename\n * @returns\n */\nfunction makeEntry (name, value, filename) {\n // 1. Set name to the result of converting name into a scalar value string.\n // \"To convert a string into a scalar value string, replace any surrogates\n // with U+FFFD.\"\n // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end\n name = Buffer.from(name).toString('utf8')\n\n // 2. If value is a string, then set value to the result of converting\n // value into a scalar value string.\n if (typeof value === 'string') {\n value = Buffer.from(value).toString('utf8')\n } else {\n // 3. Otherwise:\n\n // 1. If value is not a File object, then set value to a new File object,\n // representing the same bytes, whose name attribute value is \"blob\"\n if (!isFileLike(value)) {\n value = value instanceof Blob\n ? new File([value], 'blob', { type: value.type })\n : new FileLike(value, 'blob', { type: value.type })\n }\n\n // 2. If filename is given, then set value to a new File object,\n // representing the same bytes, whose name attribute is filename.\n if (filename !== undefined) {\n /** @type {FilePropertyBag} */\n const options = {\n type: value.type,\n lastModified: value.lastModified\n }\n\n value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile\n ? new File([value], filename, options)\n : new FileLike(value, filename, options)\n }\n }\n\n // 4. Return an entry whose name is name and whose value is value.\n return { name, value }\n}\n\nmodule.exports = { FormData }\n","'use strict'\n\nconst Busboy = require('@fastify/busboy')\nconst util = require('../core/util')\nconst {\n ReadableStreamFrom,\n isBlobLike,\n isReadableStreamLike,\n readableStreamClose,\n createDeferredPromise,\n fullyReadBody\n} = require('./util')\nconst { FormData } = require('./formdata')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { DOMException, structuredClone } = require('./constants')\nconst { Blob, File: NativeFile } = require('buffer')\nconst { kBodyUsed } = require('../core/symbols')\nconst assert = require('assert')\nconst { isErrored } = require('../core/util')\nconst { isUint8Array, isArrayBuffer } = require('util/types')\nconst { File: UndiciFile } = require('./file')\nconst { parseMIMEType, serializeAMimeType } = require('./dataURL')\n\nlet random\ntry {\n const crypto = require('node:crypto')\n random = (max) => crypto.randomInt(0, max)\n} catch {\n random = (max) => Math.floor(Math.random(max))\n}\n\nlet ReadableStream = globalThis.ReadableStream\n\n/** @type {globalThis['File']} */\nconst File = NativeFile ?? UndiciFile\nconst textEncoder = new TextEncoder()\nconst textDecoder = new TextDecoder()\n\n// https://fetch.spec.whatwg.org/#concept-bodyinit-extract\nfunction extractBody (object, keepalive = false) {\n if (!ReadableStream) {\n ReadableStream = require('stream/web').ReadableStream\n }\n\n // 1. Let stream be null.\n let stream = null\n\n // 2. If object is a ReadableStream object, then set stream to object.\n if (object instanceof ReadableStream) {\n stream = object\n } else if (isBlobLike(object)) {\n // 3. Otherwise, if object is a Blob object, set stream to the\n // result of running object’s get stream.\n stream = object.stream()\n } else {\n // 4. Otherwise, set stream to a new ReadableStream object, and set\n // up stream.\n stream = new ReadableStream({\n async pull (controller) {\n controller.enqueue(\n typeof source === 'string' ? textEncoder.encode(source) : source\n )\n queueMicrotask(() => readableStreamClose(controller))\n },\n start () {},\n type: undefined\n })\n }\n\n // 5. Assert: stream is a ReadableStream object.\n assert(isReadableStreamLike(stream))\n\n // 6. Let action be null.\n let action = null\n\n // 7. Let source be null.\n let source = null\n\n // 8. Let length be null.\n let length = null\n\n // 9. Let type be null.\n let type = null\n\n // 10. Switch on object:\n if (typeof object === 'string') {\n // Set source to the UTF-8 encoding of object.\n // Note: setting source to a Uint8Array here breaks some mocking assumptions.\n source = object\n\n // Set type to `text/plain;charset=UTF-8`.\n type = 'text/plain;charset=UTF-8'\n } else if (object instanceof URLSearchParams) {\n // URLSearchParams\n\n // spec says to run application/x-www-form-urlencoded on body.list\n // this is implemented in Node.js as apart of an URLSearchParams instance toString method\n // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490\n // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100\n\n // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.\n source = object.toString()\n\n // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.\n type = 'application/x-www-form-urlencoded;charset=UTF-8'\n } else if (isArrayBuffer(object)) {\n // BufferSource/ArrayBuffer\n\n // Set source to a copy of the bytes held by object.\n source = new Uint8Array(object.slice())\n } else if (ArrayBuffer.isView(object)) {\n // BufferSource/ArrayBufferView\n\n // Set source to a copy of the bytes held by object.\n source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))\n } else if (util.isFormDataLike(object)) {\n const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`\n const prefix = `--${boundary}\\r\\nContent-Disposition: form-data`\n\n /*! formdata-polyfill. MIT License. Jimmy Wärting */\n const escape = (str) =>\n str.replace(/\\n/g, '%0A').replace(/\\r/g, '%0D').replace(/\"/g, '%22')\n const normalizeLinefeeds = (value) => value.replace(/\\r?\\n|\\r/g, '\\r\\n')\n\n // Set action to this step: run the multipart/form-data\n // encoding algorithm, with object’s entry list and UTF-8.\n // - This ensures that the body is immutable and can't be changed afterwords\n // - That the content-length is calculated in advance.\n // - And that all parts are pre-encoded and ready to be sent.\n\n const blobParts = []\n const rn = new Uint8Array([13, 10]) // '\\r\\n'\n length = 0\n let hasUnknownSizeValue = false\n\n for (const [name, value] of object) {\n if (typeof value === 'string') {\n const chunk = textEncoder.encode(prefix +\n `; name=\"${escape(normalizeLinefeeds(name))}\"` +\n `\\r\\n\\r\\n${normalizeLinefeeds(value)}\\r\\n`)\n blobParts.push(chunk)\n length += chunk.byteLength\n } else {\n const chunk = textEncoder.encode(`${prefix}; name=\"${escape(normalizeLinefeeds(name))}\"` +\n (value.name ? `; filename=\"${escape(value.name)}\"` : '') + '\\r\\n' +\n `Content-Type: ${\n value.type || 'application/octet-stream'\n }\\r\\n\\r\\n`)\n blobParts.push(chunk, value, rn)\n if (typeof value.size === 'number') {\n length += chunk.byteLength + value.size + rn.byteLength\n } else {\n hasUnknownSizeValue = true\n }\n }\n }\n\n const chunk = textEncoder.encode(`--${boundary}--`)\n blobParts.push(chunk)\n length += chunk.byteLength\n if (hasUnknownSizeValue) {\n length = null\n }\n\n // Set source to object.\n source = object\n\n action = async function * () {\n for (const part of blobParts) {\n if (part.stream) {\n yield * part.stream()\n } else {\n yield part\n }\n }\n }\n\n // Set type to `multipart/form-data; boundary=`,\n // followed by the multipart/form-data boundary string generated\n // by the multipart/form-data encoding algorithm.\n type = 'multipart/form-data; boundary=' + boundary\n } else if (isBlobLike(object)) {\n // Blob\n\n // Set source to object.\n source = object\n\n // Set length to object’s size.\n length = object.size\n\n // If object’s type attribute is not the empty byte sequence, set\n // type to its value.\n if (object.type) {\n type = object.type\n }\n } else if (typeof object[Symbol.asyncIterator] === 'function') {\n // If keepalive is true, then throw a TypeError.\n if (keepalive) {\n throw new TypeError('keepalive')\n }\n\n // If object is disturbed or locked, then throw a TypeError.\n if (util.isDisturbed(object) || object.locked) {\n throw new TypeError(\n 'Response body object should not be disturbed or locked'\n )\n }\n\n stream =\n object instanceof ReadableStream ? object : ReadableStreamFrom(object)\n }\n\n // 11. If source is a byte sequence, then set action to a\n // step that returns source and length to source’s length.\n if (typeof source === 'string' || util.isBuffer(source)) {\n length = Buffer.byteLength(source)\n }\n\n // 12. If action is non-null, then run these steps in in parallel:\n if (action != null) {\n // Run action.\n let iterator\n stream = new ReadableStream({\n async start () {\n iterator = action(object)[Symbol.asyncIterator]()\n },\n async pull (controller) {\n const { value, done } = await iterator.next()\n if (done) {\n // When running action is done, close stream.\n queueMicrotask(() => {\n controller.close()\n })\n } else {\n // Whenever one or more bytes are available and stream is not errored,\n // enqueue a Uint8Array wrapping an ArrayBuffer containing the available\n // bytes into stream.\n if (!isErrored(stream)) {\n controller.enqueue(new Uint8Array(value))\n }\n }\n return controller.desiredSize > 0\n },\n async cancel (reason) {\n await iterator.return()\n },\n type: undefined\n })\n }\n\n // 13. Let body be a body whose stream is stream, source is source,\n // and length is length.\n const body = { stream, source, length }\n\n // 14. Return (body, type).\n return [body, type]\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit-safely-extract\nfunction safelyExtractBody (object, keepalive = false) {\n if (!ReadableStream) {\n // istanbul ignore next\n ReadableStream = require('stream/web').ReadableStream\n }\n\n // To safely extract a body and a `Content-Type` value from\n // a byte sequence or BodyInit object object, run these steps:\n\n // 1. If object is a ReadableStream object, then:\n if (object instanceof ReadableStream) {\n // Assert: object is neither disturbed nor locked.\n // istanbul ignore next\n assert(!util.isDisturbed(object), 'The body has already been consumed.')\n // istanbul ignore next\n assert(!object.locked, 'The stream is locked.')\n }\n\n // 2. Return the results of extracting object.\n return extractBody(object, keepalive)\n}\n\nfunction cloneBody (body) {\n // To clone a body body, run these steps:\n\n // https://fetch.spec.whatwg.org/#concept-body-clone\n\n // 1. Let « out1, out2 » be the result of teeing body’s stream.\n const [out1, out2] = body.stream.tee()\n const out2Clone = structuredClone(out2, { transfer: [out2] })\n // This, for whatever reasons, unrefs out2Clone which allows\n // the process to exit by itself.\n const [, finalClone] = out2Clone.tee()\n\n // 2. Set body’s stream to out1.\n body.stream = out1\n\n // 3. Return a body whose stream is out2 and other members are copied from body.\n return {\n stream: finalClone,\n length: body.length,\n source: body.source\n }\n}\n\nasync function * consumeBody (body) {\n if (body) {\n if (isUint8Array(body)) {\n yield body\n } else {\n const stream = body.stream\n\n if (util.isDisturbed(stream)) {\n throw new TypeError('The body has already been consumed.')\n }\n\n if (stream.locked) {\n throw new TypeError('The stream is locked.')\n }\n\n // Compat.\n stream[kBodyUsed] = true\n\n yield * stream\n }\n }\n}\n\nfunction throwIfAborted (state) {\n if (state.aborted) {\n throw new DOMException('The operation was aborted.', 'AbortError')\n }\n}\n\nfunction bodyMixinMethods (instance) {\n const methods = {\n blob () {\n // The blob() method steps are to return the result of\n // running consume body with this and the following step\n // given a byte sequence bytes: return a Blob whose\n // contents are bytes and whose type attribute is this’s\n // MIME type.\n return specConsumeBody(this, (bytes) => {\n let mimeType = bodyMimeType(this)\n\n if (mimeType === 'failure') {\n mimeType = ''\n } else if (mimeType) {\n mimeType = serializeAMimeType(mimeType)\n }\n\n // Return a Blob whose contents are bytes and type attribute\n // is mimeType.\n return new Blob([bytes], { type: mimeType })\n }, instance)\n },\n\n arrayBuffer () {\n // The arrayBuffer() method steps are to return the result\n // of running consume body with this and the following step\n // given a byte sequence bytes: return a new ArrayBuffer\n // whose contents are bytes.\n return specConsumeBody(this, (bytes) => {\n return new Uint8Array(bytes).buffer\n }, instance)\n },\n\n text () {\n // The text() method steps are to return the result of running\n // consume body with this and UTF-8 decode.\n return specConsumeBody(this, utf8DecodeBytes, instance)\n },\n\n json () {\n // The json() method steps are to return the result of running\n // consume body with this and parse JSON from bytes.\n return specConsumeBody(this, parseJSONFromBytes, instance)\n },\n\n async formData () {\n webidl.brandCheck(this, instance)\n\n throwIfAborted(this[kState])\n\n const contentType = this.headers.get('Content-Type')\n\n // If mimeType’s essence is \"multipart/form-data\", then:\n if (/multipart\\/form-data/.test(contentType)) {\n const headers = {}\n for (const [key, value] of this.headers) headers[key.toLowerCase()] = value\n\n const responseFormData = new FormData()\n\n let busboy\n\n try {\n busboy = new Busboy({\n headers,\n preservePath: true\n })\n } catch (err) {\n throw new DOMException(`${err}`, 'AbortError')\n }\n\n busboy.on('field', (name, value) => {\n responseFormData.append(name, value)\n })\n busboy.on('file', (name, value, filename, encoding, mimeType) => {\n const chunks = []\n\n if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {\n let base64chunk = ''\n\n value.on('data', (chunk) => {\n base64chunk += chunk.toString().replace(/[\\r\\n]/gm, '')\n\n const end = base64chunk.length - base64chunk.length % 4\n chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))\n\n base64chunk = base64chunk.slice(end)\n })\n value.on('end', () => {\n chunks.push(Buffer.from(base64chunk, 'base64'))\n responseFormData.append(name, new File(chunks, filename, { type: mimeType }))\n })\n } else {\n value.on('data', (chunk) => {\n chunks.push(chunk)\n })\n value.on('end', () => {\n responseFormData.append(name, new File(chunks, filename, { type: mimeType }))\n })\n }\n })\n\n const busboyResolve = new Promise((resolve, reject) => {\n busboy.on('finish', resolve)\n busboy.on('error', (err) => reject(new TypeError(err)))\n })\n\n if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)\n busboy.end()\n await busboyResolve\n\n return responseFormData\n } else if (/application\\/x-www-form-urlencoded/.test(contentType)) {\n // Otherwise, if mimeType’s essence is \"application/x-www-form-urlencoded\", then:\n\n // 1. Let entries be the result of parsing bytes.\n let entries\n try {\n let text = ''\n // application/x-www-form-urlencoded parser will keep the BOM.\n // https://url.spec.whatwg.org/#concept-urlencoded-parser\n // Note that streaming decoder is stateful and cannot be reused\n const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })\n\n for await (const chunk of consumeBody(this[kState].body)) {\n if (!isUint8Array(chunk)) {\n throw new TypeError('Expected Uint8Array chunk')\n }\n text += streamingDecoder.decode(chunk, { stream: true })\n }\n text += streamingDecoder.decode()\n entries = new URLSearchParams(text)\n } catch (err) {\n // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.\n // 2. If entries is failure, then throw a TypeError.\n throw Object.assign(new TypeError(), { cause: err })\n }\n\n // 3. Return a new FormData object whose entries are entries.\n const formData = new FormData()\n for (const [name, value] of entries) {\n formData.append(name, value)\n }\n return formData\n } else {\n // Wait a tick before checking if the request has been aborted.\n // Otherwise, a TypeError can be thrown when an AbortError should.\n await Promise.resolve()\n\n throwIfAborted(this[kState])\n\n // Otherwise, throw a TypeError.\n throw webidl.errors.exception({\n header: `${instance.name}.formData`,\n message: 'Could not parse content as FormData.'\n })\n }\n }\n }\n\n return methods\n}\n\nfunction mixinBody (prototype) {\n Object.assign(prototype.prototype, bodyMixinMethods(prototype))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-consume-body\n * @param {Response|Request} object\n * @param {(value: unknown) => unknown} convertBytesToJSValue\n * @param {Response|Request} instance\n */\nasync function specConsumeBody (object, convertBytesToJSValue, instance) {\n webidl.brandCheck(object, instance)\n\n throwIfAborted(object[kState])\n\n // 1. If object is unusable, then return a promise rejected\n // with a TypeError.\n if (bodyUnusable(object[kState].body)) {\n throw new TypeError('Body is unusable')\n }\n\n // 2. Let promise be a new promise.\n const promise = createDeferredPromise()\n\n // 3. Let errorSteps given error be to reject promise with error.\n const errorSteps = (error) => promise.reject(error)\n\n // 4. Let successSteps given a byte sequence data be to resolve\n // promise with the result of running convertBytesToJSValue\n // with data. If that threw an exception, then run errorSteps\n // with that exception.\n const successSteps = (data) => {\n try {\n promise.resolve(convertBytesToJSValue(data))\n } catch (e) {\n errorSteps(e)\n }\n }\n\n // 5. If object’s body is null, then run successSteps with an\n // empty byte sequence.\n if (object[kState].body == null) {\n successSteps(new Uint8Array())\n return promise.promise\n }\n\n // 6. Otherwise, fully read object’s body given successSteps,\n // errorSteps, and object’s relevant global object.\n await fullyReadBody(object[kState].body, successSteps, errorSteps)\n\n // 7. Return promise.\n return promise.promise\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction bodyUnusable (body) {\n // An object including the Body interface mixin is\n // said to be unusable if its body is non-null and\n // its body’s stream is disturbed or locked.\n return body != null && (body.stream.locked || util.isDisturbed(body.stream))\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#utf-8-decode\n * @param {Buffer} buffer\n */\nfunction utf8DecodeBytes (buffer) {\n if (buffer.length === 0) {\n return ''\n }\n\n // 1. Let buffer be the result of peeking three bytes from\n // ioQueue, converted to a byte sequence.\n\n // 2. If buffer is 0xEF 0xBB 0xBF, then read three\n // bytes from ioQueue. (Do nothing with those bytes.)\n if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {\n buffer = buffer.subarray(3)\n }\n\n // 3. Process a queue with an instance of UTF-8’s\n // decoder, ioQueue, output, and \"replacement\".\n const output = textDecoder.decode(buffer)\n\n // 4. Return output.\n return output\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value\n * @param {Uint8Array} bytes\n */\nfunction parseJSONFromBytes (bytes) {\n return JSON.parse(utf8DecodeBytes(bytes))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-mime-type\n * @param {import('./response').Response|import('./request').Request} object\n */\nfunction bodyMimeType (object) {\n const { headersList } = object[kState]\n const contentType = headersList.get('content-type')\n\n if (contentType === null) {\n return 'failure'\n }\n\n return parseMIMEType(contentType)\n}\n\nmodule.exports = {\n extractBody,\n safelyExtractBody,\n cloneBody,\n mixinBody\n}\n","'use strict'\n\nconst {\n InvalidArgumentError,\n NotSupportedError\n} = require('./errors')\nconst assert = require('assert')\nconst { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = require('./symbols')\nconst util = require('./util')\n\n// tokenRegExp and headerCharRegex have been lifted from\n// https://github.com/nodejs/node/blob/main/lib/_http_common.js\n\n/**\n * Verifies that the given val is a valid HTTP token\n * per the rules defined in RFC 7230\n * See https://tools.ietf.org/html/rfc7230#section-3.2.6\n */\nconst tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/\n\n/**\n * Matches if val contains an invalid field-vchar\n * field-value = *( field-content / obs-fold )\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n */\nconst headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/\n\n// Verifies that a given path is valid does not contain control chars \\x00 to \\x20\nconst invalidPathRegex = /[^\\u0021-\\u00ff]/\n\nconst kHandler = Symbol('handler')\n\nconst channels = {}\n\nlet extractBody\n\ntry {\n const diagnosticsChannel = require('diagnostics_channel')\n channels.create = diagnosticsChannel.channel('undici:request:create')\n channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')\n channels.headers = diagnosticsChannel.channel('undici:request:headers')\n channels.trailers = diagnosticsChannel.channel('undici:request:trailers')\n channels.error = diagnosticsChannel.channel('undici:request:error')\n} catch {\n channels.create = { hasSubscribers: false }\n channels.bodySent = { hasSubscribers: false }\n channels.headers = { hasSubscribers: false }\n channels.trailers = { hasSubscribers: false }\n channels.error = { hasSubscribers: false }\n}\n\nclass Request {\n constructor (origin, {\n path,\n method,\n body,\n headers,\n query,\n idempotent,\n blocking,\n upgrade,\n headersTimeout,\n bodyTimeout,\n reset,\n throwOnError,\n expectContinue\n }, handler) {\n if (typeof path !== 'string') {\n throw new InvalidArgumentError('path must be a string')\n } else if (\n path[0] !== '/' &&\n !(path.startsWith('http://') || path.startsWith('https://')) &&\n method !== 'CONNECT'\n ) {\n throw new InvalidArgumentError('path must be an absolute URL or start with a slash')\n } else if (invalidPathRegex.exec(path) !== null) {\n throw new InvalidArgumentError('invalid request path')\n }\n\n if (typeof method !== 'string') {\n throw new InvalidArgumentError('method must be a string')\n } else if (tokenRegExp.exec(method) === null) {\n throw new InvalidArgumentError('invalid request method')\n }\n\n if (upgrade && typeof upgrade !== 'string') {\n throw new InvalidArgumentError('upgrade must be a string')\n }\n\n if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {\n throw new InvalidArgumentError('invalid headersTimeout')\n }\n\n if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {\n throw new InvalidArgumentError('invalid bodyTimeout')\n }\n\n if (reset != null && typeof reset !== 'boolean') {\n throw new InvalidArgumentError('invalid reset')\n }\n\n if (expectContinue != null && typeof expectContinue !== 'boolean') {\n throw new InvalidArgumentError('invalid expectContinue')\n }\n\n this.headersTimeout = headersTimeout\n\n this.bodyTimeout = bodyTimeout\n\n this.throwOnError = throwOnError === true\n\n this.method = method\n\n this.abort = null\n\n if (body == null) {\n this.body = null\n } else if (util.isStream(body)) {\n this.body = body\n\n const rState = this.body._readableState\n if (!rState || !rState.autoDestroy) {\n this.endHandler = function autoDestroy () {\n util.destroy(this)\n }\n this.body.on('end', this.endHandler)\n }\n\n this.errorHandler = err => {\n if (this.abort) {\n this.abort(err)\n } else {\n this.error = err\n }\n }\n this.body.on('error', this.errorHandler)\n } else if (util.isBuffer(body)) {\n this.body = body.byteLength ? body : null\n } else if (ArrayBuffer.isView(body)) {\n this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null\n } else if (body instanceof ArrayBuffer) {\n this.body = body.byteLength ? Buffer.from(body) : null\n } else if (typeof body === 'string') {\n this.body = body.length ? Buffer.from(body) : null\n } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {\n this.body = body\n } else {\n throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')\n }\n\n this.completed = false\n\n this.aborted = false\n\n this.upgrade = upgrade || null\n\n this.path = query ? util.buildURL(path, query) : path\n\n this.origin = origin\n\n this.idempotent = idempotent == null\n ? method === 'HEAD' || method === 'GET'\n : idempotent\n\n this.blocking = blocking == null ? false : blocking\n\n this.reset = reset == null ? null : reset\n\n this.host = null\n\n this.contentLength = null\n\n this.contentType = null\n\n this.headers = ''\n\n // Only for H2\n this.expectContinue = expectContinue != null ? expectContinue : false\n\n if (Array.isArray(headers)) {\n if (headers.length % 2 !== 0) {\n throw new InvalidArgumentError('headers array must be even')\n }\n for (let i = 0; i < headers.length; i += 2) {\n processHeader(this, headers[i], headers[i + 1])\n }\n } else if (headers && typeof headers === 'object') {\n const keys = Object.keys(headers)\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n processHeader(this, key, headers[key])\n }\n } else if (headers != null) {\n throw new InvalidArgumentError('headers must be an object or an array')\n }\n\n if (util.isFormDataLike(this.body)) {\n if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {\n throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')\n }\n\n if (!extractBody) {\n extractBody = require('../fetch/body.js').extractBody\n }\n\n const [bodyStream, contentType] = extractBody(body)\n if (this.contentType == null) {\n this.contentType = contentType\n this.headers += `content-type: ${contentType}\\r\\n`\n }\n this.body = bodyStream.stream\n this.contentLength = bodyStream.length\n } else if (util.isBlobLike(body) && this.contentType == null && body.type) {\n this.contentType = body.type\n this.headers += `content-type: ${body.type}\\r\\n`\n }\n\n util.validateHandler(handler, method, upgrade)\n\n this.servername = util.getServerName(this.host)\n\n this[kHandler] = handler\n\n if (channels.create.hasSubscribers) {\n channels.create.publish({ request: this })\n }\n }\n\n onBodySent (chunk) {\n if (this[kHandler].onBodySent) {\n try {\n return this[kHandler].onBodySent(chunk)\n } catch (err) {\n this.abort(err)\n }\n }\n }\n\n onRequestSent () {\n if (channels.bodySent.hasSubscribers) {\n channels.bodySent.publish({ request: this })\n }\n\n if (this[kHandler].onRequestSent) {\n try {\n return this[kHandler].onRequestSent()\n } catch (err) {\n this.abort(err)\n }\n }\n }\n\n onConnect (abort) {\n assert(!this.aborted)\n assert(!this.completed)\n\n if (this.error) {\n abort(this.error)\n } else {\n this.abort = abort\n return this[kHandler].onConnect(abort)\n }\n }\n\n onHeaders (statusCode, headers, resume, statusText) {\n assert(!this.aborted)\n assert(!this.completed)\n\n if (channels.headers.hasSubscribers) {\n channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })\n }\n\n try {\n return this[kHandler].onHeaders(statusCode, headers, resume, statusText)\n } catch (err) {\n this.abort(err)\n }\n }\n\n onData (chunk) {\n assert(!this.aborted)\n assert(!this.completed)\n\n try {\n return this[kHandler].onData(chunk)\n } catch (err) {\n this.abort(err)\n return false\n }\n }\n\n onUpgrade (statusCode, headers, socket) {\n assert(!this.aborted)\n assert(!this.completed)\n\n return this[kHandler].onUpgrade(statusCode, headers, socket)\n }\n\n onComplete (trailers) {\n this.onFinally()\n\n assert(!this.aborted)\n\n this.completed = true\n if (channels.trailers.hasSubscribers) {\n channels.trailers.publish({ request: this, trailers })\n }\n\n try {\n return this[kHandler].onComplete(trailers)\n } catch (err) {\n // TODO (fix): This might be a bad idea?\n this.onError(err)\n }\n }\n\n onError (error) {\n this.onFinally()\n\n if (channels.error.hasSubscribers) {\n channels.error.publish({ request: this, error })\n }\n\n if (this.aborted) {\n return\n }\n this.aborted = true\n\n return this[kHandler].onError(error)\n }\n\n onFinally () {\n if (this.errorHandler) {\n this.body.off('error', this.errorHandler)\n this.errorHandler = null\n }\n\n if (this.endHandler) {\n this.body.off('end', this.endHandler)\n this.endHandler = null\n }\n }\n\n // TODO: adjust to support H2\n addHeader (key, value) {\n processHeader(this, key, value)\n return this\n }\n\n static [kHTTP1BuildRequest] (origin, opts, handler) {\n // TODO: Migrate header parsing here, to make Requests\n // HTTP agnostic\n return new Request(origin, opts, handler)\n }\n\n static [kHTTP2BuildRequest] (origin, opts, handler) {\n const headers = opts.headers\n opts = { ...opts, headers: null }\n\n const request = new Request(origin, opts, handler)\n\n request.headers = {}\n\n if (Array.isArray(headers)) {\n if (headers.length % 2 !== 0) {\n throw new InvalidArgumentError('headers array must be even')\n }\n for (let i = 0; i < headers.length; i += 2) {\n processHeader(request, headers[i], headers[i + 1], true)\n }\n } else if (headers && typeof headers === 'object') {\n const keys = Object.keys(headers)\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n processHeader(request, key, headers[key], true)\n }\n } else if (headers != null) {\n throw new InvalidArgumentError('headers must be an object or an array')\n }\n\n return request\n }\n\n static [kHTTP2CopyHeaders] (raw) {\n const rawHeaders = raw.split('\\r\\n')\n const headers = {}\n\n for (const header of rawHeaders) {\n const [key, value] = header.split(': ')\n\n if (value == null || value.length === 0) continue\n\n if (headers[key]) headers[key] += `,${value}`\n else headers[key] = value\n }\n\n return headers\n }\n}\n\nfunction processHeaderValue (key, val, skipAppend) {\n if (val && typeof val === 'object') {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\n\n val = val != null ? `${val}` : ''\n\n if (headerCharRegex.exec(val) !== null) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\n\n return skipAppend ? val : `${key}: ${val}\\r\\n`\n}\n\nfunction processHeader (request, key, val, skipAppend = false) {\n if (val && (typeof val === 'object' && !Array.isArray(val))) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n } else if (val === undefined) {\n return\n }\n\n if (\n request.host === null &&\n key.length === 4 &&\n key.toLowerCase() === 'host'\n ) {\n if (headerCharRegex.exec(val) !== null) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\n // Consumed by Client\n request.host = val\n } else if (\n request.contentLength === null &&\n key.length === 14 &&\n key.toLowerCase() === 'content-length'\n ) {\n request.contentLength = parseInt(val, 10)\n if (!Number.isFinite(request.contentLength)) {\n throw new InvalidArgumentError('invalid content-length header')\n }\n } else if (\n request.contentType === null &&\n key.length === 12 &&\n key.toLowerCase() === 'content-type'\n ) {\n request.contentType = val\n if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)\n else request.headers += processHeaderValue(key, val)\n } else if (\n key.length === 17 &&\n key.toLowerCase() === 'transfer-encoding'\n ) {\n throw new InvalidArgumentError('invalid transfer-encoding header')\n } else if (\n key.length === 10 &&\n key.toLowerCase() === 'connection'\n ) {\n const value = typeof val === 'string' ? val.toLowerCase() : null\n if (value !== 'close' && value !== 'keep-alive') {\n throw new InvalidArgumentError('invalid connection header')\n } else if (value === 'close') {\n request.reset = true\n }\n } else if (\n key.length === 10 &&\n key.toLowerCase() === 'keep-alive'\n ) {\n throw new InvalidArgumentError('invalid keep-alive header')\n } else if (\n key.length === 7 &&\n key.toLowerCase() === 'upgrade'\n ) {\n throw new InvalidArgumentError('invalid upgrade header')\n } else if (\n key.length === 6 &&\n key.toLowerCase() === 'expect'\n ) {\n throw new NotSupportedError('expect header not supported')\n } else if (tokenRegExp.exec(key) === null) {\n throw new InvalidArgumentError('invalid header key')\n } else {\n if (Array.isArray(val)) {\n for (let i = 0; i < val.length; i++) {\n if (skipAppend) {\n if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`\n else request.headers[key] = processHeaderValue(key, val[i], skipAppend)\n } else {\n request.headers += processHeaderValue(key, val[i])\n }\n }\n } else {\n if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)\n else request.headers += processHeaderValue(key, val)\n }\n }\n}\n\nmodule.exports = Request\n","'use strict'\n\nconst EventEmitter = require('events')\n\nclass Dispatcher extends EventEmitter {\n dispatch () {\n throw new Error('not implemented')\n }\n\n close () {\n throw new Error('not implemented')\n }\n\n destroy () {\n throw new Error('not implemented')\n }\n}\n\nmodule.exports = Dispatcher\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst {\n ClientDestroyedError,\n ClientClosedError,\n InvalidArgumentError\n} = require('./core/errors')\nconst { kDestroy, kClose, kDispatch, kInterceptors } = require('./core/symbols')\n\nconst kDestroyed = Symbol('destroyed')\nconst kClosed = Symbol('closed')\nconst kOnDestroyed = Symbol('onDestroyed')\nconst kOnClosed = Symbol('onClosed')\nconst kInterceptedDispatch = Symbol('Intercepted Dispatch')\n\nclass DispatcherBase extends Dispatcher {\n constructor () {\n super()\n\n this[kDestroyed] = false\n this[kOnDestroyed] = null\n this[kClosed] = false\n this[kOnClosed] = []\n }\n\n get destroyed () {\n return this[kDestroyed]\n }\n\n get closed () {\n return this[kClosed]\n }\n\n get interceptors () {\n return this[kInterceptors]\n }\n\n set interceptors (newInterceptors) {\n if (newInterceptors) {\n for (let i = newInterceptors.length - 1; i >= 0; i--) {\n const interceptor = this[kInterceptors][i]\n if (typeof interceptor !== 'function') {\n throw new InvalidArgumentError('interceptor must be an function')\n }\n }\n }\n\n this[kInterceptors] = newInterceptors\n }\n\n close (callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n this.close((err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (this[kDestroyed]) {\n queueMicrotask(() => callback(new ClientDestroyedError(), null))\n return\n }\n\n if (this[kClosed]) {\n if (this[kOnClosed]) {\n this[kOnClosed].push(callback)\n } else {\n queueMicrotask(() => callback(null, null))\n }\n return\n }\n\n this[kClosed] = true\n this[kOnClosed].push(callback)\n\n const onClosed = () => {\n const callbacks = this[kOnClosed]\n this[kOnClosed] = null\n for (let i = 0; i < callbacks.length; i++) {\n callbacks[i](null, null)\n }\n }\n\n // Should not error.\n this[kClose]()\n .then(() => this.destroy())\n .then(() => {\n queueMicrotask(onClosed)\n })\n }\n\n destroy (err, callback) {\n if (typeof err === 'function') {\n callback = err\n err = null\n }\n\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n this.destroy(err, (err, data) => {\n return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)\n })\n })\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (this[kDestroyed]) {\n if (this[kOnDestroyed]) {\n this[kOnDestroyed].push(callback)\n } else {\n queueMicrotask(() => callback(null, null))\n }\n return\n }\n\n if (!err) {\n err = new ClientDestroyedError()\n }\n\n this[kDestroyed] = true\n this[kOnDestroyed] = this[kOnDestroyed] || []\n this[kOnDestroyed].push(callback)\n\n const onDestroyed = () => {\n const callbacks = this[kOnDestroyed]\n this[kOnDestroyed] = null\n for (let i = 0; i < callbacks.length; i++) {\n callbacks[i](null, null)\n }\n }\n\n // Should not error.\n this[kDestroy](err).then(() => {\n queueMicrotask(onDestroyed)\n })\n }\n\n [kInterceptedDispatch] (opts, handler) {\n if (!this[kInterceptors] || this[kInterceptors].length === 0) {\n this[kInterceptedDispatch] = this[kDispatch]\n return this[kDispatch](opts, handler)\n }\n\n let dispatch = this[kDispatch].bind(this)\n for (let i = this[kInterceptors].length - 1; i >= 0; i--) {\n dispatch = this[kInterceptors][i](dispatch)\n }\n this[kInterceptedDispatch] = dispatch\n return dispatch(opts, handler)\n }\n\n dispatch (opts, handler) {\n if (!handler || typeof handler !== 'object') {\n throw new InvalidArgumentError('handler must be an object')\n }\n\n try {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('opts must be an object.')\n }\n\n if (this[kDestroyed] || this[kOnDestroyed]) {\n throw new ClientDestroyedError()\n }\n\n if (this[kClosed]) {\n throw new ClientClosedError()\n }\n\n return this[kInterceptedDispatch](opts, handler)\n } catch (err) {\n if (typeof handler.onError !== 'function') {\n throw new InvalidArgumentError('invalid onError method')\n }\n\n handler.onError(err)\n\n return false\n }\n }\n}\n\nmodule.exports = DispatcherBase\n","'use strict'\n\nconst net = require('net')\nconst assert = require('assert')\nconst util = require('./util')\nconst { InvalidArgumentError, ConnectTimeoutError } = require('./errors')\n\nlet tls // include tls conditionally since it is not always available\n\n// TODO: session re-use does not wait for the first\n// connection to resolve the session and might therefore\n// resolve the same servername multiple times even when\n// re-use is enabled.\n\nlet SessionCache\n// FIXME: remove workaround when the Node bug is fixed\n// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\nif (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {\n SessionCache = class WeakSessionCache {\n constructor (maxCachedSessions) {\n this._maxCachedSessions = maxCachedSessions\n this._sessionCache = new Map()\n this._sessionRegistry = new global.FinalizationRegistry((key) => {\n if (this._sessionCache.size < this._maxCachedSessions) {\n return\n }\n\n const ref = this._sessionCache.get(key)\n if (ref !== undefined && ref.deref() === undefined) {\n this._sessionCache.delete(key)\n }\n })\n }\n\n get (sessionKey) {\n const ref = this._sessionCache.get(sessionKey)\n return ref ? ref.deref() : null\n }\n\n set (sessionKey, session) {\n if (this._maxCachedSessions === 0) {\n return\n }\n\n this._sessionCache.set(sessionKey, new WeakRef(session))\n this._sessionRegistry.register(session, sessionKey)\n }\n }\n} else {\n SessionCache = class SimpleSessionCache {\n constructor (maxCachedSessions) {\n this._maxCachedSessions = maxCachedSessions\n this._sessionCache = new Map()\n }\n\n get (sessionKey) {\n return this._sessionCache.get(sessionKey)\n }\n\n set (sessionKey, session) {\n if (this._maxCachedSessions === 0) {\n return\n }\n\n if (this._sessionCache.size >= this._maxCachedSessions) {\n // remove the oldest session\n const { value: oldestKey } = this._sessionCache.keys().next()\n this._sessionCache.delete(oldestKey)\n }\n\n this._sessionCache.set(sessionKey, session)\n }\n }\n}\n\nfunction buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {\n if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {\n throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')\n }\n\n const options = { path: socketPath, ...opts }\n const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)\n timeout = timeout == null ? 10e3 : timeout\n allowH2 = allowH2 != null ? allowH2 : false\n return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {\n let socket\n if (protocol === 'https:') {\n if (!tls) {\n tls = require('tls')\n }\n servername = servername || options.servername || util.getServerName(host) || null\n\n const sessionKey = servername || hostname\n const session = sessionCache.get(sessionKey) || null\n\n assert(sessionKey)\n\n socket = tls.connect({\n highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...\n ...options,\n servername,\n session,\n localAddress,\n // TODO(HTTP/2): Add support for h2c\n ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],\n socket: httpSocket, // upgrade socket connection\n port: port || 443,\n host: hostname\n })\n\n socket\n .on('session', function (session) {\n // TODO (fix): Can a session become invalid once established? Don't think so?\n sessionCache.set(sessionKey, session)\n })\n } else {\n assert(!httpSocket, 'httpSocket can only be sent on TLS update')\n socket = net.connect({\n highWaterMark: 64 * 1024, // Same as nodejs fs streams.\n ...options,\n localAddress,\n port: port || 80,\n host: hostname\n })\n }\n\n // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket\n if (options.keepAlive == null || options.keepAlive) {\n const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay\n socket.setKeepAlive(true, keepAliveInitialDelay)\n }\n\n const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)\n\n socket\n .setNoDelay(true)\n .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {\n cancelTimeout()\n\n if (callback) {\n const cb = callback\n callback = null\n cb(null, this)\n }\n })\n .on('error', function (err) {\n cancelTimeout()\n\n if (callback) {\n const cb = callback\n callback = null\n cb(err)\n }\n })\n\n return socket\n }\n}\n\nfunction setupTimeout (onConnectTimeout, timeout) {\n if (!timeout) {\n return () => {}\n }\n\n let s1 = null\n let s2 = null\n const timeoutId = setTimeout(() => {\n // setImmediate is added to make sure that we priotorise socket error events over timeouts\n s1 = setImmediate(() => {\n if (process.platform === 'win32') {\n // Windows needs an extra setImmediate probably due to implementation differences in the socket logic\n s2 = setImmediate(() => onConnectTimeout())\n } else {\n onConnectTimeout()\n }\n })\n }, timeout)\n return () => {\n clearTimeout(timeoutId)\n clearImmediate(s1)\n clearImmediate(s2)\n }\n}\n\nfunction onConnectTimeout (socket) {\n util.destroy(socket, new ConnectTimeoutError())\n}\n\nmodule.exports = buildConnector\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enumToMap = void 0;\nfunction enumToMap(obj) {\n const res = {};\n Object.keys(obj).forEach((key) => {\n const value = obj[key];\n if (typeof value === 'number') {\n res[key] = value;\n }\n });\n return res;\n}\nexports.enumToMap = enumToMap;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;\nconst utils_1 = require(\"./utils\");\n// C headers\nvar ERROR;\n(function (ERROR) {\n ERROR[ERROR[\"OK\"] = 0] = \"OK\";\n ERROR[ERROR[\"INTERNAL\"] = 1] = \"INTERNAL\";\n ERROR[ERROR[\"STRICT\"] = 2] = \"STRICT\";\n ERROR[ERROR[\"LF_EXPECTED\"] = 3] = \"LF_EXPECTED\";\n ERROR[ERROR[\"UNEXPECTED_CONTENT_LENGTH\"] = 4] = \"UNEXPECTED_CONTENT_LENGTH\";\n ERROR[ERROR[\"CLOSED_CONNECTION\"] = 5] = \"CLOSED_CONNECTION\";\n ERROR[ERROR[\"INVALID_METHOD\"] = 6] = \"INVALID_METHOD\";\n ERROR[ERROR[\"INVALID_URL\"] = 7] = \"INVALID_URL\";\n ERROR[ERROR[\"INVALID_CONSTANT\"] = 8] = \"INVALID_CONSTANT\";\n ERROR[ERROR[\"INVALID_VERSION\"] = 9] = \"INVALID_VERSION\";\n ERROR[ERROR[\"INVALID_HEADER_TOKEN\"] = 10] = \"INVALID_HEADER_TOKEN\";\n ERROR[ERROR[\"INVALID_CONTENT_LENGTH\"] = 11] = \"INVALID_CONTENT_LENGTH\";\n ERROR[ERROR[\"INVALID_CHUNK_SIZE\"] = 12] = \"INVALID_CHUNK_SIZE\";\n ERROR[ERROR[\"INVALID_STATUS\"] = 13] = \"INVALID_STATUS\";\n ERROR[ERROR[\"INVALID_EOF_STATE\"] = 14] = \"INVALID_EOF_STATE\";\n ERROR[ERROR[\"INVALID_TRANSFER_ENCODING\"] = 15] = \"INVALID_TRANSFER_ENCODING\";\n ERROR[ERROR[\"CB_MESSAGE_BEGIN\"] = 16] = \"CB_MESSAGE_BEGIN\";\n ERROR[ERROR[\"CB_HEADERS_COMPLETE\"] = 17] = \"CB_HEADERS_COMPLETE\";\n ERROR[ERROR[\"CB_MESSAGE_COMPLETE\"] = 18] = \"CB_MESSAGE_COMPLETE\";\n ERROR[ERROR[\"CB_CHUNK_HEADER\"] = 19] = \"CB_CHUNK_HEADER\";\n ERROR[ERROR[\"CB_CHUNK_COMPLETE\"] = 20] = \"CB_CHUNK_COMPLETE\";\n ERROR[ERROR[\"PAUSED\"] = 21] = \"PAUSED\";\n ERROR[ERROR[\"PAUSED_UPGRADE\"] = 22] = \"PAUSED_UPGRADE\";\n ERROR[ERROR[\"PAUSED_H2_UPGRADE\"] = 23] = \"PAUSED_H2_UPGRADE\";\n ERROR[ERROR[\"USER\"] = 24] = \"USER\";\n})(ERROR = exports.ERROR || (exports.ERROR = {}));\nvar TYPE;\n(function (TYPE) {\n TYPE[TYPE[\"BOTH\"] = 0] = \"BOTH\";\n TYPE[TYPE[\"REQUEST\"] = 1] = \"REQUEST\";\n TYPE[TYPE[\"RESPONSE\"] = 2] = \"RESPONSE\";\n})(TYPE = exports.TYPE || (exports.TYPE = {}));\nvar FLAGS;\n(function (FLAGS) {\n FLAGS[FLAGS[\"CONNECTION_KEEP_ALIVE\"] = 1] = \"CONNECTION_KEEP_ALIVE\";\n FLAGS[FLAGS[\"CONNECTION_CLOSE\"] = 2] = \"CONNECTION_CLOSE\";\n FLAGS[FLAGS[\"CONNECTION_UPGRADE\"] = 4] = \"CONNECTION_UPGRADE\";\n FLAGS[FLAGS[\"CHUNKED\"] = 8] = \"CHUNKED\";\n FLAGS[FLAGS[\"UPGRADE\"] = 16] = \"UPGRADE\";\n FLAGS[FLAGS[\"CONTENT_LENGTH\"] = 32] = \"CONTENT_LENGTH\";\n FLAGS[FLAGS[\"SKIPBODY\"] = 64] = \"SKIPBODY\";\n FLAGS[FLAGS[\"TRAILING\"] = 128] = \"TRAILING\";\n // 1 << 8 is unused\n FLAGS[FLAGS[\"TRANSFER_ENCODING\"] = 512] = \"TRANSFER_ENCODING\";\n})(FLAGS = exports.FLAGS || (exports.FLAGS = {}));\nvar LENIENT_FLAGS;\n(function (LENIENT_FLAGS) {\n LENIENT_FLAGS[LENIENT_FLAGS[\"HEADERS\"] = 1] = \"HEADERS\";\n LENIENT_FLAGS[LENIENT_FLAGS[\"CHUNKED_LENGTH\"] = 2] = \"CHUNKED_LENGTH\";\n LENIENT_FLAGS[LENIENT_FLAGS[\"KEEP_ALIVE\"] = 4] = \"KEEP_ALIVE\";\n})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));\nvar METHODS;\n(function (METHODS) {\n METHODS[METHODS[\"DELETE\"] = 0] = \"DELETE\";\n METHODS[METHODS[\"GET\"] = 1] = \"GET\";\n METHODS[METHODS[\"HEAD\"] = 2] = \"HEAD\";\n METHODS[METHODS[\"POST\"] = 3] = \"POST\";\n METHODS[METHODS[\"PUT\"] = 4] = \"PUT\";\n /* pathological */\n METHODS[METHODS[\"CONNECT\"] = 5] = \"CONNECT\";\n METHODS[METHODS[\"OPTIONS\"] = 6] = \"OPTIONS\";\n METHODS[METHODS[\"TRACE\"] = 7] = \"TRACE\";\n /* WebDAV */\n METHODS[METHODS[\"COPY\"] = 8] = \"COPY\";\n METHODS[METHODS[\"LOCK\"] = 9] = \"LOCK\";\n METHODS[METHODS[\"MKCOL\"] = 10] = \"MKCOL\";\n METHODS[METHODS[\"MOVE\"] = 11] = \"MOVE\";\n METHODS[METHODS[\"PROPFIND\"] = 12] = \"PROPFIND\";\n METHODS[METHODS[\"PROPPATCH\"] = 13] = \"PROPPATCH\";\n METHODS[METHODS[\"SEARCH\"] = 14] = \"SEARCH\";\n METHODS[METHODS[\"UNLOCK\"] = 15] = \"UNLOCK\";\n METHODS[METHODS[\"BIND\"] = 16] = \"BIND\";\n METHODS[METHODS[\"REBIND\"] = 17] = \"REBIND\";\n METHODS[METHODS[\"UNBIND\"] = 18] = \"UNBIND\";\n METHODS[METHODS[\"ACL\"] = 19] = \"ACL\";\n /* subversion */\n METHODS[METHODS[\"REPORT\"] = 20] = \"REPORT\";\n METHODS[METHODS[\"MKACTIVITY\"] = 21] = \"MKACTIVITY\";\n METHODS[METHODS[\"CHECKOUT\"] = 22] = \"CHECKOUT\";\n METHODS[METHODS[\"MERGE\"] = 23] = \"MERGE\";\n /* upnp */\n METHODS[METHODS[\"M-SEARCH\"] = 24] = \"M-SEARCH\";\n METHODS[METHODS[\"NOTIFY\"] = 25] = \"NOTIFY\";\n METHODS[METHODS[\"SUBSCRIBE\"] = 26] = \"SUBSCRIBE\";\n METHODS[METHODS[\"UNSUBSCRIBE\"] = 27] = \"UNSUBSCRIBE\";\n /* RFC-5789 */\n METHODS[METHODS[\"PATCH\"] = 28] = \"PATCH\";\n METHODS[METHODS[\"PURGE\"] = 29] = \"PURGE\";\n /* CalDAV */\n METHODS[METHODS[\"MKCALENDAR\"] = 30] = \"MKCALENDAR\";\n /* RFC-2068, section 19.6.1.2 */\n METHODS[METHODS[\"LINK\"] = 31] = \"LINK\";\n METHODS[METHODS[\"UNLINK\"] = 32] = \"UNLINK\";\n /* icecast */\n METHODS[METHODS[\"SOURCE\"] = 33] = \"SOURCE\";\n /* RFC-7540, section 11.6 */\n METHODS[METHODS[\"PRI\"] = 34] = \"PRI\";\n /* RFC-2326 RTSP */\n METHODS[METHODS[\"DESCRIBE\"] = 35] = \"DESCRIBE\";\n METHODS[METHODS[\"ANNOUNCE\"] = 36] = \"ANNOUNCE\";\n METHODS[METHODS[\"SETUP\"] = 37] = \"SETUP\";\n METHODS[METHODS[\"PLAY\"] = 38] = \"PLAY\";\n METHODS[METHODS[\"PAUSE\"] = 39] = \"PAUSE\";\n METHODS[METHODS[\"TEARDOWN\"] = 40] = \"TEARDOWN\";\n METHODS[METHODS[\"GET_PARAMETER\"] = 41] = \"GET_PARAMETER\";\n METHODS[METHODS[\"SET_PARAMETER\"] = 42] = \"SET_PARAMETER\";\n METHODS[METHODS[\"REDIRECT\"] = 43] = \"REDIRECT\";\n METHODS[METHODS[\"RECORD\"] = 44] = \"RECORD\";\n /* RAOP */\n METHODS[METHODS[\"FLUSH\"] = 45] = \"FLUSH\";\n})(METHODS = exports.METHODS || (exports.METHODS = {}));\nexports.METHODS_HTTP = [\n METHODS.DELETE,\n METHODS.GET,\n METHODS.HEAD,\n METHODS.POST,\n METHODS.PUT,\n METHODS.CONNECT,\n METHODS.OPTIONS,\n METHODS.TRACE,\n METHODS.COPY,\n METHODS.LOCK,\n METHODS.MKCOL,\n METHODS.MOVE,\n METHODS.PROPFIND,\n METHODS.PROPPATCH,\n METHODS.SEARCH,\n METHODS.UNLOCK,\n METHODS.BIND,\n METHODS.REBIND,\n METHODS.UNBIND,\n METHODS.ACL,\n METHODS.REPORT,\n METHODS.MKACTIVITY,\n METHODS.CHECKOUT,\n METHODS.MERGE,\n METHODS['M-SEARCH'],\n METHODS.NOTIFY,\n METHODS.SUBSCRIBE,\n METHODS.UNSUBSCRIBE,\n METHODS.PATCH,\n METHODS.PURGE,\n METHODS.MKCALENDAR,\n METHODS.LINK,\n METHODS.UNLINK,\n METHODS.PRI,\n // TODO(indutny): should we allow it with HTTP?\n METHODS.SOURCE,\n];\nexports.METHODS_ICE = [\n METHODS.SOURCE,\n];\nexports.METHODS_RTSP = [\n METHODS.OPTIONS,\n METHODS.DESCRIBE,\n METHODS.ANNOUNCE,\n METHODS.SETUP,\n METHODS.PLAY,\n METHODS.PAUSE,\n METHODS.TEARDOWN,\n METHODS.GET_PARAMETER,\n METHODS.SET_PARAMETER,\n METHODS.REDIRECT,\n METHODS.RECORD,\n METHODS.FLUSH,\n // For AirPlay\n METHODS.GET,\n METHODS.POST,\n];\nexports.METHOD_MAP = utils_1.enumToMap(METHODS);\nexports.H_METHOD_MAP = {};\nObject.keys(exports.METHOD_MAP).forEach((key) => {\n if (/^H/.test(key)) {\n exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];\n }\n});\nvar FINISH;\n(function (FINISH) {\n FINISH[FINISH[\"SAFE\"] = 0] = \"SAFE\";\n FINISH[FINISH[\"SAFE_WITH_CB\"] = 1] = \"SAFE_WITH_CB\";\n FINISH[FINISH[\"UNSAFE\"] = 2] = \"UNSAFE\";\n})(FINISH = exports.FINISH || (exports.FINISH = {}));\nexports.ALPHA = [];\nfor (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {\n // Upper case\n exports.ALPHA.push(String.fromCharCode(i));\n // Lower case\n exports.ALPHA.push(String.fromCharCode(i + 0x20));\n}\nexports.NUM_MAP = {\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n};\nexports.HEX_MAP = {\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,\n a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,\n};\nexports.NUM = [\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n];\nexports.ALPHANUM = exports.ALPHA.concat(exports.NUM);\nexports.MARK = ['-', '_', '.', '!', '~', '*', '\\'', '(', ')'];\nexports.USERINFO_CHARS = exports.ALPHANUM\n .concat(exports.MARK)\n .concat(['%', ';', ':', '&', '=', '+', '$', ',']);\n// TODO(indutny): use RFC\nexports.STRICT_URL_CHAR = [\n '!', '\"', '$', '%', '&', '\\'',\n '(', ')', '*', '+', ',', '-', '.', '/',\n ':', ';', '<', '=', '>',\n '@', '[', '\\\\', ']', '^', '_',\n '`',\n '{', '|', '}', '~',\n].concat(exports.ALPHANUM);\nexports.URL_CHAR = exports.STRICT_URL_CHAR\n .concat(['\\t', '\\f']);\n// All characters with 0x80 bit set to 1\nfor (let i = 0x80; i <= 0xff; i++) {\n exports.URL_CHAR.push(i);\n}\nexports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);\n/* Tokens as defined by rfc 2616. Also lowercases them.\n * token = 1*\n * separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n * | \",\" | \";\" | \":\" | \"\\\" | <\">\n * | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n * | \"{\" | \"}\" | SP | HT\n */\nexports.STRICT_TOKEN = [\n '!', '#', '$', '%', '&', '\\'',\n '*', '+', '-', '.',\n '^', '_', '`',\n '|', '~',\n].concat(exports.ALPHANUM);\nexports.TOKEN = exports.STRICT_TOKEN.concat([' ']);\n/*\n * Verify that a char is a valid visible (printable) US-ASCII\n * character or %x80-FF\n */\nexports.HEADER_CHARS = ['\\t'];\nfor (let i = 32; i <= 255; i++) {\n if (i !== 127) {\n exports.HEADER_CHARS.push(i);\n }\n}\n// ',' = \\x44\nexports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);\nexports.MAJOR = exports.NUM_MAP;\nexports.MINOR = exports.MAJOR;\nvar HEADER_STATE;\n(function (HEADER_STATE) {\n HEADER_STATE[HEADER_STATE[\"GENERAL\"] = 0] = \"GENERAL\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION\"] = 1] = \"CONNECTION\";\n HEADER_STATE[HEADER_STATE[\"CONTENT_LENGTH\"] = 2] = \"CONTENT_LENGTH\";\n HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING\"] = 3] = \"TRANSFER_ENCODING\";\n HEADER_STATE[HEADER_STATE[\"UPGRADE\"] = 4] = \"UPGRADE\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION_KEEP_ALIVE\"] = 5] = \"CONNECTION_KEEP_ALIVE\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION_CLOSE\"] = 6] = \"CONNECTION_CLOSE\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION_UPGRADE\"] = 7] = \"CONNECTION_UPGRADE\";\n HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING_CHUNKED\"] = 8] = \"TRANSFER_ENCODING_CHUNKED\";\n})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));\nexports.SPECIAL_HEADERS = {\n 'connection': HEADER_STATE.CONNECTION,\n 'content-length': HEADER_STATE.CONTENT_LENGTH,\n 'proxy-connection': HEADER_STATE.CONNECTION,\n 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,\n 'upgrade': HEADER_STATE.UPGRADE,\n};\n//# sourceMappingURL=constants.js.map","'use strict'\n\nconst util = require('../core/util')\nconst { kBodyUsed } = require('../core/symbols')\nconst assert = require('assert')\nconst { InvalidArgumentError } = require('../core/errors')\nconst EE = require('events')\n\nconst redirectableStatusCodes = [300, 301, 302, 303, 307, 308]\n\nconst kBody = Symbol('body')\n\nclass BodyAsyncIterable {\n constructor (body) {\n this[kBody] = body\n this[kBodyUsed] = false\n }\n\n async * [Symbol.asyncIterator] () {\n assert(!this[kBodyUsed], 'disturbed')\n this[kBodyUsed] = true\n yield * this[kBody]\n }\n}\n\nclass RedirectHandler {\n constructor (dispatch, maxRedirections, opts, handler) {\n if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n throw new InvalidArgumentError('maxRedirections must be a positive number')\n }\n\n util.validateHandler(handler, opts.method, opts.upgrade)\n\n this.dispatch = dispatch\n this.location = null\n this.abort = null\n this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy\n this.maxRedirections = maxRedirections\n this.handler = handler\n this.history = []\n\n if (util.isStream(this.opts.body)) {\n // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n // so that it can be dispatched again?\n // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n if (util.bodyLength(this.opts.body) === 0) {\n this.opts.body\n .on('data', function () {\n assert(false)\n })\n }\n\n if (typeof this.opts.body.readableDidRead !== 'boolean') {\n this.opts.body[kBodyUsed] = false\n EE.prototype.on.call(this.opts.body, 'data', function () {\n this[kBodyUsed] = true\n })\n }\n } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {\n // TODO (fix): We can't access ReadableStream internal state\n // to determine whether or not it has been disturbed. This is just\n // a workaround.\n this.opts.body = new BodyAsyncIterable(this.opts.body)\n } else if (\n this.opts.body &&\n typeof this.opts.body !== 'string' &&\n !ArrayBuffer.isView(this.opts.body) &&\n util.isIterable(this.opts.body)\n ) {\n // TODO: Should we allow re-using iterable if !this.opts.idempotent\n // or through some other flag?\n this.opts.body = new BodyAsyncIterable(this.opts.body)\n }\n }\n\n onConnect (abort) {\n this.abort = abort\n this.handler.onConnect(abort, { history: this.history })\n }\n\n onUpgrade (statusCode, headers, socket) {\n this.handler.onUpgrade(statusCode, headers, socket)\n }\n\n onError (error) {\n this.handler.onError(error)\n }\n\n onHeaders (statusCode, headers, resume, statusText) {\n this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)\n ? null\n : parseLocation(statusCode, headers)\n\n if (this.opts.origin) {\n this.history.push(new URL(this.opts.path, this.opts.origin))\n }\n\n if (!this.location) {\n return this.handler.onHeaders(statusCode, headers, resume, statusText)\n }\n\n const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))\n const path = search ? `${pathname}${search}` : pathname\n\n // Remove headers referring to the original URL.\n // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.\n // https://tools.ietf.org/html/rfc7231#section-6.4\n this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)\n this.opts.path = path\n this.opts.origin = origin\n this.opts.maxRedirections = 0\n this.opts.query = null\n\n // https://tools.ietf.org/html/rfc7231#section-6.4.4\n // In case of HTTP 303, always replace method to be either HEAD or GET\n if (statusCode === 303 && this.opts.method !== 'HEAD') {\n this.opts.method = 'GET'\n this.opts.body = null\n }\n }\n\n onData (chunk) {\n if (this.location) {\n /*\n https://tools.ietf.org/html/rfc7231#section-6.4\n\n TLDR: undici always ignores 3xx response bodies.\n\n Redirection is used to serve the requested resource from another URL, so it is assumes that\n no body is generated (and thus can be ignored). Even though generating a body is not prohibited.\n\n For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually\n (which means it's optional and not mandated) contain just an hyperlink to the value of\n the Location response header, so the body can be ignored safely.\n\n For status 300, which is \"Multiple Choices\", the spec mentions both generating a Location\n response header AND a response body with the other possible location to follow.\n Since the spec explicitily chooses not to specify a format for such body and leave it to\n servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.\n */\n } else {\n return this.handler.onData(chunk)\n }\n }\n\n onComplete (trailers) {\n if (this.location) {\n /*\n https://tools.ietf.org/html/rfc7231#section-6.4\n\n TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections\n and neither are useful if present.\n\n See comment on onData method above for more detailed informations.\n */\n\n this.location = null\n this.abort = null\n\n this.dispatch(this.opts, this)\n } else {\n this.handler.onComplete(trailers)\n }\n }\n\n onBodySent (chunk) {\n if (this.handler.onBodySent) {\n this.handler.onBodySent(chunk)\n }\n }\n}\n\nfunction parseLocation (statusCode, headers) {\n if (redirectableStatusCodes.indexOf(statusCode) === -1) {\n return null\n }\n\n for (let i = 0; i < headers.length; i += 2) {\n if (headers[i].toString().toLowerCase() === 'location') {\n return headers[i + 1]\n }\n }\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4.4\nfunction shouldRemoveHeader (header, removeContent, unknownOrigin) {\n if (header.length === 4) {\n return util.headerNameToString(header) === 'host'\n }\n if (removeContent && util.headerNameToString(header).startsWith('content-')) {\n return true\n }\n if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {\n const name = util.headerNameToString(header)\n return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'\n }\n return false\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4\nfunction cleanRequestHeaders (headers, removeContent, unknownOrigin) {\n const ret = []\n if (Array.isArray(headers)) {\n for (let i = 0; i < headers.length; i += 2) {\n if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {\n ret.push(headers[i], headers[i + 1])\n }\n }\n } else if (headers && typeof headers === 'object') {\n for (const key of Object.keys(headers)) {\n if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {\n ret.push(key, headers[key])\n }\n }\n } else {\n assert(headers == null, 'headers must be an object or an array')\n }\n return ret\n}\n\nmodule.exports = RedirectHandler\n","'use strict'\n\nconst RedirectHandler = require('../handler/RedirectHandler')\n\nfunction createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {\n return (dispatch) => {\n return function Intercept (opts, handler) {\n const { maxRedirections = defaultMaxRedirections } = opts\n\n if (!maxRedirections) {\n return dispatch(opts, handler)\n }\n\n const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)\n opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.\n return dispatch(opts, redirectHandler)\n }\n }\n}\n\nmodule.exports = createRedirectInterceptor\n","module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsb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A3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgACgCHCIQQX9qDt0B2gEB2QECAwQFBgcICQoLDA0O2AEPENcBERLWARMUFRYXGBkaG+AB3wEcHR7VAR8gISIjJCXUASYnKCkqKyzTAdIBLS7RAdABLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVG2wFHSElKzwHOAUvNAUzMAU1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5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QtBrwEhEAwUC0GwASEQDBMLQbEBIRAMEgtBswEhEAwRC0GyASEQDBALQbQBIRAMDwtBtQEhEAwOC0G2ASEQDA0LQbcBIRAMDAtBuAEhEAwLC0G5ASEQDAoLQboBIRAMCQtBuwEhEAwIC0HGASEQDAcLQbwBIRAMBgtBvQEhEAwFC0G+ASEQDAQLQb8BIRAMAwtBwAEhEAwCC0HCASEQDAELQcEBIRALA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQ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QNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2AhAgAEEHNgIMQQAhEAygAQtBACEQIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgwMnwELIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgxBACEQDJ4BCyAAQQA2AhwgACAUNgIUIABB/pGAgAA2AhAgAEEHNgIMQQAhEAydAQsgAEEANgIcIAAgATYCFCAAQY6bgIAANgIQIABBBjYCDEEAIRAMnAELIBBBFUYNVyAAQQA2AhwgACABNgIUIABBzI6AgAA2AhAgAEEgNgIMQQAhEAybAQsgAEEANgIAIBBBAWohAUEkIRALIAAgEDoAKSAAKAIEIR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AJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAOxwEAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB4fICEjJSg/QEFERUZHSElKS0xNT1BRUlPeA1dZW1xdYGJlZmdoaWprbG1vcHFyc3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QQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQAhEAyrAQsgEEE/Rw0BIAFBAWohAQtBBSEQDJABC0EAIRAgAEEANgIcIAAgATYCFCAAQf2SgIAANgIQIABBBzYCDAyoAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAynAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAymAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMRgsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAylAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMPwsgAEHSADYCHCAAIBQ2AhQgACABNgIMQQAhEAykAQsgACgCBCEBIABBADYCBAJAIAAgASAUE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EAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAgAAAAACAAAAAAAAAAAAAAAAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=='\n","// @ts-check\n\n'use strict'\n\n/* global WebAssembly */\n\nconst assert = require('assert')\nconst net = require('net')\nconst http = require('http')\nconst { pipeline } = require('stream')\nconst util = require('./core/util')\nconst timers = require('./timers')\nconst Request = require('./core/request')\nconst DispatcherBase = require('./dispatcher-base')\nconst {\n RequestContentLengthMismatchError,\n ResponseContentLengthMismatchError,\n InvalidArgumentError,\n RequestAbortedError,\n HeadersTimeoutError,\n HeadersOverflowError,\n SocketError,\n InformationalError,\n BodyTimeoutError,\n HTTPParserError,\n ResponseExceededMaxSizeError,\n ClientDestroyedError\n} = require('./core/errors')\nconst buildConnector = require('./core/connect')\nconst {\n kUrl,\n kReset,\n kServerName,\n kClient,\n kBusy,\n kParser,\n kConnect,\n kBlocking,\n kResuming,\n kRunning,\n kPending,\n kSize,\n kWriting,\n kQueue,\n kConnected,\n kConnecting,\n kNeedDrain,\n kNoRef,\n kKeepAliveDefaultTimeout,\n kHostHeader,\n kPendingIdx,\n kRunningIdx,\n kError,\n kPipelining,\n kSocket,\n kKeepAliveTimeoutValue,\n kMaxHeadersSize,\n kKeepAliveMaxTimeout,\n kKeepAliveTimeoutThreshold,\n kHeadersTimeout,\n kBodyTimeout,\n kStrictContentLength,\n kConnector,\n kMaxRedirections,\n kMaxRequests,\n kCounter,\n kClose,\n kDestroy,\n kDispatch,\n kInterceptors,\n kLocalAddress,\n kMaxResponseSize,\n kHTTPConnVersion,\n // HTTP2\n kHost,\n kHTTP2Session,\n kHTTP2SessionState,\n kHTTP2BuildRequest,\n kHTTP2CopyHeaders,\n kHTTP1BuildRequest\n} = require('./core/symbols')\n\n/** @type {import('http2')} */\nlet http2\ntry {\n http2 = require('http2')\n} catch {\n // @ts-ignore\n http2 = { constants: {} }\n}\n\nconst {\n constants: {\n HTTP2_HEADER_AUTHORITY,\n HTTP2_HEADER_METHOD,\n HTTP2_HEADER_PATH,\n HTTP2_HEADER_SCHEME,\n HTTP2_HEADER_CONTENT_LENGTH,\n HTTP2_HEADER_EXPECT,\n HTTP2_HEADER_STATUS\n }\n} = http2\n\n// Experimental\nlet h2ExperimentalWarned = false\n\nconst FastBuffer = Buffer[Symbol.species]\n\nconst kClosedResolve = Symbol('kClosedResolve')\n\nconst channels = {}\n\ntry {\n const diagnosticsChannel = require('diagnostics_channel')\n channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')\n channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')\n channels.connectError = diagnosticsChannel.channel('undici:client:connectError')\n channels.connected = diagnosticsChannel.channel('undici:client:connected')\n} catch {\n channels.sendHeaders = { hasSubscribers: false }\n channels.beforeConnect = { hasSubscribers: false }\n channels.connectError = { hasSubscribers: false }\n channels.connected = { hasSubscribers: false }\n}\n\n/**\n * @type {import('../types/client').default}\n */\nclass Client extends DispatcherBase {\n /**\n *\n * @param {string|URL} url\n * @param {import('../types/client').Client.Options} options\n */\n constructor (url, {\n interceptors,\n maxHeaderSize,\n headersTimeout,\n socketTimeout,\n requestTimeout,\n connectTimeout,\n bodyTimeout,\n idleTimeout,\n keepAlive,\n keepAliveTimeout,\n maxKeepAliveTimeout,\n keepAliveMaxTimeout,\n keepAliveTimeoutThreshold,\n socketPath,\n pipelining,\n tls,\n strictContentLength,\n maxCachedSessions,\n maxRedirections,\n connect,\n maxRequestsPerClient,\n localAddress,\n maxResponseSize,\n autoSelectFamily,\n autoSelectFamilyAttemptTimeout,\n // h2\n allowH2,\n maxConcurrentStreams\n } = {}) {\n super()\n\n if (keepAlive !== undefined) {\n throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')\n }\n\n if (socketTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')\n }\n\n if (requestTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')\n }\n\n if (idleTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')\n }\n\n if (maxKeepAliveTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')\n }\n\n if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {\n throw new InvalidArgumentError('invalid maxHeaderSize')\n }\n\n if (socketPath != null && typeof socketPath !== 'string') {\n throw new InvalidArgumentError('invalid socketPath')\n }\n\n if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {\n throw new InvalidArgumentError('invalid connectTimeout')\n }\n\n if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {\n throw new InvalidArgumentError('invalid keepAliveTimeout')\n }\n\n if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {\n throw new InvalidArgumentError('invalid keepAliveMaxTimeout')\n }\n\n if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {\n throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')\n }\n\n if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {\n throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')\n }\n\n if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {\n throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n throw new InvalidArgumentError('maxRedirections must be a positive number')\n }\n\n if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {\n throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')\n }\n\n if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {\n throw new InvalidArgumentError('localAddress must be valid string IP address')\n }\n\n if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {\n throw new InvalidArgumentError('maxResponseSize must be a positive number')\n }\n\n if (\n autoSelectFamilyAttemptTimeout != null &&\n (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)\n ) {\n throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')\n }\n\n // h2\n if (allowH2 != null && typeof allowH2 !== 'boolean') {\n throw new InvalidArgumentError('allowH2 must be a valid boolean value')\n }\n\n if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {\n throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')\n }\n\n if (typeof connect !== 'function') {\n connect = buildConnector({\n ...tls,\n maxCachedSessions,\n allowH2,\n socketPath,\n timeout: connectTimeout,\n ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n ...connect\n })\n }\n\n this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)\n ? interceptors.Client\n : [createRedirectInterceptor({ maxRedirections })]\n this[kUrl] = util.parseOrigin(url)\n this[kConnector] = connect\n this[kSocket] = null\n this[kPipelining] = pipelining != null ? pipelining : 1\n this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize\n this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout\n this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout\n this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold\n this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]\n this[kServerName] = null\n this[kLocalAddress] = localAddress != null ? localAddress : null\n this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming\n this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming\n this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\\r\\n`\n this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3\n this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3\n this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength\n this[kMaxRedirections] = maxRedirections\n this[kMaxRequests] = maxRequestsPerClient\n this[kClosedResolve] = null\n this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1\n this[kHTTPConnVersion] = 'h1'\n\n // HTTP/2\n this[kHTTP2Session] = null\n this[kHTTP2SessionState] = !allowH2\n ? null\n : {\n // streams: null, // Fixed queue of streams - For future support of `push`\n openStreams: 0, // Keep track of them to decide wether or not unref the session\n maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server\n }\n this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`\n\n // kQueue is built up of 3 sections separated by\n // the kRunningIdx and kPendingIdx indices.\n // | complete | running | pending |\n // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length\n // kRunningIdx points to the first running element.\n // kPendingIdx points to the first pending element.\n // This implements a fast queue with an amortized\n // time of O(1).\n\n this[kQueue] = []\n this[kRunningIdx] = 0\n this[kPendingIdx] = 0\n }\n\n get pipelining () {\n return this[kPipelining]\n }\n\n set pipelining (value) {\n this[kPipelining] = value\n resume(this, true)\n }\n\n get [kPending] () {\n return this[kQueue].length - this[kPendingIdx]\n }\n\n get [kRunning] () {\n return this[kPendingIdx] - this[kRunningIdx]\n }\n\n get [kSize] () {\n return this[kQueue].length - this[kRunningIdx]\n }\n\n get [kConnected] () {\n return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed\n }\n\n get [kBusy] () {\n const socket = this[kSocket]\n return (\n (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||\n (this[kSize] >= (this[kPipelining] || 1)) ||\n this[kPending] > 0\n )\n }\n\n /* istanbul ignore: only used for test */\n [kConnect] (cb) {\n connect(this)\n this.once('connect', cb)\n }\n\n [kDispatch] (opts, handler) {\n const origin = opts.origin || this[kUrl].origin\n\n const request = this[kHTTPConnVersion] === 'h2'\n ? Request[kHTTP2BuildRequest](origin, opts, handler)\n : Request[kHTTP1BuildRequest](origin, opts, handler)\n\n this[kQueue].push(request)\n if (this[kResuming]) {\n // Do nothing.\n } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {\n // Wait a tick in case stream/iterator is ended in the same tick.\n this[kResuming] = 1\n process.nextTick(resume, this)\n } else {\n resume(this, true)\n }\n\n if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {\n this[kNeedDrain] = 2\n }\n\n return this[kNeedDrain] < 2\n }\n\n async [kClose] () {\n // TODO: for H2 we need to gracefully flush the remaining enqueued\n // request and close each stream.\n return new Promise((resolve) => {\n if (!this[kSize]) {\n resolve(null)\n } else {\n this[kClosedResolve] = resolve\n }\n })\n }\n\n async [kDestroy] (err) {\n return new Promise((resolve) => {\n const requests = this[kQueue].splice(this[kPendingIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n errorRequest(this, request, err)\n }\n\n const callback = () => {\n if (this[kClosedResolve]) {\n // TODO (fix): Should we error here with ClientDestroyedError?\n this[kClosedResolve]()\n this[kClosedResolve] = null\n }\n resolve()\n }\n\n if (this[kHTTP2Session] != null) {\n util.destroy(this[kHTTP2Session], err)\n this[kHTTP2Session] = null\n this[kHTTP2SessionState] = null\n }\n\n if (!this[kSocket]) {\n queueMicrotask(callback)\n } else {\n util.destroy(this[kSocket].on('close', callback), err)\n }\n\n resume(this)\n })\n }\n}\n\nfunction onHttp2SessionError (err) {\n assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n this[kSocket][kError] = err\n\n onError(this[kClient], err)\n}\n\nfunction onHttp2FrameError (type, code, id) {\n const err = new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`)\n\n if (id === 0) {\n this[kSocket][kError] = err\n onError(this[kClient], err)\n }\n}\n\nfunction onHttp2SessionEnd () {\n util.destroy(this, new SocketError('other side closed'))\n util.destroy(this[kSocket], new SocketError('other side closed'))\n}\n\nfunction onHTTP2GoAway (code) {\n const client = this[kClient]\n const err = new InformationalError(`HTTP/2: \"GOAWAY\" frame received with code ${code}`)\n client[kSocket] = null\n client[kHTTP2Session] = null\n\n if (client.destroyed) {\n assert(this[kPending] === 0)\n\n // Fail entire queue.\n const requests = client[kQueue].splice(client[kRunningIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n errorRequest(this, request, err)\n }\n } else if (client[kRunning] > 0) {\n // Fail head of pipeline.\n const request = client[kQueue][client[kRunningIdx]]\n client[kQueue][client[kRunningIdx]++] = null\n\n errorRequest(client, request, err)\n }\n\n client[kPendingIdx] = client[kRunningIdx]\n\n assert(client[kRunning] === 0)\n\n client.emit('disconnect',\n client[kUrl],\n [client],\n err\n )\n\n resume(client)\n}\n\nconst constants = require('./llhttp/constants')\nconst createRedirectInterceptor = require('./interceptor/redirectInterceptor')\nconst EMPTY_BUF = Buffer.alloc(0)\n\nasync function lazyllhttp () {\n const llhttpWasmData = process.env.JEST_WORKER_ID ? require('./llhttp/llhttp-wasm.js') : undefined\n\n let mod\n try {\n mod = await WebAssembly.compile(Buffer.from(require('./llhttp/llhttp_simd-wasm.js'), 'base64'))\n } catch (e) {\n /* istanbul ignore next */\n\n // We could check if the error was caused by the simd option not\n // being enabled, but the occurring of this other error\n // * https://github.com/emscripten-core/emscripten/issues/11495\n // got me to remove that check to avoid breaking Node 12.\n mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || require('./llhttp/llhttp-wasm.js'), 'base64'))\n }\n\n return await WebAssembly.instantiate(mod, {\n env: {\n /* eslint-disable camelcase */\n\n wasm_on_url: (p, at, len) => {\n /* istanbul ignore next */\n return 0\n },\n wasm_on_status: (p, at, len) => {\n assert.strictEqual(currentParser.ptr, p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_message_begin: (p) => {\n assert.strictEqual(currentParser.ptr, p)\n return currentParser.onMessageBegin() || 0\n },\n wasm_on_header_field: (p, at, len) => {\n assert.strictEqual(currentParser.ptr, p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_header_value: (p, at, len) => {\n assert.strictEqual(currentParser.ptr, p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {\n assert.strictEqual(currentParser.ptr, p)\n return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0\n },\n wasm_on_body: (p, at, len) => {\n assert.strictEqual(currentParser.ptr, p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_message_complete: (p) => {\n assert.strictEqual(currentParser.ptr, p)\n return currentParser.onMessageComplete() || 0\n }\n\n /* eslint-enable camelcase */\n }\n })\n}\n\nlet llhttpInstance = null\nlet llhttpPromise = lazyllhttp()\nllhttpPromise.catch()\n\nlet currentParser = null\nlet currentBufferRef = null\nlet currentBufferSize = 0\nlet currentBufferPtr = null\n\nconst TIMEOUT_HEADERS = 1\nconst TIMEOUT_BODY = 2\nconst TIMEOUT_IDLE = 3\n\nclass Parser {\n constructor (client, socket, { exports }) {\n assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)\n\n this.llhttp = exports\n this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)\n this.client = client\n this.socket = socket\n this.timeout = null\n this.timeoutValue = null\n this.timeoutType = null\n this.statusCode = null\n this.statusText = ''\n this.upgrade = false\n this.headers = []\n this.headersSize = 0\n this.headersMaxSize = client[kMaxHeadersSize]\n this.shouldKeepAlive = false\n this.paused = false\n this.resume = this.resume.bind(this)\n\n this.bytesRead = 0\n\n this.keepAlive = ''\n this.contentLength = ''\n this.connection = ''\n this.maxResponseSize = client[kMaxResponseSize]\n }\n\n setTimeout (value, type) {\n this.timeoutType = type\n if (value !== this.timeoutValue) {\n timers.clearTimeout(this.timeout)\n if (value) {\n this.timeout = timers.setTimeout(onParserTimeout, value, this)\n // istanbul ignore else: only for jest\n if (this.timeout.unref) {\n this.timeout.unref()\n }\n } else {\n this.timeout = null\n }\n this.timeoutValue = value\n } else if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n }\n\n resume () {\n if (this.socket.destroyed || !this.paused) {\n return\n }\n\n assert(this.ptr != null)\n assert(currentParser == null)\n\n this.llhttp.llhttp_resume(this.ptr)\n\n assert(this.timeoutType === TIMEOUT_BODY)\n if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n this.paused = false\n this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.\n this.readMore()\n }\n\n readMore () {\n while (!this.paused && this.ptr) {\n const chunk = this.socket.read()\n if (chunk === null) {\n break\n }\n this.execute(chunk)\n }\n }\n\n execute (data) {\n assert(this.ptr != null)\n assert(currentParser == null)\n assert(!this.paused)\n\n const { socket, llhttp } = this\n\n if (data.length > currentBufferSize) {\n if (currentBufferPtr) {\n llhttp.free(currentBufferPtr)\n }\n currentBufferSize = Math.ceil(data.length / 4096) * 4096\n currentBufferPtr = llhttp.malloc(currentBufferSize)\n }\n\n new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)\n\n // Call `execute` on the wasm parser.\n // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,\n // and finally the length of bytes to parse.\n // The return value is an error code or `constants.ERROR.OK`.\n try {\n let ret\n\n try {\n currentBufferRef = data\n currentParser = this\n ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)\n /* eslint-disable-next-line no-useless-catch */\n } catch (err) {\n /* istanbul ignore next: difficult to make a test case for */\n throw err\n } finally {\n currentParser = null\n currentBufferRef = null\n }\n\n const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr\n\n if (ret === constants.ERROR.PAUSED_UPGRADE) {\n this.onUpgrade(data.slice(offset))\n } else if (ret === constants.ERROR.PAUSED) {\n this.paused = true\n socket.unshift(data.slice(offset))\n } else if (ret !== constants.ERROR.OK) {\n const ptr = llhttp.llhttp_get_error_reason(this.ptr)\n let message = ''\n /* istanbul ignore else: difficult to make a test case for */\n if (ptr) {\n const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)\n message =\n 'Response does not match the HTTP/1.1 protocol (' +\n Buffer.from(llhttp.memory.buffer, ptr, len).toString() +\n ')'\n }\n throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))\n }\n } catch (err) {\n util.destroy(socket, err)\n }\n }\n\n destroy () {\n assert(this.ptr != null)\n assert(currentParser == null)\n\n this.llhttp.llhttp_free(this.ptr)\n this.ptr = null\n\n timers.clearTimeout(this.timeout)\n this.timeout = null\n this.timeoutValue = null\n this.timeoutType = null\n\n this.paused = false\n }\n\n onStatus (buf) {\n this.statusText = buf.toString()\n }\n\n onMessageBegin () {\n const { socket, client } = this\n\n /* istanbul ignore next: difficult to make a test case for */\n if (socket.destroyed) {\n return -1\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n if (!request) {\n return -1\n }\n }\n\n onHeaderField (buf) {\n const len = this.headers.length\n\n if ((len & 1) === 0) {\n this.headers.push(buf)\n } else {\n this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n }\n\n this.trackHeader(buf.length)\n }\n\n onHeaderValue (buf) {\n let len = this.headers.length\n\n if ((len & 1) === 1) {\n this.headers.push(buf)\n len += 1\n } else {\n this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n }\n\n const key = this.headers[len - 2]\n if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {\n this.keepAlive += buf.toString()\n } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {\n this.connection += buf.toString()\n } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {\n this.contentLength += buf.toString()\n }\n\n this.trackHeader(buf.length)\n }\n\n trackHeader (len) {\n this.headersSize += len\n if (this.headersSize >= this.headersMaxSize) {\n util.destroy(this.socket, new HeadersOverflowError())\n }\n }\n\n onUpgrade (head) {\n const { upgrade, client, socket, headers, statusCode } = this\n\n assert(upgrade)\n\n const request = client[kQueue][client[kRunningIdx]]\n assert(request)\n\n assert(!socket.destroyed)\n assert(socket === client[kSocket])\n assert(!this.paused)\n assert(request.upgrade || request.method === 'CONNECT')\n\n this.statusCode = null\n this.statusText = ''\n this.shouldKeepAlive = null\n\n assert(this.headers.length % 2 === 0)\n this.headers = []\n this.headersSize = 0\n\n socket.unshift(head)\n\n socket[kParser].destroy()\n socket[kParser] = null\n\n socket[kClient] = null\n socket[kError] = null\n socket\n .removeListener('error', onSocketError)\n .removeListener('readable', onSocketReadable)\n .removeListener('end', onSocketEnd)\n .removeListener('close', onSocketClose)\n\n client[kSocket] = null\n client[kQueue][client[kRunningIdx]++] = null\n client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))\n\n try {\n request.onUpgrade(statusCode, headers, socket)\n } catch (err) {\n util.destroy(socket, err)\n }\n\n resume(client)\n }\n\n onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {\n const { client, socket, headers, statusText } = this\n\n /* istanbul ignore next: difficult to make a test case for */\n if (socket.destroyed) {\n return -1\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n\n /* istanbul ignore next: difficult to make a test case for */\n if (!request) {\n return -1\n }\n\n assert(!this.upgrade)\n assert(this.statusCode < 200)\n\n if (statusCode === 100) {\n util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n return -1\n }\n\n /* this can only happen if server is misbehaving */\n if (upgrade && !request.upgrade) {\n util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))\n return -1\n }\n\n assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)\n\n this.statusCode = statusCode\n this.shouldKeepAlive = (\n shouldKeepAlive ||\n // Override llhttp value which does not allow keepAlive for HEAD.\n (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')\n )\n\n if (this.statusCode >= 200) {\n const bodyTimeout = request.bodyTimeout != null\n ? request.bodyTimeout\n : client[kBodyTimeout]\n this.setTimeout(bodyTimeout, TIMEOUT_BODY)\n } else if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n if (request.method === 'CONNECT') {\n assert(client[kRunning] === 1)\n this.upgrade = true\n return 2\n }\n\n if (upgrade) {\n assert(client[kRunning] === 1)\n this.upgrade = true\n return 2\n }\n\n assert(this.headers.length % 2 === 0)\n this.headers = []\n this.headersSize = 0\n\n if (this.shouldKeepAlive && client[kPipelining]) {\n const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null\n\n if (keepAliveTimeout != null) {\n const timeout = Math.min(\n keepAliveTimeout - client[kKeepAliveTimeoutThreshold],\n client[kKeepAliveMaxTimeout]\n )\n if (timeout <= 0) {\n socket[kReset] = true\n } else {\n client[kKeepAliveTimeoutValue] = timeout\n }\n } else {\n client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]\n }\n } else {\n // Stop more requests from being dispatched.\n socket[kReset] = true\n }\n\n const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false\n\n if (request.aborted) {\n return -1\n }\n\n if (request.method === 'HEAD') {\n return 1\n }\n\n if (statusCode < 200) {\n return 1\n }\n\n if (socket[kBlocking]) {\n socket[kBlocking] = false\n resume(client)\n }\n\n return pause ? constants.ERROR.PAUSED : 0\n }\n\n onBody (buf) {\n const { client, socket, statusCode, maxResponseSize } = this\n\n if (socket.destroyed) {\n return -1\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n assert(request)\n\n assert.strictEqual(this.timeoutType, TIMEOUT_BODY)\n if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n assert(statusCode >= 200)\n\n if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {\n util.destroy(socket, new ResponseExceededMaxSizeError())\n return -1\n }\n\n this.bytesRead += buf.length\n\n if (request.onData(buf) === false) {\n return constants.ERROR.PAUSED\n }\n }\n\n onMessageComplete () {\n const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this\n\n if (socket.destroyed && (!statusCode || shouldKeepAlive)) {\n return -1\n }\n\n if (upgrade) {\n return\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n assert(request)\n\n assert(statusCode >= 100)\n\n this.statusCode = null\n this.statusText = ''\n this.bytesRead = 0\n this.contentLength = ''\n this.keepAlive = ''\n this.connection = ''\n\n assert(this.headers.length % 2 === 0)\n this.headers = []\n this.headersSize = 0\n\n if (statusCode < 200) {\n return\n }\n\n /* istanbul ignore next: should be handled by llhttp? */\n if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {\n util.destroy(socket, new ResponseContentLengthMismatchError())\n return -1\n }\n\n request.onComplete(headers)\n\n client[kQueue][client[kRunningIdx]++] = null\n\n if (socket[kWriting]) {\n assert.strictEqual(client[kRunning], 0)\n // Response completed before request.\n util.destroy(socket, new InformationalError('reset'))\n return constants.ERROR.PAUSED\n } else if (!shouldKeepAlive) {\n util.destroy(socket, new InformationalError('reset'))\n return constants.ERROR.PAUSED\n } else if (socket[kReset] && client[kRunning] === 0) {\n // Destroy socket once all requests have completed.\n // The request at the tail of the pipeline is the one\n // that requested reset and no further requests should\n // have been queued since then.\n util.destroy(socket, new InformationalError('reset'))\n return constants.ERROR.PAUSED\n } else if (client[kPipelining] === 1) {\n // We must wait a full event loop cycle to reuse this socket to make sure\n // that non-spec compliant servers are not closing the connection even if they\n // said they won't.\n setImmediate(resume, client)\n } else {\n resume(client)\n }\n }\n}\n\nfunction onParserTimeout (parser) {\n const { socket, timeoutType, client } = parser\n\n /* istanbul ignore else */\n if (timeoutType === TIMEOUT_HEADERS) {\n if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {\n assert(!parser.paused, 'cannot be paused while waiting for headers')\n util.destroy(socket, new HeadersTimeoutError())\n }\n } else if (timeoutType === TIMEOUT_BODY) {\n if (!parser.paused) {\n util.destroy(socket, new BodyTimeoutError())\n }\n } else if (timeoutType === TIMEOUT_IDLE) {\n assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])\n util.destroy(socket, new InformationalError('socket idle timeout'))\n }\n}\n\nfunction onSocketReadable () {\n const { [kParser]: parser } = this\n if (parser) {\n parser.readMore()\n }\n}\n\nfunction onSocketError (err) {\n const { [kClient]: client, [kParser]: parser } = this\n\n assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n if (client[kHTTPConnVersion] !== 'h2') {\n // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded\n // to the user.\n if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {\n // We treat all incoming data so for as a valid response.\n parser.onMessageComplete()\n return\n }\n }\n\n this[kError] = err\n\n onError(this[kClient], err)\n}\n\nfunction onError (client, err) {\n if (\n client[kRunning] === 0 &&\n err.code !== 'UND_ERR_INFO' &&\n err.code !== 'UND_ERR_SOCKET'\n ) {\n // Error is not caused by running request and not a recoverable\n // socket error.\n\n assert(client[kPendingIdx] === client[kRunningIdx])\n\n const requests = client[kQueue].splice(client[kRunningIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n errorRequest(client, request, err)\n }\n assert(client[kSize] === 0)\n }\n}\n\nfunction onSocketEnd () {\n const { [kParser]: parser, [kClient]: client } = this\n\n if (client[kHTTPConnVersion] !== 'h2') {\n if (parser.statusCode && !parser.shouldKeepAlive) {\n // We treat all incoming data so far as a valid response.\n parser.onMessageComplete()\n return\n }\n }\n\n util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n}\n\nfunction onSocketClose () {\n const { [kClient]: client, [kParser]: parser } = this\n\n if (client[kHTTPConnVersion] === 'h1' && parser) {\n if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {\n // We treat all incoming data so far as a valid response.\n parser.onMessageComplete()\n }\n\n this[kParser].destroy()\n this[kParser] = null\n }\n\n const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n client[kSocket] = null\n\n if (client.destroyed) {\n assert(client[kPending] === 0)\n\n // Fail entire queue.\n const requests = client[kQueue].splice(client[kRunningIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n errorRequest(client, request, err)\n }\n } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {\n // Fail head of pipeline.\n const request = client[kQueue][client[kRunningIdx]]\n client[kQueue][client[kRunningIdx]++] = null\n\n errorRequest(client, request, err)\n }\n\n client[kPendingIdx] = client[kRunningIdx]\n\n assert(client[kRunning] === 0)\n\n client.emit('disconnect', client[kUrl], [client], err)\n\n resume(client)\n}\n\nasync function connect (client) {\n assert(!client[kConnecting])\n assert(!client[kSocket])\n\n let { host, hostname, protocol, port } = client[kUrl]\n\n // Resolve ipv6\n if (hostname[0] === '[') {\n const idx = hostname.indexOf(']')\n\n assert(idx !== -1)\n const ip = hostname.substring(1, idx)\n\n assert(net.isIP(ip))\n hostname = ip\n }\n\n client[kConnecting] = true\n\n if (channels.beforeConnect.hasSubscribers) {\n channels.beforeConnect.publish({\n connectParams: {\n host,\n hostname,\n protocol,\n port,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n },\n connector: client[kConnector]\n })\n }\n\n try {\n const socket = await new Promise((resolve, reject) => {\n client[kConnector]({\n host,\n hostname,\n protocol,\n port,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n }, (err, socket) => {\n if (err) {\n reject(err)\n } else {\n resolve(socket)\n }\n })\n })\n\n if (client.destroyed) {\n util.destroy(socket.on('error', () => {}), new ClientDestroyedError())\n return\n }\n\n client[kConnecting] = false\n\n assert(socket)\n\n const isH2 = socket.alpnProtocol === 'h2'\n if (isH2) {\n if (!h2ExperimentalWarned) {\n h2ExperimentalWarned = true\n process.emitWarning('H2 support is experimental, expect them to change at any time.', {\n code: 'UNDICI-H2'\n })\n }\n\n const session = http2.connect(client[kUrl], {\n createConnection: () => socket,\n peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams\n })\n\n client[kHTTPConnVersion] = 'h2'\n session[kClient] = client\n session[kSocket] = socket\n session.on('error', onHttp2SessionError)\n session.on('frameError', onHttp2FrameError)\n session.on('end', onHttp2SessionEnd)\n session.on('goaway', onHTTP2GoAway)\n session.on('close', onSocketClose)\n session.unref()\n\n client[kHTTP2Session] = session\n socket[kHTTP2Session] = session\n } else {\n if (!llhttpInstance) {\n llhttpInstance = await llhttpPromise\n llhttpPromise = null\n }\n\n socket[kNoRef] = false\n socket[kWriting] = false\n socket[kReset] = false\n socket[kBlocking] = false\n socket[kParser] = new Parser(client, socket, llhttpInstance)\n }\n\n socket[kCounter] = 0\n socket[kMaxRequests] = client[kMaxRequests]\n socket[kClient] = client\n socket[kError] = null\n\n socket\n .on('error', onSocketError)\n .on('readable', onSocketReadable)\n .on('end', onSocketEnd)\n .on('close', onSocketClose)\n\n client[kSocket] = socket\n\n if (channels.connected.hasSubscribers) {\n channels.connected.publish({\n connectParams: {\n host,\n hostname,\n protocol,\n port,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n },\n connector: client[kConnector],\n socket\n })\n }\n client.emit('connect', client[kUrl], [client])\n } catch (err) {\n if (client.destroyed) {\n return\n }\n\n client[kConnecting] = false\n\n if (channels.connectError.hasSubscribers) {\n channels.connectError.publish({\n connectParams: {\n host,\n hostname,\n protocol,\n port,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n },\n connector: client[kConnector],\n error: err\n })\n }\n\n if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n assert(client[kRunning] === 0)\n while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {\n const request = client[kQueue][client[kPendingIdx]++]\n errorRequest(client, request, err)\n }\n } else {\n onError(client, err)\n }\n\n client.emit('connectionError', client[kUrl], [client], err)\n }\n\n resume(client)\n}\n\nfunction emitDrain (client) {\n client[kNeedDrain] = 0\n client.emit('drain', client[kUrl], [client])\n}\n\nfunction resume (client, sync) {\n if (client[kResuming] === 2) {\n return\n }\n\n client[kResuming] = 2\n\n _resume(client, sync)\n client[kResuming] = 0\n\n if (client[kRunningIdx] > 256) {\n client[kQueue].splice(0, client[kRunningIdx])\n client[kPendingIdx] -= client[kRunningIdx]\n client[kRunningIdx] = 0\n }\n}\n\nfunction _resume (client, sync) {\n while (true) {\n if (client.destroyed) {\n assert(client[kPending] === 0)\n return\n }\n\n if (client[kClosedResolve] && !client[kSize]) {\n client[kClosedResolve]()\n client[kClosedResolve] = null\n return\n }\n\n const socket = client[kSocket]\n\n if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {\n if (client[kSize] === 0) {\n if (!socket[kNoRef] && socket.unref) {\n socket.unref()\n socket[kNoRef] = true\n }\n } else if (socket[kNoRef] && socket.ref) {\n socket.ref()\n socket[kNoRef] = false\n }\n\n if (client[kSize] === 0) {\n if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {\n socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)\n }\n } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {\n if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {\n const request = client[kQueue][client[kRunningIdx]]\n const headersTimeout = request.headersTimeout != null\n ? request.headersTimeout\n : client[kHeadersTimeout]\n socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)\n }\n }\n }\n\n if (client[kBusy]) {\n client[kNeedDrain] = 2\n } else if (client[kNeedDrain] === 2) {\n if (sync) {\n client[kNeedDrain] = 1\n process.nextTick(emitDrain, client)\n } else {\n emitDrain(client)\n }\n continue\n }\n\n if (client[kPending] === 0) {\n return\n }\n\n if (client[kRunning] >= (client[kPipelining] || 1)) {\n return\n }\n\n const request = client[kQueue][client[kPendingIdx]]\n\n if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {\n if (client[kRunning] > 0) {\n return\n }\n\n client[kServerName] = request.servername\n\n if (socket && socket.servername !== request.servername) {\n util.destroy(socket, new InformationalError('servername changed'))\n return\n }\n }\n\n if (client[kConnecting]) {\n return\n }\n\n if (!socket && !client[kHTTP2Session]) {\n connect(client)\n return\n }\n\n if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {\n return\n }\n\n if (client[kRunning] > 0 && !request.idempotent) {\n // Non-idempotent request cannot be retried.\n // Ensure that no other requests are inflight and\n // could cause failure.\n return\n }\n\n if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {\n // Don't dispatch an upgrade until all preceding requests have completed.\n // A misbehaving server might upgrade the connection before all pipelined\n // request has completed.\n return\n }\n\n if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&\n (util.isStream(request.body) || util.isAsyncIterable(request.body))) {\n // Request with stream or iterator body can error while other requests\n // are inflight and indirectly error those as well.\n // Ensure this doesn't happen by waiting for inflight\n // to complete before dispatching.\n\n // Request with stream or iterator body cannot be retried.\n // Ensure that no other requests are inflight and\n // could cause failure.\n return\n }\n\n if (!request.aborted && write(client, request)) {\n client[kPendingIdx]++\n } else {\n client[kQueue].splice(client[kPendingIdx], 1)\n }\n }\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction write (client, request) {\n if (client[kHTTPConnVersion] === 'h2') {\n writeH2(client, client[kHTTP2Session], request)\n return\n }\n\n const { body, method, path, host, upgrade, headers, blocking, reset } = request\n\n // https://tools.ietf.org/html/rfc7231#section-4.3.1\n // https://tools.ietf.org/html/rfc7231#section-4.3.2\n // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n // Sending a payload body on a request that does not\n // expect it can cause undefined behavior on some\n // servers and corrupt connection state. Do not\n // re-use the connection for further requests.\n\n const expectsPayload = (\n method === 'PUT' ||\n method === 'POST' ||\n method === 'PATCH'\n )\n\n if (body && typeof body.read === 'function') {\n // Try to read EOF in order to get length.\n body.read(0)\n }\n\n const bodyLength = util.bodyLength(body)\n\n let contentLength = bodyLength\n\n if (contentLength === null) {\n contentLength = request.contentLength\n }\n\n if (contentLength === 0 && !expectsPayload) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD NOT send a Content-Length header field when\n // the request message does not contain a payload body and the method\n // semantics do not anticipate such a body.\n\n contentLength = null\n }\n\n // https://github.com/nodejs/undici/issues/2046\n // A user agent may send a Content-Length header with 0 value, this should be allowed.\n if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {\n if (client[kStrictContentLength]) {\n errorRequest(client, request, new RequestContentLengthMismatchError())\n return false\n }\n\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n\n const socket = client[kSocket]\n\n try {\n request.onConnect((err) => {\n if (request.aborted || request.completed) {\n return\n }\n\n errorRequest(client, request, err || new RequestAbortedError())\n\n util.destroy(socket, new InformationalError('aborted'))\n })\n } catch (err) {\n errorRequest(client, request, err)\n }\n\n if (request.aborted) {\n return false\n }\n\n if (method === 'HEAD') {\n // https://github.com/mcollina/undici/issues/258\n // Close after a HEAD request to interop with misbehaving servers\n // that may send a body in the response.\n\n socket[kReset] = true\n }\n\n if (upgrade || method === 'CONNECT') {\n // On CONNECT or upgrade, block pipeline from dispatching further\n // requests on this connection.\n\n socket[kReset] = true\n }\n\n if (reset != null) {\n socket[kReset] = reset\n }\n\n if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {\n socket[kReset] = true\n }\n\n if (blocking) {\n socket[kBlocking] = true\n }\n\n let header = `${method} ${path} HTTP/1.1\\r\\n`\n\n if (typeof host === 'string') {\n header += `host: ${host}\\r\\n`\n } else {\n header += client[kHostHeader]\n }\n\n if (upgrade) {\n header += `connection: upgrade\\r\\nupgrade: ${upgrade}\\r\\n`\n } else if (client[kPipelining] && !socket[kReset]) {\n header += 'connection: keep-alive\\r\\n'\n } else {\n header += 'connection: close\\r\\n'\n }\n\n if (headers) {\n header += headers\n }\n\n if (channels.sendHeaders.hasSubscribers) {\n channels.sendHeaders.publish({ request, headers: header, socket })\n }\n\n /* istanbul ignore else: assertion */\n if (!body || bodyLength === 0) {\n if (contentLength === 0) {\n socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n } else {\n assert(contentLength === null, 'no body must not have content length')\n socket.write(`${header}\\r\\n`, 'latin1')\n }\n request.onRequestSent()\n } else if (util.isBuffer(body)) {\n assert(contentLength === body.byteLength, 'buffer body must have content length')\n\n socket.cork()\n socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n socket.write(body)\n socket.uncork()\n request.onBodySent(body)\n request.onRequestSent()\n if (!expectsPayload) {\n socket[kReset] = true\n }\n } else if (util.isBlobLike(body)) {\n if (typeof body.stream === 'function') {\n writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })\n } else {\n writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })\n }\n } else if (util.isStream(body)) {\n writeStream({ body, client, request, socket, contentLength, header, expectsPayload })\n } else if (util.isIterable(body)) {\n writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })\n } else {\n assert(false)\n }\n\n return true\n}\n\nfunction writeH2 (client, session, request) {\n const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request\n\n let headers\n if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())\n else headers = reqHeaders\n\n if (upgrade) {\n errorRequest(client, request, new Error('Upgrade not supported for H2'))\n return false\n }\n\n try {\n // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?\n request.onConnect((err) => {\n if (request.aborted || request.completed) {\n return\n }\n\n errorRequest(client, request, err || new RequestAbortedError())\n })\n } catch (err) {\n errorRequest(client, request, err)\n }\n\n if (request.aborted) {\n return false\n }\n\n /** @type {import('node:http2').ClientHttp2Stream} */\n let stream\n const h2State = client[kHTTP2SessionState]\n\n headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]\n headers[HTTP2_HEADER_METHOD] = method\n\n if (method === 'CONNECT') {\n session.ref()\n // we are already connected, streams are pending, first request\n // will create a new stream. We trigger a request to create the stream and wait until\n // `ready` event is triggered\n // We disabled endStream to allow the user to write to the stream\n stream = session.request(headers, { endStream: false, signal })\n\n if (stream.id && !stream.pending) {\n request.onUpgrade(null, null, stream)\n ++h2State.openStreams\n } else {\n stream.once('ready', () => {\n request.onUpgrade(null, null, stream)\n ++h2State.openStreams\n })\n }\n\n stream.once('close', () => {\n h2State.openStreams -= 1\n // TODO(HTTP/2): unref only if current streams count is 0\n if (h2State.openStreams === 0) session.unref()\n })\n\n return true\n }\n\n // https://tools.ietf.org/html/rfc7540#section-8.3\n // :path and :scheme headers must be omited when sending CONNECT\n\n headers[HTTP2_HEADER_PATH] = path\n headers[HTTP2_HEADER_SCHEME] = 'https'\n\n // https://tools.ietf.org/html/rfc7231#section-4.3.1\n // https://tools.ietf.org/html/rfc7231#section-4.3.2\n // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n // Sending a payload body on a request that does not\n // expect it can cause undefined behavior on some\n // servers and corrupt connection state. Do not\n // re-use the connection for further requests.\n\n const expectsPayload = (\n method === 'PUT' ||\n method === 'POST' ||\n method === 'PATCH'\n )\n\n if (body && typeof body.read === 'function') {\n // Try to read EOF in order to get length.\n body.read(0)\n }\n\n let contentLength = util.bodyLength(body)\n\n if (contentLength == null) {\n contentLength = request.contentLength\n }\n\n if (contentLength === 0 || !expectsPayload) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD NOT send a Content-Length header field when\n // the request message does not contain a payload body and the method\n // semantics do not anticipate such a body.\n\n contentLength = null\n }\n\n // https://github.com/nodejs/undici/issues/2046\n // A user agent may send a Content-Length header with 0 value, this should be allowed.\n if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {\n if (client[kStrictContentLength]) {\n errorRequest(client, request, new RequestContentLengthMismatchError())\n return false\n }\n\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n\n if (contentLength != null) {\n assert(body, 'no body must not have content length')\n headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`\n }\n\n session.ref()\n\n const shouldEndStream = method === 'GET' || method === 'HEAD'\n if (expectContinue) {\n headers[HTTP2_HEADER_EXPECT] = '100-continue'\n stream = session.request(headers, { endStream: shouldEndStream, signal })\n\n stream.once('continue', writeBodyH2)\n } else {\n stream = session.request(headers, {\n endStream: shouldEndStream,\n signal\n })\n writeBodyH2()\n }\n\n // Increment counter as we have new several streams open\n ++h2State.openStreams\n\n stream.once('response', headers => {\n const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers\n\n if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {\n stream.pause()\n }\n })\n\n stream.once('end', () => {\n request.onComplete([])\n })\n\n stream.on('data', (chunk) => {\n if (request.onData(chunk) === false) {\n stream.pause()\n }\n })\n\n stream.once('close', () => {\n h2State.openStreams -= 1\n // TODO(HTTP/2): unref only if current streams count is 0\n if (h2State.openStreams === 0) {\n session.unref()\n }\n })\n\n stream.once('error', function (err) {\n if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {\n h2State.streams -= 1\n util.destroy(stream, err)\n }\n })\n\n stream.once('frameError', (type, code) => {\n const err = new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`)\n errorRequest(client, request, err)\n\n if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {\n h2State.streams -= 1\n util.destroy(stream, err)\n }\n })\n\n // stream.on('aborted', () => {\n // // TODO(HTTP/2): Support aborted\n // })\n\n // stream.on('timeout', () => {\n // // TODO(HTTP/2): Support timeout\n // })\n\n // stream.on('push', headers => {\n // // TODO(HTTP/2): Suppor push\n // })\n\n // stream.on('trailers', headers => {\n // // TODO(HTTP/2): Support trailers\n // })\n\n return true\n\n function writeBodyH2 () {\n /* istanbul ignore else: assertion */\n if (!body) {\n request.onRequestSent()\n } else if (util.isBuffer(body)) {\n assert(contentLength === body.byteLength, 'buffer body must have content length')\n stream.cork()\n stream.write(body)\n stream.uncork()\n stream.end()\n request.onBodySent(body)\n request.onRequestSent()\n } else if (util.isBlobLike(body)) {\n if (typeof body.stream === 'function') {\n writeIterable({\n client,\n request,\n contentLength,\n h2stream: stream,\n expectsPayload,\n body: body.stream(),\n socket: client[kSocket],\n header: ''\n })\n } else {\n writeBlob({\n body,\n client,\n request,\n contentLength,\n expectsPayload,\n h2stream: stream,\n header: '',\n socket: client[kSocket]\n })\n }\n } else if (util.isStream(body)) {\n writeStream({\n body,\n client,\n request,\n contentLength,\n expectsPayload,\n socket: client[kSocket],\n h2stream: stream,\n header: ''\n })\n } else if (util.isIterable(body)) {\n writeIterable({\n body,\n client,\n request,\n contentLength,\n expectsPayload,\n header: '',\n h2stream: stream,\n socket: client[kSocket]\n })\n } else {\n assert(false)\n }\n }\n}\n\nfunction writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n if (client[kHTTPConnVersion] === 'h2') {\n // For HTTP/2, is enough to pipe the stream\n const pipe = pipeline(\n body,\n h2stream,\n (err) => {\n if (err) {\n util.destroy(body, err)\n util.destroy(h2stream, err)\n } else {\n request.onRequestSent()\n }\n }\n )\n\n pipe.on('data', onPipeData)\n pipe.once('end', () => {\n pipe.removeListener('data', onPipeData)\n util.destroy(pipe)\n })\n\n function onPipeData (chunk) {\n request.onBodySent(chunk)\n }\n\n return\n }\n\n let finished = false\n\n const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })\n\n const onData = function (chunk) {\n if (finished) {\n return\n }\n\n try {\n if (!writer.write(chunk) && this.pause) {\n this.pause()\n }\n } catch (err) {\n util.destroy(this, err)\n }\n }\n const onDrain = function () {\n if (finished) {\n return\n }\n\n if (body.resume) {\n body.resume()\n }\n }\n const onAbort = function () {\n if (finished) {\n return\n }\n const err = new RequestAbortedError()\n queueMicrotask(() => onFinished(err))\n }\n const onFinished = function (err) {\n if (finished) {\n return\n }\n\n finished = true\n\n assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))\n\n socket\n .off('drain', onDrain)\n .off('error', onFinished)\n\n body\n .removeListener('data', onData)\n .removeListener('end', onFinished)\n .removeListener('error', onFinished)\n .removeListener('close', onAbort)\n\n if (!err) {\n try {\n writer.end()\n } catch (er) {\n err = er\n }\n }\n\n writer.destroy(err)\n\n if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {\n util.destroy(body, err)\n } else {\n util.destroy(body)\n }\n }\n\n body\n .on('data', onData)\n .on('end', onFinished)\n .on('error', onFinished)\n .on('close', onAbort)\n\n if (body.resume) {\n body.resume()\n }\n\n socket\n .on('drain', onDrain)\n .on('error', onFinished)\n}\n\nasync function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {\n assert(contentLength === body.size, 'blob body must have content length')\n\n const isH2 = client[kHTTPConnVersion] === 'h2'\n try {\n if (contentLength != null && contentLength !== body.size) {\n throw new RequestContentLengthMismatchError()\n }\n\n const buffer = Buffer.from(await body.arrayBuffer())\n\n if (isH2) {\n h2stream.cork()\n h2stream.write(buffer)\n h2stream.uncork()\n } else {\n socket.cork()\n socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n socket.write(buffer)\n socket.uncork()\n }\n\n request.onBodySent(buffer)\n request.onRequestSent()\n\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n resume(client)\n } catch (err) {\n util.destroy(isH2 ? h2stream : socket, err)\n }\n}\n\nasync function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n let callback = null\n function onDrain () {\n if (callback) {\n const cb = callback\n callback = null\n cb()\n }\n }\n\n const waitForDrain = () => new Promise((resolve, reject) => {\n assert(callback === null)\n\n if (socket[kError]) {\n reject(socket[kError])\n } else {\n callback = resolve\n }\n })\n\n if (client[kHTTPConnVersion] === 'h2') {\n h2stream\n .on('close', onDrain)\n .on('drain', onDrain)\n\n try {\n // It's up to the user to somehow abort the async iterable.\n for await (const chunk of body) {\n if (socket[kError]) {\n throw socket[kError]\n }\n\n const res = h2stream.write(chunk)\n request.onBodySent(chunk)\n if (!res) {\n await waitForDrain()\n }\n }\n } catch (err) {\n h2stream.destroy(err)\n } finally {\n request.onRequestSent()\n h2stream.end()\n h2stream\n .off('close', onDrain)\n .off('drain', onDrain)\n }\n\n return\n }\n\n socket\n .on('close', onDrain)\n .on('drain', onDrain)\n\n const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })\n try {\n // It's up to the user to somehow abort the async iterable.\n for await (const chunk of body) {\n if (socket[kError]) {\n throw socket[kError]\n }\n\n if (!writer.write(chunk)) {\n await waitForDrain()\n }\n }\n\n writer.end()\n } catch (err) {\n writer.destroy(err)\n } finally {\n socket\n .off('close', onDrain)\n .off('drain', onDrain)\n }\n}\n\nclass AsyncWriter {\n constructor ({ socket, request, contentLength, client, expectsPayload, header }) {\n this.socket = socket\n this.request = request\n this.contentLength = contentLength\n this.client = client\n this.bytesWritten = 0\n this.expectsPayload = expectsPayload\n this.header = header\n\n socket[kWriting] = true\n }\n\n write (chunk) {\n const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this\n\n if (socket[kError]) {\n throw socket[kError]\n }\n\n if (socket.destroyed) {\n return false\n }\n\n const len = Buffer.byteLength(chunk)\n if (!len) {\n return true\n }\n\n // We should defer writing chunks.\n if (contentLength !== null && bytesWritten + len > contentLength) {\n if (client[kStrictContentLength]) {\n throw new RequestContentLengthMismatchError()\n }\n\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n\n socket.cork()\n\n if (bytesWritten === 0) {\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n if (contentLength === null) {\n socket.write(`${header}transfer-encoding: chunked\\r\\n`, 'latin1')\n } else {\n socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n }\n }\n\n if (contentLength === null) {\n socket.write(`\\r\\n${len.toString(16)}\\r\\n`, 'latin1')\n }\n\n this.bytesWritten += len\n\n const ret = socket.write(chunk)\n\n socket.uncork()\n\n request.onBodySent(chunk)\n\n if (!ret) {\n if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n // istanbul ignore else: only for jest\n if (socket[kParser].timeout.refresh) {\n socket[kParser].timeout.refresh()\n }\n }\n }\n\n return ret\n }\n\n end () {\n const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this\n request.onRequestSent()\n\n socket[kWriting] = false\n\n if (socket[kError]) {\n throw socket[kError]\n }\n\n if (socket.destroyed) {\n return\n }\n\n if (bytesWritten === 0) {\n if (expectsPayload) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD send a Content-Length in a request message when\n // no Transfer-Encoding is sent and the request method defines a meaning\n // for an enclosed payload body.\n\n socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n } else {\n socket.write(`${header}\\r\\n`, 'latin1')\n }\n } else if (contentLength === null) {\n socket.write('\\r\\n0\\r\\n\\r\\n', 'latin1')\n }\n\n if (contentLength !== null && bytesWritten !== contentLength) {\n if (client[kStrictContentLength]) {\n throw new RequestContentLengthMismatchError()\n } else {\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n }\n\n if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n // istanbul ignore else: only for jest\n if (socket[kParser].timeout.refresh) {\n socket[kParser].timeout.refresh()\n }\n }\n\n resume(client)\n }\n\n destroy (err) {\n const { socket, client } = this\n\n socket[kWriting] = false\n\n if (err) {\n assert(client[kRunning] <= 1, 'pipeline should only contain this request')\n util.destroy(socket, err)\n }\n }\n}\n\nfunction errorRequest (client, request, err) {\n try {\n request.onError(err)\n assert(request.aborted)\n } catch (err) {\n client.emit('error', err)\n }\n}\n\nmodule.exports = Client\n","/* eslint-disable */\n\n'use strict'\n\n// Extracted from node/lib/internal/fixed_queue.js\n\n// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.\nconst kSize = 2048;\nconst kMask = kSize - 1;\n\n// The FixedQueue is implemented as a singly-linked list of fixed-size\n// circular buffers. It looks something like this:\n//\n// head tail\n// | |\n// v v\n// +-----------+ <-----\\ +-----------+ <------\\ +-----------+\n// | [null] | \\----- | next | \\------- | next |\n// +-----------+ +-----------+ +-----------+\n// | item | <-- bottom | item | <-- bottom | [empty] |\n// | item | | item | | [empty] |\n// | item | | item | | [empty] |\n// | item | | item | | [empty] |\n// | item | | item | bottom --> | item |\n// | item | | item | | item |\n// | ... | | ... | | ... |\n// | item | | item | | item |\n// | item | | item | | item |\n// | [empty] | <-- top | item | | item |\n// | [empty] | | item | | item |\n// | [empty] | | [empty] | <-- top top --> | [empty] |\n// +-----------+ +-----------+ +-----------+\n//\n// Or, if there is only one circular buffer, it looks something\n// like either of these:\n//\n// head tail head tail\n// | | | |\n// v v v v\n// +-----------+ +-----------+\n// | [null] | | [null] |\n// +-----------+ +-----------+\n// | [empty] | | item |\n// | [empty] | | item |\n// | item | <-- bottom top --> | [empty] |\n// | item | | [empty] |\n// | [empty] | <-- top bottom --> | item |\n// | [empty] | | item |\n// +-----------+ +-----------+\n//\n// Adding a value means moving `top` forward by one, removing means\n// moving `bottom` forward by one. After reaching the end, the queue\n// wraps around.\n//\n// When `top === bottom` the current queue is empty and when\n// `top + 1 === bottom` it's full. This wastes a single space of storage\n// but allows much quicker checks.\n\nclass FixedCircularBuffer {\n constructor() {\n this.bottom = 0;\n this.top = 0;\n this.list = new Array(kSize);\n this.next = null;\n }\n\n isEmpty() {\n return this.top === this.bottom;\n }\n\n isFull() {\n return ((this.top + 1) & kMask) === this.bottom;\n }\n\n push(data) {\n this.list[this.top] = data;\n this.top = (this.top + 1) & kMask;\n }\n\n shift() {\n const nextItem = this.list[this.bottom];\n if (nextItem === undefined)\n return null;\n this.list[this.bottom] = undefined;\n this.bottom = (this.bottom + 1) & kMask;\n return nextItem;\n }\n}\n\nmodule.exports = class FixedQueue {\n constructor() {\n this.head = this.tail = new FixedCircularBuffer();\n }\n\n isEmpty() {\n return this.head.isEmpty();\n }\n\n push(data) {\n if (this.head.isFull()) {\n // Head is full: Creates a new queue, sets the old queue's `.next` to it,\n // and sets it as the new main queue.\n this.head = this.head.next = new FixedCircularBuffer();\n }\n this.head.push(data);\n }\n\n shift() {\n const tail = this.tail;\n const next = tail.shift();\n if (tail.isEmpty() && tail.next !== null) {\n // If there is another queue, it forms the new tail.\n this.tail = tail.next;\n }\n return next;\n }\n};\n","const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require('./core/symbols')\nconst kPool = Symbol('pool')\n\nclass PoolStats {\n constructor (pool) {\n this[kPool] = pool\n }\n\n get connected () {\n return this[kPool][kConnected]\n }\n\n get free () {\n return this[kPool][kFree]\n }\n\n get pending () {\n return this[kPool][kPending]\n }\n\n get queued () {\n return this[kPool][kQueued]\n }\n\n get running () {\n return this[kPool][kRunning]\n }\n\n get size () {\n return this[kPool][kSize]\n }\n}\n\nmodule.exports = PoolStats\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst FixedQueue = require('./node/fixed-queue')\nconst { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require('./core/symbols')\nconst PoolStats = require('./pool-stats')\n\nconst kClients = Symbol('clients')\nconst kNeedDrain = Symbol('needDrain')\nconst kQueue = Symbol('queue')\nconst kClosedResolve = Symbol('closed resolve')\nconst kOnDrain = Symbol('onDrain')\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kGetDispatcher = Symbol('get dispatcher')\nconst kAddClient = Symbol('add client')\nconst kRemoveClient = Symbol('remove client')\nconst kStats = Symbol('stats')\n\nclass PoolBase extends DispatcherBase {\n constructor () {\n super()\n\n this[kQueue] = new FixedQueue()\n this[kClients] = []\n this[kQueued] = 0\n\n const pool = this\n\n this[kOnDrain] = function onDrain (origin, targets) {\n const queue = pool[kQueue]\n\n let needDrain = false\n\n while (!needDrain) {\n const item = queue.shift()\n if (!item) {\n break\n }\n pool[kQueued]--\n needDrain = !this.dispatch(item.opts, item.handler)\n }\n\n this[kNeedDrain] = needDrain\n\n if (!this[kNeedDrain] && pool[kNeedDrain]) {\n pool[kNeedDrain] = false\n pool.emit('drain', origin, [pool, ...targets])\n }\n\n if (pool[kClosedResolve] && queue.isEmpty()) {\n Promise\n .all(pool[kClients].map(c => c.close()))\n .then(pool[kClosedResolve])\n }\n }\n\n this[kOnConnect] = (origin, targets) => {\n pool.emit('connect', origin, [pool, ...targets])\n }\n\n this[kOnDisconnect] = (origin, targets, err) => {\n pool.emit('disconnect', origin, [pool, ...targets], err)\n }\n\n this[kOnConnectionError] = (origin, targets, err) => {\n pool.emit('connectionError', origin, [pool, ...targets], err)\n }\n\n this[kStats] = new PoolStats(this)\n }\n\n get [kBusy] () {\n return this[kNeedDrain]\n }\n\n get [kConnected] () {\n return this[kClients].filter(client => client[kConnected]).length\n }\n\n get [kFree] () {\n return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length\n }\n\n get [kPending] () {\n let ret = this[kQueued]\n for (const { [kPending]: pending } of this[kClients]) {\n ret += pending\n }\n return ret\n }\n\n get [kRunning] () {\n let ret = 0\n for (const { [kRunning]: running } of this[kClients]) {\n ret += running\n }\n return ret\n }\n\n get [kSize] () {\n let ret = this[kQueued]\n for (const { [kSize]: size } of this[kClients]) {\n ret += size\n }\n return ret\n }\n\n get stats () {\n return this[kStats]\n }\n\n async [kClose] () {\n if (this[kQueue].isEmpty()) {\n return Promise.all(this[kClients].map(c => c.close()))\n } else {\n return new Promise((resolve) => {\n this[kClosedResolve] = resolve\n })\n }\n }\n\n async [kDestroy] (err) {\n while (true) {\n const item = this[kQueue].shift()\n if (!item) {\n break\n }\n item.handler.onError(err)\n }\n\n return Promise.all(this[kClients].map(c => c.destroy(err)))\n }\n\n [kDispatch] (opts, handler) {\n const dispatcher = this[kGetDispatcher]()\n\n if (!dispatcher) {\n this[kNeedDrain] = true\n this[kQueue].push({ opts, handler })\n this[kQueued]++\n } else if (!dispatcher.dispatch(opts, handler)) {\n dispatcher[kNeedDrain] = true\n this[kNeedDrain] = !this[kGetDispatcher]()\n }\n\n return !this[kNeedDrain]\n }\n\n [kAddClient] (client) {\n client\n .on('drain', this[kOnDrain])\n .on('connect', this[kOnConnect])\n .on('disconnect', this[kOnDisconnect])\n .on('connectionError', this[kOnConnectionError])\n\n this[kClients].push(client)\n\n if (this[kNeedDrain]) {\n process.nextTick(() => {\n if (this[kNeedDrain]) {\n this[kOnDrain](client[kUrl], [this, client])\n }\n })\n }\n\n return this\n }\n\n [kRemoveClient] (client) {\n client.close(() => {\n const idx = this[kClients].indexOf(client)\n if (idx !== -1) {\n this[kClients].splice(idx, 1)\n }\n })\n\n this[kNeedDrain] = this[kClients].some(dispatcher => (\n !dispatcher[kNeedDrain] &&\n dispatcher.closed !== true &&\n dispatcher.destroyed !== true\n ))\n }\n}\n\nmodule.exports = {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kRemoveClient,\n kGetDispatcher\n}\n","'use strict'\n\nconst {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kGetDispatcher\n} = require('./pool-base')\nconst Client = require('./client')\nconst {\n InvalidArgumentError\n} = require('./core/errors')\nconst util = require('./core/util')\nconst { kUrl, kInterceptors } = require('./core/symbols')\nconst buildConnector = require('./core/connect')\n\nconst kOptions = Symbol('options')\nconst kConnections = Symbol('connections')\nconst kFactory = Symbol('factory')\n\nfunction defaultFactory (origin, opts) {\n return new Client(origin, opts)\n}\n\nclass Pool extends PoolBase {\n constructor (origin, {\n connections,\n factory = defaultFactory,\n connect,\n connectTimeout,\n tls,\n maxCachedSessions,\n socketPath,\n autoSelectFamily,\n autoSelectFamilyAttemptTimeout,\n allowH2,\n ...options\n } = {}) {\n super()\n\n if (connections != null && (!Number.isFinite(connections) || connections < 0)) {\n throw new InvalidArgumentError('invalid connections')\n }\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (typeof connect !== 'function') {\n connect = buildConnector({\n ...tls,\n maxCachedSessions,\n allowH2,\n socketPath,\n timeout: connectTimeout,\n ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n ...connect\n })\n }\n\n this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)\n ? options.interceptors.Pool\n : []\n this[kConnections] = connections || null\n this[kUrl] = util.parseOrigin(origin)\n this[kOptions] = { ...util.deepClone(options), connect, allowH2 }\n this[kOptions].interceptors = options.interceptors\n ? { ...options.interceptors }\n : undefined\n this[kFactory] = factory\n\n this.on('connectionError', (origin, targets, error) => {\n // If a connection error occurs, we remove the client from the pool,\n // and emit a connectionError event. They will not be re-used.\n // Fixes https://github.com/nodejs/undici/issues/3895\n for (const target of targets) {\n // Do not use kRemoveClient here, as it will close the client,\n // but the client cannot be closed in this state.\n const idx = this[kClients].indexOf(target)\n if (idx !== -1) {\n this[kClients].splice(idx, 1)\n }\n }\n })\n }\n\n [kGetDispatcher] () {\n let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])\n\n if (dispatcher) {\n return dispatcher\n }\n\n if (!this[kConnections] || this[kClients].length < this[kConnections]) {\n dispatcher = this[kFactory](this[kUrl], this[kOptions])\n this[kAddClient](dispatcher)\n }\n\n return dispatcher\n }\n}\n\nmodule.exports = Pool\n","'use strict'\n\nconst {\n BalancedPoolMissingUpstreamError,\n InvalidArgumentError\n} = require('./core/errors')\nconst {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kRemoveClient,\n kGetDispatcher\n} = require('./pool-base')\nconst Pool = require('./pool')\nconst { kUrl, kInterceptors } = require('./core/symbols')\nconst { parseOrigin } = require('./core/util')\nconst kFactory = Symbol('factory')\n\nconst kOptions = Symbol('options')\nconst kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')\nconst kCurrentWeight = Symbol('kCurrentWeight')\nconst kIndex = Symbol('kIndex')\nconst kWeight = Symbol('kWeight')\nconst kMaxWeightPerServer = Symbol('kMaxWeightPerServer')\nconst kErrorPenalty = Symbol('kErrorPenalty')\n\nfunction getGreatestCommonDivisor (a, b) {\n if (b === 0) return a\n return getGreatestCommonDivisor(b, a % b)\n}\n\nfunction defaultFactory (origin, opts) {\n return new Pool(origin, opts)\n}\n\nclass BalancedPool extends PoolBase {\n constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {\n super()\n\n this[kOptions] = opts\n this[kIndex] = -1\n this[kCurrentWeight] = 0\n\n this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100\n this[kErrorPenalty] = this[kOptions].errorPenalty || 15\n\n if (!Array.isArray(upstreams)) {\n upstreams = [upstreams]\n }\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)\n ? opts.interceptors.BalancedPool\n : []\n this[kFactory] = factory\n\n for (const upstream of upstreams) {\n this.addUpstream(upstream)\n }\n this._updateBalancedPoolStats()\n }\n\n addUpstream (upstream) {\n const upstreamOrigin = parseOrigin(upstream).origin\n\n if (this[kClients].find((pool) => (\n pool[kUrl].origin === upstreamOrigin &&\n pool.closed !== true &&\n pool.destroyed !== true\n ))) {\n return this\n }\n const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))\n\n this[kAddClient](pool)\n pool.on('connect', () => {\n pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])\n })\n\n pool.on('connectionError', () => {\n pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n this._updateBalancedPoolStats()\n })\n\n pool.on('disconnect', (...args) => {\n const err = args[2]\n if (err && err.code === 'UND_ERR_SOCKET') {\n // decrease the weight of the pool.\n pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n this._updateBalancedPoolStats()\n }\n })\n\n for (const client of this[kClients]) {\n client[kWeight] = this[kMaxWeightPerServer]\n }\n\n this._updateBalancedPoolStats()\n\n return this\n }\n\n _updateBalancedPoolStats () {\n this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)\n }\n\n removeUpstream (upstream) {\n const upstreamOrigin = parseOrigin(upstream).origin\n\n const pool = this[kClients].find((pool) => (\n pool[kUrl].origin === upstreamOrigin &&\n pool.closed !== true &&\n pool.destroyed !== true\n ))\n\n if (pool) {\n this[kRemoveClient](pool)\n }\n\n return this\n }\n\n get upstreams () {\n return this[kClients]\n .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)\n .map((p) => p[kUrl].origin)\n }\n\n [kGetDispatcher] () {\n // We validate that pools is greater than 0,\n // otherwise we would have to wait until an upstream\n // is added, which might never happen.\n if (this[kClients].length === 0) {\n throw new BalancedPoolMissingUpstreamError()\n }\n\n const dispatcher = this[kClients].find(dispatcher => (\n !dispatcher[kNeedDrain] &&\n dispatcher.closed !== true &&\n dispatcher.destroyed !== true\n ))\n\n if (!dispatcher) {\n return\n }\n\n const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)\n\n if (allClientsBusy) {\n return\n }\n\n let counter = 0\n\n let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])\n\n while (counter++ < this[kClients].length) {\n this[kIndex] = (this[kIndex] + 1) % this[kClients].length\n const pool = this[kClients][this[kIndex]]\n\n // find pool index with the largest weight\n if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {\n maxWeightIndex = this[kIndex]\n }\n\n // decrease the current weight every `this[kClients].length`.\n if (this[kIndex] === 0) {\n // Set the current weight to the next lower weight.\n this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]\n\n if (this[kCurrentWeight] <= 0) {\n this[kCurrentWeight] = this[kMaxWeightPerServer]\n }\n }\n if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {\n return pool\n }\n }\n\n this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]\n this[kIndex] = maxWeightIndex\n return this[kClients][maxWeightIndex]\n }\n}\n\nmodule.exports = BalancedPool\n","'use strict'\n\n/* istanbul ignore file: only for Node 12 */\n\nconst { kConnected, kSize } = require('../core/symbols')\n\nclass CompatWeakRef {\n constructor (value) {\n this.value = value\n }\n\n deref () {\n return this.value[kConnected] === 0 && this.value[kSize] === 0\n ? undefined\n : this.value\n }\n}\n\nclass CompatFinalizer {\n constructor (finalizer) {\n this.finalizer = finalizer\n }\n\n register (dispatcher, key) {\n if (dispatcher.on) {\n dispatcher.on('disconnect', () => {\n if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {\n this.finalizer(key)\n }\n })\n }\n }\n}\n\nmodule.exports = function () {\n // FIXME: remove workaround when the Node bug is fixed\n // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\n if (process.env.NODE_V8_COVERAGE) {\n return {\n WeakRef: CompatWeakRef,\n FinalizationRegistry: CompatFinalizer\n }\n }\n return {\n WeakRef: global.WeakRef || CompatWeakRef,\n FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer\n }\n}\n","'use strict'\n\nconst { InvalidArgumentError } = require('./core/errors')\nconst { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require('./core/symbols')\nconst DispatcherBase = require('./dispatcher-base')\nconst Pool = require('./pool')\nconst Client = require('./client')\nconst util = require('./core/util')\nconst createRedirectInterceptor = require('./interceptor/redirectInterceptor')\nconst { WeakRef, FinalizationRegistry } = require('./compat/dispatcher-weakref')()\n\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kMaxRedirections = Symbol('maxRedirections')\nconst kOnDrain = Symbol('onDrain')\nconst kFactory = Symbol('factory')\nconst kFinalizer = Symbol('finalizer')\nconst kOptions = Symbol('options')\n\nfunction defaultFactory (origin, opts) {\n return opts && opts.connections === 1\n ? new Client(origin, opts)\n : new Pool(origin, opts)\n}\n\nclass Agent extends DispatcherBase {\n constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {\n super()\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {\n throw new InvalidArgumentError('maxRedirections must be a positive number')\n }\n\n if (connect && typeof connect !== 'function') {\n connect = { ...connect }\n }\n\n this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)\n ? options.interceptors.Agent\n : [createRedirectInterceptor({ maxRedirections })]\n\n this[kOptions] = { ...util.deepClone(options), connect }\n this[kOptions].interceptors = options.interceptors\n ? { ...options.interceptors }\n : undefined\n this[kMaxRedirections] = maxRedirections\n this[kFactory] = factory\n this[kClients] = new Map()\n this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {\n const ref = this[kClients].get(key)\n if (ref !== undefined && ref.deref() === undefined) {\n this[kClients].delete(key)\n }\n })\n\n const agent = this\n\n this[kOnDrain] = (origin, targets) => {\n agent.emit('drain', origin, [agent, ...targets])\n }\n\n this[kOnConnect] = (origin, targets) => {\n agent.emit('connect', origin, [agent, ...targets])\n }\n\n this[kOnDisconnect] = (origin, targets, err) => {\n agent.emit('disconnect', origin, [agent, ...targets], err)\n }\n\n this[kOnConnectionError] = (origin, targets, err) => {\n agent.emit('connectionError', origin, [agent, ...targets], err)\n }\n }\n\n get [kRunning] () {\n let ret = 0\n for (const ref of this[kClients].values()) {\n const client = ref.deref()\n /* istanbul ignore next: gc is undeterministic */\n if (client) {\n ret += client[kRunning]\n }\n }\n return ret\n }\n\n [kDispatch] (opts, handler) {\n let key\n if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {\n key = String(opts.origin)\n } else {\n throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')\n }\n\n const ref = this[kClients].get(key)\n\n let dispatcher = ref ? ref.deref() : null\n if (!dispatcher) {\n dispatcher = this[kFactory](opts.origin, this[kOptions])\n .on('drain', this[kOnDrain])\n .on('connect', this[kOnConnect])\n .on('disconnect', this[kOnDisconnect])\n .on('connectionError', this[kOnConnectionError])\n\n this[kClients].set(key, new WeakRef(dispatcher))\n this[kFinalizer].register(dispatcher, key)\n }\n\n return dispatcher.dispatch(opts, handler)\n }\n\n async [kClose] () {\n const closePromises = []\n for (const ref of this[kClients].values()) {\n const client = ref.deref()\n /* istanbul ignore else: gc is undeterministic */\n if (client) {\n closePromises.push(client.close())\n }\n }\n\n await Promise.all(closePromises)\n }\n\n async [kDestroy] (err) {\n const destroyPromises = []\n for (const ref of this[kClients].values()) {\n const client = ref.deref()\n /* istanbul ignore else: gc is undeterministic */\n if (client) {\n destroyPromises.push(client.destroy(err))\n }\n }\n\n await Promise.all(destroyPromises)\n }\n}\n\nmodule.exports = Agent\n","// Ported from https://github.com/nodejs/undici/pull/907\n\n'use strict'\n\nconst assert = require('assert')\nconst { Readable } = require('stream')\nconst { RequestAbortedError, NotSupportedError, InvalidArgumentError } = require('../core/errors')\nconst util = require('../core/util')\nconst { ReadableStreamFrom, toUSVString } = require('../core/util')\n\nlet Blob\n\nconst kConsume = Symbol('kConsume')\nconst kReading = Symbol('kReading')\nconst kBody = Symbol('kBody')\nconst kAbort = Symbol('abort')\nconst kContentType = Symbol('kContentType')\n\nconst noop = () => {}\n\nmodule.exports = class BodyReadable extends Readable {\n constructor ({\n resume,\n abort,\n contentType = '',\n highWaterMark = 64 * 1024 // Same as nodejs fs streams.\n }) {\n super({\n autoDestroy: true,\n read: resume,\n highWaterMark\n })\n\n this._readableState.dataEmitted = false\n\n this[kAbort] = abort\n this[kConsume] = null\n this[kBody] = null\n this[kContentType] = contentType\n\n // Is stream being consumed through Readable API?\n // This is an optimization so that we avoid checking\n // for 'data' and 'readable' listeners in the hot path\n // inside push().\n this[kReading] = false\n }\n\n destroy (err) {\n if (this.destroyed) {\n // Node < 16\n return this\n }\n\n if (!err && !this._readableState.endEmitted) {\n err = new RequestAbortedError()\n }\n\n if (err) {\n this[kAbort]()\n }\n\n return super.destroy(err)\n }\n\n emit (ev, ...args) {\n if (ev === 'data') {\n // Node < 16.7\n this._readableState.dataEmitted = true\n } else if (ev === 'error') {\n // Node < 16\n this._readableState.errorEmitted = true\n }\n return super.emit(ev, ...args)\n }\n\n on (ev, ...args) {\n if (ev === 'data' || ev === 'readable') {\n this[kReading] = true\n }\n return super.on(ev, ...args)\n }\n\n addListener (ev, ...args) {\n return this.on(ev, ...args)\n }\n\n off (ev, ...args) {\n const ret = super.off(ev, ...args)\n if (ev === 'data' || ev === 'readable') {\n this[kReading] = (\n this.listenerCount('data') > 0 ||\n this.listenerCount('readable') > 0\n )\n }\n return ret\n }\n\n removeListener (ev, ...args) {\n return this.off(ev, ...args)\n }\n\n push (chunk) {\n if (this[kConsume] && chunk !== null && this.readableLength === 0) {\n consumePush(this[kConsume], chunk)\n return this[kReading] ? super.push(chunk) : true\n }\n return super.push(chunk)\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-text\n async text () {\n return consume(this, 'text')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-json\n async json () {\n return consume(this, 'json')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-blob\n async blob () {\n return consume(this, 'blob')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-arraybuffer\n async arrayBuffer () {\n return consume(this, 'arrayBuffer')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-formdata\n async formData () {\n // TODO: Implement.\n throw new NotSupportedError()\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-bodyused\n get bodyUsed () {\n return util.isDisturbed(this)\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-body\n get body () {\n if (!this[kBody]) {\n this[kBody] = ReadableStreamFrom(this)\n if (this[kConsume]) {\n // TODO: Is this the best way to force a lock?\n this[kBody].getReader() // Ensure stream is locked.\n assert(this[kBody].locked)\n }\n }\n return this[kBody]\n }\n\n dump (opts) {\n let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144\n const signal = opts && opts.signal\n\n if (signal) {\n try {\n if (typeof signal !== 'object' || !('aborted' in signal)) {\n throw new InvalidArgumentError('signal must be an AbortSignal')\n }\n util.throwIfAborted(signal)\n } catch (err) {\n return Promise.reject(err)\n }\n }\n\n if (this.closed) {\n return Promise.resolve(null)\n }\n\n return new Promise((resolve, reject) => {\n const signalListenerCleanup = signal\n ? util.addAbortListener(signal, () => {\n this.destroy()\n })\n : noop\n\n this\n .on('close', function () {\n signalListenerCleanup()\n if (signal && signal.aborted) {\n reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))\n } else {\n resolve(null)\n }\n })\n .on('error', noop)\n .on('data', function (chunk) {\n limit -= chunk.length\n if (limit <= 0) {\n this.destroy()\n }\n })\n .resume()\n })\n }\n}\n\n// https://streams.spec.whatwg.org/#readablestream-locked\nfunction isLocked (self) {\n // Consume is an implicit lock.\n return (self[kBody] && self[kBody].locked === true) || self[kConsume]\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction isUnusable (self) {\n return util.isDisturbed(self) || isLocked(self)\n}\n\nasync function consume (stream, type) {\n if (isUnusable(stream)) {\n throw new TypeError('unusable')\n }\n\n assert(!stream[kConsume])\n\n return new Promise((resolve, reject) => {\n stream[kConsume] = {\n type,\n stream,\n resolve,\n reject,\n length: 0,\n body: []\n }\n\n stream\n .on('error', function (err) {\n consumeFinish(this[kConsume], err)\n })\n .on('close', function () {\n if (this[kConsume].body !== null) {\n consumeFinish(this[kConsume], new RequestAbortedError())\n }\n })\n\n process.nextTick(consumeStart, stream[kConsume])\n })\n}\n\nfunction consumeStart (consume) {\n if (consume.body === null) {\n return\n }\n\n const { _readableState: state } = consume.stream\n\n for (const chunk of state.buffer) {\n consumePush(consume, chunk)\n }\n\n if (state.endEmitted) {\n consumeEnd(this[kConsume])\n } else {\n consume.stream.on('end', function () {\n consumeEnd(this[kConsume])\n })\n }\n\n consume.stream.resume()\n\n while (consume.stream.read() != null) {\n // Loop\n }\n}\n\nfunction consumeEnd (consume) {\n const { type, body, resolve, stream, length } = consume\n\n try {\n if (type === 'text') {\n resolve(toUSVString(Buffer.concat(body)))\n } else if (type === 'json') {\n resolve(JSON.parse(Buffer.concat(body)))\n } else if (type === 'arrayBuffer') {\n const dst = new Uint8Array(length)\n\n let pos = 0\n for (const buf of body) {\n dst.set(buf, pos)\n pos += buf.byteLength\n }\n\n resolve(dst.buffer)\n } else if (type === 'blob') {\n if (!Blob) {\n Blob = require('buffer').Blob\n }\n resolve(new Blob(body, { type: stream[kContentType] }))\n }\n\n consumeFinish(consume)\n } catch (err) {\n stream.destroy(err)\n }\n}\n\nfunction consumePush (consume, chunk) {\n consume.length += chunk.length\n consume.body.push(chunk)\n}\n\nfunction consumeFinish (consume, err) {\n if (consume.body === null) {\n return\n }\n\n if (err) {\n consume.reject(err)\n } else {\n consume.resolve()\n }\n\n consume.type = null\n consume.stream = null\n consume.resolve = null\n consume.reject = null\n consume.length = 0\n consume.body = null\n}\n","const assert = require('assert')\nconst {\n ResponseStatusCodeError\n} = require('../core/errors')\nconst { toUSVString } = require('../core/util')\n\nasync function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {\n assert(body)\n\n let chunks = []\n let limit = 0\n\n for await (const chunk of body) {\n chunks.push(chunk)\n limit += chunk.length\n if (limit > 128 * 1024) {\n chunks = null\n break\n }\n }\n\n if (statusCode === 204 || !contentType || !chunks) {\n process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))\n return\n }\n\n try {\n if (contentType.startsWith('application/json')) {\n const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))\n process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))\n return\n }\n\n if (contentType.startsWith('text/')) {\n const payload = toUSVString(Buffer.concat(chunks))\n process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))\n return\n }\n } catch (err) {\n // Process in a fallback if error\n }\n\n process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))\n}\n\nmodule.exports = { getResolveErrorBodyCallback }\n","const { addAbortListener } = require('../core/util')\nconst { RequestAbortedError } = require('../core/errors')\n\nconst kListener = Symbol('kListener')\nconst kSignal = Symbol('kSignal')\n\nfunction abort (self) {\n if (self.abort) {\n self.abort()\n } else {\n self.onError(new RequestAbortedError())\n }\n}\n\nfunction addSignal (self, signal) {\n self[kSignal] = null\n self[kListener] = null\n\n if (!signal) {\n return\n }\n\n if (signal.aborted) {\n abort(self)\n return\n }\n\n self[kSignal] = signal\n self[kListener] = () => {\n abort(self)\n }\n\n addAbortListener(self[kSignal], self[kListener])\n}\n\nfunction removeSignal (self) {\n if (!self[kSignal]) {\n return\n }\n\n if ('removeEventListener' in self[kSignal]) {\n self[kSignal].removeEventListener('abort', self[kListener])\n } else {\n self[kSignal].removeListener('abort', self[kListener])\n }\n\n self[kSignal] = null\n self[kListener] = null\n}\n\nmodule.exports = {\n addSignal,\n removeSignal\n}\n","'use strict'\n\nconst Readable = require('./readable')\nconst {\n InvalidArgumentError,\n RequestAbortedError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass RequestHandler extends AsyncResource {\n constructor (opts, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts\n\n try {\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {\n throw new InvalidArgumentError('invalid highWaterMark')\n }\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n if (method === 'CONNECT') {\n throw new InvalidArgumentError('invalid method')\n }\n\n if (onInfo && typeof onInfo !== 'function') {\n throw new InvalidArgumentError('invalid onInfo callback')\n }\n\n super('UNDICI_REQUEST')\n } catch (err) {\n if (util.isStream(body)) {\n util.destroy(body.on('error', util.nop), err)\n }\n throw err\n }\n\n this.responseHeaders = responseHeaders || null\n this.opaque = opaque || null\n this.callback = callback\n this.res = null\n this.abort = null\n this.body = body\n this.trailers = {}\n this.context = null\n this.onInfo = onInfo || null\n this.throwOnError = throwOnError\n this.highWaterMark = highWaterMark\n\n if (util.isStream(body)) {\n body.on('error', (err) => {\n this.onError(err)\n })\n }\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (!this.callback) {\n throw new RequestAbortedError()\n }\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this\n\n const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n if (statusCode < 200) {\n if (this.onInfo) {\n this.onInfo({ statusCode, headers })\n }\n return\n }\n\n const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n const contentType = parsedHeaders['content-type']\n const body = new Readable({ resume, abort, contentType, highWaterMark })\n\n this.callback = null\n this.res = body\n if (callback !== null) {\n if (this.throwOnError && statusCode >= 400) {\n this.runInAsyncScope(getResolveErrorBodyCallback, null,\n { callback, body, contentType, statusCode, statusMessage, headers }\n )\n } else {\n this.runInAsyncScope(callback, null, null, {\n statusCode,\n headers,\n trailers: this.trailers,\n opaque,\n body,\n context\n })\n }\n }\n }\n\n onData (chunk) {\n const { res } = this\n return res.push(chunk)\n }\n\n onComplete (trailers) {\n const { res } = this\n\n removeSignal(this)\n\n util.parseHeaders(trailers, this.trailers)\n\n res.push(null)\n }\n\n onError (err) {\n const { res, callback, body, opaque } = this\n\n removeSignal(this)\n\n if (callback) {\n // TODO: Does this need queueMicrotask?\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n\n if (res) {\n this.res = null\n // Ensure all queued handlers are invoked before destroying res.\n queueMicrotask(() => {\n util.destroy(res, err)\n })\n }\n\n if (body) {\n this.body = null\n util.destroy(body, err)\n }\n }\n}\n\nfunction request (opts, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n request.call(this, opts, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n this.dispatch(opts, new RequestHandler(opts, callback))\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts && opts.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = request\nmodule.exports.RequestHandler = RequestHandler\n","'use strict'\n\nconst { finished, PassThrough } = require('stream')\nconst {\n InvalidArgumentError,\n InvalidReturnValueError,\n RequestAbortedError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass StreamHandler extends AsyncResource {\n constructor (opts, factory, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts\n\n try {\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('invalid factory')\n }\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n if (method === 'CONNECT') {\n throw new InvalidArgumentError('invalid method')\n }\n\n if (onInfo && typeof onInfo !== 'function') {\n throw new InvalidArgumentError('invalid onInfo callback')\n }\n\n super('UNDICI_STREAM')\n } catch (err) {\n if (util.isStream(body)) {\n util.destroy(body.on('error', util.nop), err)\n }\n throw err\n }\n\n this.responseHeaders = responseHeaders || null\n this.opaque = opaque || null\n this.factory = factory\n this.callback = callback\n this.res = null\n this.abort = null\n this.context = null\n this.trailers = null\n this.body = body\n this.onInfo = onInfo || null\n this.throwOnError = throwOnError || false\n\n if (util.isStream(body)) {\n body.on('error', (err) => {\n this.onError(err)\n })\n }\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (!this.callback) {\n throw new RequestAbortedError()\n }\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n const { factory, opaque, context, callback, responseHeaders } = this\n\n const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n if (statusCode < 200) {\n if (this.onInfo) {\n this.onInfo({ statusCode, headers })\n }\n return\n }\n\n this.factory = null\n\n let res\n\n if (this.throwOnError && statusCode >= 400) {\n const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n const contentType = parsedHeaders['content-type']\n res = new PassThrough()\n\n this.callback = null\n this.runInAsyncScope(getResolveErrorBodyCallback, null,\n { callback, body: res, contentType, statusCode, statusMessage, headers }\n )\n } else {\n if (factory === null) {\n return\n }\n\n res = this.runInAsyncScope(factory, null, {\n statusCode,\n headers,\n opaque,\n context\n })\n\n if (\n !res ||\n typeof res.write !== 'function' ||\n typeof res.end !== 'function' ||\n typeof res.on !== 'function'\n ) {\n throw new InvalidReturnValueError('expected Writable')\n }\n\n // TODO: Avoid finished. It registers an unnecessary amount of listeners.\n finished(res, { readable: false }, (err) => {\n const { callback, res, opaque, trailers, abort } = this\n\n this.res = null\n if (err || !res.readable) {\n util.destroy(res, err)\n }\n\n this.callback = null\n this.runInAsyncScope(callback, null, err || null, { opaque, trailers })\n\n if (err) {\n abort()\n }\n })\n }\n\n res.on('drain', resume)\n\n this.res = res\n\n const needDrain = res.writableNeedDrain !== undefined\n ? res.writableNeedDrain\n : res._writableState && res._writableState.needDrain\n\n return needDrain !== true\n }\n\n onData (chunk) {\n const { res } = this\n\n return res ? res.write(chunk) : true\n }\n\n onComplete (trailers) {\n const { res } = this\n\n removeSignal(this)\n\n if (!res) {\n return\n }\n\n this.trailers = util.parseHeaders(trailers)\n\n res.end()\n }\n\n onError (err) {\n const { res, callback, opaque, body } = this\n\n removeSignal(this)\n\n this.factory = null\n\n if (res) {\n this.res = null\n util.destroy(res, err)\n } else if (callback) {\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n\n if (body) {\n this.body = null\n util.destroy(body, err)\n }\n }\n}\n\nfunction stream (opts, factory, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n stream.call(this, opts, factory, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n this.dispatch(opts, new StreamHandler(opts, factory, callback))\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts && opts.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = stream\n","'use strict'\n\nconst {\n Readable,\n Duplex,\n PassThrough\n} = require('stream')\nconst {\n InvalidArgumentError,\n InvalidReturnValueError,\n RequestAbortedError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { AsyncResource } = require('async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('assert')\n\nconst kResume = Symbol('resume')\n\nclass PipelineRequest extends Readable {\n constructor () {\n super({ autoDestroy: true })\n\n this[kResume] = null\n }\n\n _read () {\n const { [kResume]: resume } = this\n\n if (resume) {\n this[kResume] = null\n resume()\n }\n }\n\n _destroy (err, callback) {\n this._read()\n\n callback(err)\n }\n}\n\nclass PipelineResponse extends Readable {\n constructor (resume) {\n super({ autoDestroy: true })\n this[kResume] = resume\n }\n\n _read () {\n this[kResume]()\n }\n\n _destroy (err, callback) {\n if (!err && !this._readableState.endEmitted) {\n err = new RequestAbortedError()\n }\n\n callback(err)\n }\n}\n\nclass PipelineHandler extends AsyncResource {\n constructor (opts, handler) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (typeof handler !== 'function') {\n throw new InvalidArgumentError('invalid handler')\n }\n\n const { signal, method, opaque, onInfo, responseHeaders } = opts\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n if (method === 'CONNECT') {\n throw new InvalidArgumentError('invalid method')\n }\n\n if (onInfo && typeof onInfo !== 'function') {\n throw new InvalidArgumentError('invalid onInfo callback')\n }\n\n super('UNDICI_PIPELINE')\n\n this.opaque = opaque || null\n this.responseHeaders = responseHeaders || null\n this.handler = handler\n this.abort = null\n this.context = null\n this.onInfo = onInfo || null\n\n this.req = new PipelineRequest().on('error', util.nop)\n\n this.ret = new Duplex({\n readableObjectMode: opts.objectMode,\n autoDestroy: true,\n read: () => {\n const { body } = this\n\n if (body && body.resume) {\n body.resume()\n }\n },\n write: (chunk, encoding, callback) => {\n const { req } = this\n\n if (req.push(chunk, encoding) || req._readableState.destroyed) {\n callback()\n } else {\n req[kResume] = callback\n }\n },\n destroy: (err, callback) => {\n const { body, req, res, ret, abort } = this\n\n if (!err && !ret._readableState.endEmitted) {\n err = new RequestAbortedError()\n }\n\n if (abort && err) {\n abort()\n }\n\n util.destroy(body, err)\n util.destroy(req, err)\n util.destroy(res, err)\n\n removeSignal(this)\n\n callback(err)\n }\n }).on('prefinish', () => {\n const { req } = this\n\n // Node < 15 does not call _final in same tick.\n req.push(null)\n })\n\n this.res = null\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n const { ret, res } = this\n\n assert(!res, 'pipeline cannot be retried')\n\n if (ret.destroyed) {\n throw new RequestAbortedError()\n }\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders (statusCode, rawHeaders, resume) {\n const { opaque, handler, context } = this\n\n if (statusCode < 200) {\n if (this.onInfo) {\n const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n this.onInfo({ statusCode, headers })\n }\n return\n }\n\n this.res = new PipelineResponse(resume)\n\n let body\n try {\n this.handler = null\n const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n body = this.runInAsyncScope(handler, null, {\n statusCode,\n headers,\n opaque,\n body: this.res,\n context\n })\n } catch (err) {\n this.res.on('error', util.nop)\n throw err\n }\n\n if (!body || typeof body.on !== 'function') {\n throw new InvalidReturnValueError('expected Readable')\n }\n\n body\n .on('data', (chunk) => {\n const { ret, body } = this\n\n if (!ret.push(chunk) && body.pause) {\n body.pause()\n }\n })\n .on('error', (err) => {\n const { ret } = this\n\n util.destroy(ret, err)\n })\n .on('end', () => {\n const { ret } = this\n\n ret.push(null)\n })\n .on('close', () => {\n const { ret } = this\n\n if (!ret._readableState.ended) {\n util.destroy(ret, new RequestAbortedError())\n }\n })\n\n this.body = body\n }\n\n onData (chunk) {\n const { res } = this\n return res.push(chunk)\n }\n\n onComplete (trailers) {\n const { res } = this\n res.push(null)\n }\n\n onError (err) {\n const { ret } = this\n this.handler = null\n util.destroy(ret, err)\n }\n}\n\nfunction pipeline (opts, handler) {\n try {\n const pipelineHandler = new PipelineHandler(opts, handler)\n this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)\n return pipelineHandler.ret\n } catch (err) {\n return new PassThrough().destroy(err)\n }\n}\n\nmodule.exports = pipeline\n","'use strict'\n\nconst { InvalidArgumentError, RequestAbortedError, SocketError } = require('../core/errors')\nconst { AsyncResource } = require('async_hooks')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('assert')\n\nclass UpgradeHandler extends AsyncResource {\n constructor (opts, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n const { signal, opaque, responseHeaders } = opts\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n super('UNDICI_UPGRADE')\n\n this.responseHeaders = responseHeaders || null\n this.opaque = opaque || null\n this.callback = callback\n this.abort = null\n this.context = null\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (!this.callback) {\n throw new RequestAbortedError()\n }\n\n this.abort = abort\n this.context = null\n }\n\n onHeaders () {\n throw new SocketError('bad upgrade', null)\n }\n\n onUpgrade (statusCode, rawHeaders, socket) {\n const { callback, opaque, context } = this\n\n assert.strictEqual(statusCode, 101)\n\n removeSignal(this)\n\n this.callback = null\n const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n this.runInAsyncScope(callback, null, null, {\n headers,\n socket,\n opaque,\n context\n })\n }\n\n onError (err) {\n const { callback, opaque } = this\n\n removeSignal(this)\n\n if (callback) {\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n }\n}\n\nfunction upgrade (opts, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n upgrade.call(this, opts, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n const upgradeHandler = new UpgradeHandler(opts, callback)\n this.dispatch({\n ...opts,\n method: opts.method || 'GET',\n upgrade: opts.protocol || 'Websocket'\n }, upgradeHandler)\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts && opts.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = upgrade\n","'use strict'\n\nconst { AsyncResource } = require('async_hooks')\nconst { InvalidArgumentError, RequestAbortedError, SocketError } = require('../core/errors')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass ConnectHandler extends AsyncResource {\n constructor (opts, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n const { signal, opaque, responseHeaders } = opts\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n super('UNDICI_CONNECT')\n\n this.opaque = opaque || null\n this.responseHeaders = responseHeaders || null\n this.callback = callback\n this.abort = null\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (!this.callback) {\n throw new RequestAbortedError()\n }\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders () {\n throw new SocketError('bad connect', null)\n }\n\n onUpgrade (statusCode, rawHeaders, socket) {\n const { callback, opaque, context } = this\n\n removeSignal(this)\n\n this.callback = null\n\n let headers = rawHeaders\n // Indicates is an HTTP2Session\n if (headers != null) {\n headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n }\n\n this.runInAsyncScope(callback, null, null, {\n statusCode,\n headers,\n socket,\n opaque,\n context\n })\n }\n\n onError (err) {\n const { callback, opaque } = this\n\n removeSignal(this)\n\n if (callback) {\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n }\n}\n\nfunction connect (opts, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n connect.call(this, opts, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n const connectHandler = new ConnectHandler(opts, callback)\n this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts && opts.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = connect\n","'use strict'\n\nmodule.exports.request = require('./api-request')\nmodule.exports.stream = require('./api-stream')\nmodule.exports.pipeline = require('./api-pipeline')\nmodule.exports.upgrade = require('./api-upgrade')\nmodule.exports.connect = require('./api-connect')\n","'use strict'\n\nconst { UndiciError } = require('../core/errors')\n\nclass MockNotMatchedError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, MockNotMatchedError)\n this.name = 'MockNotMatchedError'\n this.message = message || 'The request does not match any registered mock dispatches'\n this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'\n }\n}\n\nmodule.exports = {\n MockNotMatchedError\n}\n","'use strict'\n\nmodule.exports = {\n kAgent: Symbol('agent'),\n kOptions: Symbol('options'),\n kFactory: Symbol('factory'),\n kDispatches: Symbol('dispatches'),\n kDispatchKey: Symbol('dispatch key'),\n kDefaultHeaders: Symbol('default headers'),\n kDefaultTrailers: Symbol('default trailers'),\n kContentLength: Symbol('content length'),\n kMockAgent: Symbol('mock agent'),\n kMockAgentSet: Symbol('mock agent set'),\n kMockAgentGet: Symbol('mock agent get'),\n kMockDispatch: Symbol('mock dispatch'),\n kClose: Symbol('close'),\n kOriginalClose: Symbol('original agent close'),\n kOrigin: Symbol('origin'),\n kIsMockActive: Symbol('is mock active'),\n kNetConnect: Symbol('net connect'),\n kGetNetConnect: Symbol('get net connect'),\n kConnected: Symbol('connected')\n}\n","'use strict'\n\nconst { MockNotMatchedError } = require('./mock-errors')\nconst {\n kDispatches,\n kMockAgent,\n kOriginalDispatch,\n kOrigin,\n kGetNetConnect\n} = require('./mock-symbols')\nconst { buildURL, nop } = require('../core/util')\nconst { STATUS_CODES } = require('http')\nconst {\n types: {\n isPromise\n }\n} = require('util')\n\nfunction matchValue (match, value) {\n if (typeof match === 'string') {\n return match === value\n }\n if (match instanceof RegExp) {\n return match.test(value)\n }\n if (typeof match === 'function') {\n return match(value) === true\n }\n return false\n}\n\nfunction lowerCaseEntries (headers) {\n return Object.fromEntries(\n Object.entries(headers).map(([headerName, headerValue]) => {\n return [headerName.toLocaleLowerCase(), headerValue]\n })\n )\n}\n\n/**\n * @param {import('../../index').Headers|string[]|Record} headers\n * @param {string} key\n */\nfunction getHeaderByName (headers, key) {\n if (Array.isArray(headers)) {\n for (let i = 0; i < headers.length; i += 2) {\n if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {\n return headers[i + 1]\n }\n }\n\n return undefined\n } else if (typeof headers.get === 'function') {\n return headers.get(key)\n } else {\n return lowerCaseEntries(headers)[key.toLocaleLowerCase()]\n }\n}\n\n/** @param {string[]} headers */\nfunction buildHeadersFromArray (headers) { // fetch HeadersList\n const clone = headers.slice()\n const entries = []\n for (let index = 0; index < clone.length; index += 2) {\n entries.push([clone[index], clone[index + 1]])\n }\n return Object.fromEntries(entries)\n}\n\nfunction matchHeaders (mockDispatch, headers) {\n if (typeof mockDispatch.headers === 'function') {\n if (Array.isArray(headers)) { // fetch HeadersList\n headers = buildHeadersFromArray(headers)\n }\n return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})\n }\n if (typeof mockDispatch.headers === 'undefined') {\n return true\n }\n if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {\n return false\n }\n\n for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {\n const headerValue = getHeaderByName(headers, matchHeaderName)\n\n if (!matchValue(matchHeaderValue, headerValue)) {\n return false\n }\n }\n return true\n}\n\nfunction safeUrl (path) {\n if (typeof path !== 'string') {\n return path\n }\n\n const pathSegments = path.split('?')\n\n if (pathSegments.length !== 2) {\n return path\n }\n\n const qp = new URLSearchParams(pathSegments.pop())\n qp.sort()\n return [...pathSegments, qp.toString()].join('?')\n}\n\nfunction matchKey (mockDispatch, { path, method, body, headers }) {\n const pathMatch = matchValue(mockDispatch.path, path)\n const methodMatch = matchValue(mockDispatch.method, method)\n const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true\n const headersMatch = matchHeaders(mockDispatch, headers)\n return pathMatch && methodMatch && bodyMatch && headersMatch\n}\n\nfunction getResponseData (data) {\n if (Buffer.isBuffer(data)) {\n return data\n } else if (typeof data === 'object') {\n return JSON.stringify(data)\n } else {\n return data.toString()\n }\n}\n\nfunction getMockDispatch (mockDispatches, key) {\n const basePath = key.query ? buildURL(key.path, key.query) : key.path\n const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath\n\n // Match path\n let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)\n }\n\n // Match method\n matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)\n }\n\n // Match body\n matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)\n }\n\n // Match headers\n matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)\n }\n\n return matchedMockDispatches[0]\n}\n\nfunction addMockDispatch (mockDispatches, key, data) {\n const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }\n const replyData = typeof data === 'function' ? { callback: data } : { ...data }\n const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }\n mockDispatches.push(newMockDispatch)\n return newMockDispatch\n}\n\nfunction deleteMockDispatch (mockDispatches, key) {\n const index = mockDispatches.findIndex(dispatch => {\n if (!dispatch.consumed) {\n return false\n }\n return matchKey(dispatch, key)\n })\n if (index !== -1) {\n mockDispatches.splice(index, 1)\n }\n}\n\nfunction buildKey (opts) {\n const { path, method, body, headers, query } = opts\n return {\n path,\n method,\n body,\n headers,\n query\n }\n}\n\nfunction generateKeyValues (data) {\n return Object.entries(data).reduce((keyValuePairs, [key, value]) => [\n ...keyValuePairs,\n Buffer.from(`${key}`),\n Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)\n ], [])\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status\n * @param {number} statusCode\n */\nfunction getStatusText (statusCode) {\n return STATUS_CODES[statusCode] || 'unknown'\n}\n\nasync function getResponse (body) {\n const buffers = []\n for await (const data of body) {\n buffers.push(data)\n }\n return Buffer.concat(buffers).toString('utf8')\n}\n\n/**\n * Mock dispatch function used to simulate undici dispatches\n */\nfunction mockDispatch (opts, handler) {\n // Get mock dispatch from built key\n const key = buildKey(opts)\n const mockDispatch = getMockDispatch(this[kDispatches], key)\n\n mockDispatch.timesInvoked++\n\n // Here's where we resolve a callback if a callback is present for the dispatch data.\n if (mockDispatch.data.callback) {\n mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }\n }\n\n // Parse mockDispatch data\n const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch\n const { timesInvoked, times } = mockDispatch\n\n // If it's used up and not persistent, mark as consumed\n mockDispatch.consumed = !persist && timesInvoked >= times\n mockDispatch.pending = timesInvoked < times\n\n // If specified, trigger dispatch error\n if (error !== null) {\n deleteMockDispatch(this[kDispatches], key)\n handler.onError(error)\n return true\n }\n\n // Handle the request with a delay if necessary\n if (typeof delay === 'number' && delay > 0) {\n setTimeout(() => {\n handleReply(this[kDispatches])\n }, delay)\n } else {\n handleReply(this[kDispatches])\n }\n\n function handleReply (mockDispatches, _data = data) {\n // fetch's HeadersList is a 1D string array\n const optsHeaders = Array.isArray(opts.headers)\n ? buildHeadersFromArray(opts.headers)\n : opts.headers\n const body = typeof _data === 'function'\n ? _data({ ...opts, headers: optsHeaders })\n : _data\n\n // util.types.isPromise is likely needed for jest.\n if (isPromise(body)) {\n // If handleReply is asynchronous, throwing an error\n // in the callback will reject the promise, rather than\n // synchronously throw the error, which breaks some tests.\n // Rather, we wait for the callback to resolve if it is a\n // promise, and then re-run handleReply with the new body.\n body.then((newData) => handleReply(mockDispatches, newData))\n return\n }\n\n const responseData = getResponseData(body)\n const responseHeaders = generateKeyValues(headers)\n const responseTrailers = generateKeyValues(trailers)\n\n handler.abort = nop\n handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))\n handler.onData(Buffer.from(responseData))\n handler.onComplete(responseTrailers)\n deleteMockDispatch(mockDispatches, key)\n }\n\n function resume () {}\n\n return true\n}\n\nfunction buildMockDispatch () {\n const agent = this[kMockAgent]\n const origin = this[kOrigin]\n const originalDispatch = this[kOriginalDispatch]\n\n return function dispatch (opts, handler) {\n if (agent.isMockActive) {\n try {\n mockDispatch.call(this, opts, handler)\n } catch (error) {\n if (error instanceof MockNotMatchedError) {\n const netConnect = agent[kGetNetConnect]()\n if (netConnect === false) {\n throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)\n }\n if (checkNetConnect(netConnect, origin)) {\n originalDispatch.call(this, opts, handler)\n } else {\n throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)\n }\n } else {\n throw error\n }\n }\n } else {\n originalDispatch.call(this, opts, handler)\n }\n }\n}\n\nfunction checkNetConnect (netConnect, origin) {\n const url = new URL(origin)\n if (netConnect === true) {\n return true\n } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {\n return true\n }\n return false\n}\n\nfunction buildMockOptions (opts) {\n if (opts) {\n const { agent, ...mockOptions } = opts\n return mockOptions\n }\n}\n\nmodule.exports = {\n getResponseData,\n getMockDispatch,\n addMockDispatch,\n deleteMockDispatch,\n buildKey,\n generateKeyValues,\n matchValue,\n getResponse,\n getStatusText,\n mockDispatch,\n buildMockDispatch,\n checkNetConnect,\n buildMockOptions,\n getHeaderByName\n}\n","'use strict'\n\nconst { getResponseData, buildKey, addMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kDispatchKey,\n kDefaultHeaders,\n kDefaultTrailers,\n kContentLength,\n kMockDispatch\n} = require('./mock-symbols')\nconst { InvalidArgumentError } = require('../core/errors')\nconst { buildURL } = require('../core/util')\n\n/**\n * Defines the scope API for an interceptor reply\n */\nclass MockScope {\n constructor (mockDispatch) {\n this[kMockDispatch] = mockDispatch\n }\n\n /**\n * Delay a reply by a set amount in ms.\n */\n delay (waitInMs) {\n if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {\n throw new InvalidArgumentError('waitInMs must be a valid integer > 0')\n }\n\n this[kMockDispatch].delay = waitInMs\n return this\n }\n\n /**\n * For a defined reply, never mark as consumed.\n */\n persist () {\n this[kMockDispatch].persist = true\n return this\n }\n\n /**\n * Allow one to define a reply for a set amount of matching requests.\n */\n times (repeatTimes) {\n if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {\n throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')\n }\n\n this[kMockDispatch].times = repeatTimes\n return this\n }\n}\n\n/**\n * Defines an interceptor for a Mock\n */\nclass MockInterceptor {\n constructor (opts, mockDispatches) {\n if (typeof opts !== 'object') {\n throw new InvalidArgumentError('opts must be an object')\n }\n if (typeof opts.path === 'undefined') {\n throw new InvalidArgumentError('opts.path must be defined')\n }\n if (typeof opts.method === 'undefined') {\n opts.method = 'GET'\n }\n // See https://github.com/nodejs/undici/issues/1245\n // As per RFC 3986, clients are not supposed to send URI\n // fragments to servers when they retrieve a document,\n if (typeof opts.path === 'string') {\n if (opts.query) {\n opts.path = buildURL(opts.path, opts.query)\n } else {\n // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811\n const parsedURL = new URL(opts.path, 'data://')\n opts.path = parsedURL.pathname + parsedURL.search\n }\n }\n if (typeof opts.method === 'string') {\n opts.method = opts.method.toUpperCase()\n }\n\n this[kDispatchKey] = buildKey(opts)\n this[kDispatches] = mockDispatches\n this[kDefaultHeaders] = {}\n this[kDefaultTrailers] = {}\n this[kContentLength] = false\n }\n\n createMockScopeDispatchData (statusCode, data, responseOptions = {}) {\n const responseData = getResponseData(data)\n const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}\n const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }\n const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }\n\n return { statusCode, data, headers, trailers }\n }\n\n validateReplyParameters (statusCode, data, responseOptions) {\n if (typeof statusCode === 'undefined') {\n throw new InvalidArgumentError('statusCode must be defined')\n }\n if (typeof data === 'undefined') {\n throw new InvalidArgumentError('data must be defined')\n }\n if (typeof responseOptions !== 'object') {\n throw new InvalidArgumentError('responseOptions must be an object')\n }\n }\n\n /**\n * Mock an undici request with a defined reply.\n */\n reply (replyData) {\n // Values of reply aren't available right now as they\n // can only be available when the reply callback is invoked.\n if (typeof replyData === 'function') {\n // We'll first wrap the provided callback in another function,\n // this function will properly resolve the data from the callback\n // when invoked.\n const wrappedDefaultsCallback = (opts) => {\n // Our reply options callback contains the parameter for statusCode, data and options.\n const resolvedData = replyData(opts)\n\n // Check if it is in the right format\n if (typeof resolvedData !== 'object') {\n throw new InvalidArgumentError('reply options callback must return an object')\n }\n\n const { statusCode, data = '', responseOptions = {} } = resolvedData\n this.validateReplyParameters(statusCode, data, responseOptions)\n // Since the values can be obtained immediately we return them\n // from this higher order function that will be resolved later.\n return {\n ...this.createMockScopeDispatchData(statusCode, data, responseOptions)\n }\n }\n\n // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)\n return new MockScope(newMockDispatch)\n }\n\n // We can have either one or three parameters, if we get here,\n // we should have 1-3 parameters. So we spread the arguments of\n // this function to obtain the parameters, since replyData will always\n // just be the statusCode.\n const [statusCode, data = '', responseOptions = {}] = [...arguments]\n this.validateReplyParameters(statusCode, data, responseOptions)\n\n // Send in-already provided data like usual\n const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)\n return new MockScope(newMockDispatch)\n }\n\n /**\n * Mock an undici request with a defined error.\n */\n replyWithError (error) {\n if (typeof error === 'undefined') {\n throw new InvalidArgumentError('error must be defined')\n }\n\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })\n return new MockScope(newMockDispatch)\n }\n\n /**\n * Set default reply headers on the interceptor for subsequent replies\n */\n defaultReplyHeaders (headers) {\n if (typeof headers === 'undefined') {\n throw new InvalidArgumentError('headers must be defined')\n }\n\n this[kDefaultHeaders] = headers\n return this\n }\n\n /**\n * Set default reply trailers on the interceptor for subsequent replies\n */\n defaultReplyTrailers (trailers) {\n if (typeof trailers === 'undefined') {\n throw new InvalidArgumentError('trailers must be defined')\n }\n\n this[kDefaultTrailers] = trailers\n return this\n }\n\n /**\n * Set reply content length header for replies on the interceptor\n */\n replyContentLength () {\n this[kContentLength] = true\n return this\n }\n}\n\nmodule.exports.MockInterceptor = MockInterceptor\nmodule.exports.MockScope = MockScope\n","'use strict'\n\nconst { promisify } = require('util')\nconst Client = require('../client')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kMockAgent,\n kClose,\n kOriginalClose,\n kOrigin,\n kOriginalDispatch,\n kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockClient provides an API that extends the Client to influence the mockDispatches.\n */\nclass MockClient extends Client {\n constructor (origin, opts) {\n super(origin, opts)\n\n if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n\n this[kMockAgent] = opts.agent\n this[kOrigin] = origin\n this[kDispatches] = []\n this[kConnected] = 1\n this[kOriginalDispatch] = this.dispatch\n this[kOriginalClose] = this.close.bind(this)\n\n this.dispatch = buildMockDispatch.call(this)\n this.close = this[kClose]\n }\n\n get [Symbols.kConnected] () {\n return this[kConnected]\n }\n\n /**\n * Sets up the base interceptor for mocking replies from undici.\n */\n intercept (opts) {\n return new MockInterceptor(opts, this[kDispatches])\n }\n\n async [kClose] () {\n await promisify(this[kOriginalClose])()\n this[kConnected] = 0\n this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n }\n}\n\nmodule.exports = MockClient\n","'use strict'\n\nconst { promisify } = require('util')\nconst Pool = require('../pool')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kMockAgent,\n kClose,\n kOriginalClose,\n kOrigin,\n kOriginalDispatch,\n kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockPool provides an API that extends the Pool to influence the mockDispatches.\n */\nclass MockPool extends Pool {\n constructor (origin, opts) {\n super(origin, opts)\n\n if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n\n this[kMockAgent] = opts.agent\n this[kOrigin] = origin\n this[kDispatches] = []\n this[kConnected] = 1\n this[kOriginalDispatch] = this.dispatch\n this[kOriginalClose] = this.close.bind(this)\n\n this.dispatch = buildMockDispatch.call(this)\n this.close = this[kClose]\n }\n\n get [Symbols.kConnected] () {\n return this[kConnected]\n }\n\n /**\n * Sets up the base interceptor for mocking replies from undici.\n */\n intercept (opts) {\n return new MockInterceptor(opts, this[kDispatches])\n }\n\n async [kClose] () {\n await promisify(this[kOriginalClose])()\n this[kConnected] = 0\n this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n }\n}\n\nmodule.exports = MockPool\n","'use strict'\n\nconst singulars = {\n pronoun: 'it',\n is: 'is',\n was: 'was',\n this: 'this'\n}\n\nconst plurals = {\n pronoun: 'they',\n is: 'are',\n was: 'were',\n this: 'these'\n}\n\nmodule.exports = class Pluralizer {\n constructor (singular, plural) {\n this.singular = singular\n this.plural = plural\n }\n\n pluralize (count) {\n const one = count === 1\n const keys = one ? singulars : plurals\n const noun = one ? this.singular : this.plural\n return { ...keys, count, noun }\n }\n}\n","'use strict'\n\nconst { Transform } = require('stream')\nconst { Console } = require('console')\n\n/**\n * Gets the output of `console.table(…)` as a string.\n */\nmodule.exports = class PendingInterceptorsFormatter {\n constructor ({ disableColors } = {}) {\n this.transform = new Transform({\n transform (chunk, _enc, cb) {\n cb(null, chunk)\n }\n })\n\n this.logger = new Console({\n stdout: this.transform,\n inspectOptions: {\n colors: !disableColors && !process.env.CI\n }\n })\n }\n\n format (pendingInterceptors) {\n const withPrettyHeaders = pendingInterceptors.map(\n ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({\n Method: method,\n Origin: origin,\n Path: path,\n 'Status code': statusCode,\n Persistent: persist ? '✅' : '❌',\n Invocations: timesInvoked,\n Remaining: persist ? Infinity : times - timesInvoked\n }))\n\n this.logger.table(withPrettyHeaders)\n return this.transform.read().toString()\n }\n}\n","'use strict'\n\nconst { kClients } = require('../core/symbols')\nconst Agent = require('../agent')\nconst {\n kAgent,\n kMockAgentSet,\n kMockAgentGet,\n kDispatches,\n kIsMockActive,\n kNetConnect,\n kGetNetConnect,\n kOptions,\n kFactory\n} = require('./mock-symbols')\nconst MockClient = require('./mock-client')\nconst MockPool = require('./mock-pool')\nconst { matchValue, buildMockOptions } = require('./mock-utils')\nconst { InvalidArgumentError, UndiciError } = require('../core/errors')\nconst Dispatcher = require('../dispatcher')\nconst Pluralizer = require('./pluralizer')\nconst PendingInterceptorsFormatter = require('./pending-interceptors-formatter')\n\nclass FakeWeakRef {\n constructor (value) {\n this.value = value\n }\n\n deref () {\n return this.value\n }\n}\n\nclass MockAgent extends Dispatcher {\n constructor (opts) {\n super(opts)\n\n this[kNetConnect] = true\n this[kIsMockActive] = true\n\n // Instantiate Agent and encapsulate\n if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n const agent = opts && opts.agent ? opts.agent : new Agent(opts)\n this[kAgent] = agent\n\n this[kClients] = agent[kClients]\n this[kOptions] = buildMockOptions(opts)\n }\n\n get (origin) {\n let dispatcher = this[kMockAgentGet](origin)\n\n if (!dispatcher) {\n dispatcher = this[kFactory](origin)\n this[kMockAgentSet](origin, dispatcher)\n }\n return dispatcher\n }\n\n dispatch (opts, handler) {\n // Call MockAgent.get to perform additional setup before dispatching as normal\n this.get(opts.origin)\n return this[kAgent].dispatch(opts, handler)\n }\n\n async close () {\n await this[kAgent].close()\n this[kClients].clear()\n }\n\n deactivate () {\n this[kIsMockActive] = false\n }\n\n activate () {\n this[kIsMockActive] = true\n }\n\n enableNetConnect (matcher) {\n if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {\n if (Array.isArray(this[kNetConnect])) {\n this[kNetConnect].push(matcher)\n } else {\n this[kNetConnect] = [matcher]\n }\n } else if (typeof matcher === 'undefined') {\n this[kNetConnect] = true\n } else {\n throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')\n }\n }\n\n disableNetConnect () {\n this[kNetConnect] = false\n }\n\n // This is required to bypass issues caused by using global symbols - see:\n // https://github.com/nodejs/undici/issues/1447\n get isMockActive () {\n return this[kIsMockActive]\n }\n\n [kMockAgentSet] (origin, dispatcher) {\n this[kClients].set(origin, new FakeWeakRef(dispatcher))\n }\n\n [kFactory] (origin) {\n const mockOptions = Object.assign({ agent: this }, this[kOptions])\n return this[kOptions] && this[kOptions].connections === 1\n ? new MockClient(origin, mockOptions)\n : new MockPool(origin, mockOptions)\n }\n\n [kMockAgentGet] (origin) {\n // First check if we can immediately find it\n const ref = this[kClients].get(origin)\n if (ref) {\n return ref.deref()\n }\n\n // If the origin is not a string create a dummy parent pool and return to user\n if (typeof origin !== 'string') {\n const dispatcher = this[kFactory]('http://localhost:9999')\n this[kMockAgentSet](origin, dispatcher)\n return dispatcher\n }\n\n // If we match, create a pool and assign the same dispatches\n for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {\n const nonExplicitDispatcher = nonExplicitRef.deref()\n if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {\n const dispatcher = this[kFactory](origin)\n this[kMockAgentSet](origin, dispatcher)\n dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]\n return dispatcher\n }\n }\n }\n\n [kGetNetConnect] () {\n return this[kNetConnect]\n }\n\n pendingInterceptors () {\n const mockAgentClients = this[kClients]\n\n return Array.from(mockAgentClients.entries())\n .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))\n .filter(({ pending }) => pending)\n }\n\n assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {\n const pending = this.pendingInterceptors()\n\n if (pending.length === 0) {\n return\n }\n\n const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)\n\n throw new UndiciError(`\n${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:\n\n${pendingInterceptorsFormatter.format(pending)}\n`.trim())\n }\n}\n\nmodule.exports = MockAgent\n","'use strict'\n\nconst { kProxy, kClose, kDestroy, kInterceptors } = require('./core/symbols')\nconst { URL } = require('url')\nconst Agent = require('./agent')\nconst Pool = require('./pool')\nconst DispatcherBase = require('./dispatcher-base')\nconst { InvalidArgumentError, RequestAbortedError } = require('./core/errors')\nconst buildConnector = require('./core/connect')\n\nconst kAgent = Symbol('proxy agent')\nconst kClient = Symbol('proxy client')\nconst kProxyHeaders = Symbol('proxy headers')\nconst kRequestTls = Symbol('request tls settings')\nconst kProxyTls = Symbol('proxy tls settings')\nconst kConnectEndpoint = Symbol('connect endpoint function')\n\nfunction defaultProtocolPort (protocol) {\n return protocol === 'https:' ? 443 : 80\n}\n\nfunction buildProxyOptions (opts) {\n if (typeof opts === 'string') {\n opts = { uri: opts }\n }\n\n if (!opts || !opts.uri) {\n throw new InvalidArgumentError('Proxy opts.uri is mandatory')\n }\n\n return {\n uri: opts.uri,\n protocol: opts.protocol || 'https'\n }\n}\n\nfunction defaultFactory (origin, opts) {\n return new Pool(origin, opts)\n}\n\nclass ProxyAgent extends DispatcherBase {\n constructor (opts) {\n super(opts)\n this[kProxy] = buildProxyOptions(opts)\n this[kAgent] = new Agent(opts)\n this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)\n ? opts.interceptors.ProxyAgent\n : []\n\n if (typeof opts === 'string') {\n opts = { uri: opts }\n }\n\n if (!opts || !opts.uri) {\n throw new InvalidArgumentError('Proxy opts.uri is mandatory')\n }\n\n const { clientFactory = defaultFactory } = opts\n\n if (typeof clientFactory !== 'function') {\n throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')\n }\n\n this[kRequestTls] = opts.requestTls\n this[kProxyTls] = opts.proxyTls\n this[kProxyHeaders] = opts.headers || {}\n\n const resolvedUrl = new URL(opts.uri)\n const { origin, port, host, username, password } = resolvedUrl\n\n if (opts.auth && opts.token) {\n throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')\n } else if (opts.auth) {\n /* @deprecated in favour of opts.token */\n this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`\n } else if (opts.token) {\n this[kProxyHeaders]['proxy-authorization'] = opts.token\n } else if (username && password) {\n this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`\n }\n\n const connect = buildConnector({ ...opts.proxyTls })\n this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })\n this[kClient] = clientFactory(resolvedUrl, { connect })\n this[kAgent] = new Agent({\n ...opts,\n connect: async (opts, callback) => {\n let requestedHost = opts.host\n if (!opts.port) {\n requestedHost += `:${defaultProtocolPort(opts.protocol)}`\n }\n try {\n const { socket, statusCode } = await this[kClient].connect({\n origin,\n port,\n path: requestedHost,\n signal: opts.signal,\n headers: {\n ...this[kProxyHeaders],\n host\n }\n })\n if (statusCode !== 200) {\n socket.on('error', () => {}).destroy()\n callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))\n }\n if (opts.protocol !== 'https:') {\n callback(null, socket)\n return\n }\n let servername\n if (this[kRequestTls]) {\n servername = this[kRequestTls].servername\n } else {\n servername = opts.servername\n }\n this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)\n } catch (err) {\n callback(err)\n }\n }\n })\n }\n\n dispatch (opts, handler) {\n const { host } = new URL(opts.origin)\n const headers = buildHeaders(opts.headers)\n throwIfProxyAuthIsSent(headers)\n return this[kAgent].dispatch(\n {\n ...opts,\n headers: {\n ...headers,\n host\n }\n },\n handler\n )\n }\n\n async [kClose] () {\n await this[kAgent].close()\n await this[kClient].close()\n }\n\n async [kDestroy] () {\n await this[kAgent].destroy()\n await this[kClient].destroy()\n }\n}\n\n/**\n * @param {string[] | Record} headers\n * @returns {Record}\n */\nfunction buildHeaders (headers) {\n // When using undici.fetch, the headers list is stored\n // as an array.\n if (Array.isArray(headers)) {\n /** @type {Record} */\n const headersPair = {}\n\n for (let i = 0; i < headers.length; i += 2) {\n headersPair[headers[i]] = headers[i + 1]\n }\n\n return headersPair\n }\n\n return headers\n}\n\n/**\n * @param {Record} headers\n *\n * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers\n * Nevertheless, it was changed and to avoid a security vulnerability by end users\n * this check was created.\n * It should be removed in the next major version for performance reasons\n */\nfunction throwIfProxyAuthIsSent (headers) {\n const existProxyAuth = headers && Object.keys(headers)\n .find((key) => key.toLowerCase() === 'proxy-authorization')\n if (existProxyAuth) {\n throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')\n }\n}\n\nmodule.exports = ProxyAgent\n","const assert = require('assert')\n\nconst { kRetryHandlerDefaultRetry } = require('../core/symbols')\nconst { RequestRetryError } = require('../core/errors')\nconst { isDisturbed, parseHeaders, parseRangeHeader } = require('../core/util')\n\nfunction calculateRetryAfterHeader (retryAfter) {\n const current = Date.now()\n const diff = new Date(retryAfter).getTime() - current\n\n return diff\n}\n\nclass RetryHandler {\n constructor (opts, handlers) {\n const { retryOptions, ...dispatchOpts } = opts\n const {\n // Retry scoped\n retry: retryFn,\n maxRetries,\n maxTimeout,\n minTimeout,\n timeoutFactor,\n // Response scoped\n methods,\n errorCodes,\n retryAfter,\n statusCodes\n } = retryOptions ?? {}\n\n this.dispatch = handlers.dispatch\n this.handler = handlers.handler\n this.opts = dispatchOpts\n this.abort = null\n this.aborted = false\n this.retryOpts = {\n retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],\n retryAfter: retryAfter ?? true,\n maxTimeout: maxTimeout ?? 30 * 1000, // 30s,\n timeout: minTimeout ?? 500, // .5s\n timeoutFactor: timeoutFactor ?? 2,\n maxRetries: maxRetries ?? 5,\n // What errors we should retry\n methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],\n // Indicates which errors to retry\n statusCodes: statusCodes ?? [500, 502, 503, 504, 429],\n // List of errors to retry\n errorCodes: errorCodes ?? [\n 'ECONNRESET',\n 'ECONNREFUSED',\n 'ENOTFOUND',\n 'ENETDOWN',\n 'ENETUNREACH',\n 'EHOSTDOWN',\n 'EHOSTUNREACH',\n 'EPIPE'\n ]\n }\n\n this.retryCount = 0\n this.start = 0\n this.end = null\n this.etag = null\n this.resume = null\n\n // Handle possible onConnect duplication\n this.handler.onConnect(reason => {\n this.aborted = true\n if (this.abort) {\n this.abort(reason)\n } else {\n this.reason = reason\n }\n })\n }\n\n onRequestSent () {\n if (this.handler.onRequestSent) {\n this.handler.onRequestSent()\n }\n }\n\n onUpgrade (statusCode, headers, socket) {\n if (this.handler.onUpgrade) {\n this.handler.onUpgrade(statusCode, headers, socket)\n }\n }\n\n onConnect (abort) {\n if (this.aborted) {\n abort(this.reason)\n } else {\n this.abort = abort\n }\n }\n\n onBodySent (chunk) {\n if (this.handler.onBodySent) return this.handler.onBodySent(chunk)\n }\n\n static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {\n const { statusCode, code, headers } = err\n const { method, retryOptions } = opts\n const {\n maxRetries,\n timeout,\n maxTimeout,\n timeoutFactor,\n statusCodes,\n errorCodes,\n methods\n } = retryOptions\n let { counter, currentTimeout } = state\n\n currentTimeout =\n currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout\n\n // Any code that is not a Undici's originated and allowed to retry\n if (\n code &&\n code !== 'UND_ERR_REQ_RETRY' &&\n code !== 'UND_ERR_SOCKET' &&\n !errorCodes.includes(code)\n ) {\n cb(err)\n return\n }\n\n // If a set of method are provided and the current method is not in the list\n if (Array.isArray(methods) && !methods.includes(method)) {\n cb(err)\n return\n }\n\n // If a set of status code are provided and the current status code is not in the list\n if (\n statusCode != null &&\n Array.isArray(statusCodes) &&\n !statusCodes.includes(statusCode)\n ) {\n cb(err)\n return\n }\n\n // If we reached the max number of retries\n if (counter > maxRetries) {\n cb(err)\n return\n }\n\n let retryAfterHeader = headers != null && headers['retry-after']\n if (retryAfterHeader) {\n retryAfterHeader = Number(retryAfterHeader)\n retryAfterHeader = isNaN(retryAfterHeader)\n ? calculateRetryAfterHeader(retryAfterHeader)\n : retryAfterHeader * 1e3 // Retry-After is in seconds\n }\n\n const retryTimeout =\n retryAfterHeader > 0\n ? Math.min(retryAfterHeader, maxTimeout)\n : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)\n\n state.currentTimeout = retryTimeout\n\n setTimeout(() => cb(null), retryTimeout)\n }\n\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n const headers = parseHeaders(rawHeaders)\n\n this.retryCount += 1\n\n if (statusCode >= 300) {\n this.abort(\n new RequestRetryError('Request failed', statusCode, {\n headers,\n count: this.retryCount\n })\n )\n return false\n }\n\n // Checkpoint for resume from where we left it\n if (this.resume != null) {\n this.resume = null\n\n if (statusCode !== 206) {\n return true\n }\n\n const contentRange = parseRangeHeader(headers['content-range'])\n // If no content range\n if (!contentRange) {\n this.abort(\n new RequestRetryError('Content-Range mismatch', statusCode, {\n headers,\n count: this.retryCount\n })\n )\n return false\n }\n\n // Let's start with a weak etag check\n if (this.etag != null && this.etag !== headers.etag) {\n this.abort(\n new RequestRetryError('ETag mismatch', statusCode, {\n headers,\n count: this.retryCount\n })\n )\n return false\n }\n\n const { start, size, end = size } = contentRange\n\n assert(this.start === start, 'content-range mismatch')\n assert(this.end == null || this.end === end, 'content-range mismatch')\n\n this.resume = resume\n return true\n }\n\n if (this.end == null) {\n if (statusCode === 206) {\n // First time we receive 206\n const range = parseRangeHeader(headers['content-range'])\n\n if (range == null) {\n return this.handler.onHeaders(\n statusCode,\n rawHeaders,\n resume,\n statusMessage\n )\n }\n\n const { start, size, end = size } = range\n\n assert(\n start != null && Number.isFinite(start) && this.start !== start,\n 'content-range mismatch'\n )\n assert(Number.isFinite(start))\n assert(\n end != null && Number.isFinite(end) && this.end !== end,\n 'invalid content-length'\n )\n\n this.start = start\n this.end = end\n }\n\n // We make our best to checkpoint the body for further range headers\n if (this.end == null) {\n const contentLength = headers['content-length']\n this.end = contentLength != null ? Number(contentLength) : null\n }\n\n assert(Number.isFinite(this.start))\n assert(\n this.end == null || Number.isFinite(this.end),\n 'invalid content-length'\n )\n\n this.resume = resume\n this.etag = headers.etag != null ? headers.etag : null\n\n return this.handler.onHeaders(\n statusCode,\n rawHeaders,\n resume,\n statusMessage\n )\n }\n\n const err = new RequestRetryError('Request failed', statusCode, {\n headers,\n count: this.retryCount\n })\n\n this.abort(err)\n\n return false\n }\n\n onData (chunk) {\n this.start += chunk.length\n\n return this.handler.onData(chunk)\n }\n\n onComplete (rawTrailers) {\n this.retryCount = 0\n return this.handler.onComplete(rawTrailers)\n }\n\n onError (err) {\n if (this.aborted || isDisturbed(this.opts.body)) {\n return this.handler.onError(err)\n }\n\n this.retryOpts.retry(\n err,\n {\n state: { counter: this.retryCount++, currentTimeout: this.retryAfter },\n opts: { retryOptions: this.retryOpts, ...this.opts }\n },\n onRetry.bind(this)\n )\n\n function onRetry (err) {\n if (err != null || this.aborted || isDisturbed(this.opts.body)) {\n return this.handler.onError(err)\n }\n\n if (this.start !== 0) {\n this.opts = {\n ...this.opts,\n headers: {\n ...this.opts.headers,\n range: `bytes=${this.start}-${this.end ?? ''}`\n }\n }\n }\n\n try {\n this.dispatch(this.opts, this)\n } catch (err) {\n this.handler.onError(err)\n }\n }\n }\n}\n\nmodule.exports = RetryHandler\n","'use strict'\n\n// We include a version number for the Dispatcher API. In case of breaking changes,\n// this version number must be increased to avoid conflicts.\nconst globalDispatcher = Symbol.for('undici.globalDispatcher.1')\nconst { InvalidArgumentError } = require('./core/errors')\nconst Agent = require('./agent')\n\nif (getGlobalDispatcher() === undefined) {\n setGlobalDispatcher(new Agent())\n}\n\nfunction setGlobalDispatcher (agent) {\n if (!agent || typeof agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument agent must implement Agent')\n }\n Object.defineProperty(globalThis, globalDispatcher, {\n value: agent,\n writable: true,\n enumerable: false,\n configurable: false\n })\n}\n\nfunction getGlobalDispatcher () {\n return globalThis[globalDispatcher]\n}\n\nmodule.exports = {\n setGlobalDispatcher,\n getGlobalDispatcher\n}\n","'use strict'\n\nmodule.exports = class DecoratorHandler {\n constructor (handler) {\n this.handler = handler\n }\n\n onConnect (...args) {\n return this.handler.onConnect(...args)\n }\n\n onError (...args) {\n return this.handler.onError(...args)\n }\n\n onUpgrade (...args) {\n return this.handler.onUpgrade(...args)\n }\n\n onHeaders (...args) {\n return this.handler.onHeaders(...args)\n }\n\n onData (...args) {\n return this.handler.onData(...args)\n }\n\n onComplete (...args) {\n return this.handler.onComplete(...args)\n }\n\n onBodySent (...args) {\n return this.handler.onBodySent(...args)\n }\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst { kHeadersList, kConstruct } = require('../core/symbols')\nconst { kGuard } = require('./symbols')\nconst { kEnumerableProperty } = require('../core/util')\nconst {\n makeIterator,\n isValidHeaderName,\n isValidHeaderValue\n} = require('./util')\nconst util = require('util')\nconst { webidl } = require('./webidl')\nconst assert = require('assert')\n\nconst kHeadersMap = Symbol('headers map')\nconst kHeadersSortedMap = Symbol('headers map sorted')\n\n/**\n * @param {number} code\n */\nfunction isHTTPWhiteSpaceCharCode (code) {\n return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize\n * @param {string} potentialValue\n */\nfunction headerValueNormalize (potentialValue) {\n // To normalize a byte sequence potentialValue, remove\n // any leading and trailing HTTP whitespace bytes from\n // potentialValue.\n let i = 0; let j = potentialValue.length\n\n while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j\n while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i\n\n return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)\n}\n\nfunction fill (headers, object) {\n // To fill a Headers object headers with a given object object, run these steps:\n\n // 1. If object is a sequence, then for each header in object:\n // Note: webidl conversion to array has already been done.\n if (Array.isArray(object)) {\n for (let i = 0; i < object.length; ++i) {\n const header = object[i]\n // 1. If header does not contain exactly two items, then throw a TypeError.\n if (header.length !== 2) {\n throw webidl.errors.exception({\n header: 'Headers constructor',\n message: `expected name/value pair to be length 2, found ${header.length}.`\n })\n }\n\n // 2. Append (header’s first item, header’s second item) to headers.\n appendHeader(headers, header[0], header[1])\n }\n } else if (typeof object === 'object' && object !== null) {\n // Note: null should throw\n\n // 2. Otherwise, object is a record, then for each key → value in object,\n // append (key, value) to headers\n const keys = Object.keys(object)\n for (let i = 0; i < keys.length; ++i) {\n appendHeader(headers, keys[i], object[keys[i]])\n }\n } else {\n throw webidl.errors.conversionFailed({\n prefix: 'Headers constructor',\n argument: 'Argument 1',\n types: ['sequence>', 'record']\n })\n }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-headers-append\n */\nfunction appendHeader (headers, name, value) {\n // 1. Normalize value.\n value = headerValueNormalize(value)\n\n // 2. If name is not a header name or value is not a\n // header value, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.append',\n value: name,\n type: 'header name'\n })\n } else if (!isValidHeaderValue(value)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.append',\n value,\n type: 'header value'\n })\n }\n\n // 3. If headers’s guard is \"immutable\", then throw a TypeError.\n // 4. Otherwise, if headers’s guard is \"request\" and name is a\n // forbidden header name, return.\n // Note: undici does not implement forbidden header names\n if (headers[kGuard] === 'immutable') {\n throw new TypeError('immutable')\n } else if (headers[kGuard] === 'request-no-cors') {\n // 5. Otherwise, if headers’s guard is \"request-no-cors\":\n // TODO\n }\n\n // 6. Otherwise, if headers’s guard is \"response\" and name is a\n // forbidden response-header name, return.\n\n // 7. Append (name, value) to headers’s header list.\n return headers[kHeadersList].append(name, value)\n\n // 8. If headers’s guard is \"request-no-cors\", then remove\n // privileged no-CORS request headers from headers\n}\n\nclass HeadersList {\n /** @type {[string, string][]|null} */\n cookies = null\n\n constructor (init) {\n if (init instanceof HeadersList) {\n this[kHeadersMap] = new Map(init[kHeadersMap])\n this[kHeadersSortedMap] = init[kHeadersSortedMap]\n this.cookies = init.cookies === null ? null : [...init.cookies]\n } else {\n this[kHeadersMap] = new Map(init)\n this[kHeadersSortedMap] = null\n }\n }\n\n // https://fetch.spec.whatwg.org/#header-list-contains\n contains (name) {\n // A header list list contains a header name name if list\n // contains a header whose name is a byte-case-insensitive\n // match for name.\n name = name.toLowerCase()\n\n return this[kHeadersMap].has(name)\n }\n\n clear () {\n this[kHeadersMap].clear()\n this[kHeadersSortedMap] = null\n this.cookies = null\n }\n\n // https://fetch.spec.whatwg.org/#concept-header-list-append\n append (name, value) {\n this[kHeadersSortedMap] = null\n\n // 1. If list contains name, then set name to the first such\n // header’s name.\n const lowercaseName = name.toLowerCase()\n const exists = this[kHeadersMap].get(lowercaseName)\n\n // 2. Append (name, value) to list.\n if (exists) {\n const delimiter = lowercaseName === 'cookie' ? '; ' : ', '\n this[kHeadersMap].set(lowercaseName, {\n name: exists.name,\n value: `${exists.value}${delimiter}${value}`\n })\n } else {\n this[kHeadersMap].set(lowercaseName, { name, value })\n }\n\n if (lowercaseName === 'set-cookie') {\n this.cookies ??= []\n this.cookies.push(value)\n }\n }\n\n // https://fetch.spec.whatwg.org/#concept-header-list-set\n set (name, value) {\n this[kHeadersSortedMap] = null\n const lowercaseName = name.toLowerCase()\n\n if (lowercaseName === 'set-cookie') {\n this.cookies = [value]\n }\n\n // 1. If list contains name, then set the value of\n // the first such header to value and remove the\n // others.\n // 2. Otherwise, append header (name, value) to list.\n this[kHeadersMap].set(lowercaseName, { name, value })\n }\n\n // https://fetch.spec.whatwg.org/#concept-header-list-delete\n delete (name) {\n this[kHeadersSortedMap] = null\n\n name = name.toLowerCase()\n\n if (name === 'set-cookie') {\n this.cookies = null\n }\n\n this[kHeadersMap].delete(name)\n }\n\n // https://fetch.spec.whatwg.org/#concept-header-list-get\n get (name) {\n const value = this[kHeadersMap].get(name.toLowerCase())\n\n // 1. If list does not contain name, then return null.\n // 2. Return the values of all headers in list whose name\n // is a byte-case-insensitive match for name,\n // separated from each other by 0x2C 0x20, in order.\n return value === undefined ? null : value.value\n }\n\n * [Symbol.iterator] () {\n // use the lowercased name\n for (const [name, { value }] of this[kHeadersMap]) {\n yield [name, value]\n }\n }\n\n get entries () {\n const headers = {}\n\n if (this[kHeadersMap].size) {\n for (const { name, value } of this[kHeadersMap].values()) {\n headers[name] = value\n }\n }\n\n return headers\n }\n}\n\n// https://fetch.spec.whatwg.org/#headers-class\nclass Headers {\n constructor (init = undefined) {\n if (init === kConstruct) {\n return\n }\n this[kHeadersList] = new HeadersList()\n\n // The new Headers(init) constructor steps are:\n\n // 1. Set this’s guard to \"none\".\n this[kGuard] = 'none'\n\n // 2. If init is given, then fill this with init.\n if (init !== undefined) {\n init = webidl.converters.HeadersInit(init)\n fill(this, init)\n }\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-append\n append (name, value) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })\n\n name = webidl.converters.ByteString(name)\n value = webidl.converters.ByteString(value)\n\n return appendHeader(this, name, value)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-delete\n delete (name) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })\n\n name = webidl.converters.ByteString(name)\n\n // 1. If name is not a header name, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.delete',\n value: name,\n type: 'header name'\n })\n }\n\n // 2. If this’s guard is \"immutable\", then throw a TypeError.\n // 3. Otherwise, if this’s guard is \"request\" and name is a\n // forbidden header name, return.\n // 4. Otherwise, if this’s guard is \"request-no-cors\", name\n // is not a no-CORS-safelisted request-header name, and\n // name is not a privileged no-CORS request-header name,\n // return.\n // 5. Otherwise, if this’s guard is \"response\" and name is\n // a forbidden response-header name, return.\n // Note: undici does not implement forbidden header names\n if (this[kGuard] === 'immutable') {\n throw new TypeError('immutable')\n } else if (this[kGuard] === 'request-no-cors') {\n // TODO\n }\n\n // 6. If this’s header list does not contain name, then\n // return.\n if (!this[kHeadersList].contains(name)) {\n return\n }\n\n // 7. Delete name from this’s header list.\n // 8. If this’s guard is \"request-no-cors\", then remove\n // privileged no-CORS request headers from this.\n this[kHeadersList].delete(name)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-get\n get (name) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })\n\n name = webidl.converters.ByteString(name)\n\n // 1. If name is not a header name, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.get',\n value: name,\n type: 'header name'\n })\n }\n\n // 2. Return the result of getting name from this’s header\n // list.\n return this[kHeadersList].get(name)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-has\n has (name) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })\n\n name = webidl.converters.ByteString(name)\n\n // 1. If name is not a header name, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.has',\n value: name,\n type: 'header name'\n })\n }\n\n // 2. Return true if this’s header list contains name;\n // otherwise false.\n return this[kHeadersList].contains(name)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-set\n set (name, value) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })\n\n name = webidl.converters.ByteString(name)\n value = webidl.converters.ByteString(value)\n\n // 1. Normalize value.\n value = headerValueNormalize(value)\n\n // 2. If name is not a header name or value is not a\n // header value, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.set',\n value: name,\n type: 'header name'\n })\n } else if (!isValidHeaderValue(value)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.set',\n value,\n type: 'header value'\n })\n }\n\n // 3. If this’s guard is \"immutable\", then throw a TypeError.\n // 4. Otherwise, if this’s guard is \"request\" and name is a\n // forbidden header name, return.\n // 5. Otherwise, if this’s guard is \"request-no-cors\" and\n // name/value is not a no-CORS-safelisted request-header,\n // return.\n // 6. Otherwise, if this’s guard is \"response\" and name is a\n // forbidden response-header name, return.\n // Note: undici does not implement forbidden header names\n if (this[kGuard] === 'immutable') {\n throw new TypeError('immutable')\n } else if (this[kGuard] === 'request-no-cors') {\n // TODO\n }\n\n // 7. Set (name, value) in this’s header list.\n // 8. If this’s guard is \"request-no-cors\", then remove\n // privileged no-CORS request headers from this\n this[kHeadersList].set(name, value)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie\n getSetCookie () {\n webidl.brandCheck(this, Headers)\n\n // 1. If this’s header list does not contain `Set-Cookie`, then return « ».\n // 2. Return the values of all headers in this’s header list whose name is\n // a byte-case-insensitive match for `Set-Cookie`, in order.\n\n const list = this[kHeadersList].cookies\n\n if (list) {\n return [...list]\n }\n\n return []\n }\n\n // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n get [kHeadersSortedMap] () {\n if (this[kHeadersList][kHeadersSortedMap]) {\n return this[kHeadersList][kHeadersSortedMap]\n }\n\n // 1. Let headers be an empty list of headers with the key being the name\n // and value the value.\n const headers = []\n\n // 2. Let names be the result of convert header names to a sorted-lowercase\n // set with all the names of the headers in list.\n const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)\n const cookies = this[kHeadersList].cookies\n\n // 3. For each name of names:\n for (let i = 0; i < names.length; ++i) {\n const [name, value] = names[i]\n // 1. If name is `set-cookie`, then:\n if (name === 'set-cookie') {\n // 1. Let values be a list of all values of headers in list whose name\n // is a byte-case-insensitive match for name, in order.\n\n // 2. For each value of values:\n // 1. Append (name, value) to headers.\n for (let j = 0; j < cookies.length; ++j) {\n headers.push([name, cookies[j]])\n }\n } else {\n // 2. Otherwise:\n\n // 1. Let value be the result of getting name from list.\n\n // 2. Assert: value is non-null.\n assert(value !== null)\n\n // 3. Append (name, value) to headers.\n headers.push([name, value])\n }\n }\n\n this[kHeadersList][kHeadersSortedMap] = headers\n\n // 4. Return headers.\n return headers\n }\n\n keys () {\n webidl.brandCheck(this, Headers)\n\n if (this[kGuard] === 'immutable') {\n const value = this[kHeadersSortedMap]\n return makeIterator(() => value, 'Headers',\n 'key')\n }\n\n return makeIterator(\n () => [...this[kHeadersSortedMap].values()],\n 'Headers',\n 'key'\n )\n }\n\n values () {\n webidl.brandCheck(this, Headers)\n\n if (this[kGuard] === 'immutable') {\n const value = this[kHeadersSortedMap]\n return makeIterator(() => value, 'Headers',\n 'value')\n }\n\n return makeIterator(\n () => [...this[kHeadersSortedMap].values()],\n 'Headers',\n 'value'\n )\n }\n\n entries () {\n webidl.brandCheck(this, Headers)\n\n if (this[kGuard] === 'immutable') {\n const value = this[kHeadersSortedMap]\n return makeIterator(() => value, 'Headers',\n 'key+value')\n }\n\n return makeIterator(\n () => [...this[kHeadersSortedMap].values()],\n 'Headers',\n 'key+value'\n )\n }\n\n /**\n * @param {(value: string, key: string, self: Headers) => void} callbackFn\n * @param {unknown} thisArg\n */\n forEach (callbackFn, thisArg = globalThis) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })\n\n if (typeof callbackFn !== 'function') {\n throw new TypeError(\n \"Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.\"\n )\n }\n\n for (const [key, value] of this) {\n callbackFn.apply(thisArg, [value, key, this])\n }\n }\n\n [Symbol.for('nodejs.util.inspect.custom')] () {\n webidl.brandCheck(this, Headers)\n\n return this[kHeadersList]\n }\n}\n\nHeaders.prototype[Symbol.iterator] = Headers.prototype.entries\n\nObject.defineProperties(Headers.prototype, {\n append: kEnumerableProperty,\n delete: kEnumerableProperty,\n get: kEnumerableProperty,\n has: kEnumerableProperty,\n set: kEnumerableProperty,\n getSetCookie: kEnumerableProperty,\n keys: kEnumerableProperty,\n values: kEnumerableProperty,\n entries: kEnumerableProperty,\n forEach: kEnumerableProperty,\n [Symbol.iterator]: { enumerable: false },\n [Symbol.toStringTag]: {\n value: 'Headers',\n configurable: true\n },\n [util.inspect.custom]: {\n enumerable: false\n }\n})\n\nwebidl.converters.HeadersInit = function (V) {\n if (webidl.util.Type(V) === 'Object') {\n if (V[Symbol.iterator]) {\n return webidl.converters['sequence>'](V)\n }\n\n return webidl.converters['record'](V)\n }\n\n throw webidl.errors.conversionFailed({\n prefix: 'Headers constructor',\n argument: 'Argument 1',\n types: ['sequence>', 'record']\n })\n}\n\nmodule.exports = {\n fill,\n Headers,\n HeadersList\n}\n","'use strict'\n\nconst { Headers, HeadersList, fill } = require('./headers')\nconst { extractBody, cloneBody, mixinBody } = require('./body')\nconst util = require('../core/util')\nconst { kEnumerableProperty } = util\nconst {\n isValidReasonPhrase,\n isCancelled,\n isAborted,\n isBlobLike,\n serializeJavascriptValueToJSONString,\n isErrorLike,\n isomorphicEncode\n} = require('./util')\nconst {\n redirectStatusSet,\n nullBodyStatus,\n DOMException\n} = require('./constants')\nconst { kState, kHeaders, kGuard, kRealm } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { FormData } = require('./formdata')\nconst { getGlobalOrigin } = require('./global')\nconst { URLSerializer } = require('./dataURL')\nconst { kHeadersList, kConstruct } = require('../core/symbols')\nconst assert = require('assert')\nconst { types } = require('util')\n\nconst ReadableStream = globalThis.ReadableStream || require('stream/web').ReadableStream\nconst textEncoder = new TextEncoder('utf-8')\n\n// https://fetch.spec.whatwg.org/#response-class\nclass Response {\n // Creates network error Response.\n static error () {\n // TODO\n const relevantRealm = { settingsObject: {} }\n\n // The static error() method steps are to return the result of creating a\n // Response object, given a new network error, \"immutable\", and this’s\n // relevant Realm.\n const responseObject = new Response()\n responseObject[kState] = makeNetworkError()\n responseObject[kRealm] = relevantRealm\n responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList\n responseObject[kHeaders][kGuard] = 'immutable'\n responseObject[kHeaders][kRealm] = relevantRealm\n return responseObject\n }\n\n // https://fetch.spec.whatwg.org/#dom-response-json\n static json (data, init = {}) {\n webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })\n\n if (init !== null) {\n init = webidl.converters.ResponseInit(init)\n }\n\n // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.\n const bytes = textEncoder.encode(\n serializeJavascriptValueToJSONString(data)\n )\n\n // 2. Let body be the result of extracting bytes.\n const body = extractBody(bytes)\n\n // 3. Let responseObject be the result of creating a Response object, given a new response,\n // \"response\", and this’s relevant Realm.\n const relevantRealm = { settingsObject: {} }\n const responseObject = new Response()\n responseObject[kRealm] = relevantRealm\n responseObject[kHeaders][kGuard] = 'response'\n responseObject[kHeaders][kRealm] = relevantRealm\n\n // 4. Perform initialize a response given responseObject, init, and (body, \"application/json\").\n initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })\n\n // 5. Return responseObject.\n return responseObject\n }\n\n // Creates a redirect Response that redirects to url with status status.\n static redirect (url, status = 302) {\n const relevantRealm = { settingsObject: {} }\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })\n\n url = webidl.converters.USVString(url)\n status = webidl.converters['unsigned short'](status)\n\n // 1. Let parsedURL be the result of parsing url with current settings\n // object’s API base URL.\n // 2. If parsedURL is failure, then throw a TypeError.\n // TODO: base-URL?\n let parsedURL\n try {\n parsedURL = new URL(url, getGlobalOrigin())\n } catch (err) {\n throw Object.assign(new TypeError('Failed to parse URL from ' + url), {\n cause: err\n })\n }\n\n // 3. If status is not a redirect status, then throw a RangeError.\n if (!redirectStatusSet.has(status)) {\n throw new RangeError('Invalid status code ' + status)\n }\n\n // 4. Let responseObject be the result of creating a Response object,\n // given a new response, \"immutable\", and this’s relevant Realm.\n const responseObject = new Response()\n responseObject[kRealm] = relevantRealm\n responseObject[kHeaders][kGuard] = 'immutable'\n responseObject[kHeaders][kRealm] = relevantRealm\n\n // 5. Set responseObject’s response’s status to status.\n responseObject[kState].status = status\n\n // 6. Let value be parsedURL, serialized and isomorphic encoded.\n const value = isomorphicEncode(URLSerializer(parsedURL))\n\n // 7. Append `Location`/value to responseObject’s response’s header list.\n responseObject[kState].headersList.append('location', value)\n\n // 8. Return responseObject.\n return responseObject\n }\n\n // https://fetch.spec.whatwg.org/#dom-response\n constructor (body = null, init = {}) {\n if (body !== null) {\n body = webidl.converters.BodyInit(body)\n }\n\n init = webidl.converters.ResponseInit(init)\n\n // TODO\n this[kRealm] = { settingsObject: {} }\n\n // 1. Set this’s response to a new response.\n this[kState] = makeResponse({})\n\n // 2. Set this’s headers to a new Headers object with this’s relevant\n // Realm, whose header list is this’s response’s header list and guard\n // is \"response\".\n this[kHeaders] = new Headers(kConstruct)\n this[kHeaders][kGuard] = 'response'\n this[kHeaders][kHeadersList] = this[kState].headersList\n this[kHeaders][kRealm] = this[kRealm]\n\n // 3. Let bodyWithType be null.\n let bodyWithType = null\n\n // 4. If body is non-null, then set bodyWithType to the result of extracting body.\n if (body != null) {\n const [extractedBody, type] = extractBody(body)\n bodyWithType = { body: extractedBody, type }\n }\n\n // 5. Perform initialize a response given this, init, and bodyWithType.\n initializeResponse(this, init, bodyWithType)\n }\n\n // Returns response’s type, e.g., \"cors\".\n get type () {\n webidl.brandCheck(this, Response)\n\n // The type getter steps are to return this’s response’s type.\n return this[kState].type\n }\n\n // Returns response’s URL, if it has one; otherwise the empty string.\n get url () {\n webidl.brandCheck(this, Response)\n\n const urlList = this[kState].urlList\n\n // The url getter steps are to return the empty string if this’s\n // response’s URL is null; otherwise this’s response’s URL,\n // serialized with exclude fragment set to true.\n const url = urlList[urlList.length - 1] ?? null\n\n if (url === null) {\n return ''\n }\n\n return URLSerializer(url, true)\n }\n\n // Returns whether response was obtained through a redirect.\n get redirected () {\n webidl.brandCheck(this, Response)\n\n // The redirected getter steps are to return true if this’s response’s URL\n // list has more than one item; otherwise false.\n return this[kState].urlList.length > 1\n }\n\n // Returns response’s status.\n get status () {\n webidl.brandCheck(this, Response)\n\n // The status getter steps are to return this’s response’s status.\n return this[kState].status\n }\n\n // Returns whether response’s status is an ok status.\n get ok () {\n webidl.brandCheck(this, Response)\n\n // The ok getter steps are to return true if this’s response’s status is an\n // ok status; otherwise false.\n return this[kState].status >= 200 && this[kState].status <= 299\n }\n\n // Returns response’s status message.\n get statusText () {\n webidl.brandCheck(this, Response)\n\n // The statusText getter steps are to return this’s response’s status\n // message.\n return this[kState].statusText\n }\n\n // Returns response’s headers as Headers.\n get headers () {\n webidl.brandCheck(this, Response)\n\n // The headers getter steps are to return this’s headers.\n return this[kHeaders]\n }\n\n get body () {\n webidl.brandCheck(this, Response)\n\n return this[kState].body ? this[kState].body.stream : null\n }\n\n get bodyUsed () {\n webidl.brandCheck(this, Response)\n\n return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n }\n\n // Returns a clone of response.\n clone () {\n webidl.brandCheck(this, Response)\n\n // 1. If this is unusable, then throw a TypeError.\n if (this.bodyUsed || (this.body && this.body.locked)) {\n throw webidl.errors.exception({\n header: 'Response.clone',\n message: 'Body has already been consumed.'\n })\n }\n\n // 2. Let clonedResponse be the result of cloning this’s response.\n const clonedResponse = cloneResponse(this[kState])\n\n // 3. Return the result of creating a Response object, given\n // clonedResponse, this’s headers’s guard, and this’s relevant Realm.\n const clonedResponseObject = new Response()\n clonedResponseObject[kState] = clonedResponse\n clonedResponseObject[kRealm] = this[kRealm]\n clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList\n clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]\n clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]\n\n return clonedResponseObject\n }\n}\n\nmixinBody(Response)\n\nObject.defineProperties(Response.prototype, {\n type: kEnumerableProperty,\n url: kEnumerableProperty,\n status: kEnumerableProperty,\n ok: kEnumerableProperty,\n redirected: kEnumerableProperty,\n statusText: kEnumerableProperty,\n headers: kEnumerableProperty,\n clone: kEnumerableProperty,\n body: kEnumerableProperty,\n bodyUsed: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'Response',\n configurable: true\n }\n})\n\nObject.defineProperties(Response, {\n json: kEnumerableProperty,\n redirect: kEnumerableProperty,\n error: kEnumerableProperty\n})\n\n// https://fetch.spec.whatwg.org/#concept-response-clone\nfunction cloneResponse (response) {\n // To clone a response response, run these steps:\n\n // 1. If response is a filtered response, then return a new identical\n // filtered response whose internal response is a clone of response’s\n // internal response.\n if (response.internalResponse) {\n return filterResponse(\n cloneResponse(response.internalResponse),\n response.type\n )\n }\n\n // 2. Let newResponse be a copy of response, except for its body.\n const newResponse = makeResponse({ ...response, body: null })\n\n // 3. If response’s body is non-null, then set newResponse’s body to the\n // result of cloning response’s body.\n if (response.body != null) {\n newResponse.body = cloneBody(response.body)\n }\n\n // 4. Return newResponse.\n return newResponse\n}\n\nfunction makeResponse (init) {\n return {\n aborted: false,\n rangeRequested: false,\n timingAllowPassed: false,\n requestIncludesCredentials: false,\n type: 'default',\n status: 200,\n timingInfo: null,\n cacheState: '',\n statusText: '',\n ...init,\n headersList: init.headersList\n ? new HeadersList(init.headersList)\n : new HeadersList(),\n urlList: init.urlList ? [...init.urlList] : []\n }\n}\n\nfunction makeNetworkError (reason) {\n const isError = isErrorLike(reason)\n return makeResponse({\n type: 'error',\n status: 0,\n error: isError\n ? reason\n : new Error(reason ? String(reason) : reason),\n aborted: reason && reason.name === 'AbortError'\n })\n}\n\nfunction makeFilteredResponse (response, state) {\n state = {\n internalResponse: response,\n ...state\n }\n\n return new Proxy(response, {\n get (target, p) {\n return p in state ? state[p] : target[p]\n },\n set (target, p, value) {\n assert(!(p in state))\n target[p] = value\n return true\n }\n })\n}\n\n// https://fetch.spec.whatwg.org/#concept-filtered-response\nfunction filterResponse (response, type) {\n // Set response to the following filtered response with response as its\n // internal response, depending on request’s response tainting:\n if (type === 'basic') {\n // A basic filtered response is a filtered response whose type is \"basic\"\n // and header list excludes any headers in internal response’s header list\n // whose name is a forbidden response-header name.\n\n // Note: undici does not implement forbidden response-header names\n return makeFilteredResponse(response, {\n type: 'basic',\n headersList: response.headersList\n })\n } else if (type === 'cors') {\n // A CORS filtered response is a filtered response whose type is \"cors\"\n // and header list excludes any headers in internal response’s header\n // list whose name is not a CORS-safelisted response-header name, given\n // internal response’s CORS-exposed header-name list.\n\n // Note: undici does not implement CORS-safelisted response-header names\n return makeFilteredResponse(response, {\n type: 'cors',\n headersList: response.headersList\n })\n } else if (type === 'opaque') {\n // An opaque filtered response is a filtered response whose type is\n // \"opaque\", URL list is the empty list, status is 0, status message\n // is the empty byte sequence, header list is empty, and body is null.\n\n return makeFilteredResponse(response, {\n type: 'opaque',\n urlList: Object.freeze([]),\n status: 0,\n statusText: '',\n body: null\n })\n } else if (type === 'opaqueredirect') {\n // An opaque-redirect filtered response is a filtered response whose type\n // is \"opaqueredirect\", status is 0, status message is the empty byte\n // sequence, header list is empty, and body is null.\n\n return makeFilteredResponse(response, {\n type: 'opaqueredirect',\n status: 0,\n statusText: '',\n headersList: [],\n body: null\n })\n } else {\n assert(false)\n }\n}\n\n// https://fetch.spec.whatwg.org/#appropriate-network-error\nfunction makeAppropriateNetworkError (fetchParams, err = null) {\n // 1. Assert: fetchParams is canceled.\n assert(isCancelled(fetchParams))\n\n // 2. Return an aborted network error if fetchParams is aborted;\n // otherwise return a network error.\n return isAborted(fetchParams)\n ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))\n : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))\n}\n\n// https://whatpr.org/fetch/1392.html#initialize-a-response\nfunction initializeResponse (response, init, body) {\n // 1. If init[\"status\"] is not in the range 200 to 599, inclusive, then\n // throw a RangeError.\n if (init.status !== null && (init.status < 200 || init.status > 599)) {\n throw new RangeError('init[\"status\"] must be in the range of 200 to 599, inclusive.')\n }\n\n // 2. If init[\"statusText\"] does not match the reason-phrase token production,\n // then throw a TypeError.\n if ('statusText' in init && init.statusText != null) {\n // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:\n // reason-phrase = *( HTAB / SP / VCHAR / obs-text )\n if (!isValidReasonPhrase(String(init.statusText))) {\n throw new TypeError('Invalid statusText')\n }\n }\n\n // 3. Set response’s response’s status to init[\"status\"].\n if ('status' in init && init.status != null) {\n response[kState].status = init.status\n }\n\n // 4. Set response’s response’s status message to init[\"statusText\"].\n if ('statusText' in init && init.statusText != null) {\n response[kState].statusText = init.statusText\n }\n\n // 5. If init[\"headers\"] exists, then fill response’s headers with init[\"headers\"].\n if ('headers' in init && init.headers != null) {\n fill(response[kHeaders], init.headers)\n }\n\n // 6. If body was given, then:\n if (body) {\n // 1. If response's status is a null body status, then throw a TypeError.\n if (nullBodyStatus.includes(response.status)) {\n throw webidl.errors.exception({\n header: 'Response constructor',\n message: 'Invalid response status code ' + response.status\n })\n }\n\n // 2. Set response's body to body's body.\n response[kState].body = body.body\n\n // 3. If body's type is non-null and response's header list does not contain\n // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.\n if (body.type != null && !response[kState].headersList.contains('Content-Type')) {\n response[kState].headersList.append('content-type', body.type)\n }\n }\n}\n\nwebidl.converters.ReadableStream = webidl.interfaceConverter(\n ReadableStream\n)\n\nwebidl.converters.FormData = webidl.interfaceConverter(\n FormData\n)\n\nwebidl.converters.URLSearchParams = webidl.interfaceConverter(\n URLSearchParams\n)\n\n// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit\nwebidl.converters.XMLHttpRequestBodyInit = function (V) {\n if (typeof V === 'string') {\n return webidl.converters.USVString(V)\n }\n\n if (isBlobLike(V)) {\n return webidl.converters.Blob(V, { strict: false })\n }\n\n if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {\n return webidl.converters.BufferSource(V)\n }\n\n if (util.isFormDataLike(V)) {\n return webidl.converters.FormData(V, { strict: false })\n }\n\n if (V instanceof URLSearchParams) {\n return webidl.converters.URLSearchParams(V)\n }\n\n return webidl.converters.DOMString(V)\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit\nwebidl.converters.BodyInit = function (V) {\n if (V instanceof ReadableStream) {\n return webidl.converters.ReadableStream(V)\n }\n\n // Note: the spec doesn't include async iterables,\n // this is an undici extension.\n if (V?.[Symbol.asyncIterator]) {\n return V\n }\n\n return webidl.converters.XMLHttpRequestBodyInit(V)\n}\n\nwebidl.converters.ResponseInit = webidl.dictionaryConverter([\n {\n key: 'status',\n converter: webidl.converters['unsigned short'],\n defaultValue: 200\n },\n {\n key: 'statusText',\n converter: webidl.converters.ByteString,\n defaultValue: ''\n },\n {\n key: 'headers',\n converter: webidl.converters.HeadersInit\n }\n])\n\nmodule.exports = {\n makeNetworkError,\n makeResponse,\n makeAppropriateNetworkError,\n filterResponse,\n Response,\n cloneResponse\n}\n","/* globals AbortController */\n\n'use strict'\n\nconst { extractBody, mixinBody, cloneBody } = require('./body')\nconst { Headers, fill: fillHeaders, HeadersList } = require('./headers')\nconst { FinalizationRegistry } = require('../compat/dispatcher-weakref')()\nconst util = require('../core/util')\nconst {\n isValidHTTPToken,\n sameOrigin,\n normalizeMethod,\n makePolicyContainer,\n normalizeMethodRecord\n} = require('./util')\nconst {\n forbiddenMethodsSet,\n corsSafeListedMethodsSet,\n referrerPolicy,\n requestRedirect,\n requestMode,\n requestCredentials,\n requestCache,\n requestDuplex\n} = require('./constants')\nconst { kEnumerableProperty } = util\nconst { kHeaders, kSignal, kState, kGuard, kRealm } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { getGlobalOrigin } = require('./global')\nconst { URLSerializer } = require('./dataURL')\nconst { kHeadersList, kConstruct } = require('../core/symbols')\nconst assert = require('assert')\nconst { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require('events')\n\nlet TransformStream = globalThis.TransformStream\n\nconst kAbortController = Symbol('abortController')\n\nconst requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {\n signal.removeEventListener('abort', abort)\n})\n\n// https://fetch.spec.whatwg.org/#request-class\nclass Request {\n // https://fetch.spec.whatwg.org/#dom-request\n constructor (input, init = {}) {\n if (input === kConstruct) {\n return\n }\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })\n\n input = webidl.converters.RequestInfo(input)\n init = webidl.converters.RequestInit(init)\n\n // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object\n this[kRealm] = {\n settingsObject: {\n baseUrl: getGlobalOrigin(),\n get origin () {\n return this.baseUrl?.origin\n },\n policyContainer: makePolicyContainer()\n }\n }\n\n // 1. Let request be null.\n let request = null\n\n // 2. Let fallbackMode be null.\n let fallbackMode = null\n\n // 3. Let baseURL be this’s relevant settings object’s API base URL.\n const baseUrl = this[kRealm].settingsObject.baseUrl\n\n // 4. Let signal be null.\n let signal = null\n\n // 5. If input is a string, then:\n if (typeof input === 'string') {\n // 1. Let parsedURL be the result of parsing input with baseURL.\n // 2. If parsedURL is failure, then throw a TypeError.\n let parsedURL\n try {\n parsedURL = new URL(input, baseUrl)\n } catch (err) {\n throw new TypeError('Failed to parse URL from ' + input, { cause: err })\n }\n\n // 3. If parsedURL includes credentials, then throw a TypeError.\n if (parsedURL.username || parsedURL.password) {\n throw new TypeError(\n 'Request cannot be constructed from a URL that includes credentials: ' +\n input\n )\n }\n\n // 4. Set request to a new request whose URL is parsedURL.\n request = makeRequest({ urlList: [parsedURL] })\n\n // 5. Set fallbackMode to \"cors\".\n fallbackMode = 'cors'\n } else {\n // 6. Otherwise:\n\n // 7. Assert: input is a Request object.\n assert(input instanceof Request)\n\n // 8. Set request to input’s request.\n request = input[kState]\n\n // 9. Set signal to input’s signal.\n signal = input[kSignal]\n }\n\n // 7. Let origin be this’s relevant settings object’s origin.\n const origin = this[kRealm].settingsObject.origin\n\n // 8. Let window be \"client\".\n let window = 'client'\n\n // 9. If request’s window is an environment settings object and its origin\n // is same origin with origin, then set window to request’s window.\n if (\n request.window?.constructor?.name === 'EnvironmentSettingsObject' &&\n sameOrigin(request.window, origin)\n ) {\n window = request.window\n }\n\n // 10. If init[\"window\"] exists and is non-null, then throw a TypeError.\n if (init.window != null) {\n throw new TypeError(`'window' option '${window}' must be null`)\n }\n\n // 11. If init[\"window\"] exists, then set window to \"no-window\".\n if ('window' in init) {\n window = 'no-window'\n }\n\n // 12. Set request to a new request with the following properties:\n request = makeRequest({\n // URL request’s URL.\n // undici implementation note: this is set as the first item in request's urlList in makeRequest\n // method request’s method.\n method: request.method,\n // header list A copy of request’s header list.\n // undici implementation note: headersList is cloned in makeRequest\n headersList: request.headersList,\n // unsafe-request flag Set.\n unsafeRequest: request.unsafeRequest,\n // client This’s relevant settings object.\n client: this[kRealm].settingsObject,\n // window window.\n window,\n // priority request’s priority.\n priority: request.priority,\n // origin request’s origin. The propagation of the origin is only significant for navigation requests\n // being handled by a service worker. In this scenario a request can have an origin that is different\n // from the current client.\n origin: request.origin,\n // referrer request’s referrer.\n referrer: request.referrer,\n // referrer policy request’s referrer policy.\n referrerPolicy: request.referrerPolicy,\n // mode request’s mode.\n mode: request.mode,\n // credentials mode request’s credentials mode.\n credentials: request.credentials,\n // cache mode request’s cache mode.\n cache: request.cache,\n // redirect mode request’s redirect mode.\n redirect: request.redirect,\n // integrity metadata request’s integrity metadata.\n integrity: request.integrity,\n // keepalive request’s keepalive.\n keepalive: request.keepalive,\n // reload-navigation flag request’s reload-navigation flag.\n reloadNavigation: request.reloadNavigation,\n // history-navigation flag request’s history-navigation flag.\n historyNavigation: request.historyNavigation,\n // URL list A clone of request’s URL list.\n urlList: [...request.urlList]\n })\n\n const initHasKey = Object.keys(init).length !== 0\n\n // 13. If init is not empty, then:\n if (initHasKey) {\n // 1. If request’s mode is \"navigate\", then set it to \"same-origin\".\n if (request.mode === 'navigate') {\n request.mode = 'same-origin'\n }\n\n // 2. Unset request’s reload-navigation flag.\n request.reloadNavigation = false\n\n // 3. Unset request’s history-navigation flag.\n request.historyNavigation = false\n\n // 4. Set request’s origin to \"client\".\n request.origin = 'client'\n\n // 5. Set request’s referrer to \"client\"\n request.referrer = 'client'\n\n // 6. Set request’s referrer policy to the empty string.\n request.referrerPolicy = ''\n\n // 7. Set request’s URL to request’s current URL.\n request.url = request.urlList[request.urlList.length - 1]\n\n // 8. Set request’s URL list to « request’s URL ».\n request.urlList = [request.url]\n }\n\n // 14. If init[\"referrer\"] exists, then:\n if (init.referrer !== undefined) {\n // 1. Let referrer be init[\"referrer\"].\n const referrer = init.referrer\n\n // 2. If referrer is the empty string, then set request’s referrer to \"no-referrer\".\n if (referrer === '') {\n request.referrer = 'no-referrer'\n } else {\n // 1. Let parsedReferrer be the result of parsing referrer with\n // baseURL.\n // 2. If parsedReferrer is failure, then throw a TypeError.\n let parsedReferrer\n try {\n parsedReferrer = new URL(referrer, baseUrl)\n } catch (err) {\n throw new TypeError(`Referrer \"${referrer}\" is not a valid URL.`, { cause: err })\n }\n\n // 3. If one of the following is true\n // - parsedReferrer’s scheme is \"about\" and path is the string \"client\"\n // - parsedReferrer’s origin is not same origin with origin\n // then set request’s referrer to \"client\".\n if (\n (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||\n (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))\n ) {\n request.referrer = 'client'\n } else {\n // 4. Otherwise, set request’s referrer to parsedReferrer.\n request.referrer = parsedReferrer\n }\n }\n }\n\n // 15. If init[\"referrerPolicy\"] exists, then set request’s referrer policy\n // to it.\n if (init.referrerPolicy !== undefined) {\n request.referrerPolicy = init.referrerPolicy\n }\n\n // 16. Let mode be init[\"mode\"] if it exists, and fallbackMode otherwise.\n let mode\n if (init.mode !== undefined) {\n mode = init.mode\n } else {\n mode = fallbackMode\n }\n\n // 17. If mode is \"navigate\", then throw a TypeError.\n if (mode === 'navigate') {\n throw webidl.errors.exception({\n header: 'Request constructor',\n message: 'invalid request mode navigate.'\n })\n }\n\n // 18. If mode is non-null, set request’s mode to mode.\n if (mode != null) {\n request.mode = mode\n }\n\n // 19. If init[\"credentials\"] exists, then set request’s credentials mode\n // to it.\n if (init.credentials !== undefined) {\n request.credentials = init.credentials\n }\n\n // 18. If init[\"cache\"] exists, then set request’s cache mode to it.\n if (init.cache !== undefined) {\n request.cache = init.cache\n }\n\n // 21. If request’s cache mode is \"only-if-cached\" and request’s mode is\n // not \"same-origin\", then throw a TypeError.\n if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {\n throw new TypeError(\n \"'only-if-cached' can be set only with 'same-origin' mode\"\n )\n }\n\n // 22. If init[\"redirect\"] exists, then set request’s redirect mode to it.\n if (init.redirect !== undefined) {\n request.redirect = init.redirect\n }\n\n // 23. If init[\"integrity\"] exists, then set request’s integrity metadata to it.\n if (init.integrity != null) {\n request.integrity = String(init.integrity)\n }\n\n // 24. If init[\"keepalive\"] exists, then set request’s keepalive to it.\n if (init.keepalive !== undefined) {\n request.keepalive = Boolean(init.keepalive)\n }\n\n // 25. If init[\"method\"] exists, then:\n if (init.method !== undefined) {\n // 1. Let method be init[\"method\"].\n let method = init.method\n\n // 2. If method is not a method or method is a forbidden method, then\n // throw a TypeError.\n if (!isValidHTTPToken(method)) {\n throw new TypeError(`'${method}' is not a valid HTTP method.`)\n }\n\n if (forbiddenMethodsSet.has(method.toUpperCase())) {\n throw new TypeError(`'${method}' HTTP method is unsupported.`)\n }\n\n // 3. Normalize method.\n method = normalizeMethodRecord[method] ?? normalizeMethod(method)\n\n // 4. Set request’s method to method.\n request.method = method\n }\n\n // 26. If init[\"signal\"] exists, then set signal to it.\n if (init.signal !== undefined) {\n signal = init.signal\n }\n\n // 27. Set this’s request to request.\n this[kState] = request\n\n // 28. Set this’s signal to a new AbortSignal object with this’s relevant\n // Realm.\n // TODO: could this be simplified with AbortSignal.any\n // (https://dom.spec.whatwg.org/#dom-abortsignal-any)\n const ac = new AbortController()\n this[kSignal] = ac.signal\n this[kSignal][kRealm] = this[kRealm]\n\n // 29. If signal is not null, then make this’s signal follow signal.\n if (signal != null) {\n if (\n !signal ||\n typeof signal.aborted !== 'boolean' ||\n typeof signal.addEventListener !== 'function'\n ) {\n throw new TypeError(\n \"Failed to construct 'Request': member signal is not of type AbortSignal.\"\n )\n }\n\n if (signal.aborted) {\n ac.abort(signal.reason)\n } else {\n // Keep a strong ref to ac while request object\n // is alive. This is needed to prevent AbortController\n // from being prematurely garbage collected.\n // See, https://github.com/nodejs/undici/issues/1926.\n this[kAbortController] = ac\n\n const acRef = new WeakRef(ac)\n const abort = function () {\n const ac = acRef.deref()\n if (ac !== undefined) {\n ac.abort(this.reason)\n }\n }\n\n // Third-party AbortControllers may not work with these.\n // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.\n try {\n // If the max amount of listeners is equal to the default, increase it\n // This is only available in node >= v19.9.0\n if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {\n setMaxListeners(100, signal)\n } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {\n setMaxListeners(100, signal)\n }\n } catch {}\n\n util.addAbortListener(signal, abort)\n requestFinalizer.register(ac, { signal, abort })\n }\n }\n\n // 30. Set this’s headers to a new Headers object with this’s relevant\n // Realm, whose header list is request’s header list and guard is\n // \"request\".\n this[kHeaders] = new Headers(kConstruct)\n this[kHeaders][kHeadersList] = request.headersList\n this[kHeaders][kGuard] = 'request'\n this[kHeaders][kRealm] = this[kRealm]\n\n // 31. If this’s request’s mode is \"no-cors\", then:\n if (mode === 'no-cors') {\n // 1. If this’s request’s method is not a CORS-safelisted method,\n // then throw a TypeError.\n if (!corsSafeListedMethodsSet.has(request.method)) {\n throw new TypeError(\n `'${request.method} is unsupported in no-cors mode.`\n )\n }\n\n // 2. Set this’s headers’s guard to \"request-no-cors\".\n this[kHeaders][kGuard] = 'request-no-cors'\n }\n\n // 32. If init is not empty, then:\n if (initHasKey) {\n /** @type {HeadersList} */\n const headersList = this[kHeaders][kHeadersList]\n // 1. Let headers be a copy of this’s headers and its associated header\n // list.\n // 2. If init[\"headers\"] exists, then set headers to init[\"headers\"].\n const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)\n\n // 3. Empty this’s headers’s header list.\n headersList.clear()\n\n // 4. If headers is a Headers object, then for each header in its header\n // list, append header’s name/header’s value to this’s headers.\n if (headers instanceof HeadersList) {\n for (const [key, val] of headers) {\n headersList.append(key, val)\n }\n // Note: Copy the `set-cookie` meta-data.\n headersList.cookies = headers.cookies\n } else {\n // 5. Otherwise, fill this’s headers with headers.\n fillHeaders(this[kHeaders], headers)\n }\n }\n\n // 33. Let inputBody be input’s request’s body if input is a Request\n // object; otherwise null.\n const inputBody = input instanceof Request ? input[kState].body : null\n\n // 34. If either init[\"body\"] exists and is non-null or inputBody is\n // non-null, and request’s method is `GET` or `HEAD`, then throw a\n // TypeError.\n if (\n (init.body != null || inputBody != null) &&\n (request.method === 'GET' || request.method === 'HEAD')\n ) {\n throw new TypeError('Request with GET/HEAD method cannot have body.')\n }\n\n // 35. Let initBody be null.\n let initBody = null\n\n // 36. If init[\"body\"] exists and is non-null, then:\n if (init.body != null) {\n // 1. Let Content-Type be null.\n // 2. Set initBody and Content-Type to the result of extracting\n // init[\"body\"], with keepalive set to request’s keepalive.\n const [extractedBody, contentType] = extractBody(\n init.body,\n request.keepalive\n )\n initBody = extractedBody\n\n // 3, If Content-Type is non-null and this’s headers’s header list does\n // not contain `Content-Type`, then append `Content-Type`/Content-Type to\n // this’s headers.\n if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {\n this[kHeaders].append('content-type', contentType)\n }\n }\n\n // 37. Let inputOrInitBody be initBody if it is non-null; otherwise\n // inputBody.\n const inputOrInitBody = initBody ?? inputBody\n\n // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is\n // null, then:\n if (inputOrInitBody != null && inputOrInitBody.source == null) {\n // 1. If initBody is non-null and init[\"duplex\"] does not exist,\n // then throw a TypeError.\n if (initBody != null && init.duplex == null) {\n throw new TypeError('RequestInit: duplex option is required when sending a body.')\n }\n\n // 2. If this’s request’s mode is neither \"same-origin\" nor \"cors\",\n // then throw a TypeError.\n if (request.mode !== 'same-origin' && request.mode !== 'cors') {\n throw new TypeError(\n 'If request is made from ReadableStream, mode should be \"same-origin\" or \"cors\"'\n )\n }\n\n // 3. Set this’s request’s use-CORS-preflight flag.\n request.useCORSPreflightFlag = true\n }\n\n // 39. Let finalBody be inputOrInitBody.\n let finalBody = inputOrInitBody\n\n // 40. If initBody is null and inputBody is non-null, then:\n if (initBody == null && inputBody != null) {\n // 1. If input is unusable, then throw a TypeError.\n if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {\n throw new TypeError(\n 'Cannot construct a Request with a Request object that has already been used.'\n )\n }\n\n // 2. Set finalBody to the result of creating a proxy for inputBody.\n if (!TransformStream) {\n TransformStream = require('stream/web').TransformStream\n }\n\n // https://streams.spec.whatwg.org/#readablestream-create-a-proxy\n const identityTransform = new TransformStream()\n inputBody.stream.pipeThrough(identityTransform)\n finalBody = {\n source: inputBody.source,\n length: inputBody.length,\n stream: identityTransform.readable\n }\n }\n\n // 41. Set this’s request’s body to finalBody.\n this[kState].body = finalBody\n }\n\n // Returns request’s HTTP method, which is \"GET\" by default.\n get method () {\n webidl.brandCheck(this, Request)\n\n // The method getter steps are to return this’s request’s method.\n return this[kState].method\n }\n\n // Returns the URL of request as a string.\n get url () {\n webidl.brandCheck(this, Request)\n\n // The url getter steps are to return this’s request’s URL, serialized.\n return URLSerializer(this[kState].url)\n }\n\n // Returns a Headers object consisting of the headers associated with request.\n // Note that headers added in the network layer by the user agent will not\n // be accounted for in this object, e.g., the \"Host\" header.\n get headers () {\n webidl.brandCheck(this, Request)\n\n // The headers getter steps are to return this’s headers.\n return this[kHeaders]\n }\n\n // Returns the kind of resource requested by request, e.g., \"document\"\n // or \"script\".\n get destination () {\n webidl.brandCheck(this, Request)\n\n // The destination getter are to return this’s request’s destination.\n return this[kState].destination\n }\n\n // Returns the referrer of request. Its value can be a same-origin URL if\n // explicitly set in init, the empty string to indicate no referrer, and\n // \"about:client\" when defaulting to the global’s default. This is used\n // during fetching to determine the value of the `Referer` header of the\n // request being made.\n get referrer () {\n webidl.brandCheck(this, Request)\n\n // 1. If this’s request’s referrer is \"no-referrer\", then return the\n // empty string.\n if (this[kState].referrer === 'no-referrer') {\n return ''\n }\n\n // 2. If this’s request’s referrer is \"client\", then return\n // \"about:client\".\n if (this[kState].referrer === 'client') {\n return 'about:client'\n }\n\n // Return this’s request’s referrer, serialized.\n return this[kState].referrer.toString()\n }\n\n // Returns the referrer policy associated with request.\n // This is used during fetching to compute the value of the request’s\n // referrer.\n get referrerPolicy () {\n webidl.brandCheck(this, Request)\n\n // The referrerPolicy getter steps are to return this’s request’s referrer policy.\n return this[kState].referrerPolicy\n }\n\n // Returns the mode associated with request, which is a string indicating\n // whether the request will use CORS, or will be restricted to same-origin\n // URLs.\n get mode () {\n webidl.brandCheck(this, Request)\n\n // The mode getter steps are to return this’s request’s mode.\n return this[kState].mode\n }\n\n // Returns the credentials mode associated with request,\n // which is a string indicating whether credentials will be sent with the\n // request always, never, or only when sent to a same-origin URL.\n get credentials () {\n // The credentials getter steps are to return this’s request’s credentials mode.\n return this[kState].credentials\n }\n\n // Returns the cache mode associated with request,\n // which is a string indicating how the request will\n // interact with the browser’s cache when fetching.\n get cache () {\n webidl.brandCheck(this, Request)\n\n // The cache getter steps are to return this’s request’s cache mode.\n return this[kState].cache\n }\n\n // Returns the redirect mode associated with request,\n // which is a string indicating how redirects for the\n // request will be handled during fetching. A request\n // will follow redirects by default.\n get redirect () {\n webidl.brandCheck(this, Request)\n\n // The redirect getter steps are to return this’s request’s redirect mode.\n return this[kState].redirect\n }\n\n // Returns request’s subresource integrity metadata, which is a\n // cryptographic hash of the resource being fetched. Its value\n // consists of multiple hashes separated by whitespace. [SRI]\n get integrity () {\n webidl.brandCheck(this, Request)\n\n // The integrity getter steps are to return this’s request’s integrity\n // metadata.\n return this[kState].integrity\n }\n\n // Returns a boolean indicating whether or not request can outlive the\n // global in which it was created.\n get keepalive () {\n webidl.brandCheck(this, Request)\n\n // The keepalive getter steps are to return this’s request’s keepalive.\n return this[kState].keepalive\n }\n\n // Returns a boolean indicating whether or not request is for a reload\n // navigation.\n get isReloadNavigation () {\n webidl.brandCheck(this, Request)\n\n // The isReloadNavigation getter steps are to return true if this’s\n // request’s reload-navigation flag is set; otherwise false.\n return this[kState].reloadNavigation\n }\n\n // Returns a boolean indicating whether or not request is for a history\n // navigation (a.k.a. back-foward navigation).\n get isHistoryNavigation () {\n webidl.brandCheck(this, Request)\n\n // The isHistoryNavigation getter steps are to return true if this’s request’s\n // history-navigation flag is set; otherwise false.\n return this[kState].historyNavigation\n }\n\n // Returns the signal associated with request, which is an AbortSignal\n // object indicating whether or not request has been aborted, and its\n // abort event handler.\n get signal () {\n webidl.brandCheck(this, Request)\n\n // The signal getter steps are to return this’s signal.\n return this[kSignal]\n }\n\n get body () {\n webidl.brandCheck(this, Request)\n\n return this[kState].body ? this[kState].body.stream : null\n }\n\n get bodyUsed () {\n webidl.brandCheck(this, Request)\n\n return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n }\n\n get duplex () {\n webidl.brandCheck(this, Request)\n\n return 'half'\n }\n\n // Returns a clone of request.\n clone () {\n webidl.brandCheck(this, Request)\n\n // 1. If this is unusable, then throw a TypeError.\n if (this.bodyUsed || this.body?.locked) {\n throw new TypeError('unusable')\n }\n\n // 2. Let clonedRequest be the result of cloning this’s request.\n const clonedRequest = cloneRequest(this[kState])\n\n // 3. Let clonedRequestObject be the result of creating a Request object,\n // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.\n const clonedRequestObject = new Request(kConstruct)\n clonedRequestObject[kState] = clonedRequest\n clonedRequestObject[kRealm] = this[kRealm]\n clonedRequestObject[kHeaders] = new Headers(kConstruct)\n clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList\n clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]\n clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]\n\n // 4. Make clonedRequestObject’s signal follow this’s signal.\n const ac = new AbortController()\n if (this.signal.aborted) {\n ac.abort(this.signal.reason)\n } else {\n util.addAbortListener(\n this.signal,\n () => {\n ac.abort(this.signal.reason)\n }\n )\n }\n clonedRequestObject[kSignal] = ac.signal\n\n // 4. Return clonedRequestObject.\n return clonedRequestObject\n }\n}\n\nmixinBody(Request)\n\nfunction makeRequest (init) {\n // https://fetch.spec.whatwg.org/#requests\n const request = {\n method: 'GET',\n localURLsOnly: false,\n unsafeRequest: false,\n body: null,\n client: null,\n reservedClient: null,\n replacesClientId: '',\n window: 'client',\n keepalive: false,\n serviceWorkers: 'all',\n initiator: '',\n destination: '',\n priority: null,\n origin: 'client',\n policyContainer: 'client',\n referrer: 'client',\n referrerPolicy: '',\n mode: 'no-cors',\n useCORSPreflightFlag: false,\n credentials: 'same-origin',\n useCredentials: false,\n cache: 'default',\n redirect: 'follow',\n integrity: '',\n cryptoGraphicsNonceMetadata: '',\n parserMetadata: '',\n reloadNavigation: false,\n historyNavigation: false,\n userActivation: false,\n taintedOrigin: false,\n redirectCount: 0,\n responseTainting: 'basic',\n preventNoCacheCacheControlHeaderModification: false,\n done: false,\n timingAllowFailed: false,\n ...init,\n headersList: init.headersList\n ? new HeadersList(init.headersList)\n : new HeadersList()\n }\n request.url = request.urlList[0]\n return request\n}\n\n// https://fetch.spec.whatwg.org/#concept-request-clone\nfunction cloneRequest (request) {\n // To clone a request request, run these steps:\n\n // 1. Let newRequest be a copy of request, except for its body.\n const newRequest = makeRequest({ ...request, body: null })\n\n // 2. If request’s body is non-null, set newRequest’s body to the\n // result of cloning request’s body.\n if (request.body != null) {\n newRequest.body = cloneBody(request.body)\n }\n\n // 3. Return newRequest.\n return newRequest\n}\n\nObject.defineProperties(Request.prototype, {\n method: kEnumerableProperty,\n url: kEnumerableProperty,\n headers: kEnumerableProperty,\n redirect: kEnumerableProperty,\n clone: kEnumerableProperty,\n signal: kEnumerableProperty,\n duplex: kEnumerableProperty,\n destination: kEnumerableProperty,\n body: kEnumerableProperty,\n bodyUsed: kEnumerableProperty,\n isHistoryNavigation: kEnumerableProperty,\n isReloadNavigation: kEnumerableProperty,\n keepalive: kEnumerableProperty,\n integrity: kEnumerableProperty,\n cache: kEnumerableProperty,\n credentials: kEnumerableProperty,\n attribute: kEnumerableProperty,\n referrerPolicy: kEnumerableProperty,\n referrer: kEnumerableProperty,\n mode: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'Request',\n configurable: true\n }\n})\n\nwebidl.converters.Request = webidl.interfaceConverter(\n Request\n)\n\n// https://fetch.spec.whatwg.org/#requestinfo\nwebidl.converters.RequestInfo = function (V) {\n if (typeof V === 'string') {\n return webidl.converters.USVString(V)\n }\n\n if (V instanceof Request) {\n return webidl.converters.Request(V)\n }\n\n return webidl.converters.USVString(V)\n}\n\nwebidl.converters.AbortSignal = webidl.interfaceConverter(\n AbortSignal\n)\n\n// https://fetch.spec.whatwg.org/#requestinit\nwebidl.converters.RequestInit = webidl.dictionaryConverter([\n {\n key: 'method',\n converter: webidl.converters.ByteString\n },\n {\n key: 'headers',\n converter: webidl.converters.HeadersInit\n },\n {\n key: 'body',\n converter: webidl.nullableConverter(\n webidl.converters.BodyInit\n )\n },\n {\n key: 'referrer',\n converter: webidl.converters.USVString\n },\n {\n key: 'referrerPolicy',\n converter: webidl.converters.DOMString,\n // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy\n allowedValues: referrerPolicy\n },\n {\n key: 'mode',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#concept-request-mode\n allowedValues: requestMode\n },\n {\n key: 'credentials',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#requestcredentials\n allowedValues: requestCredentials\n },\n {\n key: 'cache',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#requestcache\n allowedValues: requestCache\n },\n {\n key: 'redirect',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#requestredirect\n allowedValues: requestRedirect\n },\n {\n key: 'integrity',\n converter: webidl.converters.DOMString\n },\n {\n key: 'keepalive',\n converter: webidl.converters.boolean\n },\n {\n key: 'signal',\n converter: webidl.nullableConverter(\n (signal) => webidl.converters.AbortSignal(\n signal,\n { strict: false }\n )\n )\n },\n {\n key: 'window',\n converter: webidl.converters.any\n },\n {\n key: 'duplex',\n converter: webidl.converters.DOMString,\n allowedValues: requestDuplex\n }\n])\n\nmodule.exports = { Request, makeRequest }\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst {\n Response,\n makeNetworkError,\n makeAppropriateNetworkError,\n filterResponse,\n makeResponse\n} = require('./response')\nconst { Headers } = require('./headers')\nconst { Request, makeRequest } = require('./request')\nconst zlib = require('zlib')\nconst {\n bytesMatch,\n makePolicyContainer,\n clonePolicyContainer,\n requestBadPort,\n TAOCheck,\n appendRequestOriginHeader,\n responseLocationURL,\n requestCurrentURL,\n setRequestReferrerPolicyOnRedirect,\n tryUpgradeRequestToAPotentiallyTrustworthyURL,\n createOpaqueTimingInfo,\n appendFetchMetadata,\n corsCheck,\n crossOriginResourcePolicyCheck,\n determineRequestsReferrer,\n coarsenedSharedCurrentTime,\n createDeferredPromise,\n isBlobLike,\n sameOrigin,\n isCancelled,\n isAborted,\n isErrorLike,\n fullyReadBody,\n readableStreamClose,\n isomorphicEncode,\n urlIsLocal,\n urlIsHttpHttpsScheme,\n urlHasHttpsScheme\n} = require('./util')\nconst { kState, kHeaders, kGuard, kRealm } = require('./symbols')\nconst assert = require('assert')\nconst { safelyExtractBody } = require('./body')\nconst {\n redirectStatusSet,\n nullBodyStatus,\n safeMethodsSet,\n requestBodyHeader,\n subresourceSet,\n DOMException\n} = require('./constants')\nconst { kHeadersList } = require('../core/symbols')\nconst EE = require('events')\nconst { Readable, pipeline } = require('stream')\nconst { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = require('../core/util')\nconst { dataURLProcessor, serializeAMimeType } = require('./dataURL')\nconst { TransformStream } = require('stream/web')\nconst { getGlobalDispatcher } = require('../global')\nconst { webidl } = require('./webidl')\nconst { STATUS_CODES } = require('http')\nconst GET_OR_HEAD = ['GET', 'HEAD']\n\n/** @type {import('buffer').resolveObjectURL} */\nlet resolveObjectURL\nlet ReadableStream = globalThis.ReadableStream\n\nclass Fetch extends EE {\n constructor (dispatcher) {\n super()\n\n this.dispatcher = dispatcher\n this.connection = null\n this.dump = false\n this.state = 'ongoing'\n // 2 terminated listeners get added per request,\n // but only 1 gets removed. If there are 20 redirects,\n // 21 listeners will be added.\n // See https://github.com/nodejs/undici/issues/1711\n // TODO (fix): Find and fix root cause for leaked listener.\n this.setMaxListeners(21)\n }\n\n terminate (reason) {\n if (this.state !== 'ongoing') {\n return\n }\n\n this.state = 'terminated'\n this.connection?.destroy(reason)\n this.emit('terminated', reason)\n }\n\n // https://fetch.spec.whatwg.org/#fetch-controller-abort\n abort (error) {\n if (this.state !== 'ongoing') {\n return\n }\n\n // 1. Set controller’s state to \"aborted\".\n this.state = 'aborted'\n\n // 2. Let fallbackError be an \"AbortError\" DOMException.\n // 3. Set error to fallbackError if it is not given.\n if (!error) {\n error = new DOMException('The operation was aborted.', 'AbortError')\n }\n\n // 4. Let serializedError be StructuredSerialize(error).\n // If that threw an exception, catch it, and let\n // serializedError be StructuredSerialize(fallbackError).\n\n // 5. Set controller’s serialized abort reason to serializedError.\n this.serializedAbortReason = error\n\n this.connection?.destroy(error)\n this.emit('terminated', error)\n }\n}\n\n// https://fetch.spec.whatwg.org/#fetch-method\nfunction fetch (input, init = {}) {\n webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })\n\n // 1. Let p be a new promise.\n const p = createDeferredPromise()\n\n // 2. Let requestObject be the result of invoking the initial value of\n // Request as constructor with input and init as arguments. If this throws\n // an exception, reject p with it and return p.\n let requestObject\n\n try {\n requestObject = new Request(input, init)\n } catch (e) {\n p.reject(e)\n return p.promise\n }\n\n // 3. Let request be requestObject’s request.\n const request = requestObject[kState]\n\n // 4. If requestObject’s signal’s aborted flag is set, then:\n if (requestObject.signal.aborted) {\n // 1. Abort the fetch() call with p, request, null, and\n // requestObject’s signal’s abort reason.\n abortFetch(p, request, null, requestObject.signal.reason)\n\n // 2. Return p.\n return p.promise\n }\n\n // 5. Let globalObject be request’s client’s global object.\n const globalObject = request.client.globalObject\n\n // 6. If globalObject is a ServiceWorkerGlobalScope object, then set\n // request’s service-workers mode to \"none\".\n if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {\n request.serviceWorkers = 'none'\n }\n\n // 7. Let responseObject be null.\n let responseObject = null\n\n // 8. Let relevantRealm be this’s relevant Realm.\n const relevantRealm = null\n\n // 9. Let locallyAborted be false.\n let locallyAborted = false\n\n // 10. Let controller be null.\n let controller = null\n\n // 11. Add the following abort steps to requestObject’s signal:\n addAbortListener(\n requestObject.signal,\n () => {\n // 1. Set locallyAborted to true.\n locallyAborted = true\n\n // 2. Assert: controller is non-null.\n assert(controller != null)\n\n // 3. Abort controller with requestObject’s signal’s abort reason.\n controller.abort(requestObject.signal.reason)\n\n // 4. Abort the fetch() call with p, request, responseObject,\n // and requestObject’s signal’s abort reason.\n abortFetch(p, request, responseObject, requestObject.signal.reason)\n }\n )\n\n // 12. Let handleFetchDone given response response be to finalize and\n // report timing with response, globalObject, and \"fetch\".\n const handleFetchDone = (response) =>\n finalizeAndReportTiming(response, 'fetch')\n\n // 13. Set controller to the result of calling fetch given request,\n // with processResponseEndOfBody set to handleFetchDone, and processResponse\n // given response being these substeps:\n\n const processResponse = (response) => {\n // 1. If locallyAborted is true, terminate these substeps.\n if (locallyAborted) {\n return Promise.resolve()\n }\n\n // 2. If response’s aborted flag is set, then:\n if (response.aborted) {\n // 1. Let deserializedError be the result of deserialize a serialized\n // abort reason given controller’s serialized abort reason and\n // relevantRealm.\n\n // 2. Abort the fetch() call with p, request, responseObject, and\n // deserializedError.\n\n abortFetch(p, request, responseObject, controller.serializedAbortReason)\n return Promise.resolve()\n }\n\n // 3. If response is a network error, then reject p with a TypeError\n // and terminate these substeps.\n if (response.type === 'error') {\n p.reject(\n Object.assign(new TypeError('fetch failed'), { cause: response.error })\n )\n return Promise.resolve()\n }\n\n // 4. Set responseObject to the result of creating a Response object,\n // given response, \"immutable\", and relevantRealm.\n responseObject = new Response()\n responseObject[kState] = response\n responseObject[kRealm] = relevantRealm\n responseObject[kHeaders][kHeadersList] = response.headersList\n responseObject[kHeaders][kGuard] = 'immutable'\n responseObject[kHeaders][kRealm] = relevantRealm\n\n // 5. Resolve p with responseObject.\n p.resolve(responseObject)\n }\n\n controller = fetching({\n request,\n processResponseEndOfBody: handleFetchDone,\n processResponse,\n dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici\n })\n\n // 14. Return p.\n return p.promise\n}\n\n// https://fetch.spec.whatwg.org/#finalize-and-report-timing\nfunction finalizeAndReportTiming (response, initiatorType = 'other') {\n // 1. If response is an aborted network error, then return.\n if (response.type === 'error' && response.aborted) {\n return\n }\n\n // 2. If response’s URL list is null or empty, then return.\n if (!response.urlList?.length) {\n return\n }\n\n // 3. Let originalURL be response’s URL list[0].\n const originalURL = response.urlList[0]\n\n // 4. Let timingInfo be response’s timing info.\n let timingInfo = response.timingInfo\n\n // 5. Let cacheState be response’s cache state.\n let cacheState = response.cacheState\n\n // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.\n if (!urlIsHttpHttpsScheme(originalURL)) {\n return\n }\n\n // 7. If timingInfo is null, then return.\n if (timingInfo === null) {\n return\n }\n\n // 8. If response’s timing allow passed flag is not set, then:\n if (!response.timingAllowPassed) {\n // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.\n timingInfo = createOpaqueTimingInfo({\n startTime: timingInfo.startTime\n })\n\n // 2. Set cacheState to the empty string.\n cacheState = ''\n }\n\n // 9. Set timingInfo’s end time to the coarsened shared current time\n // given global’s relevant settings object’s cross-origin isolated\n // capability.\n // TODO: given global’s relevant settings object’s cross-origin isolated\n // capability?\n timingInfo.endTime = coarsenedSharedCurrentTime()\n\n // 10. Set response’s timing info to timingInfo.\n response.timingInfo = timingInfo\n\n // 11. Mark resource timing for timingInfo, originalURL, initiatorType,\n // global, and cacheState.\n markResourceTiming(\n timingInfo,\n originalURL,\n initiatorType,\n globalThis,\n cacheState\n )\n}\n\n// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing\nfunction markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {\n if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {\n performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)\n }\n}\n\n// https://fetch.spec.whatwg.org/#abort-fetch\nfunction abortFetch (p, request, responseObject, error) {\n // Note: AbortSignal.reason was added in node v17.2.0\n // which would give us an undefined error to reject with.\n // Remove this once node v16 is no longer supported.\n if (!error) {\n error = new DOMException('The operation was aborted.', 'AbortError')\n }\n\n // 1. Reject promise with error.\n p.reject(error)\n\n // 2. If request’s body is not null and is readable, then cancel request’s\n // body with error.\n if (request.body != null && isReadable(request.body?.stream)) {\n request.body.stream.cancel(error).catch((err) => {\n if (err.code === 'ERR_INVALID_STATE') {\n // Node bug?\n return\n }\n throw err\n })\n }\n\n // 3. If responseObject is null, then return.\n if (responseObject == null) {\n return\n }\n\n // 4. Let response be responseObject’s response.\n const response = responseObject[kState]\n\n // 5. If response’s body is not null and is readable, then error response’s\n // body with error.\n if (response.body != null && isReadable(response.body?.stream)) {\n response.body.stream.cancel(error).catch((err) => {\n if (err.code === 'ERR_INVALID_STATE') {\n // Node bug?\n return\n }\n throw err\n })\n }\n}\n\n// https://fetch.spec.whatwg.org/#fetching\nfunction fetching ({\n request,\n processRequestBodyChunkLength,\n processRequestEndOfBody,\n processResponse,\n processResponseEndOfBody,\n processResponseConsumeBody,\n useParallelQueue = false,\n dispatcher // undici\n}) {\n // 1. Let taskDestination be null.\n let taskDestination = null\n\n // 2. Let crossOriginIsolatedCapability be false.\n let crossOriginIsolatedCapability = false\n\n // 3. If request’s client is non-null, then:\n if (request.client != null) {\n // 1. Set taskDestination to request’s client’s global object.\n taskDestination = request.client.globalObject\n\n // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin\n // isolated capability.\n crossOriginIsolatedCapability =\n request.client.crossOriginIsolatedCapability\n }\n\n // 4. If useParallelQueue is true, then set taskDestination to the result of\n // starting a new parallel queue.\n // TODO\n\n // 5. Let timingInfo be a new fetch timing info whose start time and\n // post-redirect start time are the coarsened shared current time given\n // crossOriginIsolatedCapability.\n const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)\n const timingInfo = createOpaqueTimingInfo({\n startTime: currenTime\n })\n\n // 6. Let fetchParams be a new fetch params whose\n // request is request,\n // timing info is timingInfo,\n // process request body chunk length is processRequestBodyChunkLength,\n // process request end-of-body is processRequestEndOfBody,\n // process response is processResponse,\n // process response consume body is processResponseConsumeBody,\n // process response end-of-body is processResponseEndOfBody,\n // task destination is taskDestination,\n // and cross-origin isolated capability is crossOriginIsolatedCapability.\n const fetchParams = {\n controller: new Fetch(dispatcher),\n request,\n timingInfo,\n processRequestBodyChunkLength,\n processRequestEndOfBody,\n processResponse,\n processResponseConsumeBody,\n processResponseEndOfBody,\n taskDestination,\n crossOriginIsolatedCapability\n }\n\n // 7. If request’s body is a byte sequence, then set request’s body to\n // request’s body as a body.\n // NOTE: Since fetching is only called from fetch, body should already be\n // extracted.\n assert(!request.body || request.body.stream)\n\n // 8. If request’s window is \"client\", then set request’s window to request’s\n // client, if request’s client’s global object is a Window object; otherwise\n // \"no-window\".\n if (request.window === 'client') {\n // TODO: What if request.client is null?\n request.window =\n request.client?.globalObject?.constructor?.name === 'Window'\n ? request.client\n : 'no-window'\n }\n\n // 9. If request’s origin is \"client\", then set request’s origin to request’s\n // client’s origin.\n if (request.origin === 'client') {\n // TODO: What if request.client is null?\n request.origin = request.client?.origin\n }\n\n // 10. If all of the following conditions are true:\n // TODO\n\n // 11. If request’s policy container is \"client\", then:\n if (request.policyContainer === 'client') {\n // 1. If request’s client is non-null, then set request’s policy\n // container to a clone of request’s client’s policy container. [HTML]\n if (request.client != null) {\n request.policyContainer = clonePolicyContainer(\n request.client.policyContainer\n )\n } else {\n // 2. Otherwise, set request’s policy container to a new policy\n // container.\n request.policyContainer = makePolicyContainer()\n }\n }\n\n // 12. If request’s header list does not contain `Accept`, then:\n if (!request.headersList.contains('accept')) {\n // 1. Let value be `*/*`.\n const value = '*/*'\n\n // 2. A user agent should set value to the first matching statement, if\n // any, switching on request’s destination:\n // \"document\"\n // \"frame\"\n // \"iframe\"\n // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`\n // \"image\"\n // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`\n // \"style\"\n // `text/css,*/*;q=0.1`\n // TODO\n\n // 3. Append `Accept`/value to request’s header list.\n request.headersList.append('accept', value)\n }\n\n // 13. If request’s header list does not contain `Accept-Language`, then\n // user agents should append `Accept-Language`/an appropriate value to\n // request’s header list.\n if (!request.headersList.contains('accept-language')) {\n request.headersList.append('accept-language', '*')\n }\n\n // 14. If request’s priority is null, then use request’s initiator and\n // destination appropriately in setting request’s priority to a\n // user-agent-defined object.\n if (request.priority === null) {\n // TODO\n }\n\n // 15. If request is a subresource request, then:\n if (subresourceSet.has(request.destination)) {\n // TODO\n }\n\n // 16. Run main fetch given fetchParams.\n mainFetch(fetchParams)\n .catch(err => {\n fetchParams.controller.terminate(err)\n })\n\n // 17. Return fetchParam's controller\n return fetchParams.controller\n}\n\n// https://fetch.spec.whatwg.org/#concept-main-fetch\nasync function mainFetch (fetchParams, recursive = false) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let response be null.\n let response = null\n\n // 3. If request’s local-URLs-only flag is set and request’s current URL is\n // not local, then set response to a network error.\n if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {\n response = makeNetworkError('local URLs only')\n }\n\n // 4. Run report Content Security Policy violations for request.\n // TODO\n\n // 5. Upgrade request to a potentially trustworthy URL, if appropriate.\n tryUpgradeRequestToAPotentiallyTrustworthyURL(request)\n\n // 6. If should request be blocked due to a bad port, should fetching request\n // be blocked as mixed content, or should request be blocked by Content\n // Security Policy returns blocked, then set response to a network error.\n if (requestBadPort(request) === 'blocked') {\n response = makeNetworkError('bad port')\n }\n // TODO: should fetching request be blocked as mixed content?\n // TODO: should request be blocked by Content Security Policy?\n\n // 7. If request’s referrer policy is the empty string, then set request’s\n // referrer policy to request’s policy container’s referrer policy.\n if (request.referrerPolicy === '') {\n request.referrerPolicy = request.policyContainer.referrerPolicy\n }\n\n // 8. If request’s referrer is not \"no-referrer\", then set request’s\n // referrer to the result of invoking determine request’s referrer.\n if (request.referrer !== 'no-referrer') {\n request.referrer = determineRequestsReferrer(request)\n }\n\n // 9. Set request’s current URL’s scheme to \"https\" if all of the following\n // conditions are true:\n // - request’s current URL’s scheme is \"http\"\n // - request’s current URL’s host is a domain\n // - Matching request’s current URL’s host per Known HSTS Host Domain Name\n // Matching results in either a superdomain match with an asserted\n // includeSubDomains directive or a congruent match (with or without an\n // asserted includeSubDomains directive). [HSTS]\n // TODO\n\n // 10. If recursive is false, then run the remaining steps in parallel.\n // TODO\n\n // 11. If response is null, then set response to the result of running\n // the steps corresponding to the first matching statement:\n if (response === null) {\n response = await (async () => {\n const currentURL = requestCurrentURL(request)\n\n if (\n // - request’s current URL’s origin is same origin with request’s origin,\n // and request’s response tainting is \"basic\"\n (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||\n // request’s current URL’s scheme is \"data\"\n (currentURL.protocol === 'data:') ||\n // - request’s mode is \"navigate\" or \"websocket\"\n (request.mode === 'navigate' || request.mode === 'websocket')\n ) {\n // 1. Set request’s response tainting to \"basic\".\n request.responseTainting = 'basic'\n\n // 2. Return the result of running scheme fetch given fetchParams.\n return await schemeFetch(fetchParams)\n }\n\n // request’s mode is \"same-origin\"\n if (request.mode === 'same-origin') {\n // 1. Return a network error.\n return makeNetworkError('request mode cannot be \"same-origin\"')\n }\n\n // request’s mode is \"no-cors\"\n if (request.mode === 'no-cors') {\n // 1. If request’s redirect mode is not \"follow\", then return a network\n // error.\n if (request.redirect !== 'follow') {\n return makeNetworkError(\n 'redirect mode cannot be \"follow\" for \"no-cors\" request'\n )\n }\n\n // 2. Set request’s response tainting to \"opaque\".\n request.responseTainting = 'opaque'\n\n // 3. Return the result of running scheme fetch given fetchParams.\n return await schemeFetch(fetchParams)\n }\n\n // request’s current URL’s scheme is not an HTTP(S) scheme\n if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {\n // Return a network error.\n return makeNetworkError('URL scheme must be a HTTP(S) scheme')\n }\n\n // - request’s use-CORS-preflight flag is set\n // - request’s unsafe-request flag is set and either request’s method is\n // not a CORS-safelisted method or CORS-unsafe request-header names with\n // request’s header list is not empty\n // 1. Set request’s response tainting to \"cors\".\n // 2. Let corsWithPreflightResponse be the result of running HTTP fetch\n // given fetchParams and true.\n // 3. If corsWithPreflightResponse is a network error, then clear cache\n // entries using request.\n // 4. Return corsWithPreflightResponse.\n // TODO\n\n // Otherwise\n // 1. Set request’s response tainting to \"cors\".\n request.responseTainting = 'cors'\n\n // 2. Return the result of running HTTP fetch given fetchParams.\n return await httpFetch(fetchParams)\n })()\n }\n\n // 12. If recursive is true, then return response.\n if (recursive) {\n return response\n }\n\n // 13. If response is not a network error and response is not a filtered\n // response, then:\n if (response.status !== 0 && !response.internalResponse) {\n // If request’s response tainting is \"cors\", then:\n if (request.responseTainting === 'cors') {\n // 1. Let headerNames be the result of extracting header list values\n // given `Access-Control-Expose-Headers` and response’s header list.\n // TODO\n // 2. If request’s credentials mode is not \"include\" and headerNames\n // contains `*`, then set response’s CORS-exposed header-name list to\n // all unique header names in response’s header list.\n // TODO\n // 3. Otherwise, if headerNames is not null or failure, then set\n // response’s CORS-exposed header-name list to headerNames.\n // TODO\n }\n\n // Set response to the following filtered response with response as its\n // internal response, depending on request’s response tainting:\n if (request.responseTainting === 'basic') {\n response = filterResponse(response, 'basic')\n } else if (request.responseTainting === 'cors') {\n response = filterResponse(response, 'cors')\n } else if (request.responseTainting === 'opaque') {\n response = filterResponse(response, 'opaque')\n } else {\n assert(false)\n }\n }\n\n // 14. Let internalResponse be response, if response is a network error,\n // and response’s internal response otherwise.\n let internalResponse =\n response.status === 0 ? response : response.internalResponse\n\n // 15. If internalResponse’s URL list is empty, then set it to a clone of\n // request’s URL list.\n if (internalResponse.urlList.length === 0) {\n internalResponse.urlList.push(...request.urlList)\n }\n\n // 16. If request’s timing allow failed flag is unset, then set\n // internalResponse’s timing allow passed flag.\n if (!request.timingAllowFailed) {\n response.timingAllowPassed = true\n }\n\n // 17. If response is not a network error and any of the following returns\n // blocked\n // - should internalResponse to request be blocked as mixed content\n // - should internalResponse to request be blocked by Content Security Policy\n // - should internalResponse to request be blocked due to its MIME type\n // - should internalResponse to request be blocked due to nosniff\n // TODO\n\n // 18. If response’s type is \"opaque\", internalResponse’s status is 206,\n // internalResponse’s range-requested flag is set, and request’s header\n // list does not contain `Range`, then set response and internalResponse\n // to a network error.\n if (\n response.type === 'opaque' &&\n internalResponse.status === 206 &&\n internalResponse.rangeRequested &&\n !request.headers.contains('range')\n ) {\n response = internalResponse = makeNetworkError()\n }\n\n // 19. If response is not a network error and either request’s method is\n // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,\n // set internalResponse’s body to null and disregard any enqueuing toward\n // it (if any).\n if (\n response.status !== 0 &&\n (request.method === 'HEAD' ||\n request.method === 'CONNECT' ||\n nullBodyStatus.includes(internalResponse.status))\n ) {\n internalResponse.body = null\n fetchParams.controller.dump = true\n }\n\n // 20. If request’s integrity metadata is not the empty string, then:\n if (request.integrity) {\n // 1. Let processBodyError be this step: run fetch finale given fetchParams\n // and a network error.\n const processBodyError = (reason) =>\n fetchFinale(fetchParams, makeNetworkError(reason))\n\n // 2. If request’s response tainting is \"opaque\", or response’s body is null,\n // then run processBodyError and abort these steps.\n if (request.responseTainting === 'opaque' || response.body == null) {\n processBodyError(response.error)\n return\n }\n\n // 3. Let processBody given bytes be these steps:\n const processBody = (bytes) => {\n // 1. If bytes do not match request’s integrity metadata,\n // then run processBodyError and abort these steps. [SRI]\n if (!bytesMatch(bytes, request.integrity)) {\n processBodyError('integrity mismatch')\n return\n }\n\n // 2. Set response’s body to bytes as a body.\n response.body = safelyExtractBody(bytes)[0]\n\n // 3. Run fetch finale given fetchParams and response.\n fetchFinale(fetchParams, response)\n }\n\n // 4. Fully read response’s body given processBody and processBodyError.\n await fullyReadBody(response.body, processBody, processBodyError)\n } else {\n // 21. Otherwise, run fetch finale given fetchParams and response.\n fetchFinale(fetchParams, response)\n }\n}\n\n// https://fetch.spec.whatwg.org/#concept-scheme-fetch\n// given a fetch params fetchParams\nfunction schemeFetch (fetchParams) {\n // Note: since the connection is destroyed on redirect, which sets fetchParams to a\n // cancelled state, we do not want this condition to trigger *unless* there have been\n // no redirects. See https://github.com/nodejs/undici/issues/1776\n // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {\n return Promise.resolve(makeAppropriateNetworkError(fetchParams))\n }\n\n // 2. Let request be fetchParams’s request.\n const { request } = fetchParams\n\n const { protocol: scheme } = requestCurrentURL(request)\n\n // 3. Switch on request’s current URL’s scheme and run the associated steps:\n switch (scheme) {\n case 'about:': {\n // If request’s current URL’s path is the string \"blank\", then return a new response\n // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,\n // and body is the empty byte sequence as a body.\n\n // Otherwise, return a network error.\n return Promise.resolve(makeNetworkError('about scheme is not supported'))\n }\n case 'blob:': {\n if (!resolveObjectURL) {\n resolveObjectURL = require('buffer').resolveObjectURL\n }\n\n // 1. Let blobURLEntry be request’s current URL’s blob URL entry.\n const blobURLEntry = requestCurrentURL(request)\n\n // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56\n // Buffer.resolveObjectURL does not ignore URL queries.\n if (blobURLEntry.search.length !== 0) {\n return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))\n }\n\n const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())\n\n // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s\n // object is not a Blob object, then return a network error.\n if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {\n return Promise.resolve(makeNetworkError('invalid method'))\n }\n\n // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.\n const bodyWithType = safelyExtractBody(blobURLEntryObject)\n\n // 4. Let body be bodyWithType’s body.\n const body = bodyWithType[0]\n\n // 5. Let length be body’s length, serialized and isomorphic encoded.\n const length = isomorphicEncode(`${body.length}`)\n\n // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.\n const type = bodyWithType[1] ?? ''\n\n // 7. Return a new response whose status message is `OK`, header list is\n // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.\n const response = makeResponse({\n statusText: 'OK',\n headersList: [\n ['content-length', { name: 'Content-Length', value: length }],\n ['content-type', { name: 'Content-Type', value: type }]\n ]\n })\n\n response.body = body\n\n return Promise.resolve(response)\n }\n case 'data:': {\n // 1. Let dataURLStruct be the result of running the\n // data: URL processor on request’s current URL.\n const currentURL = requestCurrentURL(request)\n const dataURLStruct = dataURLProcessor(currentURL)\n\n // 2. If dataURLStruct is failure, then return a\n // network error.\n if (dataURLStruct === 'failure') {\n return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n }\n\n // 3. Let mimeType be dataURLStruct’s MIME type, serialized.\n const mimeType = serializeAMimeType(dataURLStruct.mimeType)\n\n // 4. Return a response whose status message is `OK`,\n // header list is « (`Content-Type`, mimeType) »,\n // and body is dataURLStruct’s body as a body.\n return Promise.resolve(makeResponse({\n statusText: 'OK',\n headersList: [\n ['content-type', { name: 'Content-Type', value: mimeType }]\n ],\n body: safelyExtractBody(dataURLStruct.body)[0]\n }))\n }\n case 'file:': {\n // For now, unfortunate as it is, file URLs are left as an exercise for the reader.\n // When in doubt, return a network error.\n return Promise.resolve(makeNetworkError('not implemented... yet...'))\n }\n case 'http:':\n case 'https:': {\n // Return the result of running HTTP fetch given fetchParams.\n\n return httpFetch(fetchParams)\n .catch((err) => makeNetworkError(err))\n }\n default: {\n return Promise.resolve(makeNetworkError('unknown scheme'))\n }\n }\n}\n\n// https://fetch.spec.whatwg.org/#finalize-response\nfunction finalizeResponse (fetchParams, response) {\n // 1. Set fetchParams’s request’s done flag.\n fetchParams.request.done = true\n\n // 2, If fetchParams’s process response done is not null, then queue a fetch\n // task to run fetchParams’s process response done given response, with\n // fetchParams’s task destination.\n if (fetchParams.processResponseDone != null) {\n queueMicrotask(() => fetchParams.processResponseDone(response))\n }\n}\n\n// https://fetch.spec.whatwg.org/#fetch-finale\nfunction fetchFinale (fetchParams, response) {\n // 1. If response is a network error, then:\n if (response.type === 'error') {\n // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».\n response.urlList = [fetchParams.request.urlList[0]]\n\n // 2. Set response’s timing info to the result of creating an opaque timing\n // info for fetchParams’s timing info.\n response.timingInfo = createOpaqueTimingInfo({\n startTime: fetchParams.timingInfo.startTime\n })\n }\n\n // 2. Let processResponseEndOfBody be the following steps:\n const processResponseEndOfBody = () => {\n // 1. Set fetchParams’s request’s done flag.\n fetchParams.request.done = true\n\n // If fetchParams’s process response end-of-body is not null,\n // then queue a fetch task to run fetchParams’s process response\n // end-of-body given response with fetchParams’s task destination.\n if (fetchParams.processResponseEndOfBody != null) {\n queueMicrotask(() => fetchParams.processResponseEndOfBody(response))\n }\n }\n\n // 3. If fetchParams’s process response is non-null, then queue a fetch task\n // to run fetchParams’s process response given response, with fetchParams’s\n // task destination.\n if (fetchParams.processResponse != null) {\n queueMicrotask(() => fetchParams.processResponse(response))\n }\n\n // 4. If response’s body is null, then run processResponseEndOfBody.\n if (response.body == null) {\n processResponseEndOfBody()\n } else {\n // 5. Otherwise:\n\n // 1. Let transformStream be a new a TransformStream.\n\n // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,\n // enqueues chunk in transformStream.\n const identityTransformAlgorithm = (chunk, controller) => {\n controller.enqueue(chunk)\n }\n\n // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm\n // and flushAlgorithm set to processResponseEndOfBody.\n const transformStream = new TransformStream({\n start () {},\n transform: identityTransformAlgorithm,\n flush: processResponseEndOfBody\n }, {\n size () {\n return 1\n }\n }, {\n size () {\n return 1\n }\n })\n\n // 4. Set response’s body to the result of piping response’s body through transformStream.\n response.body = { stream: response.body.stream.pipeThrough(transformStream) }\n }\n\n // 6. If fetchParams’s process response consume body is non-null, then:\n if (fetchParams.processResponseConsumeBody != null) {\n // 1. Let processBody given nullOrBytes be this step: run fetchParams’s\n // process response consume body given response and nullOrBytes.\n const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)\n\n // 2. Let processBodyError be this step: run fetchParams’s process\n // response consume body given response and failure.\n const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)\n\n // 3. If response’s body is null, then queue a fetch task to run processBody\n // given null, with fetchParams’s task destination.\n if (response.body == null) {\n queueMicrotask(() => processBody(null))\n } else {\n // 4. Otherwise, fully read response’s body given processBody, processBodyError,\n // and fetchParams’s task destination.\n return fullyReadBody(response.body, processBody, processBodyError)\n }\n return Promise.resolve()\n }\n}\n\n// https://fetch.spec.whatwg.org/#http-fetch\nasync function httpFetch (fetchParams) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let response be null.\n let response = null\n\n // 3. Let actualResponse be null.\n let actualResponse = null\n\n // 4. Let timingInfo be fetchParams’s timing info.\n const timingInfo = fetchParams.timingInfo\n\n // 5. If request’s service-workers mode is \"all\", then:\n if (request.serviceWorkers === 'all') {\n // TODO\n }\n\n // 6. If response is null, then:\n if (response === null) {\n // 1. If makeCORSPreflight is true and one of these conditions is true:\n // TODO\n\n // 2. If request’s redirect mode is \"follow\", then set request’s\n // service-workers mode to \"none\".\n if (request.redirect === 'follow') {\n request.serviceWorkers = 'none'\n }\n\n // 3. Set response and actualResponse to the result of running\n // HTTP-network-or-cache fetch given fetchParams.\n actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)\n\n // 4. If request’s response tainting is \"cors\" and a CORS check\n // for request and response returns failure, then return a network error.\n if (\n request.responseTainting === 'cors' &&\n corsCheck(request, response) === 'failure'\n ) {\n return makeNetworkError('cors failure')\n }\n\n // 5. If the TAO check for request and response returns failure, then set\n // request’s timing allow failed flag.\n if (TAOCheck(request, response) === 'failure') {\n request.timingAllowFailed = true\n }\n }\n\n // 7. If either request’s response tainting or response’s type\n // is \"opaque\", and the cross-origin resource policy check with\n // request’s origin, request’s client, request’s destination,\n // and actualResponse returns blocked, then return a network error.\n if (\n (request.responseTainting === 'opaque' || response.type === 'opaque') &&\n crossOriginResourcePolicyCheck(\n request.origin,\n request.client,\n request.destination,\n actualResponse\n ) === 'blocked'\n ) {\n return makeNetworkError('blocked')\n }\n\n // 8. If actualResponse’s status is a redirect status, then:\n if (redirectStatusSet.has(actualResponse.status)) {\n // 1. If actualResponse’s status is not 303, request’s body is not null,\n // and the connection uses HTTP/2, then user agents may, and are even\n // encouraged to, transmit an RST_STREAM frame.\n // See, https://github.com/whatwg/fetch/issues/1288\n if (request.redirect !== 'manual') {\n fetchParams.controller.connection.destroy()\n }\n\n // 2. Switch on request’s redirect mode:\n if (request.redirect === 'error') {\n // Set response to a network error.\n response = makeNetworkError('unexpected redirect')\n } else if (request.redirect === 'manual') {\n // Set response to an opaque-redirect filtered response whose internal\n // response is actualResponse.\n // NOTE(spec): On the web this would return an `opaqueredirect` response,\n // but that doesn't make sense server side.\n // See https://github.com/nodejs/undici/issues/1193.\n response = actualResponse\n } else if (request.redirect === 'follow') {\n // Set response to the result of running HTTP-redirect fetch given\n // fetchParams and response.\n response = await httpRedirectFetch(fetchParams, response)\n } else {\n assert(false)\n }\n }\n\n // 9. Set response’s timing info to timingInfo.\n response.timingInfo = timingInfo\n\n // 10. Return response.\n return response\n}\n\n// https://fetch.spec.whatwg.org/#http-redirect-fetch\nfunction httpRedirectFetch (fetchParams, response) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let actualResponse be response, if response is not a filtered response,\n // and response’s internal response otherwise.\n const actualResponse = response.internalResponse\n ? response.internalResponse\n : response\n\n // 3. Let locationURL be actualResponse’s location URL given request’s current\n // URL’s fragment.\n let locationURL\n\n try {\n locationURL = responseLocationURL(\n actualResponse,\n requestCurrentURL(request).hash\n )\n\n // 4. If locationURL is null, then return response.\n if (locationURL == null) {\n return response\n }\n } catch (err) {\n // 5. If locationURL is failure, then return a network error.\n return Promise.resolve(makeNetworkError(err))\n }\n\n // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network\n // error.\n if (!urlIsHttpHttpsScheme(locationURL)) {\n return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))\n }\n\n // 7. If request’s redirect count is 20, then return a network error.\n if (request.redirectCount === 20) {\n return Promise.resolve(makeNetworkError('redirect count exceeded'))\n }\n\n // 8. Increase request’s redirect count by 1.\n request.redirectCount += 1\n\n // 9. If request’s mode is \"cors\", locationURL includes credentials, and\n // request’s origin is not same origin with locationURL’s origin, then return\n // a network error.\n if (\n request.mode === 'cors' &&\n (locationURL.username || locationURL.password) &&\n !sameOrigin(request, locationURL)\n ) {\n return Promise.resolve(makeNetworkError('cross origin not allowed for request mode \"cors\"'))\n }\n\n // 10. If request’s response tainting is \"cors\" and locationURL includes\n // credentials, then return a network error.\n if (\n request.responseTainting === 'cors' &&\n (locationURL.username || locationURL.password)\n ) {\n return Promise.resolve(makeNetworkError(\n 'URL cannot contain credentials for request mode \"cors\"'\n ))\n }\n\n // 11. If actualResponse’s status is not 303, request’s body is non-null,\n // and request’s body’s source is null, then return a network error.\n if (\n actualResponse.status !== 303 &&\n request.body != null &&\n request.body.source == null\n ) {\n return Promise.resolve(makeNetworkError())\n }\n\n // 12. If one of the following is true\n // - actualResponse’s status is 301 or 302 and request’s method is `POST`\n // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`\n if (\n ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||\n (actualResponse.status === 303 &&\n !GET_OR_HEAD.includes(request.method))\n ) {\n // then:\n // 1. Set request’s method to `GET` and request’s body to null.\n request.method = 'GET'\n request.body = null\n\n // 2. For each headerName of request-body-header name, delete headerName from\n // request’s header list.\n for (const headerName of requestBodyHeader) {\n request.headersList.delete(headerName)\n }\n }\n\n // 13. If request’s current URL’s origin is not same origin with locationURL’s\n // origin, then for each headerName of CORS non-wildcard request-header name,\n // delete headerName from request’s header list.\n if (!sameOrigin(requestCurrentURL(request), locationURL)) {\n // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name\n request.headersList.delete('authorization')\n\n // https://fetch.spec.whatwg.org/#authentication-entries\n request.headersList.delete('proxy-authorization', true)\n\n // \"Cookie\" and \"Host\" are forbidden request-headers, which undici doesn't implement.\n request.headersList.delete('cookie')\n request.headersList.delete('host')\n }\n\n // 14. If request’s body is non-null, then set request’s body to the first return\n // value of safely extracting request’s body’s source.\n if (request.body != null) {\n assert(request.body.source != null)\n request.body = safelyExtractBody(request.body.source)[0]\n }\n\n // 15. Let timingInfo be fetchParams’s timing info.\n const timingInfo = fetchParams.timingInfo\n\n // 16. Set timingInfo’s redirect end time and post-redirect start time to the\n // coarsened shared current time given fetchParams’s cross-origin isolated\n // capability.\n timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =\n coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n\n // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s\n // redirect start time to timingInfo’s start time.\n if (timingInfo.redirectStartTime === 0) {\n timingInfo.redirectStartTime = timingInfo.startTime\n }\n\n // 18. Append locationURL to request’s URL list.\n request.urlList.push(locationURL)\n\n // 19. Invoke set request’s referrer policy on redirect on request and\n // actualResponse.\n setRequestReferrerPolicyOnRedirect(request, actualResponse)\n\n // 20. Return the result of running main fetch given fetchParams and true.\n return mainFetch(fetchParams, true)\n}\n\n// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch\nasync function httpNetworkOrCacheFetch (\n fetchParams,\n isAuthenticationFetch = false,\n isNewConnectionFetch = false\n) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let httpFetchParams be null.\n let httpFetchParams = null\n\n // 3. Let httpRequest be null.\n let httpRequest = null\n\n // 4. Let response be null.\n let response = null\n\n // 5. Let storedResponse be null.\n // TODO: cache\n\n // 6. Let httpCache be null.\n const httpCache = null\n\n // 7. Let the revalidatingFlag be unset.\n const revalidatingFlag = false\n\n // 8. Run these steps, but abort when the ongoing fetch is terminated:\n\n // 1. If request’s window is \"no-window\" and request’s redirect mode is\n // \"error\", then set httpFetchParams to fetchParams and httpRequest to\n // request.\n if (request.window === 'no-window' && request.redirect === 'error') {\n httpFetchParams = fetchParams\n httpRequest = request\n } else {\n // Otherwise:\n\n // 1. Set httpRequest to a clone of request.\n httpRequest = makeRequest(request)\n\n // 2. Set httpFetchParams to a copy of fetchParams.\n httpFetchParams = { ...fetchParams }\n\n // 3. Set httpFetchParams’s request to httpRequest.\n httpFetchParams.request = httpRequest\n }\n\n // 3. Let includeCredentials be true if one of\n const includeCredentials =\n request.credentials === 'include' ||\n (request.credentials === 'same-origin' &&\n request.responseTainting === 'basic')\n\n // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s\n // body is non-null; otherwise null.\n const contentLength = httpRequest.body ? httpRequest.body.length : null\n\n // 5. Let contentLengthHeaderValue be null.\n let contentLengthHeaderValue = null\n\n // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or\n // `PUT`, then set contentLengthHeaderValue to `0`.\n if (\n httpRequest.body == null &&\n ['POST', 'PUT'].includes(httpRequest.method)\n ) {\n contentLengthHeaderValue = '0'\n }\n\n // 7. If contentLength is non-null, then set contentLengthHeaderValue to\n // contentLength, serialized and isomorphic encoded.\n if (contentLength != null) {\n contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)\n }\n\n // 8. If contentLengthHeaderValue is non-null, then append\n // `Content-Length`/contentLengthHeaderValue to httpRequest’s header\n // list.\n if (contentLengthHeaderValue != null) {\n httpRequest.headersList.append('content-length', contentLengthHeaderValue)\n }\n\n // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,\n // contentLengthHeaderValue) to httpRequest’s header list.\n\n // 10. If contentLength is non-null and httpRequest’s keepalive is true,\n // then:\n if (contentLength != null && httpRequest.keepalive) {\n // NOTE: keepalive is a noop outside of browser context.\n }\n\n // 11. If httpRequest’s referrer is a URL, then append\n // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,\n // to httpRequest’s header list.\n if (httpRequest.referrer instanceof URL) {\n httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))\n }\n\n // 12. Append a request `Origin` header for httpRequest.\n appendRequestOriginHeader(httpRequest)\n\n // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]\n appendFetchMetadata(httpRequest)\n\n // 14. If httpRequest’s header list does not contain `User-Agent`, then\n // user agents should append `User-Agent`/default `User-Agent` value to\n // httpRequest’s header list.\n if (!httpRequest.headersList.contains('user-agent')) {\n httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')\n }\n\n // 15. If httpRequest’s cache mode is \"default\" and httpRequest’s header\n // list contains `If-Modified-Since`, `If-None-Match`,\n // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set\n // httpRequest’s cache mode to \"no-store\".\n if (\n httpRequest.cache === 'default' &&\n (httpRequest.headersList.contains('if-modified-since') ||\n httpRequest.headersList.contains('if-none-match') ||\n httpRequest.headersList.contains('if-unmodified-since') ||\n httpRequest.headersList.contains('if-match') ||\n httpRequest.headersList.contains('if-range'))\n ) {\n httpRequest.cache = 'no-store'\n }\n\n // 16. If httpRequest’s cache mode is \"no-cache\", httpRequest’s prevent\n // no-cache cache-control header modification flag is unset, and\n // httpRequest’s header list does not contain `Cache-Control`, then append\n // `Cache-Control`/`max-age=0` to httpRequest’s header list.\n if (\n httpRequest.cache === 'no-cache' &&\n !httpRequest.preventNoCacheCacheControlHeaderModification &&\n !httpRequest.headersList.contains('cache-control')\n ) {\n httpRequest.headersList.append('cache-control', 'max-age=0')\n }\n\n // 17. If httpRequest’s cache mode is \"no-store\" or \"reload\", then:\n if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {\n // 1. If httpRequest’s header list does not contain `Pragma`, then append\n // `Pragma`/`no-cache` to httpRequest’s header list.\n if (!httpRequest.headersList.contains('pragma')) {\n httpRequest.headersList.append('pragma', 'no-cache')\n }\n\n // 2. If httpRequest’s header list does not contain `Cache-Control`,\n // then append `Cache-Control`/`no-cache` to httpRequest’s header list.\n if (!httpRequest.headersList.contains('cache-control')) {\n httpRequest.headersList.append('cache-control', 'no-cache')\n }\n }\n\n // 18. If httpRequest’s header list contains `Range`, then append\n // `Accept-Encoding`/`identity` to httpRequest’s header list.\n if (httpRequest.headersList.contains('range')) {\n httpRequest.headersList.append('accept-encoding', 'identity')\n }\n\n // 19. Modify httpRequest’s header list per HTTP. Do not append a given\n // header if httpRequest’s header list contains that header’s name.\n // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129\n if (!httpRequest.headersList.contains('accept-encoding')) {\n if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {\n httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')\n } else {\n httpRequest.headersList.append('accept-encoding', 'gzip, deflate')\n }\n }\n\n httpRequest.headersList.delete('host')\n\n // 20. If includeCredentials is true, then:\n if (includeCredentials) {\n // 1. If the user agent is not configured to block cookies for httpRequest\n // (see section 7 of [COOKIES]), then:\n // TODO: credentials\n // 2. If httpRequest’s header list does not contain `Authorization`, then:\n // TODO: credentials\n }\n\n // 21. If there’s a proxy-authentication entry, use it as appropriate.\n // TODO: proxy-authentication\n\n // 22. Set httpCache to the result of determining the HTTP cache\n // partition, given httpRequest.\n // TODO: cache\n\n // 23. If httpCache is null, then set httpRequest’s cache mode to\n // \"no-store\".\n if (httpCache == null) {\n httpRequest.cache = 'no-store'\n }\n\n // 24. If httpRequest’s cache mode is neither \"no-store\" nor \"reload\",\n // then:\n if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {\n // TODO: cache\n }\n\n // 9. If aborted, then return the appropriate network error for fetchParams.\n // TODO\n\n // 10. If response is null, then:\n if (response == null) {\n // 1. If httpRequest’s cache mode is \"only-if-cached\", then return a\n // network error.\n if (httpRequest.mode === 'only-if-cached') {\n return makeNetworkError('only if cached')\n }\n\n // 2. Let forwardResponse be the result of running HTTP-network fetch\n // given httpFetchParams, includeCredentials, and isNewConnectionFetch.\n const forwardResponse = await httpNetworkFetch(\n httpFetchParams,\n includeCredentials,\n isNewConnectionFetch\n )\n\n // 3. If httpRequest’s method is unsafe and forwardResponse’s status is\n // in the range 200 to 399, inclusive, invalidate appropriate stored\n // responses in httpCache, as per the \"Invalidation\" chapter of HTTP\n // Caching, and set storedResponse to null. [HTTP-CACHING]\n if (\n !safeMethodsSet.has(httpRequest.method) &&\n forwardResponse.status >= 200 &&\n forwardResponse.status <= 399\n ) {\n // TODO: cache\n }\n\n // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,\n // then:\n if (revalidatingFlag && forwardResponse.status === 304) {\n // TODO: cache\n }\n\n // 5. If response is null, then:\n if (response == null) {\n // 1. Set response to forwardResponse.\n response = forwardResponse\n\n // 2. Store httpRequest and forwardResponse in httpCache, as per the\n // \"Storing Responses in Caches\" chapter of HTTP Caching. [HTTP-CACHING]\n // TODO: cache\n }\n }\n\n // 11. Set response’s URL list to a clone of httpRequest’s URL list.\n response.urlList = [...httpRequest.urlList]\n\n // 12. If httpRequest’s header list contains `Range`, then set response’s\n // range-requested flag.\n if (httpRequest.headersList.contains('range')) {\n response.rangeRequested = true\n }\n\n // 13. Set response’s request-includes-credentials to includeCredentials.\n response.requestIncludesCredentials = includeCredentials\n\n // 14. If response’s status is 401, httpRequest’s response tainting is not\n // \"cors\", includeCredentials is true, and request’s window is an environment\n // settings object, then:\n // TODO\n\n // 15. If response’s status is 407, then:\n if (response.status === 407) {\n // 1. If request’s window is \"no-window\", then return a network error.\n if (request.window === 'no-window') {\n return makeNetworkError()\n }\n\n // 2. ???\n\n // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n if (isCancelled(fetchParams)) {\n return makeAppropriateNetworkError(fetchParams)\n }\n\n // 4. Prompt the end user as appropriate in request’s window and store\n // the result as a proxy-authentication entry. [HTTP-AUTH]\n // TODO: Invoke some kind of callback?\n\n // 5. Set response to the result of running HTTP-network-or-cache fetch given\n // fetchParams.\n // TODO\n return makeNetworkError('proxy authentication required')\n }\n\n // 16. If all of the following are true\n if (\n // response’s status is 421\n response.status === 421 &&\n // isNewConnectionFetch is false\n !isNewConnectionFetch &&\n // request’s body is null, or request’s body is non-null and request’s body’s source is non-null\n (request.body == null || request.body.source != null)\n ) {\n // then:\n\n // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n if (isCancelled(fetchParams)) {\n return makeAppropriateNetworkError(fetchParams)\n }\n\n // 2. Set response to the result of running HTTP-network-or-cache\n // fetch given fetchParams, isAuthenticationFetch, and true.\n\n // TODO (spec): The spec doesn't specify this but we need to cancel\n // the active response before we can start a new one.\n // https://github.com/whatwg/fetch/issues/1293\n fetchParams.controller.connection.destroy()\n\n response = await httpNetworkOrCacheFetch(\n fetchParams,\n isAuthenticationFetch,\n true\n )\n }\n\n // 17. If isAuthenticationFetch is true, then create an authentication entry\n if (isAuthenticationFetch) {\n // TODO\n }\n\n // 18. Return response.\n return response\n}\n\n// https://fetch.spec.whatwg.org/#http-network-fetch\nasync function httpNetworkFetch (\n fetchParams,\n includeCredentials = false,\n forceNewConnection = false\n) {\n assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)\n\n fetchParams.controller.connection = {\n abort: null,\n destroyed: false,\n destroy (err) {\n if (!this.destroyed) {\n this.destroyed = true\n this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))\n }\n }\n }\n\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let response be null.\n let response = null\n\n // 3. Let timingInfo be fetchParams’s timing info.\n const timingInfo = fetchParams.timingInfo\n\n // 4. Let httpCache be the result of determining the HTTP cache partition,\n // given request.\n // TODO: cache\n const httpCache = null\n\n // 5. If httpCache is null, then set request’s cache mode to \"no-store\".\n if (httpCache == null) {\n request.cache = 'no-store'\n }\n\n // 6. Let networkPartitionKey be the result of determining the network\n // partition key given request.\n // TODO\n\n // 7. Let newConnection be \"yes\" if forceNewConnection is true; otherwise\n // \"no\".\n const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars\n\n // 8. Switch on request’s mode:\n if (request.mode === 'websocket') {\n // Let connection be the result of obtaining a WebSocket connection,\n // given request’s current URL.\n // TODO\n } else {\n // Let connection be the result of obtaining a connection, given\n // networkPartitionKey, request’s current URL’s origin,\n // includeCredentials, and forceNewConnection.\n // TODO\n }\n\n // 9. Run these steps, but abort when the ongoing fetch is terminated:\n\n // 1. If connection is failure, then return a network error.\n\n // 2. Set timingInfo’s final connection timing info to the result of\n // calling clamp and coarsen connection timing info with connection’s\n // timing info, timingInfo’s post-redirect start time, and fetchParams’s\n // cross-origin isolated capability.\n\n // 3. If connection is not an HTTP/2 connection, request’s body is non-null,\n // and request’s body’s source is null, then append (`Transfer-Encoding`,\n // `chunked`) to request’s header list.\n\n // 4. Set timingInfo’s final network-request start time to the coarsened\n // shared current time given fetchParams’s cross-origin isolated\n // capability.\n\n // 5. Set response to the result of making an HTTP request over connection\n // using request with the following caveats:\n\n // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]\n // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]\n\n // - If request’s body is non-null, and request’s body’s source is null,\n // then the user agent may have a buffer of up to 64 kibibytes and store\n // a part of request’s body in that buffer. If the user agent reads from\n // request’s body beyond that buffer’s size and the user agent needs to\n // resend request, then instead return a network error.\n\n // - Set timingInfo’s final network-response start time to the coarsened\n // shared current time given fetchParams’s cross-origin isolated capability,\n // immediately after the user agent’s HTTP parser receives the first byte\n // of the response (e.g., frame header bytes for HTTP/2 or response status\n // line for HTTP/1.x).\n\n // - Wait until all the headers are transmitted.\n\n // - Any responses whose status is in the range 100 to 199, inclusive,\n // and is not 101, are to be ignored, except for the purposes of setting\n // timingInfo’s final network-response start time above.\n\n // - If request’s header list contains `Transfer-Encoding`/`chunked` and\n // response is transferred via HTTP/1.0 or older, then return a network\n // error.\n\n // - If the HTTP request results in a TLS client certificate dialog, then:\n\n // 1. If request’s window is an environment settings object, make the\n // dialog available in request’s window.\n\n // 2. Otherwise, return a network error.\n\n // To transmit request’s body body, run these steps:\n let requestBody = null\n // 1. If body is null and fetchParams’s process request end-of-body is\n // non-null, then queue a fetch task given fetchParams’s process request\n // end-of-body and fetchParams’s task destination.\n if (request.body == null && fetchParams.processRequestEndOfBody) {\n queueMicrotask(() => fetchParams.processRequestEndOfBody())\n } else if (request.body != null) {\n // 2. Otherwise, if body is non-null:\n\n // 1. Let processBodyChunk given bytes be these steps:\n const processBodyChunk = async function * (bytes) {\n // 1. If the ongoing fetch is terminated, then abort these steps.\n if (isCancelled(fetchParams)) {\n return\n }\n\n // 2. Run this step in parallel: transmit bytes.\n yield bytes\n\n // 3. If fetchParams’s process request body is non-null, then run\n // fetchParams’s process request body given bytes’s length.\n fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)\n }\n\n // 2. Let processEndOfBody be these steps:\n const processEndOfBody = () => {\n // 1. If fetchParams is canceled, then abort these steps.\n if (isCancelled(fetchParams)) {\n return\n }\n\n // 2. If fetchParams’s process request end-of-body is non-null,\n // then run fetchParams’s process request end-of-body.\n if (fetchParams.processRequestEndOfBody) {\n fetchParams.processRequestEndOfBody()\n }\n }\n\n // 3. Let processBodyError given e be these steps:\n const processBodyError = (e) => {\n // 1. If fetchParams is canceled, then abort these steps.\n if (isCancelled(fetchParams)) {\n return\n }\n\n // 2. If e is an \"AbortError\" DOMException, then abort fetchParams’s controller.\n if (e.name === 'AbortError') {\n fetchParams.controller.abort()\n } else {\n fetchParams.controller.terminate(e)\n }\n }\n\n // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,\n // processBodyError, and fetchParams’s task destination.\n requestBody = (async function * () {\n try {\n for await (const bytes of request.body.stream) {\n yield * processBodyChunk(bytes)\n }\n processEndOfBody()\n } catch (err) {\n processBodyError(err)\n }\n })()\n }\n\n try {\n // socket is only provided for websockets\n const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })\n\n if (socket) {\n response = makeResponse({ status, statusText, headersList, socket })\n } else {\n const iterator = body[Symbol.asyncIterator]()\n fetchParams.controller.next = () => iterator.next()\n\n response = makeResponse({ status, statusText, headersList })\n }\n } catch (err) {\n // 10. If aborted, then:\n if (err.name === 'AbortError') {\n // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n fetchParams.controller.connection.destroy()\n\n // 2. Return the appropriate network error for fetchParams.\n return makeAppropriateNetworkError(fetchParams, err)\n }\n\n return makeNetworkError(err)\n }\n\n // 11. Let pullAlgorithm be an action that resumes the ongoing fetch\n // if it is suspended.\n const pullAlgorithm = () => {\n fetchParams.controller.resume()\n }\n\n // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s\n // controller with reason, given reason.\n const cancelAlgorithm = (reason) => {\n fetchParams.controller.abort(reason)\n }\n\n // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by\n // the user agent.\n // TODO\n\n // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object\n // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.\n // TODO\n\n // 15. Let stream be a new ReadableStream.\n // 16. Set up stream with pullAlgorithm set to pullAlgorithm,\n // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to\n // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.\n if (!ReadableStream) {\n ReadableStream = require('stream/web').ReadableStream\n }\n\n const stream = new ReadableStream(\n {\n async start (controller) {\n fetchParams.controller.controller = controller\n },\n async pull (controller) {\n await pullAlgorithm(controller)\n },\n async cancel (reason) {\n await cancelAlgorithm(reason)\n }\n },\n {\n highWaterMark: 0,\n size () {\n return 1\n }\n }\n )\n\n // 17. Run these steps, but abort when the ongoing fetch is terminated:\n\n // 1. Set response’s body to a new body whose stream is stream.\n response.body = { stream }\n\n // 2. If response is not a network error and request’s cache mode is\n // not \"no-store\", then update response in httpCache for request.\n // TODO\n\n // 3. If includeCredentials is true and the user agent is not configured\n // to block cookies for request (see section 7 of [COOKIES]), then run the\n // \"set-cookie-string\" parsing algorithm (see section 5.2 of [COOKIES]) on\n // the value of each header whose name is a byte-case-insensitive match for\n // `Set-Cookie` in response’s header list, if any, and request’s current URL.\n // TODO\n\n // 18. If aborted, then:\n // TODO\n\n // 19. Run these steps in parallel:\n\n // 1. Run these steps, but abort when fetchParams is canceled:\n fetchParams.controller.on('terminated', onAborted)\n fetchParams.controller.resume = async () => {\n // 1. While true\n while (true) {\n // 1-3. See onData...\n\n // 4. Set bytes to the result of handling content codings given\n // codings and bytes.\n let bytes\n let isFailure\n try {\n const { done, value } = await fetchParams.controller.next()\n\n if (isAborted(fetchParams)) {\n break\n }\n\n bytes = done ? undefined : value\n } catch (err) {\n if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {\n // zlib doesn't like empty streams.\n bytes = undefined\n } else {\n bytes = err\n\n // err may be propagated from the result of calling readablestream.cancel,\n // which might not be an error. https://github.com/nodejs/undici/issues/2009\n isFailure = true\n }\n }\n\n if (bytes === undefined) {\n // 2. Otherwise, if the bytes transmission for response’s message\n // body is done normally and stream is readable, then close\n // stream, finalize response for fetchParams and response, and\n // abort these in-parallel steps.\n readableStreamClose(fetchParams.controller.controller)\n\n finalizeResponse(fetchParams, response)\n\n return\n }\n\n // 5. Increase timingInfo’s decoded body size by bytes’s length.\n timingInfo.decodedBodySize += bytes?.byteLength ?? 0\n\n // 6. If bytes is failure, then terminate fetchParams’s controller.\n if (isFailure) {\n fetchParams.controller.terminate(bytes)\n return\n }\n\n // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes\n // into stream.\n fetchParams.controller.controller.enqueue(new Uint8Array(bytes))\n\n // 8. If stream is errored, then terminate the ongoing fetch.\n if (isErrored(stream)) {\n fetchParams.controller.terminate()\n return\n }\n\n // 9. If stream doesn’t need more data ask the user agent to suspend\n // the ongoing fetch.\n if (!fetchParams.controller.controller.desiredSize) {\n return\n }\n }\n }\n\n // 2. If aborted, then:\n function onAborted (reason) {\n // 2. If fetchParams is aborted, then:\n if (isAborted(fetchParams)) {\n // 1. Set response’s aborted flag.\n response.aborted = true\n\n // 2. If stream is readable, then error stream with the result of\n // deserialize a serialized abort reason given fetchParams’s\n // controller’s serialized abort reason and an\n // implementation-defined realm.\n if (isReadable(stream)) {\n fetchParams.controller.controller.error(\n fetchParams.controller.serializedAbortReason\n )\n }\n } else {\n // 3. Otherwise, if stream is readable, error stream with a TypeError.\n if (isReadable(stream)) {\n fetchParams.controller.controller.error(new TypeError('terminated', {\n cause: isErrorLike(reason) ? reason : undefined\n }))\n }\n }\n\n // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.\n fetchParams.controller.connection.destroy()\n }\n\n // 20. Return response.\n return response\n\n async function dispatch ({ body }) {\n const url = requestCurrentURL(request)\n /** @type {import('../..').Agent} */\n const agent = fetchParams.controller.dispatcher\n\n return new Promise((resolve, reject) => agent.dispatch(\n {\n path: url.pathname + url.search,\n origin: url.origin,\n method: request.method,\n body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,\n headers: request.headersList.entries,\n maxRedirections: 0,\n upgrade: request.mode === 'websocket' ? 'websocket' : undefined\n },\n {\n body: null,\n abort: null,\n\n onConnect (abort) {\n // TODO (fix): Do we need connection here?\n const { connection } = fetchParams.controller\n\n if (connection.destroyed) {\n abort(new DOMException('The operation was aborted.', 'AbortError'))\n } else {\n fetchParams.controller.on('terminated', abort)\n this.abort = connection.abort = abort\n }\n },\n\n onHeaders (status, headersList, resume, statusText) {\n if (status < 200) {\n return\n }\n\n let codings = []\n let location = ''\n\n const headers = new Headers()\n\n // For H2, the headers are a plain JS object\n // We distinguish between them and iterate accordingly\n if (Array.isArray(headersList)) {\n for (let n = 0; n < headersList.length; n += 2) {\n const key = headersList[n + 0].toString('latin1')\n const val = headersList[n + 1].toString('latin1')\n if (key.toLowerCase() === 'content-encoding') {\n // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1\n // \"All content-coding values are case-insensitive...\"\n codings = val.toLowerCase().split(',').map((x) => x.trim())\n } else if (key.toLowerCase() === 'location') {\n location = val\n }\n\n headers[kHeadersList].append(key, val)\n }\n } else {\n const keys = Object.keys(headersList)\n for (const key of keys) {\n const val = headersList[key]\n if (key.toLowerCase() === 'content-encoding') {\n // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1\n // \"All content-coding values are case-insensitive...\"\n codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()\n } else if (key.toLowerCase() === 'location') {\n location = val\n }\n\n headers[kHeadersList].append(key, val)\n }\n }\n\n this.body = new Readable({ read: resume })\n\n const decoders = []\n\n const willFollow = request.redirect === 'follow' &&\n location &&\n redirectStatusSet.has(status)\n\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding\n if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {\n for (const coding of codings) {\n // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2\n if (coding === 'x-gzip' || coding === 'gzip') {\n decoders.push(zlib.createGunzip({\n // Be less strict when decoding compressed responses, since sometimes\n // servers send slightly invalid responses that are still accepted\n // by common browsers.\n // Always using Z_SYNC_FLUSH is what cURL does.\n flush: zlib.constants.Z_SYNC_FLUSH,\n finishFlush: zlib.constants.Z_SYNC_FLUSH\n }))\n } else if (coding === 'deflate') {\n decoders.push(zlib.createInflate())\n } else if (coding === 'br') {\n decoders.push(zlib.createBrotliDecompress())\n } else {\n decoders.length = 0\n break\n }\n }\n }\n\n resolve({\n status,\n statusText,\n headersList: headers[kHeadersList],\n body: decoders.length\n ? pipeline(this.body, ...decoders, () => { })\n : this.body.on('error', () => {})\n })\n\n return true\n },\n\n onData (chunk) {\n if (fetchParams.controller.dump) {\n return\n }\n\n // 1. If one or more bytes have been transmitted from response’s\n // message body, then:\n\n // 1. Let bytes be the transmitted bytes.\n const bytes = chunk\n\n // 2. Let codings be the result of extracting header list values\n // given `Content-Encoding` and response’s header list.\n // See pullAlgorithm.\n\n // 3. Increase timingInfo’s encoded body size by bytes’s length.\n timingInfo.encodedBodySize += bytes.byteLength\n\n // 4. See pullAlgorithm...\n\n return this.body.push(bytes)\n },\n\n onComplete () {\n if (this.abort) {\n fetchParams.controller.off('terminated', this.abort)\n }\n\n fetchParams.controller.ended = true\n\n this.body.push(null)\n },\n\n onError (error) {\n if (this.abort) {\n fetchParams.controller.off('terminated', this.abort)\n }\n\n this.body?.destroy(error)\n\n fetchParams.controller.terminate(error)\n\n reject(error)\n },\n\n onUpgrade (status, headersList, socket) {\n if (status !== 101) {\n return\n }\n\n const headers = new Headers()\n\n for (let n = 0; n < headersList.length; n += 2) {\n const key = headersList[n + 0].toString('latin1')\n const val = headersList[n + 1].toString('latin1')\n\n headers[kHeadersList].append(key, val)\n }\n\n resolve({\n status,\n statusText: STATUS_CODES[status],\n headersList: headers[kHeadersList],\n socket\n })\n\n return true\n }\n }\n ))\n }\n}\n\nmodule.exports = {\n fetch,\n Fetch,\n fetching,\n finalizeAndReportTiming\n}\n","'use strict'\n\nmodule.exports = {\n kState: Symbol('FileReader state'),\n kResult: Symbol('FileReader result'),\n kError: Symbol('FileReader error'),\n kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),\n kEvents: Symbol('FileReader events'),\n kAborted: Symbol('FileReader aborted')\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\n\nconst kState = Symbol('ProgressEvent state')\n\n/**\n * @see https://xhr.spec.whatwg.org/#progressevent\n */\nclass ProgressEvent extends Event {\n constructor (type, eventInitDict = {}) {\n type = webidl.converters.DOMString(type)\n eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})\n\n super(type, eventInitDict)\n\n this[kState] = {\n lengthComputable: eventInitDict.lengthComputable,\n loaded: eventInitDict.loaded,\n total: eventInitDict.total\n }\n }\n\n get lengthComputable () {\n webidl.brandCheck(this, ProgressEvent)\n\n return this[kState].lengthComputable\n }\n\n get loaded () {\n webidl.brandCheck(this, ProgressEvent)\n\n return this[kState].loaded\n }\n\n get total () {\n webidl.brandCheck(this, ProgressEvent)\n\n return this[kState].total\n }\n}\n\nwebidl.converters.ProgressEventInit = webidl.dictionaryConverter([\n {\n key: 'lengthComputable',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'loaded',\n converter: webidl.converters['unsigned long long'],\n defaultValue: 0\n },\n {\n key: 'total',\n converter: webidl.converters['unsigned long long'],\n defaultValue: 0\n },\n {\n key: 'bubbles',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'cancelable',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'composed',\n converter: webidl.converters.boolean,\n defaultValue: false\n }\n])\n\nmodule.exports = {\n ProgressEvent\n}\n","'use strict'\n\n/**\n * @see https://encoding.spec.whatwg.org/#concept-encoding-get\n * @param {string|undefined} label\n */\nfunction getEncoding (label) {\n if (!label) {\n return 'failure'\n }\n\n // 1. Remove any leading and trailing ASCII whitespace from label.\n // 2. If label is an ASCII case-insensitive match for any of the\n // labels listed in the table below, then return the\n // corresponding encoding; otherwise return failure.\n switch (label.trim().toLowerCase()) {\n case 'unicode-1-1-utf-8':\n case 'unicode11utf8':\n case 'unicode20utf8':\n case 'utf-8':\n case 'utf8':\n case 'x-unicode20utf8':\n return 'UTF-8'\n case '866':\n case 'cp866':\n case 'csibm866':\n case 'ibm866':\n return 'IBM866'\n case 'csisolatin2':\n case 'iso-8859-2':\n case 'iso-ir-101':\n case 'iso8859-2':\n case 'iso88592':\n case 'iso_8859-2':\n case 'iso_8859-2:1987':\n case 'l2':\n case 'latin2':\n return 'ISO-8859-2'\n case 'csisolatin3':\n case 'iso-8859-3':\n case 'iso-ir-109':\n case 'iso8859-3':\n case 'iso88593':\n case 'iso_8859-3':\n case 'iso_8859-3:1988':\n case 'l3':\n case 'latin3':\n return 'ISO-8859-3'\n case 'csisolatin4':\n case 'iso-8859-4':\n case 'iso-ir-110':\n case 'iso8859-4':\n case 'iso88594':\n case 'iso_8859-4':\n case 'iso_8859-4:1988':\n case 'l4':\n case 'latin4':\n return 'ISO-8859-4'\n case 'csisolatincyrillic':\n case 'cyrillic':\n case 'iso-8859-5':\n case 'iso-ir-144':\n case 'iso8859-5':\n case 'iso88595':\n case 'iso_8859-5':\n case 'iso_8859-5:1988':\n return 'ISO-8859-5'\n case 'arabic':\n case 'asmo-708':\n case 'csiso88596e':\n case 'csiso88596i':\n case 'csisolatinarabic':\n case 'ecma-114':\n case 'iso-8859-6':\n case 'iso-8859-6-e':\n case 'iso-8859-6-i':\n case 'iso-ir-127':\n case 'iso8859-6':\n case 'iso88596':\n case 'iso_8859-6':\n case 'iso_8859-6:1987':\n return 'ISO-8859-6'\n case 'csisolatingreek':\n case 'ecma-118':\n case 'elot_928':\n case 'greek':\n case 'greek8':\n case 'iso-8859-7':\n case 'iso-ir-126':\n case 'iso8859-7':\n case 'iso88597':\n case 'iso_8859-7':\n case 'iso_8859-7:1987':\n case 'sun_eu_greek':\n return 'ISO-8859-7'\n case 'csiso88598e':\n case 'csisolatinhebrew':\n case 'hebrew':\n case 'iso-8859-8':\n case 'iso-8859-8-e':\n case 'iso-ir-138':\n case 'iso8859-8':\n case 'iso88598':\n case 'iso_8859-8':\n case 'iso_8859-8:1988':\n case 'visual':\n return 'ISO-8859-8'\n case 'csiso88598i':\n case 'iso-8859-8-i':\n case 'logical':\n return 'ISO-8859-8-I'\n case 'csisolatin6':\n case 'iso-8859-10':\n case 'iso-ir-157':\n case 'iso8859-10':\n case 'iso885910':\n case 'l6':\n case 'latin6':\n return 'ISO-8859-10'\n case 'iso-8859-13':\n case 'iso8859-13':\n case 'iso885913':\n return 'ISO-8859-13'\n case 'iso-8859-14':\n case 'iso8859-14':\n case 'iso885914':\n return 'ISO-8859-14'\n case 'csisolatin9':\n case 'iso-8859-15':\n case 'iso8859-15':\n case 'iso885915':\n case 'iso_8859-15':\n case 'l9':\n return 'ISO-8859-15'\n case 'iso-8859-16':\n return 'ISO-8859-16'\n case 'cskoi8r':\n case 'koi':\n case 'koi8':\n case 'koi8-r':\n case 'koi8_r':\n return 'KOI8-R'\n case 'koi8-ru':\n case 'koi8-u':\n return 'KOI8-U'\n case 'csmacintosh':\n case 'mac':\n case 'macintosh':\n case 'x-mac-roman':\n return 'macintosh'\n case 'iso-8859-11':\n case 'iso8859-11':\n case 'iso885911':\n case 'tis-620':\n case 'windows-874':\n return 'windows-874'\n case 'cp1250':\n case 'windows-1250':\n case 'x-cp1250':\n return 'windows-1250'\n case 'cp1251':\n case 'windows-1251':\n case 'x-cp1251':\n return 'windows-1251'\n case 'ansi_x3.4-1968':\n case 'ascii':\n case 'cp1252':\n case 'cp819':\n case 'csisolatin1':\n case 'ibm819':\n case 'iso-8859-1':\n case 'iso-ir-100':\n case 'iso8859-1':\n case 'iso88591':\n case 'iso_8859-1':\n case 'iso_8859-1:1987':\n case 'l1':\n case 'latin1':\n case 'us-ascii':\n case 'windows-1252':\n case 'x-cp1252':\n return 'windows-1252'\n case 'cp1253':\n case 'windows-1253':\n case 'x-cp1253':\n return 'windows-1253'\n case 'cp1254':\n case 'csisolatin5':\n case 'iso-8859-9':\n case 'iso-ir-148':\n case 'iso8859-9':\n case 'iso88599':\n case 'iso_8859-9':\n case 'iso_8859-9:1989':\n case 'l5':\n case 'latin5':\n case 'windows-1254':\n case 'x-cp1254':\n return 'windows-1254'\n case 'cp1255':\n case 'windows-1255':\n case 'x-cp1255':\n return 'windows-1255'\n case 'cp1256':\n case 'windows-1256':\n case 'x-cp1256':\n return 'windows-1256'\n case 'cp1257':\n case 'windows-1257':\n case 'x-cp1257':\n return 'windows-1257'\n case 'cp1258':\n case 'windows-1258':\n case 'x-cp1258':\n return 'windows-1258'\n case 'x-mac-cyrillic':\n case 'x-mac-ukrainian':\n return 'x-mac-cyrillic'\n case 'chinese':\n case 'csgb2312':\n case 'csiso58gb231280':\n case 'gb2312':\n case 'gb_2312':\n case 'gb_2312-80':\n case 'gbk':\n case 'iso-ir-58':\n case 'x-gbk':\n return 'GBK'\n case 'gb18030':\n return 'gb18030'\n case 'big5':\n case 'big5-hkscs':\n case 'cn-big5':\n case 'csbig5':\n case 'x-x-big5':\n return 'Big5'\n case 'cseucpkdfmtjapanese':\n case 'euc-jp':\n case 'x-euc-jp':\n return 'EUC-JP'\n case 'csiso2022jp':\n case 'iso-2022-jp':\n return 'ISO-2022-JP'\n case 'csshiftjis':\n case 'ms932':\n case 'ms_kanji':\n case 'shift-jis':\n case 'shift_jis':\n case 'sjis':\n case 'windows-31j':\n case 'x-sjis':\n return 'Shift_JIS'\n case 'cseuckr':\n case 'csksc56011987':\n case 'euc-kr':\n case 'iso-ir-149':\n case 'korean':\n case 'ks_c_5601-1987':\n case 'ks_c_5601-1989':\n case 'ksc5601':\n case 'ksc_5601':\n case 'windows-949':\n return 'EUC-KR'\n case 'csiso2022kr':\n case 'hz-gb-2312':\n case 'iso-2022-cn':\n case 'iso-2022-cn-ext':\n case 'iso-2022-kr':\n case 'replacement':\n return 'replacement'\n case 'unicodefffe':\n case 'utf-16be':\n return 'UTF-16BE'\n case 'csunicode':\n case 'iso-10646-ucs-2':\n case 'ucs-2':\n case 'unicode':\n case 'unicodefeff':\n case 'utf-16':\n case 'utf-16le':\n return 'UTF-16LE'\n case 'x-user-defined':\n return 'x-user-defined'\n default: return 'failure'\n }\n}\n\nmodule.exports = {\n getEncoding\n}\n","'use strict'\n\nconst {\n kState,\n kError,\n kResult,\n kAborted,\n kLastProgressEventFired\n} = require('./symbols')\nconst { ProgressEvent } = require('./progressevent')\nconst { getEncoding } = require('./encoding')\nconst { DOMException } = require('../fetch/constants')\nconst { serializeAMimeType, parseMIMEType } = require('../fetch/dataURL')\nconst { types } = require('util')\nconst { StringDecoder } = require('string_decoder')\nconst { btoa } = require('buffer')\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n enumerable: true,\n writable: false,\n configurable: false\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#readOperation\n * @param {import('./filereader').FileReader} fr\n * @param {import('buffer').Blob} blob\n * @param {string} type\n * @param {string?} encodingName\n */\nfunction readOperation (fr, blob, type, encodingName) {\n // 1. If fr’s state is \"loading\", throw an InvalidStateError\n // DOMException.\n if (fr[kState] === 'loading') {\n throw new DOMException('Invalid state', 'InvalidStateError')\n }\n\n // 2. Set fr’s state to \"loading\".\n fr[kState] = 'loading'\n\n // 3. Set fr’s result to null.\n fr[kResult] = null\n\n // 4. Set fr’s error to null.\n fr[kError] = null\n\n // 5. Let stream be the result of calling get stream on blob.\n /** @type {import('stream/web').ReadableStream} */\n const stream = blob.stream()\n\n // 6. Let reader be the result of getting a reader from stream.\n const reader = stream.getReader()\n\n // 7. Let bytes be an empty byte sequence.\n /** @type {Uint8Array[]} */\n const bytes = []\n\n // 8. Let chunkPromise be the result of reading a chunk from\n // stream with reader.\n let chunkPromise = reader.read()\n\n // 9. Let isFirstChunk be true.\n let isFirstChunk = true\n\n // 10. In parallel, while true:\n // Note: \"In parallel\" just means non-blocking\n // Note 2: readOperation itself cannot be async as double\n // reading the body would then reject the promise, instead\n // of throwing an error.\n ;(async () => {\n while (!fr[kAborted]) {\n // 1. Wait for chunkPromise to be fulfilled or rejected.\n try {\n const { done, value } = await chunkPromise\n\n // 2. If chunkPromise is fulfilled, and isFirstChunk is\n // true, queue a task to fire a progress event called\n // loadstart at fr.\n if (isFirstChunk && !fr[kAborted]) {\n queueMicrotask(() => {\n fireAProgressEvent('loadstart', fr)\n })\n }\n\n // 3. Set isFirstChunk to false.\n isFirstChunk = false\n\n // 4. If chunkPromise is fulfilled with an object whose\n // done property is false and whose value property is\n // a Uint8Array object, run these steps:\n if (!done && types.isUint8Array(value)) {\n // 1. Let bs be the byte sequence represented by the\n // Uint8Array object.\n\n // 2. Append bs to bytes.\n bytes.push(value)\n\n // 3. If roughly 50ms have passed since these steps\n // were last invoked, queue a task to fire a\n // progress event called progress at fr.\n if (\n (\n fr[kLastProgressEventFired] === undefined ||\n Date.now() - fr[kLastProgressEventFired] >= 50\n ) &&\n !fr[kAborted]\n ) {\n fr[kLastProgressEventFired] = Date.now()\n queueMicrotask(() => {\n fireAProgressEvent('progress', fr)\n })\n }\n\n // 4. Set chunkPromise to the result of reading a\n // chunk from stream with reader.\n chunkPromise = reader.read()\n } else if (done) {\n // 5. Otherwise, if chunkPromise is fulfilled with an\n // object whose done property is true, queue a task\n // to run the following steps and abort this algorithm:\n queueMicrotask(() => {\n // 1. Set fr’s state to \"done\".\n fr[kState] = 'done'\n\n // 2. Let result be the result of package data given\n // bytes, type, blob’s type, and encodingName.\n try {\n const result = packageData(bytes, type, blob.type, encodingName)\n\n // 4. Else:\n\n if (fr[kAborted]) {\n return\n }\n\n // 1. Set fr’s result to result.\n fr[kResult] = result\n\n // 2. Fire a progress event called load at the fr.\n fireAProgressEvent('load', fr)\n } catch (error) {\n // 3. If package data threw an exception error:\n\n // 1. Set fr’s error to error.\n fr[kError] = error\n\n // 2. Fire a progress event called error at fr.\n fireAProgressEvent('error', fr)\n }\n\n // 5. If fr’s state is not \"loading\", fire a progress\n // event called loadend at the fr.\n if (fr[kState] !== 'loading') {\n fireAProgressEvent('loadend', fr)\n }\n })\n\n break\n }\n } catch (error) {\n if (fr[kAborted]) {\n return\n }\n\n // 6. Otherwise, if chunkPromise is rejected with an\n // error error, queue a task to run the following\n // steps and abort this algorithm:\n queueMicrotask(() => {\n // 1. Set fr’s state to \"done\".\n fr[kState] = 'done'\n\n // 2. Set fr’s error to error.\n fr[kError] = error\n\n // 3. Fire a progress event called error at fr.\n fireAProgressEvent('error', fr)\n\n // 4. If fr’s state is not \"loading\", fire a progress\n // event called loadend at fr.\n if (fr[kState] !== 'loading') {\n fireAProgressEvent('loadend', fr)\n }\n })\n\n break\n }\n }\n })()\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#fire-a-progress-event\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e The name of the event\n * @param {import('./filereader').FileReader} reader\n */\nfunction fireAProgressEvent (e, reader) {\n // The progress event e does not bubble. e.bubbles must be false\n // The progress event e is NOT cancelable. e.cancelable must be false\n const event = new ProgressEvent(e, {\n bubbles: false,\n cancelable: false\n })\n\n reader.dispatchEvent(event)\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#blob-package-data\n * @param {Uint8Array[]} bytes\n * @param {string} type\n * @param {string?} mimeType\n * @param {string?} encodingName\n */\nfunction packageData (bytes, type, mimeType, encodingName) {\n // 1. A Blob has an associated package data algorithm, given\n // bytes, a type, a optional mimeType, and a optional\n // encodingName, which switches on type and runs the\n // associated steps:\n\n switch (type) {\n case 'DataURL': {\n // 1. Return bytes as a DataURL [RFC2397] subject to\n // the considerations below:\n // * Use mimeType as part of the Data URL if it is\n // available in keeping with the Data URL\n // specification [RFC2397].\n // * If mimeType is not available return a Data URL\n // without a media-type. [RFC2397].\n\n // https://datatracker.ietf.org/doc/html/rfc2397#section-3\n // dataurl := \"data:\" [ mediatype ] [ \";base64\" ] \",\" data\n // mediatype := [ type \"/\" subtype ] *( \";\" parameter )\n // data := *urlchar\n // parameter := attribute \"=\" value\n let dataURL = 'data:'\n\n const parsed = parseMIMEType(mimeType || 'application/octet-stream')\n\n if (parsed !== 'failure') {\n dataURL += serializeAMimeType(parsed)\n }\n\n dataURL += ';base64,'\n\n const decoder = new StringDecoder('latin1')\n\n for (const chunk of bytes) {\n dataURL += btoa(decoder.write(chunk))\n }\n\n dataURL += btoa(decoder.end())\n\n return dataURL\n }\n case 'Text': {\n // 1. Let encoding be failure\n let encoding = 'failure'\n\n // 2. If the encodingName is present, set encoding to the\n // result of getting an encoding from encodingName.\n if (encodingName) {\n encoding = getEncoding(encodingName)\n }\n\n // 3. If encoding is failure, and mimeType is present:\n if (encoding === 'failure' && mimeType) {\n // 1. Let type be the result of parse a MIME type\n // given mimeType.\n const type = parseMIMEType(mimeType)\n\n // 2. If type is not failure, set encoding to the result\n // of getting an encoding from type’s parameters[\"charset\"].\n if (type !== 'failure') {\n encoding = getEncoding(type.parameters.get('charset'))\n }\n }\n\n // 4. If encoding is failure, then set encoding to UTF-8.\n if (encoding === 'failure') {\n encoding = 'UTF-8'\n }\n\n // 5. Decode bytes using fallback encoding encoding, and\n // return the result.\n return decode(bytes, encoding)\n }\n case 'ArrayBuffer': {\n // Return a new ArrayBuffer whose contents are bytes.\n const sequence = combineByteSequences(bytes)\n\n return sequence.buffer\n }\n case 'BinaryString': {\n // Return bytes as a binary string, in which every byte\n // is represented by a code unit of equal value [0..255].\n let binaryString = ''\n\n const decoder = new StringDecoder('latin1')\n\n for (const chunk of bytes) {\n binaryString += decoder.write(chunk)\n }\n\n binaryString += decoder.end()\n\n return binaryString\n }\n }\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#decode\n * @param {Uint8Array[]} ioQueue\n * @param {string} encoding\n */\nfunction decode (ioQueue, encoding) {\n const bytes = combineByteSequences(ioQueue)\n\n // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.\n const BOMEncoding = BOMSniffing(bytes)\n\n let slice = 0\n\n // 2. If BOMEncoding is non-null:\n if (BOMEncoding !== null) {\n // 1. Set encoding to BOMEncoding.\n encoding = BOMEncoding\n\n // 2. Read three bytes from ioQueue, if BOMEncoding is\n // UTF-8; otherwise read two bytes.\n // (Do nothing with those bytes.)\n slice = BOMEncoding === 'UTF-8' ? 3 : 2\n }\n\n // 3. Process a queue with an instance of encoding’s\n // decoder, ioQueue, output, and \"replacement\".\n\n // 4. Return output.\n\n const sliced = bytes.slice(slice)\n return new TextDecoder(encoding).decode(sliced)\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#bom-sniff\n * @param {Uint8Array} ioQueue\n */\nfunction BOMSniffing (ioQueue) {\n // 1. Let BOM be the result of peeking 3 bytes from ioQueue,\n // converted to a byte sequence.\n const [a, b, c] = ioQueue\n\n // 2. For each of the rows in the table below, starting with\n // the first one and going down, if BOM starts with the\n // bytes given in the first column, then return the\n // encoding given in the cell in the second column of that\n // row. Otherwise, return null.\n if (a === 0xEF && b === 0xBB && c === 0xBF) {\n return 'UTF-8'\n } else if (a === 0xFE && b === 0xFF) {\n return 'UTF-16BE'\n } else if (a === 0xFF && b === 0xFE) {\n return 'UTF-16LE'\n }\n\n return null\n}\n\n/**\n * @param {Uint8Array[]} sequences\n */\nfunction combineByteSequences (sequences) {\n const size = sequences.reduce((a, b) => {\n return a + b.byteLength\n }, 0)\n\n let offset = 0\n\n return sequences.reduce((a, b) => {\n a.set(b, offset)\n offset += b.byteLength\n return a\n }, new Uint8Array(size))\n}\n\nmodule.exports = {\n staticPropertyDescriptors,\n readOperation,\n fireAProgressEvent\n}\n","'use strict'\n\nconst {\n staticPropertyDescriptors,\n readOperation,\n fireAProgressEvent\n} = require('./util')\nconst {\n kState,\n kError,\n kResult,\n kEvents,\n kAborted\n} = require('./symbols')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../core/util')\n\nclass FileReader extends EventTarget {\n constructor () {\n super()\n\n this[kState] = 'empty'\n this[kResult] = null\n this[kError] = null\n this[kEvents] = {\n loadend: null,\n error: null,\n abort: null,\n load: null,\n progress: null,\n loadstart: null\n }\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer\n * @param {import('buffer').Blob} blob\n */\n readAsArrayBuffer (blob) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n // The readAsArrayBuffer(blob) method, when invoked,\n // must initiate a read operation for blob with ArrayBuffer.\n readOperation(this, blob, 'ArrayBuffer')\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#readAsBinaryString\n * @param {import('buffer').Blob} blob\n */\n readAsBinaryString (blob) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n // The readAsBinaryString(blob) method, when invoked,\n // must initiate a read operation for blob with BinaryString.\n readOperation(this, blob, 'BinaryString')\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#readAsDataText\n * @param {import('buffer').Blob} blob\n * @param {string?} encoding\n */\n readAsText (blob, encoding = undefined) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n if (encoding !== undefined) {\n encoding = webidl.converters.DOMString(encoding)\n }\n\n // The readAsText(blob, encoding) method, when invoked,\n // must initiate a read operation for blob with Text and encoding.\n readOperation(this, blob, 'Text', encoding)\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL\n * @param {import('buffer').Blob} blob\n */\n readAsDataURL (blob) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n // The readAsDataURL(blob) method, when invoked, must\n // initiate a read operation for blob with DataURL.\n readOperation(this, blob, 'DataURL')\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dfn-abort\n */\n abort () {\n // 1. If this's state is \"empty\" or if this's state is\n // \"done\" set this's result to null and terminate\n // this algorithm.\n if (this[kState] === 'empty' || this[kState] === 'done') {\n this[kResult] = null\n return\n }\n\n // 2. If this's state is \"loading\" set this's state to\n // \"done\" and set this's result to null.\n if (this[kState] === 'loading') {\n this[kState] = 'done'\n this[kResult] = null\n }\n\n // 3. If there are any tasks from this on the file reading\n // task source in an affiliated task queue, then remove\n // those tasks from that task queue.\n this[kAborted] = true\n\n // 4. Terminate the algorithm for the read method being processed.\n // TODO\n\n // 5. Fire a progress event called abort at this.\n fireAProgressEvent('abort', this)\n\n // 6. If this's state is not \"loading\", fire a progress\n // event called loadend at this.\n if (this[kState] !== 'loading') {\n fireAProgressEvent('loadend', this)\n }\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate\n */\n get readyState () {\n webidl.brandCheck(this, FileReader)\n\n switch (this[kState]) {\n case 'empty': return this.EMPTY\n case 'loading': return this.LOADING\n case 'done': return this.DONE\n }\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dom-filereader-result\n */\n get result () {\n webidl.brandCheck(this, FileReader)\n\n // The result attribute’s getter, when invoked, must return\n // this's result.\n return this[kResult]\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dom-filereader-error\n */\n get error () {\n webidl.brandCheck(this, FileReader)\n\n // The error attribute’s getter, when invoked, must return\n // this's error.\n return this[kError]\n }\n\n get onloadend () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].loadend\n }\n\n set onloadend (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].loadend) {\n this.removeEventListener('loadend', this[kEvents].loadend)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].loadend = fn\n this.addEventListener('loadend', fn)\n } else {\n this[kEvents].loadend = null\n }\n }\n\n get onerror () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].error\n }\n\n set onerror (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].error) {\n this.removeEventListener('error', this[kEvents].error)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].error = fn\n this.addEventListener('error', fn)\n } else {\n this[kEvents].error = null\n }\n }\n\n get onloadstart () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].loadstart\n }\n\n set onloadstart (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].loadstart) {\n this.removeEventListener('loadstart', this[kEvents].loadstart)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].loadstart = fn\n this.addEventListener('loadstart', fn)\n } else {\n this[kEvents].loadstart = null\n }\n }\n\n get onprogress () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].progress\n }\n\n set onprogress (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].progress) {\n this.removeEventListener('progress', this[kEvents].progress)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].progress = fn\n this.addEventListener('progress', fn)\n } else {\n this[kEvents].progress = null\n }\n }\n\n get onload () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].load\n }\n\n set onload (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].load) {\n this.removeEventListener('load', this[kEvents].load)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].load = fn\n this.addEventListener('load', fn)\n } else {\n this[kEvents].load = null\n }\n }\n\n get onabort () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].abort\n }\n\n set onabort (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].abort) {\n this.removeEventListener('abort', this[kEvents].abort)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].abort = fn\n this.addEventListener('abort', fn)\n } else {\n this[kEvents].abort = null\n }\n }\n}\n\n// https://w3c.github.io/FileAPI/#dom-filereader-empty\nFileReader.EMPTY = FileReader.prototype.EMPTY = 0\n// https://w3c.github.io/FileAPI/#dom-filereader-loading\nFileReader.LOADING = FileReader.prototype.LOADING = 1\n// https://w3c.github.io/FileAPI/#dom-filereader-done\nFileReader.DONE = FileReader.prototype.DONE = 2\n\nObject.defineProperties(FileReader.prototype, {\n EMPTY: staticPropertyDescriptors,\n LOADING: staticPropertyDescriptors,\n DONE: staticPropertyDescriptors,\n readAsArrayBuffer: kEnumerableProperty,\n readAsBinaryString: kEnumerableProperty,\n readAsText: kEnumerableProperty,\n readAsDataURL: kEnumerableProperty,\n abort: kEnumerableProperty,\n readyState: kEnumerableProperty,\n result: kEnumerableProperty,\n error: kEnumerableProperty,\n onloadstart: kEnumerableProperty,\n onprogress: kEnumerableProperty,\n onload: kEnumerableProperty,\n onabort: kEnumerableProperty,\n onerror: kEnumerableProperty,\n onloadend: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'FileReader',\n writable: false,\n enumerable: false,\n configurable: true\n }\n})\n\nObject.defineProperties(FileReader, {\n EMPTY: staticPropertyDescriptors,\n LOADING: staticPropertyDescriptors,\n DONE: staticPropertyDescriptors\n})\n\nmodule.exports = {\n FileReader\n}\n","'use strict'\n\nmodule.exports = {\n kConstruct: require('../core/symbols').kConstruct\n}\n","'use strict'\n\nconst assert = require('assert')\nconst { URLSerializer } = require('../fetch/dataURL')\nconst { isValidHeaderName } = require('../fetch/util')\n\n/**\n * @see https://url.spec.whatwg.org/#concept-url-equals\n * @param {URL} A\n * @param {URL} B\n * @param {boolean | undefined} excludeFragment\n * @returns {boolean}\n */\nfunction urlEquals (A, B, excludeFragment = false) {\n const serializedA = URLSerializer(A, excludeFragment)\n\n const serializedB = URLSerializer(B, excludeFragment)\n\n return serializedA === serializedB\n}\n\n/**\n * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262\n * @param {string} header\n */\nfunction fieldValues (header) {\n assert(header !== null)\n\n const values = []\n\n for (let value of header.split(',')) {\n value = value.trim()\n\n if (!value.length) {\n continue\n } else if (!isValidHeaderName(value)) {\n continue\n }\n\n values.push(value)\n }\n\n return values\n}\n\nmodule.exports = {\n urlEquals,\n fieldValues\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { urlEquals, fieldValues: getFieldValues } = require('./util')\nconst { kEnumerableProperty, isDisturbed } = require('../core/util')\nconst { kHeadersList } = require('../core/symbols')\nconst { webidl } = require('../fetch/webidl')\nconst { Response, cloneResponse } = require('../fetch/response')\nconst { Request } = require('../fetch/request')\nconst { kState, kHeaders, kGuard, kRealm } = require('../fetch/symbols')\nconst { fetching } = require('../fetch/index')\nconst { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require('../fetch/util')\nconst assert = require('assert')\nconst { getGlobalDispatcher } = require('../global')\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation\n * @typedef {Object} CacheBatchOperation\n * @property {'delete' | 'put'} type\n * @property {any} request\n * @property {any} response\n * @property {import('../../types/cache').CacheQueryOptions} options\n */\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list\n * @typedef {[any, any][]} requestResponseList\n */\n\nclass Cache {\n /**\n * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list\n * @type {requestResponseList}\n */\n #relevantRequestResponseList\n\n constructor () {\n if (arguments[0] !== kConstruct) {\n webidl.illegalConstructor()\n }\n\n this.#relevantRequestResponseList = arguments[1]\n }\n\n async match (request, options = {}) {\n webidl.brandCheck(this, Cache)\n webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })\n\n request = webidl.converters.RequestInfo(request)\n options = webidl.converters.CacheQueryOptions(options)\n\n const p = await this.matchAll(request, options)\n\n if (p.length === 0) {\n return\n }\n\n return p[0]\n }\n\n async matchAll (request = undefined, options = {}) {\n webidl.brandCheck(this, Cache)\n\n if (request !== undefined) request = webidl.converters.RequestInfo(request)\n options = webidl.converters.CacheQueryOptions(options)\n\n // 1.\n let r = null\n\n // 2.\n if (request !== undefined) {\n if (request instanceof Request) {\n // 2.1.1\n r = request[kState]\n\n // 2.1.2\n if (r.method !== 'GET' && !options.ignoreMethod) {\n return []\n }\n } else if (typeof request === 'string') {\n // 2.2.1\n r = new Request(request)[kState]\n }\n }\n\n // 5.\n // 5.1\n const responses = []\n\n // 5.2\n if (request === undefined) {\n // 5.2.1\n for (const requestResponse of this.#relevantRequestResponseList) {\n responses.push(requestResponse[1])\n }\n } else { // 5.3\n // 5.3.1\n const requestResponses = this.#queryCache(r, options)\n\n // 5.3.2\n for (const requestResponse of requestResponses) {\n responses.push(requestResponse[1])\n }\n }\n\n // 5.4\n // We don't implement CORs so we don't need to loop over the responses, yay!\n\n // 5.5.1\n const responseList = []\n\n // 5.5.2\n for (const response of responses) {\n // 5.5.2.1\n const responseObject = new Response(response.body?.source ?? null)\n const body = responseObject[kState].body\n responseObject[kState] = response\n responseObject[kState].body = body\n responseObject[kHeaders][kHeadersList] = response.headersList\n responseObject[kHeaders][kGuard] = 'immutable'\n\n responseList.push(responseObject)\n }\n\n // 6.\n return Object.freeze(responseList)\n }\n\n async add (request) {\n webidl.brandCheck(this, Cache)\n webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })\n\n request = webidl.converters.RequestInfo(request)\n\n // 1.\n const requests = [request]\n\n // 2.\n const responseArrayPromise = this.addAll(requests)\n\n // 3.\n return await responseArrayPromise\n }\n\n async addAll (requests) {\n webidl.brandCheck(this, Cache)\n webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })\n\n requests = webidl.converters['sequence'](requests)\n\n // 1.\n const responsePromises = []\n\n // 2.\n const requestList = []\n\n // 3.\n for (const request of requests) {\n if (typeof request === 'string') {\n continue\n }\n\n // 3.1\n const r = request[kState]\n\n // 3.2\n if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {\n throw webidl.errors.exception({\n header: 'Cache.addAll',\n message: 'Expected http/s scheme when method is not GET.'\n })\n }\n }\n\n // 4.\n /** @type {ReturnType[]} */\n const fetchControllers = []\n\n // 5.\n for (const request of requests) {\n // 5.1\n const r = new Request(request)[kState]\n\n // 5.2\n if (!urlIsHttpHttpsScheme(r.url)) {\n throw webidl.errors.exception({\n header: 'Cache.addAll',\n message: 'Expected http/s scheme.'\n })\n }\n\n // 5.4\n r.initiator = 'fetch'\n r.destination = 'subresource'\n\n // 5.5\n requestList.push(r)\n\n // 5.6\n const responsePromise = createDeferredPromise()\n\n // 5.7\n fetchControllers.push(fetching({\n request: r,\n dispatcher: getGlobalDispatcher(),\n processResponse (response) {\n // 1.\n if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {\n responsePromise.reject(webidl.errors.exception({\n header: 'Cache.addAll',\n message: 'Received an invalid status code or the request failed.'\n }))\n } else if (response.headersList.contains('vary')) { // 2.\n // 2.1\n const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n // 2.2\n for (const fieldValue of fieldValues) {\n // 2.2.1\n if (fieldValue === '*') {\n responsePromise.reject(webidl.errors.exception({\n header: 'Cache.addAll',\n message: 'invalid vary field value'\n }))\n\n for (const controller of fetchControllers) {\n controller.abort()\n }\n\n return\n }\n }\n }\n },\n processResponseEndOfBody (response) {\n // 1.\n if (response.aborted) {\n responsePromise.reject(new DOMException('aborted', 'AbortError'))\n return\n }\n\n // 2.\n responsePromise.resolve(response)\n }\n }))\n\n // 5.8\n responsePromises.push(responsePromise.promise)\n }\n\n // 6.\n const p = Promise.all(responsePromises)\n\n // 7.\n const responses = await p\n\n // 7.1\n const operations = []\n\n // 7.2\n let index = 0\n\n // 7.3\n for (const response of responses) {\n // 7.3.1\n /** @type {CacheBatchOperation} */\n const operation = {\n type: 'put', // 7.3.2\n request: requestList[index], // 7.3.3\n response // 7.3.4\n }\n\n operations.push(operation) // 7.3.5\n\n index++ // 7.3.6\n }\n\n // 7.5\n const cacheJobPromise = createDeferredPromise()\n\n // 7.6.1\n let errorData = null\n\n // 7.6.2\n try {\n this.#batchCacheOperations(operations)\n } catch (e) {\n errorData = e\n }\n\n // 7.6.3\n queueMicrotask(() => {\n // 7.6.3.1\n if (errorData === null) {\n cacheJobPromise.resolve(undefined)\n } else {\n // 7.6.3.2\n cacheJobPromise.reject(errorData)\n }\n })\n\n // 7.7\n return cacheJobPromise.promise\n }\n\n async put (request, response) {\n webidl.brandCheck(this, Cache)\n webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })\n\n request = webidl.converters.RequestInfo(request)\n response = webidl.converters.Response(response)\n\n // 1.\n let innerRequest = null\n\n // 2.\n if (request instanceof Request) {\n innerRequest = request[kState]\n } else { // 3.\n innerRequest = new Request(request)[kState]\n }\n\n // 4.\n if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {\n throw webidl.errors.exception({\n header: 'Cache.put',\n message: 'Expected an http/s scheme when method is not GET'\n })\n }\n\n // 5.\n const innerResponse = response[kState]\n\n // 6.\n if (innerResponse.status === 206) {\n throw webidl.errors.exception({\n header: 'Cache.put',\n message: 'Got 206 status'\n })\n }\n\n // 7.\n if (innerResponse.headersList.contains('vary')) {\n // 7.1.\n const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))\n\n // 7.2.\n for (const fieldValue of fieldValues) {\n // 7.2.1\n if (fieldValue === '*') {\n throw webidl.errors.exception({\n header: 'Cache.put',\n message: 'Got * vary field value'\n })\n }\n }\n }\n\n // 8.\n if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {\n throw webidl.errors.exception({\n header: 'Cache.put',\n message: 'Response body is locked or disturbed'\n })\n }\n\n // 9.\n const clonedResponse = cloneResponse(innerResponse)\n\n // 10.\n const bodyReadPromise = createDeferredPromise()\n\n // 11.\n if (innerResponse.body != null) {\n // 11.1\n const stream = innerResponse.body.stream\n\n // 11.2\n const reader = stream.getReader()\n\n // 11.3\n readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)\n } else {\n bodyReadPromise.resolve(undefined)\n }\n\n // 12.\n /** @type {CacheBatchOperation[]} */\n const operations = []\n\n // 13.\n /** @type {CacheBatchOperation} */\n const operation = {\n type: 'put', // 14.\n request: innerRequest, // 15.\n response: clonedResponse // 16.\n }\n\n // 17.\n operations.push(operation)\n\n // 19.\n const bytes = await bodyReadPromise.promise\n\n if (clonedResponse.body != null) {\n clonedResponse.body.source = bytes\n }\n\n // 19.1\n const cacheJobPromise = createDeferredPromise()\n\n // 19.2.1\n let errorData = null\n\n // 19.2.2\n try {\n this.#batchCacheOperations(operations)\n } catch (e) {\n errorData = e\n }\n\n // 19.2.3\n queueMicrotask(() => {\n // 19.2.3.1\n if (errorData === null) {\n cacheJobPromise.resolve()\n } else { // 19.2.3.2\n cacheJobPromise.reject(errorData)\n }\n })\n\n return cacheJobPromise.promise\n }\n\n async delete (request, options = {}) {\n webidl.brandCheck(this, Cache)\n webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })\n\n request = webidl.converters.RequestInfo(request)\n options = webidl.converters.CacheQueryOptions(options)\n\n /**\n * @type {Request}\n */\n let r = null\n\n if (request instanceof Request) {\n r = request[kState]\n\n if (r.method !== 'GET' && !options.ignoreMethod) {\n return false\n }\n } else {\n assert(typeof request === 'string')\n\n r = new Request(request)[kState]\n }\n\n /** @type {CacheBatchOperation[]} */\n const operations = []\n\n /** @type {CacheBatchOperation} */\n const operation = {\n type: 'delete',\n request: r,\n options\n }\n\n operations.push(operation)\n\n const cacheJobPromise = createDeferredPromise()\n\n let errorData = null\n let requestResponses\n\n try {\n requestResponses = this.#batchCacheOperations(operations)\n } catch (e) {\n errorData = e\n }\n\n queueMicrotask(() => {\n if (errorData === null) {\n cacheJobPromise.resolve(!!requestResponses?.length)\n } else {\n cacheJobPromise.reject(errorData)\n }\n })\n\n return cacheJobPromise.promise\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys\n * @param {any} request\n * @param {import('../../types/cache').CacheQueryOptions} options\n * @returns {readonly Request[]}\n */\n async keys (request = undefined, options = {}) {\n webidl.brandCheck(this, Cache)\n\n if (request !== undefined) request = webidl.converters.RequestInfo(request)\n options = webidl.converters.CacheQueryOptions(options)\n\n // 1.\n let r = null\n\n // 2.\n if (request !== undefined) {\n // 2.1\n if (request instanceof Request) {\n // 2.1.1\n r = request[kState]\n\n // 2.1.2\n if (r.method !== 'GET' && !options.ignoreMethod) {\n return []\n }\n } else if (typeof request === 'string') { // 2.2\n r = new Request(request)[kState]\n }\n }\n\n // 4.\n const promise = createDeferredPromise()\n\n // 5.\n // 5.1\n const requests = []\n\n // 5.2\n if (request === undefined) {\n // 5.2.1\n for (const requestResponse of this.#relevantRequestResponseList) {\n // 5.2.1.1\n requests.push(requestResponse[0])\n }\n } else { // 5.3\n // 5.3.1\n const requestResponses = this.#queryCache(r, options)\n\n // 5.3.2\n for (const requestResponse of requestResponses) {\n // 5.3.2.1\n requests.push(requestResponse[0])\n }\n }\n\n // 5.4\n queueMicrotask(() => {\n // 5.4.1\n const requestList = []\n\n // 5.4.2\n for (const request of requests) {\n const requestObject = new Request('https://a')\n requestObject[kState] = request\n requestObject[kHeaders][kHeadersList] = request.headersList\n requestObject[kHeaders][kGuard] = 'immutable'\n requestObject[kRealm] = request.client\n\n // 5.4.2.1\n requestList.push(requestObject)\n }\n\n // 5.4.3\n promise.resolve(Object.freeze(requestList))\n })\n\n return promise.promise\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm\n * @param {CacheBatchOperation[]} operations\n * @returns {requestResponseList}\n */\n #batchCacheOperations (operations) {\n // 1.\n const cache = this.#relevantRequestResponseList\n\n // 2.\n const backupCache = [...cache]\n\n // 3.\n const addedItems = []\n\n // 4.1\n const resultList = []\n\n try {\n // 4.2\n for (const operation of operations) {\n // 4.2.1\n if (operation.type !== 'delete' && operation.type !== 'put') {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'operation type does not match \"delete\" or \"put\"'\n })\n }\n\n // 4.2.2\n if (operation.type === 'delete' && operation.response != null) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'delete operation should not have an associated response'\n })\n }\n\n // 4.2.3\n if (this.#queryCache(operation.request, operation.options, addedItems).length) {\n throw new DOMException('???', 'InvalidStateError')\n }\n\n // 4.2.4\n let requestResponses\n\n // 4.2.5\n if (operation.type === 'delete') {\n // 4.2.5.1\n requestResponses = this.#queryCache(operation.request, operation.options)\n\n // TODO: the spec is wrong, this is needed to pass WPTs\n if (requestResponses.length === 0) {\n return []\n }\n\n // 4.2.5.2\n for (const requestResponse of requestResponses) {\n const idx = cache.indexOf(requestResponse)\n assert(idx !== -1)\n\n // 4.2.5.2.1\n cache.splice(idx, 1)\n }\n } else if (operation.type === 'put') { // 4.2.6\n // 4.2.6.1\n if (operation.response == null) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'put operation should have an associated response'\n })\n }\n\n // 4.2.6.2\n const r = operation.request\n\n // 4.2.6.3\n if (!urlIsHttpHttpsScheme(r.url)) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'expected http or https scheme'\n })\n }\n\n // 4.2.6.4\n if (r.method !== 'GET') {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'not get method'\n })\n }\n\n // 4.2.6.5\n if (operation.options != null) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'options must not be defined'\n })\n }\n\n // 4.2.6.6\n requestResponses = this.#queryCache(operation.request)\n\n // 4.2.6.7\n for (const requestResponse of requestResponses) {\n const idx = cache.indexOf(requestResponse)\n assert(idx !== -1)\n\n // 4.2.6.7.1\n cache.splice(idx, 1)\n }\n\n // 4.2.6.8\n cache.push([operation.request, operation.response])\n\n // 4.2.6.10\n addedItems.push([operation.request, operation.response])\n }\n\n // 4.2.7\n resultList.push([operation.request, operation.response])\n }\n\n // 4.3\n return resultList\n } catch (e) { // 5.\n // 5.1\n this.#relevantRequestResponseList.length = 0\n\n // 5.2\n this.#relevantRequestResponseList = backupCache\n\n // 5.3\n throw e\n }\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#query-cache\n * @param {any} requestQuery\n * @param {import('../../types/cache').CacheQueryOptions} options\n * @param {requestResponseList} targetStorage\n * @returns {requestResponseList}\n */\n #queryCache (requestQuery, options, targetStorage) {\n /** @type {requestResponseList} */\n const resultList = []\n\n const storage = targetStorage ?? this.#relevantRequestResponseList\n\n for (const requestResponse of storage) {\n const [cachedRequest, cachedResponse] = requestResponse\n if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {\n resultList.push(requestResponse)\n }\n }\n\n return resultList\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm\n * @param {any} requestQuery\n * @param {any} request\n * @param {any | null} response\n * @param {import('../../types/cache').CacheQueryOptions | undefined} options\n * @returns {boolean}\n */\n #requestMatchesCachedItem (requestQuery, request, response = null, options) {\n // if (options?.ignoreMethod === false && request.method === 'GET') {\n // return false\n // }\n\n const queryURL = new URL(requestQuery.url)\n\n const cachedURL = new URL(request.url)\n\n if (options?.ignoreSearch) {\n cachedURL.search = ''\n\n queryURL.search = ''\n }\n\n if (!urlEquals(queryURL, cachedURL, true)) {\n return false\n }\n\n if (\n response == null ||\n options?.ignoreVary ||\n !response.headersList.contains('vary')\n ) {\n return true\n }\n\n const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n for (const fieldValue of fieldValues) {\n if (fieldValue === '*') {\n return false\n }\n\n const requestValue = request.headersList.get(fieldValue)\n const queryValue = requestQuery.headersList.get(fieldValue)\n\n // If one has the header and the other doesn't, or one has\n // a different value than the other, return false\n if (requestValue !== queryValue) {\n return false\n }\n }\n\n return true\n }\n}\n\nObject.defineProperties(Cache.prototype, {\n [Symbol.toStringTag]: {\n value: 'Cache',\n configurable: true\n },\n match: kEnumerableProperty,\n matchAll: kEnumerableProperty,\n add: kEnumerableProperty,\n addAll: kEnumerableProperty,\n put: kEnumerableProperty,\n delete: kEnumerableProperty,\n keys: kEnumerableProperty\n})\n\nconst cacheQueryOptionConverters = [\n {\n key: 'ignoreSearch',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'ignoreMethod',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'ignoreVary',\n converter: webidl.converters.boolean,\n defaultValue: false\n }\n]\n\nwebidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)\n\nwebidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([\n ...cacheQueryOptionConverters,\n {\n key: 'cacheName',\n converter: webidl.converters.DOMString\n }\n])\n\nwebidl.converters.Response = webidl.interfaceConverter(Response)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.RequestInfo\n)\n\nmodule.exports = {\n Cache\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { Cache } = require('./cache')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../core/util')\n\nclass CacheStorage {\n /**\n * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map\n * @type {Map}\n */\n async has (cacheName) {\n webidl.brandCheck(this, CacheStorage)\n webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })\n\n cacheName = webidl.converters.DOMString(cacheName)\n\n // 2.1.1\n // 2.2\n return this.#caches.has(cacheName)\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open\n * @param {string} cacheName\n * @returns {Promise}\n */\n async open (cacheName) {\n webidl.brandCheck(this, CacheStorage)\n webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })\n\n cacheName = webidl.converters.DOMString(cacheName)\n\n // 2.1\n if (this.#caches.has(cacheName)) {\n // await caches.open('v1') !== await caches.open('v1')\n\n // 2.1.1\n const cache = this.#caches.get(cacheName)\n\n // 2.1.1.1\n return new Cache(kConstruct, cache)\n }\n\n // 2.2\n const cache = []\n\n // 2.3\n this.#caches.set(cacheName, cache)\n\n // 2.4\n return new Cache(kConstruct, cache)\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete\n * @param {string} cacheName\n * @returns {Promise}\n */\n async delete (cacheName) {\n webidl.brandCheck(this, CacheStorage)\n webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })\n\n cacheName = webidl.converters.DOMString(cacheName)\n\n return this.#caches.delete(cacheName)\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys\n * @returns {string[]}\n */\n async keys () {\n webidl.brandCheck(this, CacheStorage)\n\n // 2.1\n const keys = this.#caches.keys()\n\n // 2.2\n return [...keys]\n }\n}\n\nObject.defineProperties(CacheStorage.prototype, {\n [Symbol.toStringTag]: {\n value: 'CacheStorage',\n configurable: true\n },\n match: kEnumerableProperty,\n has: kEnumerableProperty,\n open: kEnumerableProperty,\n delete: kEnumerableProperty,\n keys: kEnumerableProperty\n})\n\nmodule.exports = {\n CacheStorage\n}\n","'use strict'\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size\nconst maxAttributeValueSize = 1024\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size\nconst maxNameValuePairSize = 4096\n\nmodule.exports = {\n maxAttributeValueSize,\n maxNameValuePairSize\n}\n","'use strict'\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nfunction isCTLExcludingHtab (value) {\n if (value.length === 0) {\n return false\n }\n\n for (const char of value) {\n const code = char.charCodeAt(0)\n\n if (\n (code >= 0x00 || code <= 0x08) ||\n (code >= 0x0A || code <= 0x1F) ||\n code === 0x7F\n ) {\n return false\n }\n }\n}\n\n/**\n CHAR = \n token = 1*\n separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n | \",\" | \";\" | \":\" | \"\\\" | <\">\n | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n | \"{\" | \"}\" | SP | HT\n * @param {string} name\n */\nfunction validateCookieName (name) {\n for (const char of name) {\n const code = char.charCodeAt(0)\n\n if (\n (code <= 0x20 || code > 0x7F) ||\n char === '(' ||\n char === ')' ||\n char === '>' ||\n char === '<' ||\n char === '@' ||\n char === ',' ||\n char === ';' ||\n char === ':' ||\n char === '\\\\' ||\n char === '\"' ||\n char === '/' ||\n char === '[' ||\n char === ']' ||\n char === '?' ||\n char === '=' ||\n char === '{' ||\n char === '}'\n ) {\n throw new Error('Invalid cookie name')\n }\n }\n}\n\n/**\n cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n ; US-ASCII characters excluding CTLs,\n ; whitespace DQUOTE, comma, semicolon,\n ; and backslash\n * @param {string} value\n */\nfunction validateCookieValue (value) {\n for (const char of value) {\n const code = char.charCodeAt(0)\n\n if (\n code < 0x21 || // exclude CTLs (0-31)\n code === 0x22 ||\n code === 0x2C ||\n code === 0x3B ||\n code === 0x5C ||\n code > 0x7E // non-ascii\n ) {\n throw new Error('Invalid header value')\n }\n }\n}\n\n/**\n * path-value = \n * @param {string} path\n */\nfunction validateCookiePath (path) {\n for (const char of path) {\n const code = char.charCodeAt(0)\n\n if (code < 0x21 || char === ';') {\n throw new Error('Invalid cookie path')\n }\n }\n}\n\n/**\n * I have no idea why these values aren't allowed to be honest,\n * but Deno tests these. - Khafra\n * @param {string} domain\n */\nfunction validateCookieDomain (domain) {\n if (\n domain.startsWith('-') ||\n domain.endsWith('.') ||\n domain.endsWith('-')\n ) {\n throw new Error('Invalid cookie domain')\n }\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1\n * @param {number|Date} date\n IMF-fixdate = day-name \",\" SP date1 SP time-of-day SP GMT\n ; fixed length/zone/capitalization subset of the format\n ; see Section 3.3 of [RFC5322]\n\n day-name = %x4D.6F.6E ; \"Mon\", case-sensitive\n / %x54.75.65 ; \"Tue\", case-sensitive\n / %x57.65.64 ; \"Wed\", case-sensitive\n / %x54.68.75 ; \"Thu\", case-sensitive\n / %x46.72.69 ; \"Fri\", case-sensitive\n / %x53.61.74 ; \"Sat\", case-sensitive\n / %x53.75.6E ; \"Sun\", case-sensitive\n date1 = day SP month SP year\n ; e.g., 02 Jun 1982\n\n day = 2DIGIT\n month = %x4A.61.6E ; \"Jan\", case-sensitive\n / %x46.65.62 ; \"Feb\", case-sensitive\n / %x4D.61.72 ; \"Mar\", case-sensitive\n / %x41.70.72 ; \"Apr\", case-sensitive\n / %x4D.61.79 ; \"May\", case-sensitive\n / %x4A.75.6E ; \"Jun\", case-sensitive\n / %x4A.75.6C ; \"Jul\", case-sensitive\n / %x41.75.67 ; \"Aug\", case-sensitive\n / %x53.65.70 ; \"Sep\", case-sensitive\n / %x4F.63.74 ; \"Oct\", case-sensitive\n / %x4E.6F.76 ; \"Nov\", case-sensitive\n / %x44.65.63 ; \"Dec\", case-sensitive\n year = 4DIGIT\n\n GMT = %x47.4D.54 ; \"GMT\", case-sensitive\n\n time-of-day = hour \":\" minute \":\" second\n ; 00:00:00 - 23:59:60 (leap second)\n\n hour = 2DIGIT\n minute = 2DIGIT\n second = 2DIGIT\n */\nfunction toIMFDate (date) {\n if (typeof date === 'number') {\n date = new Date(date)\n }\n\n const days = [\n 'Sun', 'Mon', 'Tue', 'Wed',\n 'Thu', 'Fri', 'Sat'\n ]\n\n const months = [\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\n ]\n\n const dayName = days[date.getUTCDay()]\n const day = date.getUTCDate().toString().padStart(2, '0')\n const month = months[date.getUTCMonth()]\n const year = date.getUTCFullYear()\n const hour = date.getUTCHours().toString().padStart(2, '0')\n const minute = date.getUTCMinutes().toString().padStart(2, '0')\n const second = date.getUTCSeconds().toString().padStart(2, '0')\n\n return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`\n}\n\n/**\n max-age-av = \"Max-Age=\" non-zero-digit *DIGIT\n ; In practice, both expires-av and max-age-av\n ; are limited to dates representable by the\n ; user agent.\n * @param {number} maxAge\n */\nfunction validateCookieMaxAge (maxAge) {\n if (maxAge < 0) {\n throw new Error('Invalid cookie max-age')\n }\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1\n * @param {import('./index').Cookie} cookie\n */\nfunction stringify (cookie) {\n if (cookie.name.length === 0) {\n return null\n }\n\n validateCookieName(cookie.name)\n validateCookieValue(cookie.value)\n\n const out = [`${cookie.name}=${cookie.value}`]\n\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2\n if (cookie.name.startsWith('__Secure-')) {\n cookie.secure = true\n }\n\n if (cookie.name.startsWith('__Host-')) {\n cookie.secure = true\n cookie.domain = null\n cookie.path = '/'\n }\n\n if (cookie.secure) {\n out.push('Secure')\n }\n\n if (cookie.httpOnly) {\n out.push('HttpOnly')\n }\n\n if (typeof cookie.maxAge === 'number') {\n validateCookieMaxAge(cookie.maxAge)\n out.push(`Max-Age=${cookie.maxAge}`)\n }\n\n if (cookie.domain) {\n validateCookieDomain(cookie.domain)\n out.push(`Domain=${cookie.domain}`)\n }\n\n if (cookie.path) {\n validateCookiePath(cookie.path)\n out.push(`Path=${cookie.path}`)\n }\n\n if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {\n out.push(`Expires=${toIMFDate(cookie.expires)}`)\n }\n\n if (cookie.sameSite) {\n out.push(`SameSite=${cookie.sameSite}`)\n }\n\n for (const part of cookie.unparsed) {\n if (!part.includes('=')) {\n throw new Error('Invalid unparsed')\n }\n\n const [key, ...value] = part.split('=')\n\n out.push(`${key.trim()}=${value.join('=')}`)\n }\n\n return out.join('; ')\n}\n\nmodule.exports = {\n isCTLExcludingHtab,\n validateCookieName,\n validateCookiePath,\n validateCookieValue,\n toIMFDate,\n stringify\n}\n","'use strict'\n\nconst { maxNameValuePairSize, maxAttributeValueSize } = require('./constants')\nconst { isCTLExcludingHtab } = require('./util')\nconst { collectASequenceOfCodePointsFast } = require('../fetch/dataURL')\nconst assert = require('assert')\n\n/**\n * @description Parses the field-value attributes of a set-cookie header string.\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} header\n * @returns if the header is invalid, null will be returned\n */\nfunction parseSetCookie (header) {\n // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F\n // character (CTL characters excluding HTAB): Abort these steps and\n // ignore the set-cookie-string entirely.\n if (isCTLExcludingHtab(header)) {\n return null\n }\n\n let nameValuePair = ''\n let unparsedAttributes = ''\n let name = ''\n let value = ''\n\n // 2. If the set-cookie-string contains a %x3B (\";\") character:\n if (header.includes(';')) {\n // 1. The name-value-pair string consists of the characters up to,\n // but not including, the first %x3B (\";\"), and the unparsed-\n // attributes consist of the remainder of the set-cookie-string\n // (including the %x3B (\";\") in question).\n const position = { position: 0 }\n\n nameValuePair = collectASequenceOfCodePointsFast(';', header, position)\n unparsedAttributes = header.slice(position.position)\n } else {\n // Otherwise:\n\n // 1. The name-value-pair string consists of all the characters\n // contained in the set-cookie-string, and the unparsed-\n // attributes is the empty string.\n nameValuePair = header\n }\n\n // 3. If the name-value-pair string lacks a %x3D (\"=\") character, then\n // the name string is empty, and the value string is the value of\n // name-value-pair.\n if (!nameValuePair.includes('=')) {\n value = nameValuePair\n } else {\n // Otherwise, the name string consists of the characters up to, but\n // not including, the first %x3D (\"=\") character, and the (possibly\n // empty) value string consists of the characters after the first\n // %x3D (\"=\") character.\n const position = { position: 0 }\n name = collectASequenceOfCodePointsFast(\n '=',\n nameValuePair,\n position\n )\n value = nameValuePair.slice(position.position + 1)\n }\n\n // 4. Remove any leading or trailing WSP characters from the name\n // string and the value string.\n name = name.trim()\n value = value.trim()\n\n // 5. If the sum of the lengths of the name string and the value string\n // is more than 4096 octets, abort these steps and ignore the set-\n // cookie-string entirely.\n if (name.length + value.length > maxNameValuePairSize) {\n return null\n }\n\n // 6. The cookie-name is the name string, and the cookie-value is the\n // value string.\n return {\n name, value, ...parseUnparsedAttributes(unparsedAttributes)\n }\n}\n\n/**\n * Parses the remaining attributes of a set-cookie header\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} unparsedAttributes\n * @param {[Object.]={}} cookieAttributeList\n */\nfunction parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {\n // 1. If the unparsed-attributes string is empty, skip the rest of\n // these steps.\n if (unparsedAttributes.length === 0) {\n return cookieAttributeList\n }\n\n // 2. Discard the first character of the unparsed-attributes (which\n // will be a %x3B (\";\") character).\n assert(unparsedAttributes[0] === ';')\n unparsedAttributes = unparsedAttributes.slice(1)\n\n let cookieAv = ''\n\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n if (unparsedAttributes.includes(';')) {\n // 1. Consume the characters of the unparsed-attributes up to, but\n // not including, the first %x3B (\";\") character.\n cookieAv = collectASequenceOfCodePointsFast(\n ';',\n unparsedAttributes,\n { position: 0 }\n )\n unparsedAttributes = unparsedAttributes.slice(cookieAv.length)\n } else {\n // Otherwise:\n\n // 1. Consume the remainder of the unparsed-attributes.\n cookieAv = unparsedAttributes\n unparsedAttributes = ''\n }\n\n // Let the cookie-av string be the characters consumed in this step.\n\n let attributeName = ''\n let attributeValue = ''\n\n // 4. If the cookie-av string contains a %x3D (\"=\") character:\n if (cookieAv.includes('=')) {\n // 1. The (possibly empty) attribute-name string consists of the\n // characters up to, but not including, the first %x3D (\"=\")\n // character, and the (possibly empty) attribute-value string\n // consists of the characters after the first %x3D (\"=\")\n // character.\n const position = { position: 0 }\n\n attributeName = collectASequenceOfCodePointsFast(\n '=',\n cookieAv,\n position\n )\n attributeValue = cookieAv.slice(position.position + 1)\n } else {\n // Otherwise:\n\n // 1. The attribute-name string consists of the entire cookie-av\n // string, and the attribute-value string is empty.\n attributeName = cookieAv\n }\n\n // 5. Remove any leading or trailing WSP characters from the attribute-\n // name string and the attribute-value string.\n attributeName = attributeName.trim()\n attributeValue = attributeValue.trim()\n\n // 6. If the attribute-value is longer than 1024 octets, ignore the\n // cookie-av string and return to Step 1 of this algorithm.\n if (attributeValue.length > maxAttributeValueSize) {\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n }\n\n // 7. Process the attribute-name and attribute-value according to the\n // requirements in the following subsections. (Notice that\n // attributes with unrecognized attribute-names are ignored.)\n const attributeNameLowercase = attributeName.toLowerCase()\n\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1\n // If the attribute-name case-insensitively matches the string\n // \"Expires\", the user agent MUST process the cookie-av as follows.\n if (attributeNameLowercase === 'expires') {\n // 1. Let the expiry-time be the result of parsing the attribute-value\n // as cookie-date (see Section 5.1.1).\n const expiryTime = new Date(attributeValue)\n\n // 2. If the attribute-value failed to parse as a cookie date, ignore\n // the cookie-av.\n\n cookieAttributeList.expires = expiryTime\n } else if (attributeNameLowercase === 'max-age') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2\n // If the attribute-name case-insensitively matches the string \"Max-\n // Age\", the user agent MUST process the cookie-av as follows.\n\n // 1. If the first character of the attribute-value is not a DIGIT or a\n // \"-\" character, ignore the cookie-av.\n const charCode = attributeValue.charCodeAt(0)\n\n if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n }\n\n // 2. If the remainder of attribute-value contains a non-DIGIT\n // character, ignore the cookie-av.\n if (!/^\\d+$/.test(attributeValue)) {\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n }\n\n // 3. Let delta-seconds be the attribute-value converted to an integer.\n const deltaSeconds = Number(attributeValue)\n\n // 4. Let cookie-age-limit be the maximum age of the cookie (which\n // SHOULD be 400 days or less, see Section 4.1.2.2).\n\n // 5. Set delta-seconds to the smaller of its present value and cookie-\n // age-limit.\n // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)\n\n // 6. If delta-seconds is less than or equal to zero (0), let expiry-\n // time be the earliest representable date and time. Otherwise, let\n // the expiry-time be the current date and time plus delta-seconds\n // seconds.\n // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds\n\n // 7. Append an attribute to the cookie-attribute-list with an\n // attribute-name of Max-Age and an attribute-value of expiry-time.\n cookieAttributeList.maxAge = deltaSeconds\n } else if (attributeNameLowercase === 'domain') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3\n // If the attribute-name case-insensitively matches the string \"Domain\",\n // the user agent MUST process the cookie-av as follows.\n\n // 1. Let cookie-domain be the attribute-value.\n let cookieDomain = attributeValue\n\n // 2. If cookie-domain starts with %x2E (\".\"), let cookie-domain be\n // cookie-domain without its leading %x2E (\".\").\n if (cookieDomain[0] === '.') {\n cookieDomain = cookieDomain.slice(1)\n }\n\n // 3. Convert the cookie-domain to lower case.\n cookieDomain = cookieDomain.toLowerCase()\n\n // 4. Append an attribute to the cookie-attribute-list with an\n // attribute-name of Domain and an attribute-value of cookie-domain.\n cookieAttributeList.domain = cookieDomain\n } else if (attributeNameLowercase === 'path') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4\n // If the attribute-name case-insensitively matches the string \"Path\",\n // the user agent MUST process the cookie-av as follows.\n\n // 1. If the attribute-value is empty or if the first character of the\n // attribute-value is not %x2F (\"/\"):\n let cookiePath = ''\n if (attributeValue.length === 0 || attributeValue[0] !== '/') {\n // 1. Let cookie-path be the default-path.\n cookiePath = '/'\n } else {\n // Otherwise:\n\n // 1. Let cookie-path be the attribute-value.\n cookiePath = attributeValue\n }\n\n // 2. Append an attribute to the cookie-attribute-list with an\n // attribute-name of Path and an attribute-value of cookie-path.\n cookieAttributeList.path = cookiePath\n } else if (attributeNameLowercase === 'secure') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5\n // If the attribute-name case-insensitively matches the string \"Secure\",\n // the user agent MUST append an attribute to the cookie-attribute-list\n // with an attribute-name of Secure and an empty attribute-value.\n\n cookieAttributeList.secure = true\n } else if (attributeNameLowercase === 'httponly') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6\n // If the attribute-name case-insensitively matches the string\n // \"HttpOnly\", the user agent MUST append an attribute to the cookie-\n // attribute-list with an attribute-name of HttpOnly and an empty\n // attribute-value.\n\n cookieAttributeList.httpOnly = true\n } else if (attributeNameLowercase === 'samesite') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7\n // If the attribute-name case-insensitively matches the string\n // \"SameSite\", the user agent MUST process the cookie-av as follows:\n\n // 1. Let enforcement be \"Default\".\n let enforcement = 'Default'\n\n const attributeValueLowercase = attributeValue.toLowerCase()\n // 2. If cookie-av's attribute-value is a case-insensitive match for\n // \"None\", set enforcement to \"None\".\n if (attributeValueLowercase.includes('none')) {\n enforcement = 'None'\n }\n\n // 3. If cookie-av's attribute-value is a case-insensitive match for\n // \"Strict\", set enforcement to \"Strict\".\n if (attributeValueLowercase.includes('strict')) {\n enforcement = 'Strict'\n }\n\n // 4. If cookie-av's attribute-value is a case-insensitive match for\n // \"Lax\", set enforcement to \"Lax\".\n if (attributeValueLowercase.includes('lax')) {\n enforcement = 'Lax'\n }\n\n // 5. Append an attribute to the cookie-attribute-list with an\n // attribute-name of \"SameSite\" and an attribute-value of\n // enforcement.\n cookieAttributeList.sameSite = enforcement\n } else {\n cookieAttributeList.unparsed ??= []\n\n cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)\n }\n\n // 8. Return to Step 1 of this algorithm.\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n}\n\nmodule.exports = {\n parseSetCookie,\n parseUnparsedAttributes\n}\n","'use strict'\n\nconst { parseSetCookie } = require('./parse')\nconst { stringify } = require('./util')\nconst { webidl } = require('../fetch/webidl')\nconst { Headers } = require('../fetch/headers')\n\n/**\n * @typedef {Object} Cookie\n * @property {string} name\n * @property {string} value\n * @property {Date|number|undefined} expires\n * @property {number|undefined} maxAge\n * @property {string|undefined} domain\n * @property {string|undefined} path\n * @property {boolean|undefined} secure\n * @property {boolean|undefined} httpOnly\n * @property {'Strict'|'Lax'|'None'} sameSite\n * @property {string[]} unparsed\n */\n\n/**\n * @param {Headers} headers\n * @returns {Record}\n */\nfunction getCookies (headers) {\n webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })\n\n webidl.brandCheck(headers, Headers, { strict: false })\n\n const cookie = headers.get('cookie')\n const out = {}\n\n if (!cookie) {\n return out\n }\n\n for (const piece of cookie.split(';')) {\n const [name, ...value] = piece.split('=')\n\n out[name.trim()] = value.join('=')\n }\n\n return out\n}\n\n/**\n * @param {Headers} headers\n * @param {string} name\n * @param {{ path?: string, domain?: string }|undefined} attributes\n * @returns {void}\n */\nfunction deleteCookie (headers, name, attributes) {\n webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })\n\n webidl.brandCheck(headers, Headers, { strict: false })\n\n name = webidl.converters.DOMString(name)\n attributes = webidl.converters.DeleteCookieAttributes(attributes)\n\n // Matches behavior of\n // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278\n setCookie(headers, {\n name,\n value: '',\n expires: new Date(0),\n ...attributes\n })\n}\n\n/**\n * @param {Headers} headers\n * @returns {Cookie[]}\n */\nfunction getSetCookies (headers) {\n webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })\n\n webidl.brandCheck(headers, Headers, { strict: false })\n\n const cookies = headers.getSetCookie()\n\n if (!cookies) {\n return []\n }\n\n return cookies.map((pair) => parseSetCookie(pair))\n}\n\n/**\n * @param {Headers} headers\n * @param {Cookie} cookie\n * @returns {void}\n */\nfunction setCookie (headers, cookie) {\n webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })\n\n webidl.brandCheck(headers, Headers, { strict: false })\n\n cookie = webidl.converters.Cookie(cookie)\n\n const str = stringify(cookie)\n\n if (str) {\n headers.append('Set-Cookie', stringify(cookie))\n }\n}\n\nwebidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'path',\n defaultValue: null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'domain',\n defaultValue: null\n }\n])\n\nwebidl.converters.Cookie = webidl.dictionaryConverter([\n {\n converter: webidl.converters.DOMString,\n key: 'name'\n },\n {\n converter: webidl.converters.DOMString,\n key: 'value'\n },\n {\n converter: webidl.nullableConverter((value) => {\n if (typeof value === 'number') {\n return webidl.converters['unsigned long long'](value)\n }\n\n return new Date(value)\n }),\n key: 'expires',\n defaultValue: null\n },\n {\n converter: webidl.nullableConverter(webidl.converters['long long']),\n key: 'maxAge',\n defaultValue: null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'domain',\n defaultValue: null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'path',\n defaultValue: null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.boolean),\n key: 'secure',\n defaultValue: null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.boolean),\n key: 'httpOnly',\n defaultValue: null\n },\n {\n converter: webidl.converters.USVString,\n key: 'sameSite',\n allowedValues: ['Strict', 'Lax', 'None']\n },\n {\n converter: webidl.sequenceConverter(webidl.converters.DOMString),\n key: 'unparsed',\n defaultValue: []\n }\n])\n\nmodule.exports = {\n getCookies,\n deleteCookie,\n getSetCookies,\n setCookie\n}\n","'use strict'\n\n// This is a Globally Unique Identifier unique used\n// to validate that the endpoint accepts websocket\n// connections.\n// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3\nconst uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n enumerable: true,\n writable: false,\n configurable: false\n}\n\nconst states = {\n CONNECTING: 0,\n OPEN: 1,\n CLOSING: 2,\n CLOSED: 3\n}\n\nconst opcodes = {\n CONTINUATION: 0x0,\n TEXT: 0x1,\n BINARY: 0x2,\n CLOSE: 0x8,\n PING: 0x9,\n PONG: 0xA\n}\n\nconst maxUnsigned16Bit = 2 ** 16 - 1 // 65535\n\nconst parserStates = {\n INFO: 0,\n PAYLOADLENGTH_16: 2,\n PAYLOADLENGTH_64: 3,\n READ_DATA: 4\n}\n\nconst emptyBuffer = Buffer.allocUnsafe(0)\n\nmodule.exports = {\n uid,\n staticPropertyDescriptors,\n states,\n opcodes,\n maxUnsigned16Bit,\n parserStates,\n emptyBuffer\n}\n","'use strict'\n\nmodule.exports = {\n kWebSocketURL: Symbol('url'),\n kReadyState: Symbol('ready state'),\n kController: Symbol('controller'),\n kResponse: Symbol('response'),\n kBinaryType: Symbol('binary type'),\n kSentClose: Symbol('sent close'),\n kReceivedClose: Symbol('received close'),\n kByteParser: Symbol('byte parser')\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../core/util')\nconst { MessagePort } = require('worker_threads')\n\n/**\n * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent\n */\nclass MessageEvent extends Event {\n #eventInit\n\n constructor (type, eventInitDict = {}) {\n webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })\n\n type = webidl.converters.DOMString(type)\n eventInitDict = webidl.converters.MessageEventInit(eventInitDict)\n\n super(type, eventInitDict)\n\n this.#eventInit = eventInitDict\n }\n\n get data () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.data\n }\n\n get origin () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.origin\n }\n\n get lastEventId () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.lastEventId\n }\n\n get source () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.source\n }\n\n get ports () {\n webidl.brandCheck(this, MessageEvent)\n\n if (!Object.isFrozen(this.#eventInit.ports)) {\n Object.freeze(this.#eventInit.ports)\n }\n\n return this.#eventInit.ports\n }\n\n initMessageEvent (\n type,\n bubbles = false,\n cancelable = false,\n data = null,\n origin = '',\n lastEventId = '',\n source = null,\n ports = []\n ) {\n webidl.brandCheck(this, MessageEvent)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })\n\n return new MessageEvent(type, {\n bubbles, cancelable, data, origin, lastEventId, source, ports\n })\n }\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#the-closeevent-interface\n */\nclass CloseEvent extends Event {\n #eventInit\n\n constructor (type, eventInitDict = {}) {\n webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })\n\n type = webidl.converters.DOMString(type)\n eventInitDict = webidl.converters.CloseEventInit(eventInitDict)\n\n super(type, eventInitDict)\n\n this.#eventInit = eventInitDict\n }\n\n get wasClean () {\n webidl.brandCheck(this, CloseEvent)\n\n return this.#eventInit.wasClean\n }\n\n get code () {\n webidl.brandCheck(this, CloseEvent)\n\n return this.#eventInit.code\n }\n\n get reason () {\n webidl.brandCheck(this, CloseEvent)\n\n return this.#eventInit.reason\n }\n}\n\n// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface\nclass ErrorEvent extends Event {\n #eventInit\n\n constructor (type, eventInitDict) {\n webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })\n\n super(type, eventInitDict)\n\n type = webidl.converters.DOMString(type)\n eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})\n\n this.#eventInit = eventInitDict\n }\n\n get message () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.message\n }\n\n get filename () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.filename\n }\n\n get lineno () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.lineno\n }\n\n get colno () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.colno\n }\n\n get error () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.error\n }\n}\n\nObject.defineProperties(MessageEvent.prototype, {\n [Symbol.toStringTag]: {\n value: 'MessageEvent',\n configurable: true\n },\n data: kEnumerableProperty,\n origin: kEnumerableProperty,\n lastEventId: kEnumerableProperty,\n source: kEnumerableProperty,\n ports: kEnumerableProperty,\n initMessageEvent: kEnumerableProperty\n})\n\nObject.defineProperties(CloseEvent.prototype, {\n [Symbol.toStringTag]: {\n value: 'CloseEvent',\n configurable: true\n },\n reason: kEnumerableProperty,\n code: kEnumerableProperty,\n wasClean: kEnumerableProperty\n})\n\nObject.defineProperties(ErrorEvent.prototype, {\n [Symbol.toStringTag]: {\n value: 'ErrorEvent',\n configurable: true\n },\n message: kEnumerableProperty,\n filename: kEnumerableProperty,\n lineno: kEnumerableProperty,\n colno: kEnumerableProperty,\n error: kEnumerableProperty\n})\n\nwebidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.MessagePort\n)\n\nconst eventInit = [\n {\n key: 'bubbles',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'cancelable',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'composed',\n converter: webidl.converters.boolean,\n defaultValue: false\n }\n]\n\nwebidl.converters.MessageEventInit = webidl.dictionaryConverter([\n ...eventInit,\n {\n key: 'data',\n converter: webidl.converters.any,\n defaultValue: null\n },\n {\n key: 'origin',\n converter: webidl.converters.USVString,\n defaultValue: ''\n },\n {\n key: 'lastEventId',\n converter: webidl.converters.DOMString,\n defaultValue: ''\n },\n {\n key: 'source',\n // Node doesn't implement WindowProxy or ServiceWorker, so the only\n // valid value for source is a MessagePort.\n converter: webidl.nullableConverter(webidl.converters.MessagePort),\n defaultValue: null\n },\n {\n key: 'ports',\n converter: webidl.converters['sequence'],\n get defaultValue () {\n return []\n }\n }\n])\n\nwebidl.converters.CloseEventInit = webidl.dictionaryConverter([\n ...eventInit,\n {\n key: 'wasClean',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'code',\n converter: webidl.converters['unsigned short'],\n defaultValue: 0\n },\n {\n key: 'reason',\n converter: webidl.converters.USVString,\n defaultValue: ''\n }\n])\n\nwebidl.converters.ErrorEventInit = webidl.dictionaryConverter([\n ...eventInit,\n {\n key: 'message',\n converter: webidl.converters.DOMString,\n defaultValue: ''\n },\n {\n key: 'filename',\n converter: webidl.converters.USVString,\n defaultValue: ''\n },\n {\n key: 'lineno',\n converter: webidl.converters['unsigned long'],\n defaultValue: 0\n },\n {\n key: 'colno',\n converter: webidl.converters['unsigned long'],\n defaultValue: 0\n },\n {\n key: 'error',\n converter: webidl.converters.any\n }\n])\n\nmodule.exports = {\n MessageEvent,\n CloseEvent,\n ErrorEvent\n}\n","'use strict'\n\nconst { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require('./symbols')\nconst { states, opcodes } = require('./constants')\nconst { MessageEvent, ErrorEvent } = require('./events')\n\n/* globals Blob */\n\n/**\n * @param {import('./websocket').WebSocket} ws\n */\nfunction isEstablished (ws) {\n // If the server's response is validated as provided for above, it is\n // said that _The WebSocket Connection is Established_ and that the\n // WebSocket Connection is in the OPEN state.\n return ws[kReadyState] === states.OPEN\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n */\nfunction isClosing (ws) {\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n return ws[kReadyState] === states.CLOSING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n */\nfunction isClosed (ws) {\n return ws[kReadyState] === states.CLOSED\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e\n * @param {EventTarget} target\n * @param {EventInit | undefined} eventInitDict\n */\nfunction fireEvent (e, target, eventConstructor = Event, eventInitDict) {\n // 1. If eventConstructor is not given, then let eventConstructor be Event.\n\n // 2. Let event be the result of creating an event given eventConstructor,\n // in the relevant realm of target.\n // 3. Initialize event’s type attribute to e.\n const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap\n\n // 4. Initialize any other IDL attributes of event as described in the\n // invocation of this algorithm.\n\n // 5. Return the result of dispatching event at target, with legacy target\n // override flag set if set.\n target.dispatchEvent(event)\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @param {import('./websocket').WebSocket} ws\n * @param {number} type Opcode\n * @param {Buffer} data application data\n */\nfunction websocketMessageReceived (ws, type, data) {\n // 1. If ready state is not OPEN (1), then return.\n if (ws[kReadyState] !== states.OPEN) {\n return\n }\n\n // 2. Let dataForEvent be determined by switching on type and binary type:\n let dataForEvent\n\n if (type === opcodes.TEXT) {\n // -> type indicates that the data is Text\n // a new DOMString containing data\n try {\n dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)\n } catch {\n failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')\n return\n }\n } else if (type === opcodes.BINARY) {\n if (ws[kBinaryType] === 'blob') {\n // -> type indicates that the data is Binary and binary type is \"blob\"\n // a new Blob object, created in the relevant Realm of the WebSocket\n // object, that represents data as its raw data\n dataForEvent = new Blob([data])\n } else {\n // -> type indicates that the data is Binary and binary type is \"arraybuffer\"\n // a new ArrayBuffer object, created in the relevant Realm of the\n // WebSocket object, whose contents are data\n dataForEvent = new Uint8Array(data).buffer\n }\n }\n\n // 3. Fire an event named message at the WebSocket object, using MessageEvent,\n // with the origin attribute initialized to the serialization of the WebSocket\n // object’s url's origin, and the data attribute initialized to dataForEvent.\n fireEvent('message', ws, MessageEvent, {\n origin: ws[kWebSocketURL].origin,\n data: dataForEvent\n })\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455\n * @see https://datatracker.ietf.org/doc/html/rfc2616\n * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407\n * @param {string} protocol\n */\nfunction isValidSubprotocol (protocol) {\n // If present, this value indicates one\n // or more comma-separated subprotocol the client wishes to speak,\n // ordered by preference. The elements that comprise this value\n // MUST be non-empty strings with characters in the range U+0021 to\n // U+007E not including separator characters as defined in\n // [RFC2616] and MUST all be unique strings.\n if (protocol.length === 0) {\n return false\n }\n\n for (const char of protocol) {\n const code = char.charCodeAt(0)\n\n if (\n code < 0x21 ||\n code > 0x7E ||\n char === '(' ||\n char === ')' ||\n char === '<' ||\n char === '>' ||\n char === '@' ||\n char === ',' ||\n char === ';' ||\n char === ':' ||\n char === '\\\\' ||\n char === '\"' ||\n char === '/' ||\n char === '[' ||\n char === ']' ||\n char === '?' ||\n char === '=' ||\n char === '{' ||\n char === '}' ||\n code === 32 || // SP\n code === 9 // HT\n ) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4\n * @param {number} code\n */\nfunction isValidStatusCode (code) {\n if (code >= 1000 && code < 1015) {\n return (\n code !== 1004 && // reserved\n code !== 1005 && // \"MUST NOT be set as a status code\"\n code !== 1006 // \"MUST NOT be set as a status code\"\n )\n }\n\n return code >= 3000 && code <= 4999\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @param {string|undefined} reason\n */\nfunction failWebsocketConnection (ws, reason) {\n const { [kController]: controller, [kResponse]: response } = ws\n\n controller.abort()\n\n if (response?.socket && !response.socket.destroyed) {\n response.socket.destroy()\n }\n\n if (reason) {\n fireEvent('error', ws, ErrorEvent, {\n error: new Error(reason)\n })\n }\n}\n\nmodule.exports = {\n isEstablished,\n isClosing,\n isClosed,\n fireEvent,\n isValidSubprotocol,\n isValidStatusCode,\n failWebsocketConnection,\n websocketMessageReceived\n}\n","'use strict'\n\nconst diagnosticsChannel = require('diagnostics_channel')\nconst { uid, states } = require('./constants')\nconst {\n kReadyState,\n kSentClose,\n kByteParser,\n kReceivedClose\n} = require('./symbols')\nconst { fireEvent, failWebsocketConnection } = require('./util')\nconst { CloseEvent } = require('./events')\nconst { makeRequest } = require('../fetch/request')\nconst { fetching } = require('../fetch/index')\nconst { Headers } = require('../fetch/headers')\nconst { getGlobalDispatcher } = require('../global')\nconst { kHeadersList } = require('../core/symbols')\n\nconst channels = {}\nchannels.open = diagnosticsChannel.channel('undici:websocket:open')\nchannels.close = diagnosticsChannel.channel('undici:websocket:close')\nchannels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')\n\n/** @type {import('crypto')} */\nlet crypto\ntry {\n crypto = require('crypto')\n} catch {\n\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#concept-websocket-establish\n * @param {URL} url\n * @param {string|string[]} protocols\n * @param {import('./websocket').WebSocket} ws\n * @param {(response: any) => void} onEstablish\n * @param {Partial} options\n */\nfunction establishWebSocketConnection (url, protocols, ws, onEstablish, options) {\n // 1. Let requestURL be a copy of url, with its scheme set to \"http\", if url’s\n // scheme is \"ws\", and to \"https\" otherwise.\n const requestURL = url\n\n requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'\n\n // 2. Let request be a new request, whose URL is requestURL, client is client,\n // service-workers mode is \"none\", referrer is \"no-referrer\", mode is\n // \"websocket\", credentials mode is \"include\", cache mode is \"no-store\" ,\n // and redirect mode is \"error\".\n const request = makeRequest({\n urlList: [requestURL],\n serviceWorkers: 'none',\n referrer: 'no-referrer',\n mode: 'websocket',\n credentials: 'include',\n cache: 'no-store',\n redirect: 'error'\n })\n\n // Note: undici extension, allow setting custom headers.\n if (options.headers) {\n const headersList = new Headers(options.headers)[kHeadersList]\n\n request.headersList = headersList\n }\n\n // 3. Append (`Upgrade`, `websocket`) to request’s header list.\n // 4. Append (`Connection`, `Upgrade`) to request’s header list.\n // Note: both of these are handled by undici currently.\n // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397\n\n // 5. Let keyValue be a nonce consisting of a randomly selected\n // 16-byte value that has been forgiving-base64-encoded and\n // isomorphic encoded.\n const keyValue = crypto.randomBytes(16).toString('base64')\n\n // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s\n // header list.\n request.headersList.append('sec-websocket-key', keyValue)\n\n // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s\n // header list.\n request.headersList.append('sec-websocket-version', '13')\n\n // 8. For each protocol in protocols, combine\n // (`Sec-WebSocket-Protocol`, protocol) in request’s header\n // list.\n for (const protocol of protocols) {\n request.headersList.append('sec-websocket-protocol', protocol)\n }\n\n // 9. Let permessageDeflate be a user-agent defined\n // \"permessage-deflate\" extension header value.\n // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673\n // TODO: enable once permessage-deflate is supported\n const permessageDeflate = '' // 'permessage-deflate; 15'\n\n // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to\n // request’s header list.\n // request.headersList.append('sec-websocket-extensions', permessageDeflate)\n\n // 11. Fetch request with useParallelQueue set to true, and\n // processResponse given response being these steps:\n const controller = fetching({\n request,\n useParallelQueue: true,\n dispatcher: options.dispatcher ?? getGlobalDispatcher(),\n processResponse (response) {\n // 1. If response is a network error or its status is not 101,\n // fail the WebSocket connection.\n if (response.type === 'error' || response.status !== 101) {\n failWebsocketConnection(ws, 'Received network error or non-101 status code.')\n return\n }\n\n // 2. If protocols is not the empty list and extracting header\n // list values given `Sec-WebSocket-Protocol` and response’s\n // header list results in null, failure, or the empty byte\n // sequence, then fail the WebSocket connection.\n if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {\n failWebsocketConnection(ws, 'Server did not respond with sent protocols.')\n return\n }\n\n // 3. Follow the requirements stated step 2 to step 6, inclusive,\n // of the last set of steps in section 4.1 of The WebSocket\n // Protocol to validate response. This either results in fail\n // the WebSocket connection or the WebSocket connection is\n // established.\n\n // 2. If the response lacks an |Upgrade| header field or the |Upgrade|\n // header field contains a value that is not an ASCII case-\n // insensitive match for the value \"websocket\", the client MUST\n // _Fail the WebSocket Connection_.\n if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {\n failWebsocketConnection(ws, 'Server did not set Upgrade header to \"websocket\".')\n return\n }\n\n // 3. If the response lacks a |Connection| header field or the\n // |Connection| header field doesn't contain a token that is an\n // ASCII case-insensitive match for the value \"Upgrade\", the client\n // MUST _Fail the WebSocket Connection_.\n if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {\n failWebsocketConnection(ws, 'Server did not set Connection header to \"upgrade\".')\n return\n }\n\n // 4. If the response lacks a |Sec-WebSocket-Accept| header field or\n // the |Sec-WebSocket-Accept| contains a value other than the\n // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-\n // Key| (as a string, not base64-decoded) with the string \"258EAFA5-\n // E914-47DA-95CA-C5AB0DC85B11\" but ignoring any leading and\n // trailing whitespace, the client MUST _Fail the WebSocket\n // Connection_.\n const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')\n const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')\n if (secWSAccept !== digest) {\n failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')\n return\n }\n\n // 5. If the response includes a |Sec-WebSocket-Extensions| header\n // field and this header field indicates the use of an extension\n // that was not present in the client's handshake (the server has\n // indicated an extension not requested by the client), the client\n // MUST _Fail the WebSocket Connection_. (The parsing of this\n // header field to determine which extensions are requested is\n // discussed in Section 9.1.)\n const secExtension = response.headersList.get('Sec-WebSocket-Extensions')\n\n if (secExtension !== null && secExtension !== permessageDeflate) {\n failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')\n return\n }\n\n // 6. If the response includes a |Sec-WebSocket-Protocol| header field\n // and this header field indicates the use of a subprotocol that was\n // not present in the client's handshake (the server has indicated a\n // subprotocol not requested by the client), the client MUST _Fail\n // the WebSocket Connection_.\n const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')\n\n if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {\n failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')\n return\n }\n\n response.socket.on('data', onSocketData)\n response.socket.on('close', onSocketClose)\n response.socket.on('error', onSocketError)\n\n if (channels.open.hasSubscribers) {\n channels.open.publish({\n address: response.socket.address(),\n protocol: secProtocol,\n extensions: secExtension\n })\n }\n\n onEstablish(response)\n }\n })\n\n return controller\n}\n\n/**\n * @param {Buffer} chunk\n */\nfunction onSocketData (chunk) {\n if (!this.ws[kByteParser].write(chunk)) {\n this.pause()\n }\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4\n */\nfunction onSocketClose () {\n const { ws } = this\n\n // If the TCP connection was closed after the\n // WebSocket closing handshake was completed, the WebSocket connection\n // is said to have been closed _cleanly_.\n const wasClean = ws[kSentClose] && ws[kReceivedClose]\n\n let code = 1005\n let reason = ''\n\n const result = ws[kByteParser].closingInfo\n\n if (result) {\n code = result.code ?? 1005\n reason = result.reason\n } else if (!ws[kSentClose]) {\n // If _The WebSocket\n // Connection is Closed_ and no Close control frame was received by the\n // endpoint (such as could occur if the underlying transport connection\n // is lost), _The WebSocket Connection Close Code_ is considered to be\n // 1006.\n code = 1006\n }\n\n // 1. Change the ready state to CLOSED (3).\n ws[kReadyState] = states.CLOSED\n\n // 2. If the user agent was required to fail the WebSocket\n // connection, or if the WebSocket connection was closed\n // after being flagged as full, fire an event named error\n // at the WebSocket object.\n // TODO\n\n // 3. Fire an event named close at the WebSocket object,\n // using CloseEvent, with the wasClean attribute\n // initialized to true if the connection closed cleanly\n // and false otherwise, the code attribute initialized to\n // the WebSocket connection close code, and the reason\n // attribute initialized to the result of applying UTF-8\n // decode without BOM to the WebSocket connection close\n // reason.\n fireEvent('close', ws, CloseEvent, {\n wasClean, code, reason\n })\n\n if (channels.close.hasSubscribers) {\n channels.close.publish({\n websocket: ws,\n code,\n reason\n })\n }\n}\n\nfunction onSocketError (error) {\n const { ws } = this\n\n ws[kReadyState] = states.CLOSING\n\n if (channels.socketError.hasSubscribers) {\n channels.socketError.publish(error)\n }\n\n this.destroy()\n}\n\nmodule.exports = {\n establishWebSocketConnection\n}\n","'use strict'\n\nconst { maxUnsigned16Bit } = require('./constants')\n\n/** @type {import('crypto')} */\nlet crypto\ntry {\n crypto = require('crypto')\n} catch {\n\n}\n\nclass WebsocketFrameSend {\n /**\n * @param {Buffer|undefined} data\n */\n constructor (data) {\n this.frameData = data\n this.maskKey = crypto.randomBytes(4)\n }\n\n createFrame (opcode) {\n const bodyLength = this.frameData?.byteLength ?? 0\n\n /** @type {number} */\n let payloadLength = bodyLength // 0-125\n let offset = 6\n\n if (bodyLength > maxUnsigned16Bit) {\n offset += 8 // payload length is next 8 bytes\n payloadLength = 127\n } else if (bodyLength > 125) {\n offset += 2 // payload length is next 2 bytes\n payloadLength = 126\n }\n\n const buffer = Buffer.allocUnsafe(bodyLength + offset)\n\n // Clear first 2 bytes, everything else is overwritten\n buffer[0] = buffer[1] = 0\n buffer[0] |= 0x80 // FIN\n buffer[0] = (buffer[0] & 0xF0) + opcode // opcode\n\n /*! ws. MIT License. Einar Otto Stangvik */\n buffer[offset - 4] = this.maskKey[0]\n buffer[offset - 3] = this.maskKey[1]\n buffer[offset - 2] = this.maskKey[2]\n buffer[offset - 1] = this.maskKey[3]\n\n buffer[1] = payloadLength\n\n if (payloadLength === 126) {\n buffer.writeUInt16BE(bodyLength, 2)\n } else if (payloadLength === 127) {\n // Clear extended payload length\n buffer[2] = buffer[3] = 0\n buffer.writeUIntBE(bodyLength, 4, 6)\n }\n\n buffer[1] |= 0x80 // MASK\n\n // mask body\n for (let i = 0; i < bodyLength; i++) {\n buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]\n }\n\n return buffer\n }\n}\n\nmodule.exports = {\n WebsocketFrameSend\n}\n","'use strict'\n\nconst { Writable } = require('stream')\nconst diagnosticsChannel = require('diagnostics_channel')\nconst { parserStates, opcodes, states, emptyBuffer } = require('./constants')\nconst { kReadyState, kSentClose, kResponse, kReceivedClose } = require('./symbols')\nconst { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = require('./util')\nconst { WebsocketFrameSend } = require('./frame')\n\n// This code was influenced by ws released under the MIT license.\n// Copyright (c) 2011 Einar Otto Stangvik \n// Copyright (c) 2013 Arnout Kazemier and contributors\n// Copyright (c) 2016 Luigi Pinca and contributors\n\nconst channels = {}\nchannels.ping = diagnosticsChannel.channel('undici:websocket:ping')\nchannels.pong = diagnosticsChannel.channel('undici:websocket:pong')\n\nclass ByteParser extends Writable {\n #buffers = []\n #byteOffset = 0\n\n #state = parserStates.INFO\n\n #info = {}\n #fragments = []\n\n constructor (ws) {\n super()\n\n this.ws = ws\n }\n\n /**\n * @param {Buffer} chunk\n * @param {() => void} callback\n */\n _write (chunk, _, callback) {\n this.#buffers.push(chunk)\n this.#byteOffset += chunk.length\n\n this.run(callback)\n }\n\n /**\n * Runs whenever a new chunk is received.\n * Callback is called whenever there are no more chunks buffering,\n * or not enough bytes are buffered to parse.\n */\n run (callback) {\n while (true) {\n if (this.#state === parserStates.INFO) {\n // If there aren't enough bytes to parse the payload length, etc.\n if (this.#byteOffset < 2) {\n return callback()\n }\n\n const buffer = this.consume(2)\n\n this.#info.fin = (buffer[0] & 0x80) !== 0\n this.#info.opcode = buffer[0] & 0x0F\n\n // If we receive a fragmented message, we use the type of the first\n // frame to parse the full message as binary/text, when it's terminated\n this.#info.originalOpcode ??= this.#info.opcode\n\n this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION\n\n if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {\n // Only text and binary frames can be fragmented\n failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')\n return\n }\n\n const payloadLength = buffer[1] & 0x7F\n\n if (payloadLength <= 125) {\n this.#info.payloadLength = payloadLength\n this.#state = parserStates.READ_DATA\n } else if (payloadLength === 126) {\n this.#state = parserStates.PAYLOADLENGTH_16\n } else if (payloadLength === 127) {\n this.#state = parserStates.PAYLOADLENGTH_64\n }\n\n if (this.#info.fragmented && payloadLength > 125) {\n // A fragmented frame can't be fragmented itself\n failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')\n return\n } else if (\n (this.#info.opcode === opcodes.PING ||\n this.#info.opcode === opcodes.PONG ||\n this.#info.opcode === opcodes.CLOSE) &&\n payloadLength > 125\n ) {\n // Control frames can have a payload length of 125 bytes MAX\n failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')\n return\n } else if (this.#info.opcode === opcodes.CLOSE) {\n if (payloadLength === 1) {\n failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')\n return\n }\n\n const body = this.consume(payloadLength)\n\n this.#info.closeInfo = this.parseCloseBody(false, body)\n\n if (!this.ws[kSentClose]) {\n // If an endpoint receives a Close frame and did not previously send a\n // Close frame, the endpoint MUST send a Close frame in response. (When\n // sending a Close frame in response, the endpoint typically echos the\n // status code it received.)\n const body = Buffer.allocUnsafe(2)\n body.writeUInt16BE(this.#info.closeInfo.code, 0)\n const closeFrame = new WebsocketFrameSend(body)\n\n this.ws[kResponse].socket.write(\n closeFrame.createFrame(opcodes.CLOSE),\n (err) => {\n if (!err) {\n this.ws[kSentClose] = true\n }\n }\n )\n }\n\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n this.ws[kReadyState] = states.CLOSING\n this.ws[kReceivedClose] = true\n\n this.end()\n\n return\n } else if (this.#info.opcode === opcodes.PING) {\n // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in\n // response, unless it already received a Close frame.\n // A Pong frame sent in response to a Ping frame must have identical\n // \"Application data\"\n\n const body = this.consume(payloadLength)\n\n if (!this.ws[kReceivedClose]) {\n const frame = new WebsocketFrameSend(body)\n\n this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))\n\n if (channels.ping.hasSubscribers) {\n channels.ping.publish({\n payload: body\n })\n }\n }\n\n this.#state = parserStates.INFO\n\n if (this.#byteOffset > 0) {\n continue\n } else {\n callback()\n return\n }\n } else if (this.#info.opcode === opcodes.PONG) {\n // A Pong frame MAY be sent unsolicited. This serves as a\n // unidirectional heartbeat. A response to an unsolicited Pong frame is\n // not expected.\n\n const body = this.consume(payloadLength)\n\n if (channels.pong.hasSubscribers) {\n channels.pong.publish({\n payload: body\n })\n }\n\n if (this.#byteOffset > 0) {\n continue\n } else {\n callback()\n return\n }\n }\n } else if (this.#state === parserStates.PAYLOADLENGTH_16) {\n if (this.#byteOffset < 2) {\n return callback()\n }\n\n const buffer = this.consume(2)\n\n this.#info.payloadLength = buffer.readUInt16BE(0)\n this.#state = parserStates.READ_DATA\n } else if (this.#state === parserStates.PAYLOADLENGTH_64) {\n if (this.#byteOffset < 8) {\n return callback()\n }\n\n const buffer = this.consume(8)\n const upper = buffer.readUInt32BE(0)\n\n // 2^31 is the maxinimum bytes an arraybuffer can contain\n // on 32-bit systems. Although, on 64-bit systems, this is\n // 2^53-1 bytes.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length\n // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275\n // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e\n if (upper > 2 ** 31 - 1) {\n failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')\n return\n }\n\n const lower = buffer.readUInt32BE(4)\n\n this.#info.payloadLength = (upper << 8) + lower\n this.#state = parserStates.READ_DATA\n } else if (this.#state === parserStates.READ_DATA) {\n if (this.#byteOffset < this.#info.payloadLength) {\n // If there is still more data in this chunk that needs to be read\n return callback()\n } else if (this.#byteOffset >= this.#info.payloadLength) {\n // If the server sent multiple frames in a single chunk\n\n const body = this.consume(this.#info.payloadLength)\n\n this.#fragments.push(body)\n\n // If the frame is unfragmented, or a fragmented frame was terminated,\n // a message was received\n if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {\n const fullMessage = Buffer.concat(this.#fragments)\n\n websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)\n\n this.#info = {}\n this.#fragments.length = 0\n }\n\n this.#state = parserStates.INFO\n }\n }\n\n if (this.#byteOffset > 0) {\n continue\n } else {\n callback()\n break\n }\n }\n }\n\n /**\n * Take n bytes from the buffered Buffers\n * @param {number} n\n * @returns {Buffer|null}\n */\n consume (n) {\n if (n > this.#byteOffset) {\n return null\n } else if (n === 0) {\n return emptyBuffer\n }\n\n if (this.#buffers[0].length === n) {\n this.#byteOffset -= this.#buffers[0].length\n return this.#buffers.shift()\n }\n\n const buffer = Buffer.allocUnsafe(n)\n let offset = 0\n\n while (offset !== n) {\n const next = this.#buffers[0]\n const { length } = next\n\n if (length + offset === n) {\n buffer.set(this.#buffers.shift(), offset)\n break\n } else if (length + offset > n) {\n buffer.set(next.subarray(0, n - offset), offset)\n this.#buffers[0] = next.subarray(n - offset)\n break\n } else {\n buffer.set(this.#buffers.shift(), offset)\n offset += next.length\n }\n }\n\n this.#byteOffset -= n\n\n return buffer\n }\n\n parseCloseBody (onlyCode, data) {\n // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5\n /** @type {number|undefined} */\n let code\n\n if (data.length >= 2) {\n // _The WebSocket Connection Close Code_ is\n // defined as the status code (Section 7.4) contained in the first Close\n // control frame received by the application\n code = data.readUInt16BE(0)\n }\n\n if (onlyCode) {\n if (!isValidStatusCode(code)) {\n return null\n }\n\n return { code }\n }\n\n // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6\n /** @type {Buffer} */\n let reason = data.subarray(2)\n\n // Remove BOM\n if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {\n reason = reason.subarray(3)\n }\n\n if (code !== undefined && !isValidStatusCode(code)) {\n return null\n }\n\n try {\n // TODO: optimize this\n reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)\n } catch {\n return null\n }\n\n return { code, reason }\n }\n\n get closingInfo () {\n return this.#info.closeInfo\n }\n}\n\nmodule.exports = {\n ByteParser\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { DOMException } = require('../fetch/constants')\nconst { URLSerializer } = require('../fetch/dataURL')\nconst { getGlobalOrigin } = require('../fetch/global')\nconst { staticPropertyDescriptors, states, opcodes, emptyBuffer } = require('./constants')\nconst {\n kWebSocketURL,\n kReadyState,\n kController,\n kBinaryType,\n kResponse,\n kSentClose,\n kByteParser\n} = require('./symbols')\nconst { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = require('./util')\nconst { establishWebSocketConnection } = require('./connection')\nconst { WebsocketFrameSend } = require('./frame')\nconst { ByteParser } = require('./receiver')\nconst { kEnumerableProperty, isBlobLike } = require('../core/util')\nconst { getGlobalDispatcher } = require('../global')\nconst { types } = require('util')\n\nlet experimentalWarned = false\n\n// https://websockets.spec.whatwg.org/#interface-definition\nclass WebSocket extends EventTarget {\n #events = {\n open: null,\n error: null,\n close: null,\n message: null\n }\n\n #bufferedAmount = 0\n #protocol = ''\n #extensions = ''\n\n /**\n * @param {string} url\n * @param {string|string[]} protocols\n */\n constructor (url, protocols = []) {\n super()\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })\n\n if (!experimentalWarned) {\n experimentalWarned = true\n process.emitWarning('WebSockets are experimental, expect them to change at any time.', {\n code: 'UNDICI-WS'\n })\n }\n\n const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols)\n\n url = webidl.converters.USVString(url)\n protocols = options.protocols\n\n // 1. Let baseURL be this's relevant settings object's API base URL.\n const baseURL = getGlobalOrigin()\n\n // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.\n let urlRecord\n\n try {\n urlRecord = new URL(url, baseURL)\n } catch (e) {\n // 3. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n throw new DOMException(e, 'SyntaxError')\n }\n\n // 4. If urlRecord’s scheme is \"http\", then set urlRecord’s scheme to \"ws\".\n if (urlRecord.protocol === 'http:') {\n urlRecord.protocol = 'ws:'\n } else if (urlRecord.protocol === 'https:') {\n // 5. Otherwise, if urlRecord’s scheme is \"https\", set urlRecord’s scheme to \"wss\".\n urlRecord.protocol = 'wss:'\n }\n\n // 6. If urlRecord’s scheme is not \"ws\" or \"wss\", then throw a \"SyntaxError\" DOMException.\n if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {\n throw new DOMException(\n `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,\n 'SyntaxError'\n )\n }\n\n // 7. If urlRecord’s fragment is non-null, then throw a \"SyntaxError\"\n // DOMException.\n if (urlRecord.hash || urlRecord.href.endsWith('#')) {\n throw new DOMException('Got fragment', 'SyntaxError')\n }\n\n // 8. If protocols is a string, set protocols to a sequence consisting\n // of just that string.\n if (typeof protocols === 'string') {\n protocols = [protocols]\n }\n\n // 9. If any of the values in protocols occur more than once or otherwise\n // fail to match the requirements for elements that comprise the value\n // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket\n // protocol, then throw a \"SyntaxError\" DOMException.\n if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {\n throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n }\n\n if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {\n throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n }\n\n // 10. Set this's url to urlRecord.\n this[kWebSocketURL] = new URL(urlRecord.href)\n\n // 11. Let client be this's relevant settings object.\n\n // 12. Run this step in parallel:\n\n // 1. Establish a WebSocket connection given urlRecord, protocols,\n // and client.\n this[kController] = establishWebSocketConnection(\n urlRecord,\n protocols,\n this,\n (response) => this.#onConnectionEstablished(response),\n options\n )\n\n // Each WebSocket object has an associated ready state, which is a\n // number representing the state of the connection. Initially it must\n // be CONNECTING (0).\n this[kReadyState] = WebSocket.CONNECTING\n\n // The extensions attribute must initially return the empty string.\n\n // The protocol attribute must initially return the empty string.\n\n // Each WebSocket object has an associated binary type, which is a\n // BinaryType. Initially it must be \"blob\".\n this[kBinaryType] = 'blob'\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#dom-websocket-close\n * @param {number|undefined} code\n * @param {string|undefined} reason\n */\n close (code = undefined, reason = undefined) {\n webidl.brandCheck(this, WebSocket)\n\n if (code !== undefined) {\n code = webidl.converters['unsigned short'](code, { clamp: true })\n }\n\n if (reason !== undefined) {\n reason = webidl.converters.USVString(reason)\n }\n\n // 1. If code is present, but is neither an integer equal to 1000 nor an\n // integer in the range 3000 to 4999, inclusive, throw an\n // \"InvalidAccessError\" DOMException.\n if (code !== undefined) {\n if (code !== 1000 && (code < 3000 || code > 4999)) {\n throw new DOMException('invalid code', 'InvalidAccessError')\n }\n }\n\n let reasonByteLength = 0\n\n // 2. If reason is present, then run these substeps:\n if (reason !== undefined) {\n // 1. Let reasonBytes be the result of encoding reason.\n // 2. If reasonBytes is longer than 123 bytes, then throw a\n // \"SyntaxError\" DOMException.\n reasonByteLength = Buffer.byteLength(reason)\n\n if (reasonByteLength > 123) {\n throw new DOMException(\n `Reason must be less than 123 bytes; received ${reasonByteLength}`,\n 'SyntaxError'\n )\n }\n }\n\n // 3. Run the first matching steps from the following list:\n if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {\n // If this's ready state is CLOSING (2) or CLOSED (3)\n // Do nothing.\n } else if (!isEstablished(this)) {\n // If the WebSocket connection is not yet established\n // Fail the WebSocket connection and set this's ready state\n // to CLOSING (2).\n failWebsocketConnection(this, 'Connection was closed before it was established.')\n this[kReadyState] = WebSocket.CLOSING\n } else if (!isClosing(this)) {\n // If the WebSocket closing handshake has not yet been started\n // Start the WebSocket closing handshake and set this's ready\n // state to CLOSING (2).\n // - If neither code nor reason is present, the WebSocket Close\n // message must not have a body.\n // - If code is present, then the status code to use in the\n // WebSocket Close message must be the integer given by code.\n // - If reason is also present, then reasonBytes must be\n // provided in the Close message after the status code.\n\n const frame = new WebsocketFrameSend()\n\n // If neither code nor reason is present, the WebSocket Close\n // message must not have a body.\n\n // If code is present, then the status code to use in the\n // WebSocket Close message must be the integer given by code.\n if (code !== undefined && reason === undefined) {\n frame.frameData = Buffer.allocUnsafe(2)\n frame.frameData.writeUInt16BE(code, 0)\n } else if (code !== undefined && reason !== undefined) {\n // If reason is also present, then reasonBytes must be\n // provided in the Close message after the status code.\n frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)\n frame.frameData.writeUInt16BE(code, 0)\n // the body MAY contain UTF-8-encoded data with value /reason/\n frame.frameData.write(reason, 2, 'utf-8')\n } else {\n frame.frameData = emptyBuffer\n }\n\n /** @type {import('stream').Duplex} */\n const socket = this[kResponse].socket\n\n socket.write(frame.createFrame(opcodes.CLOSE), (err) => {\n if (!err) {\n this[kSentClose] = true\n }\n })\n\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n this[kReadyState] = states.CLOSING\n } else {\n // Otherwise\n // Set this's ready state to CLOSING (2).\n this[kReadyState] = WebSocket.CLOSING\n }\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#dom-websocket-send\n * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data\n */\n send (data) {\n webidl.brandCheck(this, WebSocket)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })\n\n data = webidl.converters.WebSocketSendData(data)\n\n // 1. If this's ready state is CONNECTING, then throw an\n // \"InvalidStateError\" DOMException.\n if (this[kReadyState] === WebSocket.CONNECTING) {\n throw new DOMException('Sent before connected.', 'InvalidStateError')\n }\n\n // 2. Run the appropriate set of steps from the following list:\n // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1\n // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2\n\n if (!isEstablished(this) || isClosing(this)) {\n return\n }\n\n /** @type {import('stream').Duplex} */\n const socket = this[kResponse].socket\n\n // If data is a string\n if (typeof data === 'string') {\n // If the WebSocket connection is established and the WebSocket\n // closing handshake has not yet started, then the user agent\n // must send a WebSocket Message comprised of the data argument\n // using a text frame opcode; if the data cannot be sent, e.g.\n // because it would need to be buffered but the buffer is full,\n // the user agent must flag the WebSocket as full and then close\n // the WebSocket connection. Any invocation of this method with a\n // string argument that does not throw an exception must increase\n // the bufferedAmount attribute by the number of bytes needed to\n // express the argument as UTF-8.\n\n const value = Buffer.from(data)\n const frame = new WebsocketFrameSend(value)\n const buffer = frame.createFrame(opcodes.TEXT)\n\n this.#bufferedAmount += value.byteLength\n socket.write(buffer, () => {\n this.#bufferedAmount -= value.byteLength\n })\n } else if (types.isArrayBuffer(data)) {\n // If the WebSocket connection is established, and the WebSocket\n // closing handshake has not yet started, then the user agent must\n // send a WebSocket Message comprised of data using a binary frame\n // opcode; if the data cannot be sent, e.g. because it would need\n // to be buffered but the buffer is full, the user agent must flag\n // the WebSocket as full and then close the WebSocket connection.\n // The data to be sent is the data stored in the buffer described\n // by the ArrayBuffer object. Any invocation of this method with an\n // ArrayBuffer argument that does not throw an exception must\n // increase the bufferedAmount attribute by the length of the\n // ArrayBuffer in bytes.\n\n const value = Buffer.from(data)\n const frame = new WebsocketFrameSend(value)\n const buffer = frame.createFrame(opcodes.BINARY)\n\n this.#bufferedAmount += value.byteLength\n socket.write(buffer, () => {\n this.#bufferedAmount -= value.byteLength\n })\n } else if (ArrayBuffer.isView(data)) {\n // If the WebSocket connection is established, and the WebSocket\n // closing handshake has not yet started, then the user agent must\n // send a WebSocket Message comprised of data using a binary frame\n // opcode; if the data cannot be sent, e.g. because it would need to\n // be buffered but the buffer is full, the user agent must flag the\n // WebSocket as full and then close the WebSocket connection. The\n // data to be sent is the data stored in the section of the buffer\n // described by the ArrayBuffer object that data references. Any\n // invocation of this method with this kind of argument that does\n // not throw an exception must increase the bufferedAmount attribute\n // by the length of data’s buffer in bytes.\n\n const ab = Buffer.from(data, data.byteOffset, data.byteLength)\n\n const frame = new WebsocketFrameSend(ab)\n const buffer = frame.createFrame(opcodes.BINARY)\n\n this.#bufferedAmount += ab.byteLength\n socket.write(buffer, () => {\n this.#bufferedAmount -= ab.byteLength\n })\n } else if (isBlobLike(data)) {\n // If the WebSocket connection is established, and the WebSocket\n // closing handshake has not yet started, then the user agent must\n // send a WebSocket Message comprised of data using a binary frame\n // opcode; if the data cannot be sent, e.g. because it would need to\n // be buffered but the buffer is full, the user agent must flag the\n // WebSocket as full and then close the WebSocket connection. The data\n // to be sent is the raw data represented by the Blob object. Any\n // invocation of this method with a Blob argument that does not throw\n // an exception must increase the bufferedAmount attribute by the size\n // of the Blob object’s raw data, in bytes.\n\n const frame = new WebsocketFrameSend()\n\n data.arrayBuffer().then((ab) => {\n const value = Buffer.from(ab)\n frame.frameData = value\n const buffer = frame.createFrame(opcodes.BINARY)\n\n this.#bufferedAmount += value.byteLength\n socket.write(buffer, () => {\n this.#bufferedAmount -= value.byteLength\n })\n })\n }\n }\n\n get readyState () {\n webidl.brandCheck(this, WebSocket)\n\n // The readyState getter steps are to return this's ready state.\n return this[kReadyState]\n }\n\n get bufferedAmount () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#bufferedAmount\n }\n\n get url () {\n webidl.brandCheck(this, WebSocket)\n\n // The url getter steps are to return this's url, serialized.\n return URLSerializer(this[kWebSocketURL])\n }\n\n get extensions () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#extensions\n }\n\n get protocol () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#protocol\n }\n\n get onopen () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.open\n }\n\n set onopen (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.open) {\n this.removeEventListener('open', this.#events.open)\n }\n\n if (typeof fn === 'function') {\n this.#events.open = fn\n this.addEventListener('open', fn)\n } else {\n this.#events.open = null\n }\n }\n\n get onerror () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.error\n }\n\n set onerror (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.error) {\n this.removeEventListener('error', this.#events.error)\n }\n\n if (typeof fn === 'function') {\n this.#events.error = fn\n this.addEventListener('error', fn)\n } else {\n this.#events.error = null\n }\n }\n\n get onclose () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.close\n }\n\n set onclose (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.close) {\n this.removeEventListener('close', this.#events.close)\n }\n\n if (typeof fn === 'function') {\n this.#events.close = fn\n this.addEventListener('close', fn)\n } else {\n this.#events.close = null\n }\n }\n\n get onmessage () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.message\n }\n\n set onmessage (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.message) {\n this.removeEventListener('message', this.#events.message)\n }\n\n if (typeof fn === 'function') {\n this.#events.message = fn\n this.addEventListener('message', fn)\n } else {\n this.#events.message = null\n }\n }\n\n get binaryType () {\n webidl.brandCheck(this, WebSocket)\n\n return this[kBinaryType]\n }\n\n set binaryType (type) {\n webidl.brandCheck(this, WebSocket)\n\n if (type !== 'blob' && type !== 'arraybuffer') {\n this[kBinaryType] = 'blob'\n } else {\n this[kBinaryType] = type\n }\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n */\n #onConnectionEstablished (response) {\n // processResponse is called when the \"response’s header list has been received and initialized.\"\n // once this happens, the connection is open\n this[kResponse] = response\n\n const parser = new ByteParser(this)\n parser.on('drain', function onParserDrain () {\n this.ws[kResponse].socket.resume()\n })\n\n response.socket.ws = this\n this[kByteParser] = parser\n\n // 1. Change the ready state to OPEN (1).\n this[kReadyState] = states.OPEN\n\n // 2. Change the extensions attribute’s value to the extensions in use, if\n // it is not the null value.\n // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\n const extensions = response.headersList.get('sec-websocket-extensions')\n\n if (extensions !== null) {\n this.#extensions = extensions\n }\n\n // 3. Change the protocol attribute’s value to the subprotocol in use, if\n // it is not the null value.\n // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9\n const protocol = response.headersList.get('sec-websocket-protocol')\n\n if (protocol !== null) {\n this.#protocol = protocol\n }\n\n // 4. Fire an event named open at the WebSocket object.\n fireEvent('open', this)\n }\n}\n\n// https://websockets.spec.whatwg.org/#dom-websocket-connecting\nWebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING\n// https://websockets.spec.whatwg.org/#dom-websocket-open\nWebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN\n// https://websockets.spec.whatwg.org/#dom-websocket-closing\nWebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING\n// https://websockets.spec.whatwg.org/#dom-websocket-closed\nWebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED\n\nObject.defineProperties(WebSocket.prototype, {\n CONNECTING: staticPropertyDescriptors,\n OPEN: staticPropertyDescriptors,\n CLOSING: staticPropertyDescriptors,\n CLOSED: staticPropertyDescriptors,\n url: kEnumerableProperty,\n readyState: kEnumerableProperty,\n bufferedAmount: kEnumerableProperty,\n onopen: kEnumerableProperty,\n onerror: kEnumerableProperty,\n onclose: kEnumerableProperty,\n close: kEnumerableProperty,\n onmessage: kEnumerableProperty,\n binaryType: kEnumerableProperty,\n send: kEnumerableProperty,\n extensions: kEnumerableProperty,\n protocol: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'WebSocket',\n writable: false,\n enumerable: false,\n configurable: true\n }\n})\n\nObject.defineProperties(WebSocket, {\n CONNECTING: staticPropertyDescriptors,\n OPEN: staticPropertyDescriptors,\n CLOSING: staticPropertyDescriptors,\n CLOSED: staticPropertyDescriptors\n})\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.DOMString\n)\n\nwebidl.converters['DOMString or sequence'] = function (V) {\n if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {\n return webidl.converters['sequence'](V)\n }\n\n return webidl.converters.DOMString(V)\n}\n\n// This implements the propsal made in https://github.com/whatwg/websockets/issues/42\nwebidl.converters.WebSocketInit = webidl.dictionaryConverter([\n {\n key: 'protocols',\n converter: webidl.converters['DOMString or sequence'],\n get defaultValue () {\n return []\n }\n },\n {\n key: 'dispatcher',\n converter: (V) => V,\n get defaultValue () {\n return getGlobalDispatcher()\n }\n },\n {\n key: 'headers',\n converter: webidl.nullableConverter(webidl.converters.HeadersInit)\n }\n])\n\nwebidl.converters['DOMString or sequence or WebSocketInit'] = function (V) {\n if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {\n return webidl.converters.WebSocketInit(V)\n }\n\n return { protocols: webidl.converters['DOMString or sequence'](V) }\n}\n\nwebidl.converters.WebSocketSendData = function (V) {\n if (webidl.util.Type(V) === 'Object') {\n if (isBlobLike(V)) {\n return webidl.converters.Blob(V, { strict: false })\n }\n\n if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {\n return webidl.converters.BufferSource(V)\n }\n }\n\n return webidl.converters.USVString(V)\n}\n\nmodule.exports = {\n WebSocket\n}\n","'use strict'\n\nconst Client = require('./lib/client')\nconst Dispatcher = require('./lib/dispatcher')\nconst errors = require('./lib/core/errors')\nconst Pool = require('./lib/pool')\nconst BalancedPool = require('./lib/balanced-pool')\nconst Agent = require('./lib/agent')\nconst util = require('./lib/core/util')\nconst { InvalidArgumentError } = errors\nconst api = require('./lib/api')\nconst buildConnector = require('./lib/core/connect')\nconst MockClient = require('./lib/mock/mock-client')\nconst MockAgent = require('./lib/mock/mock-agent')\nconst MockPool = require('./lib/mock/mock-pool')\nconst mockErrors = require('./lib/mock/mock-errors')\nconst ProxyAgent = require('./lib/proxy-agent')\nconst RetryHandler = require('./lib/handler/RetryHandler')\nconst { getGlobalDispatcher, setGlobalDispatcher } = require('./lib/global')\nconst DecoratorHandler = require('./lib/handler/DecoratorHandler')\nconst RedirectHandler = require('./lib/handler/RedirectHandler')\nconst createRedirectInterceptor = require('./lib/interceptor/redirectInterceptor')\n\nlet hasCrypto\ntry {\n require('crypto')\n hasCrypto = true\n} catch {\n hasCrypto = false\n}\n\nObject.assign(Dispatcher.prototype, api)\n\nmodule.exports.Dispatcher = Dispatcher\nmodule.exports.Client = Client\nmodule.exports.Pool = Pool\nmodule.exports.BalancedPool = BalancedPool\nmodule.exports.Agent = Agent\nmodule.exports.ProxyAgent = ProxyAgent\nmodule.exports.RetryHandler = RetryHandler\n\nmodule.exports.DecoratorHandler = DecoratorHandler\nmodule.exports.RedirectHandler = RedirectHandler\nmodule.exports.createRedirectInterceptor = createRedirectInterceptor\n\nmodule.exports.buildConnector = buildConnector\nmodule.exports.errors = errors\n\nfunction makeDispatcher (fn) {\n return (url, opts, handler) => {\n if (typeof opts === 'function') {\n handler = opts\n opts = null\n }\n\n if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {\n throw new InvalidArgumentError('invalid url')\n }\n\n if (opts != null && typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (opts && opts.path != null) {\n if (typeof opts.path !== 'string') {\n throw new InvalidArgumentError('invalid opts.path')\n }\n\n let path = opts.path\n if (!opts.path.startsWith('/')) {\n path = `/${path}`\n }\n\n url = new URL(util.parseOrigin(url).origin + path)\n } else {\n if (!opts) {\n opts = typeof url === 'object' ? url : {}\n }\n\n url = util.parseURL(url)\n }\n\n const { agent, dispatcher = getGlobalDispatcher() } = opts\n\n if (agent) {\n throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')\n }\n\n return fn.call(dispatcher, {\n ...opts,\n origin: url.origin,\n path: url.search ? `${url.pathname}${url.search}` : url.pathname,\n method: opts.method || (opts.body ? 'PUT' : 'GET')\n }, handler)\n }\n}\n\nmodule.exports.setGlobalDispatcher = setGlobalDispatcher\nmodule.exports.getGlobalDispatcher = getGlobalDispatcher\n\nif (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {\n let fetchImpl = null\n module.exports.fetch = async function fetch (resource) {\n if (!fetchImpl) {\n fetchImpl = require('./lib/fetch').fetch\n }\n\n try {\n return await fetchImpl(...arguments)\n } catch (err) {\n if (typeof err === 'object') {\n Error.captureStackTrace(err, this)\n }\n\n throw err\n }\n }\n module.exports.Headers = require('./lib/fetch/headers').Headers\n module.exports.Response = require('./lib/fetch/response').Response\n module.exports.Request = require('./lib/fetch/request').Request\n module.exports.FormData = require('./lib/fetch/formdata').FormData\n module.exports.File = require('./lib/fetch/file').File\n module.exports.FileReader = require('./lib/fileapi/filereader').FileReader\n\n const { setGlobalOrigin, getGlobalOrigin } = require('./lib/fetch/global')\n\n module.exports.setGlobalOrigin = setGlobalOrigin\n module.exports.getGlobalOrigin = getGlobalOrigin\n\n const { CacheStorage } = require('./lib/cache/cachestorage')\n const { kConstruct } = require('./lib/cache/symbols')\n\n // Cache & CacheStorage are tightly coupled with fetch. Even if it may run\n // in an older version of Node, it doesn't have any use without fetch.\n module.exports.caches = new CacheStorage(kConstruct)\n}\n\nif (util.nodeMajor >= 16) {\n const { deleteCookie, getCookies, getSetCookies, setCookie } = require('./lib/cookies')\n\n module.exports.deleteCookie = deleteCookie\n module.exports.getCookies = getCookies\n module.exports.getSetCookies = getSetCookies\n module.exports.setCookie = setCookie\n\n const { parseMIMEType, serializeAMimeType } = require('./lib/fetch/dataURL')\n\n module.exports.parseMIMEType = parseMIMEType\n module.exports.serializeAMimeType = serializeAMimeType\n}\n\nif (util.nodeMajor >= 18 && hasCrypto) {\n const { WebSocket } = require('./lib/websocket/websocket')\n\n module.exports.WebSocket = WebSocket\n}\n\nmodule.exports.request = makeDispatcher(api.request)\nmodule.exports.stream = makeDispatcher(api.stream)\nmodule.exports.pipeline = makeDispatcher(api.pipeline)\nmodule.exports.connect = makeDispatcher(api.connect)\nmodule.exports.upgrade = makeDispatcher(api.upgrade)\n\nmodule.exports.MockClient = MockClient\nmodule.exports.MockPool = MockPool\nmodule.exports.MockAgent = MockAgent\nmodule.exports.mockErrors = mockErrors\n","\"use strict\";\n/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;\nconst http = __importStar(require(\"http\"));\nconst https = __importStar(require(\"https\"));\nconst pm = __importStar(require(\"./proxy\"));\nconst tunnel = __importStar(require(\"tunnel\"));\nconst undici_1 = require(\"undici\");\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes || (exports.HttpCodes = HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers || (exports.Headers = Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes || (exports.MediaTypes = MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n }));\n });\n }\n readBodyBuffer() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n const chunks = [];\n this.message.on('data', (chunk) => {\n chunks.push(chunk);\n });\n this.message.on('end', () => {\n resolve(Buffer.concat(chunks));\n });\n }));\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n });\n }\n get(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n });\n }\n del(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n });\n }\n post(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n });\n }\n patch(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n });\n }\n put(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n });\n }\n head(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n });\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n });\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n getJson(requestUrl, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = yield this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n postJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n putJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n patchJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n request(verb, requestUrl, data, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = yield this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n 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.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n yield response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = yield this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n yield response.readBody();\n yield this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n });\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n getAgentDispatcher(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (!useProxy) {\n return;\n }\n return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n })), { host: proxyUrl.hostname, port: proxyUrl.port })\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _getProxyAgentDispatcher(parsedUrl, proxyUrl) {\n let proxyAgent;\n if (this._keepAlive) {\n proxyAgent = this._proxyAgentDispatcher;\n }\n // if agent is already assigned use that agent.\n if (proxyAgent) {\n return proxyAgent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {\n token: `${proxyUrl.username}:${proxyUrl.password}`\n })));\n this._proxyAgentDispatcher = proxyAgent;\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {\n rejectUnauthorized: false\n });\n }\n return proxyAgent;\n }\n _performExponentialBackoff(retryNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n });\n }\n _processResponse(res, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = yield res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n }));\n });\n }\n}\nexports.HttpClient = HttpClient;\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n//# sourceMappingURL=auth.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;\nconst os_1 = require(\"os\");\nconst fs_1 = require(\"fs\");\nconst { access, appendFile, writeFile } = fs_1.promises;\nexports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(os_1.EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexports.markdownSummary = _summary;\nexports.summary = _summary;\n//# sourceMappingURL=summary.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;\nconst path = __importStar(require(\"path\"));\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nfunction toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\nexports.toPosixPath = toPosixPath;\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nfunction toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\nexports.toWin32Path = toWin32Path;\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nfunction toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\nexports.toPlatformPath = toPlatformPath;\n//# sourceMappingURL=path-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));\n }\n command_1.issueCommand('set-env', { name }, convertedVal);\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueFileCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));\n }\n command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n/**\n * Summary exports\n */\nvar summary_1 = require(\"./summary\");\nObject.defineProperty(exports, \"summary\", { enumerable: true, get: function () { return summary_1.summary; } });\n/**\n * @deprecated use core.summary\n */\nvar summary_2 = require(\"./summary\");\nObject.defineProperty(exports, \"markdownSummary\", { enumerable: true, get: function () { return summary_2.markdownSummary; } });\n/**\n * Path exports\n */\nvar path_utils_1 = require(\"./path-utils\");\nObject.defineProperty(exports, \"toPosixPath\", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });\nObject.defineProperty(exports, \"toWin32Path\", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });\nObject.defineProperty(exports, \"toPlatformPath\", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });\n//# sourceMappingURL=core.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Context = void 0;\nconst fs_1 = require(\"fs\");\nconst os_1 = require(\"os\");\nclass Context {\n /**\n * Hydrate the context from the environment\n */\n constructor() {\n var _a, _b, _c;\n this.payload = {};\n if (process.env.GITHUB_EVENT_PATH) {\n if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {\n this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));\n }\n else {\n const path = process.env.GITHUB_EVENT_PATH;\n process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);\n }\n }\n this.eventName = process.env.GITHUB_EVENT_NAME;\n this.sha = process.env.GITHUB_SHA;\n this.ref = process.env.GITHUB_REF;\n this.workflow = process.env.GITHUB_WORKFLOW;\n this.action = process.env.GITHUB_ACTION;\n this.actor = process.env.GITHUB_ACTOR;\n this.job = process.env.GITHUB_JOB;\n this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);\n this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);\n this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;\n this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;\n this.graphqlUrl =\n (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;\n }\n get issue() {\n const payload = this.payload;\n return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });\n }\n get repo() {\n if (process.env.GITHUB_REPOSITORY) {\n const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');\n return { owner, repo };\n }\n if (this.payload.repository) {\n return {\n owner: this.payload.repository.owner.login,\n repo: this.payload.repository.name\n };\n }\n throw new Error(\"context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'\");\n }\n}\nexports.Context = Context;\n//# sourceMappingURL=context.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;\nconst httpClient = __importStar(require(\"@actions/http-client\"));\nconst undici_1 = require(\"undici\");\nfunction getAuthString(token, options) {\n if (!token && !options.auth) {\n throw new Error('Parameter token or opts.auth is required');\n }\n else if (token && options.auth) {\n throw new Error('Parameters token and opts.auth may not both be specified');\n }\n return typeof options.auth === 'string' ? options.auth : `token ${token}`;\n}\nexports.getAuthString = getAuthString;\nfunction getProxyAgent(destinationUrl) {\n const hc = new httpClient.HttpClient();\n return hc.getAgent(destinationUrl);\n}\nexports.getProxyAgent = getProxyAgent;\nfunction getProxyAgentDispatcher(destinationUrl) {\n const hc = new httpClient.HttpClient();\n return hc.getAgentDispatcher(destinationUrl);\n}\nexports.getProxyAgentDispatcher = getProxyAgentDispatcher;\nfunction getProxyFetch(destinationUrl) {\n const httpDispatcher = getProxyAgentDispatcher(destinationUrl);\n const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {\n return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));\n });\n return proxyFetch;\n}\nexports.getProxyFetch = getProxyFetch;\nfunction getApiBaseUrl() {\n return process.env['GITHUB_API_URL'] || 'https://api.github.com';\n}\nexports.getApiBaseUrl = getApiBaseUrl;\n//# sourceMappingURL=utils.js.map","function getUserAgent() {\n if (typeof navigator === \"object\" && \"userAgent\" in navigator) {\n return navigator.userAgent;\n }\n if (typeof process === \"object\" && process.version !== undefined) {\n return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;\n }\n return \"\";\n}\n\nexport { getUserAgent };\n//# sourceMappingURL=index.js.map\n","module.exports = register;\n\nfunction register(state, name, method, options) {\n if (typeof method !== \"function\") {\n throw new Error(\"method for before hook must be a function\");\n }\n\n if (!options) {\n options = {};\n }\n\n if (Array.isArray(name)) {\n return name.reverse().reduce(function (callback, name) {\n return register.bind(null, state, name, callback, options);\n }, method)();\n }\n\n return Promise.resolve().then(function () {\n if (!state.registry[name]) {\n return method(options);\n }\n\n return state.registry[name].reduce(function (method, registered) {\n return registered.hook.bind(null, method, options);\n }, method)();\n });\n}\n","module.exports = addHook;\n\nfunction addHook(state, kind, name, hook) {\n var orig = hook;\n if (!state.registry[name]) {\n state.registry[name] = [];\n }\n\n if (kind === \"before\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(orig.bind(null, options))\n .then(method.bind(null, options));\n };\n }\n\n if (kind === \"after\") {\n hook = function (method, options) {\n var result;\n return Promise.resolve()\n .then(method.bind(null, options))\n .then(function (result_) {\n result = result_;\n return orig(result, options);\n })\n .then(function () {\n return result;\n });\n };\n }\n\n if (kind === \"error\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(method.bind(null, options))\n .catch(function (error) {\n return orig(error, options);\n });\n };\n }\n\n state.registry[name].push({\n hook: hook,\n orig: orig,\n });\n}\n","module.exports = removeHook;\n\nfunction removeHook(state, name, method) {\n if (!state.registry[name]) {\n return;\n }\n\n var index = state.registry[name]\n .map(function (registered) {\n return registered.orig;\n })\n .indexOf(method);\n\n if (index === -1) {\n return;\n }\n\n state.registry[name].splice(index, 1);\n}\n","var register = require(\"./lib/register\");\nvar addHook = require(\"./lib/add\");\nvar removeHook = require(\"./lib/remove\");\n\n// bind with array of arguments: https://stackoverflow.com/a/21792913\nvar bind = Function.bind;\nvar bindable = bind.bind(bind);\n\nfunction bindApi(hook, state, name) {\n var removeHookRef = bindable(removeHook, null).apply(\n null,\n name ? [state, name] : [state]\n );\n hook.api = { remove: removeHookRef };\n hook.remove = removeHookRef;\n [\"before\", \"error\", \"after\", \"wrap\"].forEach(function (kind) {\n var args = name ? [state, kind, name] : [state, kind];\n hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);\n });\n}\n\nfunction HookSingular() {\n var singularHookName = \"h\";\n var singularHookState = {\n registry: {},\n };\n var singularHook = register.bind(null, singularHookState, singularHookName);\n bindApi(singularHook, singularHookState, singularHookName);\n return singularHook;\n}\n\nfunction HookCollection() {\n var state = {\n registry: {},\n };\n\n var hook = register.bind(null, state);\n bindApi(hook, state);\n\n return hook;\n}\n\nvar collectionHookDeprecationMessageDisplayed = false;\nfunction Hook() {\n if (!collectionHookDeprecationMessageDisplayed) {\n console.warn(\n '[before-after-hook]: \"Hook()\" repurposing warning, use \"Hook.Collection()\". Read more: https://git.io/upgrade-before-after-hook-to-1.4'\n );\n collectionHookDeprecationMessageDisplayed = true;\n }\n return HookCollection();\n}\n\nHook.Singular = HookSingular.bind();\nHook.Collection = HookCollection.bind();\n\nmodule.exports = Hook;\n// expose constructors as a named property for TypeScript\nmodule.exports.Hook = Hook;\nmodule.exports.Singular = Hook.Singular;\nmodule.exports.Collection = Hook.Collection;\n","const VERSION = \"9.0.6\";\nexport {\n VERSION\n};\n","import { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nconst userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;\nconst DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent\n },\n mediaType: {\n format: \"\"\n }\n};\nexport {\n DEFAULTS\n};\n","function lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\nexport {\n lowercaseKeys\n};\n","function isPlainObject(value) {\n if (typeof value !== \"object\" || value === null)\n return false;\n if (Object.prototype.toString.call(value) !== \"[object Object]\")\n return false;\n const proto = Object.getPrototypeOf(value);\n if (proto === null)\n return true;\n const Ctor = Object.prototype.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof Ctor === \"function\" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);\n}\nexport {\n isPlainObject\n};\n","import { isPlainObject } from \"./is-plain-object\";\nfunction mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach((key) => {\n if (isPlainObject(options[key])) {\n if (!(key in defaults))\n Object.assign(result, { [key]: options[key] });\n else\n result[key] = mergeDeep(defaults[key], options[key]);\n } else {\n Object.assign(result, { [key]: options[key] });\n }\n });\n return result;\n}\nexport {\n mergeDeep\n};\n","function removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === void 0) {\n delete obj[key];\n }\n }\n return obj;\n}\nexport {\n removeUndefinedProperties\n};\n","import { lowercaseKeys } from \"./util/lowercase-keys\";\nimport { mergeDeep } from \"./util/merge-deep\";\nimport { removeUndefinedProperties } from \"./util/remove-undefined-properties\";\nfunction merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? { method, url } : { url: method }, options);\n } else {\n options = Object.assign({}, route);\n }\n options.headers = lowercaseKeys(options.headers);\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options);\n if (options.url === \"/graphql\") {\n if (defaults && defaults.mediaType.previews?.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(\n (preview) => !mergedOptions.mediaType.previews.includes(preview)\n ).concat(mergedOptions.mediaType.previews);\n }\n mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, \"\"));\n }\n return mergedOptions;\n}\nexport {\n merge\n};\n","function addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n if (names.length === 0) {\n return url;\n }\n return url + separator + names.map((name) => {\n if (name === \"q\") {\n return \"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\");\n }\n return `${name}=${encodeURIComponent(parameters[name])}`;\n }).join(\"&\");\n}\nexport {\n addQueryParameters\n};\n","const urlVariableRegex = /\\{[^{}}]+\\}/g;\nfunction removeNonChars(variableName) {\n return variableName.replace(/(?:^\\W+)|(?:(? a.concat(b), []);\n}\nexport {\n extractUrlVariableNames\n};\n","function omit(object, keysToOmit) {\n const result = { __proto__: null };\n for (const key of Object.keys(object)) {\n if (keysToOmit.indexOf(key) === -1) {\n result[key] = object[key];\n }\n }\n return result;\n}\nexport {\n omit\n};\n","function encodeReserved(str) {\n return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n return part;\n }).join(\"\");\n}\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\nfunction encodeValue(operator, value, key) {\n value = operator === \"+\" || operator === \"#\" ? encodeReserved(value) : encodeUnreserved(value);\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n } else {\n return value;\n }\n}\nfunction isDefined(value) {\n return value !== void 0 && value !== null;\n}\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\nfunction getValues(context, operator, key, modifier) {\n var value = context[key], result = [];\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n value = value.toString();\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n result.push(\n encodeValue(operator, value, isKeyOperator(operator) ? key : \"\")\n );\n } else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function(value2) {\n result.push(\n encodeValue(operator, value2, isKeyOperator(operator) ? key : \"\")\n );\n });\n } else {\n Object.keys(value).forEach(function(k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n } else {\n const tmp = [];\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function(value2) {\n tmp.push(encodeValue(operator, value2));\n });\n } else {\n Object.keys(value).forEach(function(k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n } else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n } else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n } else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n } else if (value === \"\") {\n result.push(\"\");\n }\n }\n return result;\n}\nfunction parseUrl(template) {\n return {\n expand: expand.bind(null, template)\n };\n}\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n template = template.replace(\n /\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g,\n function(_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n expression.split(/,/g).forEach(function(variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n if (operator && operator !== \"+\") {\n var separator = \",\";\n if (operator === \"?\") {\n separator = \"&\";\n } else if (operator !== \"#\") {\n separator = operator;\n }\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n } else {\n return values.join(\",\");\n }\n } else {\n return encodeReserved(literal);\n }\n }\n );\n if (template === \"/\") {\n return template;\n } else {\n return template.replace(/\\/$/, \"\");\n }\n}\nexport {\n parseUrl\n};\n","import { addQueryParameters } from \"./util/add-query-parameters\";\nimport { extractUrlVariableNames } from \"./util/extract-url-variable-names\";\nimport { omit } from \"./util/omit\";\nimport { parseUrl } from \"./util/url-template\";\nfunction parse(options) {\n let method = options.method.toUpperCase();\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\n \"method\",\n \"baseUrl\",\n \"url\",\n \"headers\",\n \"request\",\n \"mediaType\"\n ]);\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n headers.accept = headers.accept.split(/,/).map(\n (format) => format.replace(\n /application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/,\n `application/vnd$1$2.${options.mediaType.format}`\n )\n ).join(\",\");\n }\n if (url.endsWith(\"/graphql\")) {\n if (options.mediaType.previews?.length) {\n const previewsFromAcceptHeader = headers.accept.match(/(? {\n const format = options.mediaType.format ? `.${options.mediaType.format}` : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n }).join(\",\");\n }\n }\n }\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n } else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n } else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n }\n }\n }\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n }\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n }\n return Object.assign(\n { method, url, headers },\n typeof body !== \"undefined\" ? { body } : null,\n options.request ? { request: options.request } : null\n );\n}\nexport {\n parse\n};\n","import { DEFAULTS } from \"./defaults\";\nimport { merge } from \"./merge\";\nimport { parse } from \"./parse\";\nfunction endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\nexport {\n endpointWithDefaults\n};\n","import { endpointWithDefaults } from \"./endpoint-with-defaults\";\nimport { merge } from \"./merge\";\nimport { parse } from \"./parse\";\nfunction withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS = merge(oldDefaults, newDefaults);\n const endpoint = endpointWithDefaults.bind(null, DEFAULTS);\n return Object.assign(endpoint, {\n DEFAULTS,\n defaults: withDefaults.bind(null, DEFAULTS),\n merge: merge.bind(null, DEFAULTS),\n parse\n });\n}\nexport {\n withDefaults\n};\n","import { withDefaults } from \"./with-defaults\";\nimport { DEFAULTS } from \"./defaults\";\nconst endpoint = withDefaults(null, DEFAULTS);\nexport {\n endpoint\n};\n","const VERSION = \"8.4.1\";\nexport {\n VERSION\n};\n","function isPlainObject(value) {\n if (typeof value !== \"object\" || value === null)\n return false;\n if (Object.prototype.toString.call(value) !== \"[object Object]\")\n return false;\n const proto = Object.getPrototypeOf(value);\n if (proto === null)\n return true;\n const Ctor = Object.prototype.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof Ctor === \"function\" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);\n}\nexport {\n isPlainObject\n};\n","class Deprecation extends Error {\n constructor(message) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = 'Deprecation';\n }\n\n}\n\nexport { Deprecation };\n","// Returns a wrapper function that returns a wrapped callback\n// The wrapper function should do some stuff, and return a\n// presumably different callback function.\n// This makes sure that own properties are retained, so that\n// decorations and such are not lost along the way.\nmodule.exports = wrappy\nfunction wrappy (fn, cb) {\n if (fn && cb) return wrappy(fn)(cb)\n\n if (typeof fn !== 'function')\n throw new TypeError('need wrapper function')\n\n Object.keys(fn).forEach(function (k) {\n wrapper[k] = fn[k]\n })\n\n return wrapper\n\n function wrapper() {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n var ret = fn.apply(this, args)\n var cb = args[args.length-1]\n if (typeof ret === 'function' && ret !== cb) {\n Object.keys(cb).forEach(function (k) {\n ret[k] = cb[k]\n })\n }\n return ret\n }\n}\n","var wrappy = require('wrappy')\nmodule.exports = wrappy(once)\nmodule.exports.strict = wrappy(onceStrict)\n\nonce.proto = once(function () {\n Object.defineProperty(Function.prototype, 'once', {\n value: function () {\n return once(this)\n },\n configurable: true\n })\n\n Object.defineProperty(Function.prototype, 'onceStrict', {\n value: function () {\n return onceStrict(this)\n },\n configurable: true\n })\n})\n\nfunction once (fn) {\n var f = function () {\n if (f.called) return f.value\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n f.called = false\n return f\n}\n\nfunction onceStrict (fn) {\n var f = function () {\n if (f.called)\n throw new Error(f.onceError)\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n var name = fn.name || 'Function wrapped with `once`'\n f.onceError = name + \" shouldn't be called more than once\"\n f.called = false\n return f\n}\n","import { Deprecation } from \"deprecation\";\nimport once from \"once\";\nconst logOnceCode = once((deprecation) => console.warn(deprecation));\nconst logOnceHeaders = once((deprecation) => console.warn(deprecation));\nclass RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n this.name = \"HttpError\";\n this.status = statusCode;\n let headers;\n if (\"headers\" in options && typeof options.headers !== \"undefined\") {\n headers = options.headers;\n }\n if (\"response\" in options) {\n this.response = options.response;\n headers = options.response.headers;\n }\n const requestCopy = Object.assign({}, options.request);\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(\n /(? {\n url = response.url;\n status = response.status;\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n if (\"deprecation\" in headers) {\n const matches = headers.link && headers.link.match(/<([^<>]+)>; rel=\"deprecation\"/);\n const deprecationLink = matches && matches.pop();\n log.warn(\n `[@octokit/request] \"${requestOptions.method} ${requestOptions.url}\" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : \"\"}`\n );\n }\n if (status === 204 || status === 205) {\n return;\n }\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n throw new RequestError(response.statusText, status, {\n response: {\n url,\n status,\n headers,\n data: void 0\n },\n request: requestOptions\n });\n }\n if (status === 304) {\n throw new RequestError(\"Not modified\", status, {\n response: {\n url,\n status,\n headers,\n data: await getResponseData(response)\n },\n request: requestOptions\n });\n }\n if (status >= 400) {\n const data = await getResponseData(response);\n const error = new RequestError(toErrorMessage(data), status, {\n response: {\n url,\n status,\n headers,\n data\n },\n request: requestOptions\n });\n throw error;\n }\n return parseSuccessResponseBody ? await getResponseData(response) : response.body;\n }).then((data) => {\n return {\n status,\n url,\n headers,\n data\n };\n }).catch((error) => {\n if (error instanceof RequestError)\n throw error;\n else if (error.name === \"AbortError\")\n throw error;\n let message = error.message;\n if (error.name === \"TypeError\" && \"cause\" in error) {\n if (error.cause instanceof Error) {\n message = error.cause.message;\n } else if (typeof error.cause === \"string\") {\n message = error.cause;\n }\n }\n throw new RequestError(message, 500, {\n request: requestOptions\n });\n });\n}\nasync function getResponseData(response) {\n const contentType = response.headers.get(\"content-type\");\n if (/application\\/json/.test(contentType)) {\n return response.json().catch(() => response.text()).catch(() => \"\");\n }\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n return getBuffer(response);\n}\nfunction toErrorMessage(data) {\n if (typeof data === \"string\")\n return data;\n let suffix;\n if (\"documentation_url\" in data) {\n suffix = ` - ${data.documentation_url}`;\n } else {\n suffix = \"\";\n }\n if (\"message\" in data) {\n if (Array.isArray(data.errors)) {\n return `${data.message}: ${data.errors.map(JSON.stringify).join(\", \")}${suffix}`;\n }\n return `${data.message}${suffix}`;\n }\n return `Unknown error: ${JSON.stringify(data)}`;\n}\nexport {\n fetchWrapper as default\n};\n","import fetchWrapper from \"./fetch-wrapper.js\";\nfunction withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n const newApi = function(route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n const request = (route2, parameters2) => {\n return fetchWrapper(\n endpoint.parse(endpoint.merge(route2, parameters2))\n );\n };\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n}\nexport {\n withDefaults as default\n};\n","import { endpoint } from \"@octokit/endpoint\";\nimport { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version.js\";\nimport withDefaults from \"./with-defaults.js\";\nconst request = withDefaults(endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${getUserAgent()}`\n }\n});\nexport {\n request\n};\n","// pkg/dist-src/index.js\nimport { request } from \"@octokit/request\";\nimport { getUserAgent } from \"universal-user-agent\";\n\n// pkg/dist-src/version.js\nvar VERSION = \"7.1.1\";\n\n// pkg/dist-src/with-defaults.js\nimport { request as Request2 } from \"@octokit/request\";\n\n// pkg/dist-src/graphql.js\nimport { request as Request } from \"@octokit/request\";\n\n// pkg/dist-src/error.js\nfunction _buildMessageForResponseErrors(data) {\n return `Request failed due to following response errors:\n` + data.errors.map((e) => ` - ${e.message}`).join(\"\\n\");\n}\nvar GraphqlResponseError = class extends Error {\n constructor(request2, headers, response) {\n super(_buildMessageForResponseErrors(response));\n this.request = request2;\n this.headers = headers;\n this.response = response;\n this.name = \"GraphqlResponseError\";\n this.errors = response.errors;\n this.data = response.data;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n};\n\n// pkg/dist-src/graphql.js\nvar NON_VARIABLE_OPTIONS = [\n \"method\",\n \"baseUrl\",\n \"url\",\n \"headers\",\n \"request\",\n \"query\",\n \"mediaType\"\n];\nvar FORBIDDEN_VARIABLE_OPTIONS = [\"query\", \"method\", \"url\"];\nvar GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nfunction graphql(request2, query, options) {\n if (options) {\n if (typeof query === \"string\" && \"query\" in options) {\n return Promise.reject(\n new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`)\n );\n }\n for (const key in options) {\n if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;\n return Promise.reject(\n new Error(\n `[@octokit/graphql] \"${key}\" cannot be used as variable name`\n )\n );\n }\n }\n const parsedOptions = typeof query === \"string\" ? Object.assign({ query }, options) : query;\n const requestOptions = Object.keys(\n parsedOptions\n ).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n if (!result.variables) {\n result.variables = {};\n }\n result.variables[key] = parsedOptions[key];\n return result;\n }, {});\n const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n return request2(requestOptions).then((response) => {\n if (response.data.errors) {\n const headers = {};\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n throw new GraphqlResponseError(\n requestOptions,\n headers,\n response.data\n );\n }\n return response.data.data;\n });\n}\n\n// pkg/dist-src/with-defaults.js\nfunction withDefaults(request2, newDefaults) {\n const newRequest = request2.defaults(newDefaults);\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: newRequest.endpoint\n });\n}\n\n// pkg/dist-src/index.js\nvar graphql2 = withDefaults(request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${getUserAgent()}`\n },\n method: \"POST\",\n url: \"/graphql\"\n});\nfunction withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\"\n });\n}\nexport {\n GraphqlResponseError,\n graphql2 as graphql,\n withCustomRequest\n};\n","const REGEX_IS_INSTALLATION_LEGACY = /^v1\\./;\nconst REGEX_IS_INSTALLATION = /^ghs_/;\nconst REGEX_IS_USER_TO_SERVER = /^ghu_/;\nasync function auth(token) {\n const isApp = token.split(/\\./).length === 3;\n const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);\n const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);\n const tokenType = isApp ? \"app\" : isInstallation ? \"installation\" : isUserToServer ? \"user-to-server\" : \"oauth\";\n return {\n type: \"token\",\n token,\n tokenType\n };\n}\nexport {\n auth\n};\n","function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n return `token ${token}`;\n}\nexport {\n withAuthorizationPrefix\n};\n","import { withAuthorizationPrefix } from \"./with-authorization-prefix\";\nasync function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(\n route,\n parameters\n );\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\nexport {\n hook\n};\n","import { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nconst createTokenAuth = function createTokenAuth2(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n if (typeof token !== \"string\") {\n throw new Error(\n \"[@octokit/auth-token] Token passed to createTokenAuth is not a string\"\n );\n }\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\nexport {\n createTokenAuth\n};\n","// pkg/dist-src/index.js\nimport { getUserAgent } from \"universal-user-agent\";\nimport { Collection } from \"before-after-hook\";\nimport { request } from \"@octokit/request\";\nimport { graphql, withCustomRequest } from \"@octokit/graphql\";\nimport { createTokenAuth } from \"@octokit/auth-token\";\n\n// pkg/dist-src/version.js\nvar VERSION = \"5.2.2\";\n\n// pkg/dist-src/index.js\nvar noop = () => {\n};\nvar consoleWarn = console.warn.bind(console);\nvar consoleError = console.error.bind(console);\nfunction createLogger(logger = {}) {\n if (typeof logger.debug !== \"function\") {\n logger.debug = noop;\n }\n if (typeof logger.info !== \"function\") {\n logger.info = noop;\n }\n if (typeof logger.warn !== \"function\") {\n logger.warn = consoleWarn;\n }\n if (typeof logger.error !== \"function\") {\n logger.error = consoleError;\n }\n return logger;\n}\nvar userAgentTrail = `octokit-core.js/${VERSION} ${getUserAgent()}`;\nvar Octokit = class {\n static {\n this.VERSION = VERSION;\n }\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n super(\n Object.assign(\n {},\n defaults,\n options,\n options.userAgent && defaults.userAgent ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`\n } : null\n )\n );\n }\n };\n return OctokitWithDefaults;\n }\n static {\n this.plugins = [];\n }\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n static plugin(...newPlugins) {\n const currentPlugins = this.plugins;\n const NewOctokit = class extends this {\n static {\n this.plugins = currentPlugins.concat(\n newPlugins.filter((plugin) => !currentPlugins.includes(plugin))\n );\n }\n };\n return NewOctokit;\n }\n constructor(options = {}) {\n const hook = new Collection();\n const requestDefaults = {\n baseUrl: request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n // @ts-ignore internal usage only, no need to type\n hook: hook.bind(null, \"request\")\n }),\n mediaType: {\n previews: [],\n format: \"\"\n }\n };\n requestDefaults.headers[\"user-agent\"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n this.request = request.defaults(requestDefaults);\n this.graphql = withCustomRequest(this.request).defaults(requestDefaults);\n this.log = createLogger(options.log);\n this.hook = hook;\n if (!options.authStrategy) {\n if (!options.auth) {\n this.auth = async () => ({\n type: \"unauthenticated\"\n });\n } else {\n const auth = createTokenAuth(options.auth);\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n } else {\n const { authStrategy, ...otherOptions } = options;\n const auth = authStrategy(\n Object.assign(\n {\n request: this.request,\n log: this.log,\n // we pass the current octokit instance as well as its constructor options\n // to allow for authentication strategies that return a new octokit instance\n // that shares the same internal state as the current one. The original\n // requirement for this was the \"event-octokit\" authentication strategy\n // of https://github.com/probot/octokit-auth-probot.\n octokit: this,\n octokitOptions: otherOptions\n },\n options.auth\n )\n );\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n const classConstructor = this.constructor;\n for (let i = 0; i < classConstructor.plugins.length; ++i) {\n Object.assign(this, classConstructor.plugins[i](this, options));\n }\n }\n};\nexport {\n Octokit\n};\n","const VERSION = \"10.4.1\";\nexport {\n VERSION\n};\n","const Endpoints = {\n actions: {\n addCustomLabelsToSelfHostedRunnerForOrg: [\n \"POST /orgs/{org}/actions/runners/{runner_id}/labels\"\n ],\n addCustomLabelsToSelfHostedRunnerForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"\n ],\n addSelectedRepoToOrgSecret: [\n \"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"\n ],\n addSelectedRepoToOrgVariable: [\n \"PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}\"\n ],\n approveWorkflowRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve\"\n ],\n cancelWorkflowRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\"\n ],\n createEnvironmentVariable: [\n \"POST /repositories/{repository_id}/environments/{environment_name}/variables\"\n ],\n createOrUpdateEnvironmentSecret: [\n \"PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"\n ],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\n \"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\"\n ],\n createOrgVariable: [\"POST /orgs/{org}/actions/variables\"],\n createRegistrationTokenForOrg: [\n \"POST /orgs/{org}/actions/runners/registration-token\"\n ],\n createRegistrationTokenForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/registration-token\"\n ],\n createRemoveTokenForOrg: [\"POST /orgs/{org}/actions/runners/remove-token\"],\n createRemoveTokenForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/remove-token\"\n ],\n createRepoVariable: [\"POST /repos/{owner}/{repo}/actions/variables\"],\n createWorkflowDispatch: [\n \"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\"\n ],\n deleteActionsCacheById: [\n \"DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}\"\n ],\n deleteActionsCacheByKey: [\n \"DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}\"\n ],\n deleteArtifact: [\n \"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"\n ],\n deleteEnvironmentSecret: [\n \"DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"\n ],\n deleteEnvironmentVariable: [\n \"DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}\"\n ],\n deleteOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}\"],\n deleteOrgVariable: [\"DELETE /orgs/{org}/actions/variables/{name}\"],\n deleteRepoSecret: [\n \"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\"\n ],\n deleteRepoVariable: [\n \"DELETE /repos/{owner}/{repo}/actions/variables/{name}\"\n ],\n deleteSelfHostedRunnerFromOrg: [\n \"DELETE /orgs/{org}/actions/runners/{runner_id}\"\n ],\n deleteSelfHostedRunnerFromRepo: [\n \"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\"\n ],\n deleteWorkflowRun: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n deleteWorkflowRunLogs: [\n \"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"\n ],\n disableSelectedRepositoryGithubActionsOrganization: [\n \"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}\"\n ],\n disableWorkflow: [\n \"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\"\n ],\n downloadArtifact: [\n \"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\"\n ],\n downloadJobLogsForWorkflowRun: [\n \"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\"\n ],\n downloadWorkflowRunAttemptLogs: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs\"\n ],\n downloadWorkflowRunLogs: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"\n ],\n enableSelectedRepositoryGithubActionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}\"\n ],\n enableWorkflow: [\n \"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\"\n ],\n forceCancelWorkflowRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel\"\n ],\n generateRunnerJitconfigForOrg: [\n \"POST /orgs/{org}/actions/runners/generate-jitconfig\"\n ],\n generateRunnerJitconfigForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig\"\n ],\n getActionsCacheList: [\"GET /repos/{owner}/{repo}/actions/caches\"],\n getActionsCacheUsage: [\"GET /repos/{owner}/{repo}/actions/cache/usage\"],\n getActionsCacheUsageByRepoForOrg: [\n \"GET /orgs/{org}/actions/cache/usage-by-repository\"\n ],\n getActionsCacheUsageForOrg: [\"GET /orgs/{org}/actions/cache/usage\"],\n getAllowedActionsOrganization: [\n \"GET /orgs/{org}/actions/permissions/selected-actions\"\n ],\n getAllowedActionsRepository: [\n \"GET /repos/{owner}/{repo}/actions/permissions/selected-actions\"\n ],\n getArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n getCustomOidcSubClaimForRepo: [\n \"GET /repos/{owner}/{repo}/actions/oidc/customization/sub\"\n ],\n getEnvironmentPublicKey: [\n \"GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key\"\n ],\n getEnvironmentSecret: [\n \"GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"\n ],\n getEnvironmentVariable: [\n \"GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}\"\n ],\n getGithubActionsDefaultWorkflowPermissionsOrganization: [\n \"GET /orgs/{org}/actions/permissions/workflow\"\n ],\n getGithubActionsDefaultWorkflowPermissionsRepository: [\n \"GET /repos/{owner}/{repo}/actions/permissions/workflow\"\n ],\n getGithubActionsPermissionsOrganization: [\n \"GET /orgs/{org}/actions/permissions\"\n ],\n getGithubActionsPermissionsRepository: [\n \"GET /repos/{owner}/{repo}/actions/permissions\"\n ],\n getJobForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/actions/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}\"],\n getOrgVariable: [\"GET /orgs/{org}/actions/variables/{name}\"],\n getPendingDeploymentsForRun: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"\n ],\n getRepoPermissions: [\n \"GET /repos/{owner}/{repo}/actions/permissions\",\n {},\n { renamed: [\"actions\", \"getGithubActionsPermissionsRepository\"] }\n ],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/actions/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n getRepoVariable: [\"GET /repos/{owner}/{repo}/actions/variables/{name}\"],\n getReviewsForRun: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals\"\n ],\n getSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}\"],\n getSelfHostedRunnerForRepo: [\n \"GET /repos/{owner}/{repo}/actions/runners/{runner_id}\"\n ],\n getWorkflow: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\"],\n getWorkflowAccessToRepository: [\n \"GET /repos/{owner}/{repo}/actions/permissions/access\"\n ],\n getWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n getWorkflowRunAttempt: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}\"\n ],\n getWorkflowRunUsage: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\"\n ],\n getWorkflowUsage: [\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\"\n ],\n listArtifactsForRepo: [\"GET /repos/{owner}/{repo}/actions/artifacts\"],\n listEnvironmentSecrets: [\n \"GET /repositories/{repository_id}/environments/{environment_name}/secrets\"\n ],\n listEnvironmentVariables: [\n \"GET /repositories/{repository_id}/environments/{environment_name}/variables\"\n ],\n listJobsForWorkflowRun: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\"\n ],\n listJobsForWorkflowRunAttempt: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\"\n ],\n listLabelsForSelfHostedRunnerForOrg: [\n \"GET /orgs/{org}/actions/runners/{runner_id}/labels\"\n ],\n listLabelsForSelfHostedRunnerForRepo: [\n \"GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"\n ],\n listOrgSecrets: [\"GET /orgs/{org}/actions/secrets\"],\n listOrgVariables: [\"GET /orgs/{org}/actions/variables\"],\n listRepoOrganizationSecrets: [\n \"GET /repos/{owner}/{repo}/actions/organization-secrets\"\n ],\n listRepoOrganizationVariables: [\n \"GET /repos/{owner}/{repo}/actions/organization-variables\"\n ],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/actions/secrets\"],\n listRepoVariables: [\"GET /repos/{owner}/{repo}/actions/variables\"],\n listRepoWorkflows: [\"GET /repos/{owner}/{repo}/actions/workflows\"],\n listRunnerApplicationsForOrg: [\"GET /orgs/{org}/actions/runners/downloads\"],\n listRunnerApplicationsForRepo: [\n \"GET /repos/{owner}/{repo}/actions/runners/downloads\"\n ],\n listSelectedReposForOrgSecret: [\n \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\"\n ],\n listSelectedReposForOrgVariable: [\n \"GET /orgs/{org}/actions/variables/{name}/repositories\"\n ],\n listSelectedRepositoriesEnabledGithubActionsOrganization: [\n \"GET /orgs/{org}/actions/permissions/repositories\"\n ],\n listSelfHostedRunnersForOrg: [\"GET /orgs/{org}/actions/runners\"],\n listSelfHostedRunnersForRepo: [\"GET /repos/{owner}/{repo}/actions/runners\"],\n listWorkflowRunArtifacts: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\"\n ],\n listWorkflowRuns: [\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\"\n ],\n listWorkflowRunsForRepo: [\"GET /repos/{owner}/{repo}/actions/runs\"],\n reRunJobForWorkflowRun: [\n \"POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun\"\n ],\n reRunWorkflow: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun\"],\n reRunWorkflowFailedJobs: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs\"\n ],\n removeAllCustomLabelsFromSelfHostedRunnerForOrg: [\n \"DELETE /orgs/{org}/actions/runners/{runner_id}/labels\"\n ],\n removeAllCustomLabelsFromSelfHostedRunnerForRepo: [\n \"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"\n ],\n removeCustomLabelFromSelfHostedRunnerForOrg: [\n \"DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}\"\n ],\n removeCustomLabelFromSelfHostedRunnerForRepo: [\n \"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}\"\n ],\n removeSelectedRepoFromOrgSecret: [\n \"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"\n ],\n removeSelectedRepoFromOrgVariable: [\n \"DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}\"\n ],\n reviewCustomGatesForRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule\"\n ],\n reviewPendingDeploymentsForRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"\n ],\n setAllowedActionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions/selected-actions\"\n ],\n setAllowedActionsRepository: [\n \"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions\"\n ],\n setCustomLabelsForSelfHostedRunnerForOrg: [\n \"PUT /orgs/{org}/actions/runners/{runner_id}/labels\"\n ],\n setCustomLabelsForSelfHostedRunnerForRepo: [\n \"PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"\n ],\n setCustomOidcSubClaimForRepo: [\n \"PUT /repos/{owner}/{repo}/actions/oidc/customization/sub\"\n ],\n setGithubActionsDefaultWorkflowPermissionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions/workflow\"\n ],\n setGithubActionsDefaultWorkflowPermissionsRepository: [\n \"PUT /repos/{owner}/{repo}/actions/permissions/workflow\"\n ],\n setGithubActionsPermissionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions\"\n ],\n setGithubActionsPermissionsRepository: [\n \"PUT /repos/{owner}/{repo}/actions/permissions\"\n ],\n setSelectedReposForOrgSecret: [\n \"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\"\n ],\n setSelectedReposForOrgVariable: [\n \"PUT /orgs/{org}/actions/variables/{name}/repositories\"\n ],\n setSelectedRepositoriesEnabledGithubActionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions/repositories\"\n ],\n setWorkflowAccessToRepository: [\n \"PUT /repos/{owner}/{repo}/actions/permissions/access\"\n ],\n updateEnvironmentVariable: [\n \"PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}\"\n ],\n updateOrgVariable: [\"PATCH /orgs/{org}/actions/variables/{name}\"],\n updateRepoVariable: [\n \"PATCH /repos/{owner}/{repo}/actions/variables/{name}\"\n ]\n },\n activity: {\n checkRepoIsStarredByAuthenticatedUser: [\"GET /user/starred/{owner}/{repo}\"],\n deleteRepoSubscription: [\"DELETE /repos/{owner}/{repo}/subscription\"],\n deleteThreadSubscription: [\n \"DELETE /notifications/threads/{thread_id}/subscription\"\n ],\n getFeeds: [\"GET /feeds\"],\n getRepoSubscription: [\"GET /repos/{owner}/{repo}/subscription\"],\n getThread: [\"GET /notifications/threads/{thread_id}\"],\n getThreadSubscriptionForAuthenticatedUser: [\n \"GET /notifications/threads/{thread_id}/subscription\"\n ],\n listEventsForAuthenticatedUser: [\"GET /users/{username}/events\"],\n listNotificationsForAuthenticatedUser: [\"GET /notifications\"],\n listOrgEventsForAuthenticatedUser: [\n \"GET /users/{username}/events/orgs/{org}\"\n ],\n listPublicEvents: [\"GET /events\"],\n listPublicEventsForRepoNetwork: [\"GET /networks/{owner}/{repo}/events\"],\n listPublicEventsForUser: [\"GET /users/{username}/events/public\"],\n listPublicOrgEvents: [\"GET /orgs/{org}/events\"],\n listReceivedEventsForUser: [\"GET /users/{username}/received_events\"],\n listReceivedPublicEventsForUser: [\n \"GET /users/{username}/received_events/public\"\n ],\n listRepoEvents: [\"GET /repos/{owner}/{repo}/events\"],\n listRepoNotificationsForAuthenticatedUser: [\n \"GET /repos/{owner}/{repo}/notifications\"\n ],\n listReposStarredByAuthenticatedUser: [\"GET /user/starred\"],\n listReposStarredByUser: [\"GET /users/{username}/starred\"],\n listReposWatchedByUser: [\"GET /users/{username}/subscriptions\"],\n listStargazersForRepo: [\"GET /repos/{owner}/{repo}/stargazers\"],\n listWatchedReposForAuthenticatedUser: [\"GET /user/subscriptions\"],\n listWatchersForRepo: [\"GET /repos/{owner}/{repo}/subscribers\"],\n markNotificationsAsRead: [\"PUT /notifications\"],\n markRepoNotificationsAsRead: [\"PUT /repos/{owner}/{repo}/notifications\"],\n markThreadAsDone: [\"DELETE /notifications/threads/{thread_id}\"],\n markThreadAsRead: [\"PATCH /notifications/threads/{thread_id}\"],\n setRepoSubscription: [\"PUT /repos/{owner}/{repo}/subscription\"],\n setThreadSubscription: [\n \"PUT /notifications/threads/{thread_id}/subscription\"\n ],\n starRepoForAuthenticatedUser: [\"PUT /user/starred/{owner}/{repo}\"],\n unstarRepoForAuthenticatedUser: [\"DELETE /user/starred/{owner}/{repo}\"]\n },\n apps: {\n addRepoToInstallation: [\n \"PUT /user/installations/{installation_id}/repositories/{repository_id}\",\n {},\n { renamed: [\"apps\", \"addRepoToInstallationForAuthenticatedUser\"] }\n ],\n addRepoToInstallationForAuthenticatedUser: [\n \"PUT /user/installations/{installation_id}/repositories/{repository_id}\"\n ],\n checkToken: [\"POST /applications/{client_id}/token\"],\n createFromManifest: [\"POST /app-manifests/{code}/conversions\"],\n createInstallationAccessToken: [\n \"POST /app/installations/{installation_id}/access_tokens\"\n ],\n deleteAuthorization: [\"DELETE /applications/{client_id}/grant\"],\n deleteInstallation: [\"DELETE /app/installations/{installation_id}\"],\n deleteToken: [\"DELETE /applications/{client_id}/token\"],\n getAuthenticated: [\"GET /app\"],\n getBySlug: [\"GET /apps/{app_slug}\"],\n getInstallation: [\"GET /app/installations/{installation_id}\"],\n getOrgInstallation: [\"GET /orgs/{org}/installation\"],\n getRepoInstallation: [\"GET /repos/{owner}/{repo}/installation\"],\n getSubscriptionPlanForAccount: [\n \"GET /marketplace_listing/accounts/{account_id}\"\n ],\n getSubscriptionPlanForAccountStubbed: [\n \"GET /marketplace_listing/stubbed/accounts/{account_id}\"\n ],\n getUserInstallation: [\"GET /users/{username}/installation\"],\n getWebhookConfigForApp: [\"GET /app/hook/config\"],\n getWebhookDelivery: [\"GET /app/hook/deliveries/{delivery_id}\"],\n listAccountsForPlan: [\"GET /marketplace_listing/plans/{plan_id}/accounts\"],\n listAccountsForPlanStubbed: [\n \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\"\n ],\n listInstallationReposForAuthenticatedUser: [\n \"GET /user/installations/{installation_id}/repositories\"\n ],\n listInstallationRequestsForAuthenticatedApp: [\n \"GET /app/installation-requests\"\n ],\n listInstallations: [\"GET /app/installations\"],\n listInstallationsForAuthenticatedUser: [\"GET /user/installations\"],\n listPlans: [\"GET /marketplace_listing/plans\"],\n listPlansStubbed: [\"GET /marketplace_listing/stubbed/plans\"],\n listReposAccessibleToInstallation: [\"GET /installation/repositories\"],\n listSubscriptionsForAuthenticatedUser: [\"GET /user/marketplace_purchases\"],\n listSubscriptionsForAuthenticatedUserStubbed: [\n \"GET /user/marketplace_purchases/stubbed\"\n ],\n listWebhookDeliveries: [\"GET /app/hook/deliveries\"],\n redeliverWebhookDelivery: [\n \"POST /app/hook/deliveries/{delivery_id}/attempts\"\n ],\n removeRepoFromInstallation: [\n \"DELETE /user/installations/{installation_id}/repositories/{repository_id}\",\n {},\n { renamed: [\"apps\", \"removeRepoFromInstallationForAuthenticatedUser\"] }\n ],\n removeRepoFromInstallationForAuthenticatedUser: [\n \"DELETE /user/installations/{installation_id}/repositories/{repository_id}\"\n ],\n resetToken: [\"PATCH /applications/{client_id}/token\"],\n revokeInstallationAccessToken: [\"DELETE /installation/token\"],\n scopeToken: [\"POST /applications/{client_id}/token/scoped\"],\n suspendInstallation: [\"PUT /app/installations/{installation_id}/suspended\"],\n unsuspendInstallation: [\n \"DELETE /app/installations/{installation_id}/suspended\"\n ],\n updateWebhookConfigForApp: [\"PATCH /app/hook/config\"]\n },\n billing: {\n getGithubActionsBillingOrg: [\"GET /orgs/{org}/settings/billing/actions\"],\n getGithubActionsBillingUser: [\n \"GET /users/{username}/settings/billing/actions\"\n ],\n getGithubPackagesBillingOrg: [\"GET /orgs/{org}/settings/billing/packages\"],\n getGithubPackagesBillingUser: [\n \"GET /users/{username}/settings/billing/packages\"\n ],\n getSharedStorageBillingOrg: [\n \"GET /orgs/{org}/settings/billing/shared-storage\"\n ],\n getSharedStorageBillingUser: [\n \"GET /users/{username}/settings/billing/shared-storage\"\n ]\n },\n checks: {\n create: [\"POST /repos/{owner}/{repo}/check-runs\"],\n createSuite: [\"POST /repos/{owner}/{repo}/check-suites\"],\n get: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n getSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\"],\n listAnnotations: [\n \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\"\n ],\n listForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\"],\n listForSuite: [\n \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\"\n ],\n listSuitesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\"],\n rerequestRun: [\n \"POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest\"\n ],\n rerequestSuite: [\n \"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\"\n ],\n setSuitesPreferences: [\n \"PATCH /repos/{owner}/{repo}/check-suites/preferences\"\n ],\n update: [\"PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\"]\n },\n codeScanning: {\n deleteAnalysis: [\n \"DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}\"\n ],\n getAlert: [\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\",\n {},\n { renamedParameters: { alert_id: \"alert_number\" } }\n ],\n getAnalysis: [\n \"GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}\"\n ],\n getCodeqlDatabase: [\n \"GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}\"\n ],\n getDefaultSetup: [\"GET /repos/{owner}/{repo}/code-scanning/default-setup\"],\n getSarif: [\"GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}\"],\n listAlertInstances: [\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\"\n ],\n listAlertsForOrg: [\"GET /orgs/{org}/code-scanning/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/code-scanning/alerts\"],\n listAlertsInstances: [\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\",\n {},\n { renamed: [\"codeScanning\", \"listAlertInstances\"] }\n ],\n listCodeqlDatabases: [\n \"GET /repos/{owner}/{repo}/code-scanning/codeql/databases\"\n ],\n listRecentAnalyses: [\"GET /repos/{owner}/{repo}/code-scanning/analyses\"],\n updateAlert: [\n \"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\"\n ],\n updateDefaultSetup: [\n \"PATCH /repos/{owner}/{repo}/code-scanning/default-setup\"\n ],\n uploadSarif: [\"POST /repos/{owner}/{repo}/code-scanning/sarifs\"]\n },\n codesOfConduct: {\n getAllCodesOfConduct: [\"GET /codes_of_conduct\"],\n getConductCode: [\"GET /codes_of_conduct/{key}\"]\n },\n codespaces: {\n addRepositoryForSecretForAuthenticatedUser: [\n \"PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\"\n ],\n addSelectedRepoToOrgSecret: [\n \"PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}\"\n ],\n checkPermissionsForDevcontainer: [\n \"GET /repos/{owner}/{repo}/codespaces/permissions_check\"\n ],\n codespaceMachinesForAuthenticatedUser: [\n \"GET /user/codespaces/{codespace_name}/machines\"\n ],\n createForAuthenticatedUser: [\"POST /user/codespaces\"],\n createOrUpdateOrgSecret: [\n \"PUT /orgs/{org}/codespaces/secrets/{secret_name}\"\n ],\n createOrUpdateRepoSecret: [\n \"PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\"\n ],\n createOrUpdateSecretForAuthenticatedUser: [\n \"PUT /user/codespaces/secrets/{secret_name}\"\n ],\n createWithPrForAuthenticatedUser: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces\"\n ],\n createWithRepoForAuthenticatedUser: [\n \"POST /repos/{owner}/{repo}/codespaces\"\n ],\n deleteForAuthenticatedUser: [\"DELETE /user/codespaces/{codespace_name}\"],\n deleteFromOrganization: [\n \"DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}\"\n ],\n deleteOrgSecret: [\"DELETE /orgs/{org}/codespaces/secrets/{secret_name}\"],\n deleteRepoSecret: [\n \"DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\"\n ],\n deleteSecretForAuthenticatedUser: [\n \"DELETE /user/codespaces/secrets/{secret_name}\"\n ],\n exportForAuthenticatedUser: [\n \"POST /user/codespaces/{codespace_name}/exports\"\n ],\n getCodespacesForUserInOrg: [\n \"GET /orgs/{org}/members/{username}/codespaces\"\n ],\n getExportDetailsForAuthenticatedUser: [\n \"GET /user/codespaces/{codespace_name}/exports/{export_id}\"\n ],\n getForAuthenticatedUser: [\"GET /user/codespaces/{codespace_name}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/codespaces/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/codespaces/secrets/{secret_name}\"],\n getPublicKeyForAuthenticatedUser: [\n \"GET /user/codespaces/secrets/public-key\"\n ],\n getRepoPublicKey: [\n \"GET /repos/{owner}/{repo}/codespaces/secrets/public-key\"\n ],\n getRepoSecret: [\n \"GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\"\n ],\n getSecretForAuthenticatedUser: [\n \"GET /user/codespaces/secrets/{secret_name}\"\n ],\n listDevcontainersInRepositoryForAuthenticatedUser: [\n \"GET /repos/{owner}/{repo}/codespaces/devcontainers\"\n ],\n listForAuthenticatedUser: [\"GET /user/codespaces\"],\n listInOrganization: [\n \"GET /orgs/{org}/codespaces\",\n {},\n { renamedParameters: { org_id: \"org\" } }\n ],\n listInRepositoryForAuthenticatedUser: [\n \"GET /repos/{owner}/{repo}/codespaces\"\n ],\n listOrgSecrets: [\"GET /orgs/{org}/codespaces/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/codespaces/secrets\"],\n listRepositoriesForSecretForAuthenticatedUser: [\n \"GET /user/codespaces/secrets/{secret_name}/repositories\"\n ],\n listSecretsForAuthenticatedUser: [\"GET /user/codespaces/secrets\"],\n listSelectedReposForOrgSecret: [\n \"GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories\"\n ],\n preFlightWithRepoForAuthenticatedUser: [\n \"GET /repos/{owner}/{repo}/codespaces/new\"\n ],\n publishForAuthenticatedUser: [\n \"POST /user/codespaces/{codespace_name}/publish\"\n ],\n removeRepositoryForSecretForAuthenticatedUser: [\n \"DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\"\n ],\n removeSelectedRepoFromOrgSecret: [\n \"DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}\"\n ],\n repoMachinesForAuthenticatedUser: [\n \"GET /repos/{owner}/{repo}/codespaces/machines\"\n ],\n setRepositoriesForSecretForAuthenticatedUser: [\n \"PUT /user/codespaces/secrets/{secret_name}/repositories\"\n ],\n setSelectedReposForOrgSecret: [\n \"PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories\"\n ],\n startForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/start\"],\n stopForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/stop\"],\n stopInOrganization: [\n \"POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop\"\n ],\n updateForAuthenticatedUser: [\"PATCH /user/codespaces/{codespace_name}\"]\n },\n copilot: {\n addCopilotSeatsForTeams: [\n \"POST /orgs/{org}/copilot/billing/selected_teams\"\n ],\n addCopilotSeatsForUsers: [\n \"POST /orgs/{org}/copilot/billing/selected_users\"\n ],\n cancelCopilotSeatAssignmentForTeams: [\n \"DELETE /orgs/{org}/copilot/billing/selected_teams\"\n ],\n cancelCopilotSeatAssignmentForUsers: [\n \"DELETE /orgs/{org}/copilot/billing/selected_users\"\n ],\n getCopilotOrganizationDetails: [\"GET /orgs/{org}/copilot/billing\"],\n getCopilotSeatDetailsForUser: [\n \"GET /orgs/{org}/members/{username}/copilot\"\n ],\n listCopilotSeats: [\"GET /orgs/{org}/copilot/billing/seats\"]\n },\n dependabot: {\n addSelectedRepoToOrgSecret: [\n \"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\"\n ],\n createOrUpdateOrgSecret: [\n \"PUT /orgs/{org}/dependabot/secrets/{secret_name}\"\n ],\n createOrUpdateRepoSecret: [\n \"PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\"\n ],\n deleteOrgSecret: [\"DELETE /orgs/{org}/dependabot/secrets/{secret_name}\"],\n deleteRepoSecret: [\n \"DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\"\n ],\n getAlert: [\"GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/dependabot/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/dependabot/secrets/{secret_name}\"],\n getRepoPublicKey: [\n \"GET /repos/{owner}/{repo}/dependabot/secrets/public-key\"\n ],\n getRepoSecret: [\n \"GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\"\n ],\n listAlertsForEnterprise: [\n \"GET /enterprises/{enterprise}/dependabot/alerts\"\n ],\n listAlertsForOrg: [\"GET /orgs/{org}/dependabot/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/dependabot/alerts\"],\n listOrgSecrets: [\"GET /orgs/{org}/dependabot/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/dependabot/secrets\"],\n listSelectedReposForOrgSecret: [\n \"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories\"\n ],\n removeSelectedRepoFromOrgSecret: [\n \"DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\"\n ],\n setSelectedReposForOrgSecret: [\n \"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories\"\n ],\n updateAlert: [\n \"PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}\"\n ]\n },\n dependencyGraph: {\n createRepositorySnapshot: [\n \"POST /repos/{owner}/{repo}/dependency-graph/snapshots\"\n ],\n diffRange: [\n \"GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}\"\n ],\n exportSbom: [\"GET /repos/{owner}/{repo}/dependency-graph/sbom\"]\n },\n emojis: { get: [\"GET /emojis\"] },\n gists: {\n checkIsStarred: [\"GET /gists/{gist_id}/star\"],\n create: [\"POST /gists\"],\n createComment: [\"POST /gists/{gist_id}/comments\"],\n delete: [\"DELETE /gists/{gist_id}\"],\n deleteComment: [\"DELETE /gists/{gist_id}/comments/{comment_id}\"],\n fork: [\"POST /gists/{gist_id}/forks\"],\n get: [\"GET /gists/{gist_id}\"],\n getComment: [\"GET /gists/{gist_id}/comments/{comment_id}\"],\n getRevision: [\"GET /gists/{gist_id}/{sha}\"],\n list: [\"GET /gists\"],\n listComments: [\"GET /gists/{gist_id}/comments\"],\n listCommits: [\"GET /gists/{gist_id}/commits\"],\n listForUser: [\"GET /users/{username}/gists\"],\n listForks: [\"GET /gists/{gist_id}/forks\"],\n listPublic: [\"GET /gists/public\"],\n listStarred: [\"GET /gists/starred\"],\n star: [\"PUT /gists/{gist_id}/star\"],\n unstar: [\"DELETE /gists/{gist_id}/star\"],\n update: [\"PATCH /gists/{gist_id}\"],\n updateComment: [\"PATCH /gists/{gist_id}/comments/{comment_id}\"]\n },\n git: {\n createBlob: [\"POST /repos/{owner}/{repo}/git/blobs\"],\n createCommit: [\"POST /repos/{owner}/{repo}/git/commits\"],\n createRef: [\"POST /repos/{owner}/{repo}/git/refs\"],\n createTag: [\"POST /repos/{owner}/{repo}/git/tags\"],\n createTree: [\"POST /repos/{owner}/{repo}/git/trees\"],\n deleteRef: [\"DELETE /repos/{owner}/{repo}/git/refs/{ref}\"],\n getBlob: [\"GET /repos/{owner}/{repo}/git/blobs/{file_sha}\"],\n getCommit: [\"GET /repos/{owner}/{repo}/git/commits/{commit_sha}\"],\n getRef: [\"GET /repos/{owner}/{repo}/git/ref/{ref}\"],\n getTag: [\"GET /repos/{owner}/{repo}/git/tags/{tag_sha}\"],\n getTree: [\"GET /repos/{owner}/{repo}/git/trees/{tree_sha}\"],\n listMatchingRefs: [\"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\"],\n updateRef: [\"PATCH /repos/{owner}/{repo}/git/refs/{ref}\"]\n },\n gitignore: {\n getAllTemplates: [\"GET /gitignore/templates\"],\n getTemplate: [\"GET /gitignore/templates/{name}\"]\n },\n interactions: {\n getRestrictionsForAuthenticatedUser: [\"GET /user/interaction-limits\"],\n getRestrictionsForOrg: [\"GET /orgs/{org}/interaction-limits\"],\n getRestrictionsForRepo: [\"GET /repos/{owner}/{repo}/interaction-limits\"],\n getRestrictionsForYourPublicRepos: [\n \"GET /user/interaction-limits\",\n {},\n { renamed: [\"interactions\", \"getRestrictionsForAuthenticatedUser\"] }\n ],\n removeRestrictionsForAuthenticatedUser: [\"DELETE /user/interaction-limits\"],\n removeRestrictionsForOrg: [\"DELETE /orgs/{org}/interaction-limits\"],\n removeRestrictionsForRepo: [\n \"DELETE /repos/{owner}/{repo}/interaction-limits\"\n ],\n removeRestrictionsForYourPublicRepos: [\n \"DELETE /user/interaction-limits\",\n {},\n { renamed: [\"interactions\", \"removeRestrictionsForAuthenticatedUser\"] }\n ],\n setRestrictionsForAuthenticatedUser: [\"PUT /user/interaction-limits\"],\n setRestrictionsForOrg: [\"PUT /orgs/{org}/interaction-limits\"],\n setRestrictionsForRepo: [\"PUT /repos/{owner}/{repo}/interaction-limits\"],\n setRestrictionsForYourPublicRepos: [\n \"PUT /user/interaction-limits\",\n {},\n { renamed: [\"interactions\", \"setRestrictionsForAuthenticatedUser\"] }\n ]\n },\n issues: {\n addAssignees: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\"\n ],\n addLabels: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n checkUserCanBeAssigned: [\"GET /repos/{owner}/{repo}/assignees/{assignee}\"],\n checkUserCanBeAssignedToIssue: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}\"\n ],\n create: [\"POST /repos/{owner}/{repo}/issues\"],\n createComment: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/comments\"\n ],\n createLabel: [\"POST /repos/{owner}/{repo}/labels\"],\n createMilestone: [\"POST /repos/{owner}/{repo}/milestones\"],\n deleteComment: [\n \"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\"\n ],\n deleteLabel: [\"DELETE /repos/{owner}/{repo}/labels/{name}\"],\n deleteMilestone: [\n \"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\"\n ],\n get: [\"GET /repos/{owner}/{repo}/issues/{issue_number}\"],\n getComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n getEvent: [\"GET /repos/{owner}/{repo}/issues/events/{event_id}\"],\n getLabel: [\"GET /repos/{owner}/{repo}/labels/{name}\"],\n getMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n list: [\"GET /issues\"],\n listAssignees: [\"GET /repos/{owner}/{repo}/assignees\"],\n listComments: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n listCommentsForRepo: [\"GET /repos/{owner}/{repo}/issues/comments\"],\n listEvents: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/events\"],\n listEventsForRepo: [\"GET /repos/{owner}/{repo}/issues/events\"],\n listEventsForTimeline: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\"\n ],\n listForAuthenticatedUser: [\"GET /user/issues\"],\n listForOrg: [\"GET /orgs/{org}/issues\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/issues\"],\n listLabelsForMilestone: [\n \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\"\n ],\n listLabelsForRepo: [\"GET /repos/{owner}/{repo}/labels\"],\n listLabelsOnIssue: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\"\n ],\n listMilestones: [\"GET /repos/{owner}/{repo}/milestones\"],\n lock: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n removeAllLabels: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\"\n ],\n removeAssignees: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\"\n ],\n removeLabel: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\"\n ],\n setLabels: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n unlock: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n update: [\"PATCH /repos/{owner}/{repo}/issues/{issue_number}\"],\n updateComment: [\"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n updateLabel: [\"PATCH /repos/{owner}/{repo}/labels/{name}\"],\n updateMilestone: [\n \"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\"\n ]\n },\n licenses: {\n get: [\"GET /licenses/{license}\"],\n getAllCommonlyUsed: [\"GET /licenses\"],\n getForRepo: [\"GET /repos/{owner}/{repo}/license\"]\n },\n markdown: {\n render: [\"POST /markdown\"],\n renderRaw: [\n \"POST /markdown/raw\",\n { headers: { \"content-type\": \"text/plain; charset=utf-8\" } }\n ]\n },\n meta: {\n get: [\"GET /meta\"],\n getAllVersions: [\"GET /versions\"],\n getOctocat: [\"GET /octocat\"],\n getZen: [\"GET /zen\"],\n root: [\"GET /\"]\n },\n migrations: {\n cancelImport: [\n \"DELETE /repos/{owner}/{repo}/import\",\n {},\n {\n deprecated: \"octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import\"\n }\n ],\n deleteArchiveForAuthenticatedUser: [\n \"DELETE /user/migrations/{migration_id}/archive\"\n ],\n deleteArchiveForOrg: [\n \"DELETE /orgs/{org}/migrations/{migration_id}/archive\"\n ],\n downloadArchiveForOrg: [\n \"GET /orgs/{org}/migrations/{migration_id}/archive\"\n ],\n getArchiveForAuthenticatedUser: [\n \"GET /user/migrations/{migration_id}/archive\"\n ],\n getCommitAuthors: [\n \"GET /repos/{owner}/{repo}/import/authors\",\n {},\n {\n deprecated: \"octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors\"\n }\n ],\n getImportStatus: [\n \"GET /repos/{owner}/{repo}/import\",\n {},\n {\n deprecated: \"octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status\"\n }\n ],\n getLargeFiles: [\n \"GET /repos/{owner}/{repo}/import/large_files\",\n {},\n {\n deprecated: \"octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files\"\n }\n ],\n getStatusForAuthenticatedUser: [\"GET /user/migrations/{migration_id}\"],\n getStatusForOrg: [\"GET /orgs/{org}/migrations/{migration_id}\"],\n listForAuthenticatedUser: [\"GET /user/migrations\"],\n listForOrg: [\"GET /orgs/{org}/migrations\"],\n listReposForAuthenticatedUser: [\n \"GET /user/migrations/{migration_id}/repositories\"\n ],\n listReposForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/repositories\"],\n listReposForUser: [\n \"GET /user/migrations/{migration_id}/repositories\",\n {},\n { renamed: [\"migrations\", \"listReposForAuthenticatedUser\"] }\n ],\n mapCommitAuthor: [\n \"PATCH /repos/{owner}/{repo}/import/authors/{author_id}\",\n {},\n {\n deprecated: \"octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author\"\n }\n ],\n setLfsPreference: [\n \"PATCH /repos/{owner}/{repo}/import/lfs\",\n {},\n {\n deprecated: \"octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference\"\n }\n ],\n startForAuthenticatedUser: [\"POST /user/migrations\"],\n startForOrg: [\"POST /orgs/{org}/migrations\"],\n startImport: [\n \"PUT /repos/{owner}/{repo}/import\",\n {},\n {\n deprecated: \"octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import\"\n }\n ],\n unlockRepoForAuthenticatedUser: [\n \"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\"\n ],\n unlockRepoForOrg: [\n \"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\"\n ],\n updateImport: [\n \"PATCH /repos/{owner}/{repo}/import\",\n {},\n {\n deprecated: \"octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import\"\n }\n ]\n },\n oidc: {\n getOidcCustomSubTemplateForOrg: [\n \"GET /orgs/{org}/actions/oidc/customization/sub\"\n ],\n updateOidcCustomSubTemplateForOrg: [\n \"PUT /orgs/{org}/actions/oidc/customization/sub\"\n ]\n },\n orgs: {\n addSecurityManagerTeam: [\n \"PUT /orgs/{org}/security-managers/teams/{team_slug}\"\n ],\n assignTeamToOrgRole: [\n \"PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}\"\n ],\n assignUserToOrgRole: [\n \"PUT /orgs/{org}/organization-roles/users/{username}/{role_id}\"\n ],\n blockUser: [\"PUT /orgs/{org}/blocks/{username}\"],\n cancelInvitation: [\"DELETE /orgs/{org}/invitations/{invitation_id}\"],\n checkBlockedUser: [\"GET /orgs/{org}/blocks/{username}\"],\n checkMembershipForUser: [\"GET /orgs/{org}/members/{username}\"],\n checkPublicMembershipForUser: [\"GET /orgs/{org}/public_members/{username}\"],\n convertMemberToOutsideCollaborator: [\n \"PUT /orgs/{org}/outside_collaborators/{username}\"\n ],\n createCustomOrganizationRole: [\"POST /orgs/{org}/organization-roles\"],\n createInvitation: [\"POST /orgs/{org}/invitations\"],\n createOrUpdateCustomProperties: [\"PATCH /orgs/{org}/properties/schema\"],\n createOrUpdateCustomPropertiesValuesForRepos: [\n \"PATCH /orgs/{org}/properties/values\"\n ],\n createOrUpdateCustomProperty: [\n \"PUT /orgs/{org}/properties/schema/{custom_property_name}\"\n ],\n createWebhook: [\"POST /orgs/{org}/hooks\"],\n delete: [\"DELETE /orgs/{org}\"],\n deleteCustomOrganizationRole: [\n \"DELETE /orgs/{org}/organization-roles/{role_id}\"\n ],\n deleteWebhook: [\"DELETE /orgs/{org}/hooks/{hook_id}\"],\n enableOrDisableSecurityProductOnAllOrgRepos: [\n \"POST /orgs/{org}/{security_product}/{enablement}\"\n ],\n get: [\"GET /orgs/{org}\"],\n getAllCustomProperties: [\"GET /orgs/{org}/properties/schema\"],\n getCustomProperty: [\n \"GET /orgs/{org}/properties/schema/{custom_property_name}\"\n ],\n getMembershipForAuthenticatedUser: [\"GET /user/memberships/orgs/{org}\"],\n getMembershipForUser: [\"GET /orgs/{org}/memberships/{username}\"],\n getOrgRole: [\"GET /orgs/{org}/organization-roles/{role_id}\"],\n getWebhook: [\"GET /orgs/{org}/hooks/{hook_id}\"],\n getWebhookConfigForOrg: [\"GET /orgs/{org}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\n \"GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}\"\n ],\n list: [\"GET /organizations\"],\n listAppInstallations: [\"GET /orgs/{org}/installations\"],\n listBlockedUsers: [\"GET /orgs/{org}/blocks\"],\n listCustomPropertiesValuesForRepos: [\"GET /orgs/{org}/properties/values\"],\n listFailedInvitations: [\"GET /orgs/{org}/failed_invitations\"],\n listForAuthenticatedUser: [\"GET /user/orgs\"],\n listForUser: [\"GET /users/{username}/orgs\"],\n listInvitationTeams: [\"GET /orgs/{org}/invitations/{invitation_id}/teams\"],\n listMembers: [\"GET /orgs/{org}/members\"],\n listMembershipsForAuthenticatedUser: [\"GET /user/memberships/orgs\"],\n listOrgRoleTeams: [\"GET /orgs/{org}/organization-roles/{role_id}/teams\"],\n listOrgRoleUsers: [\"GET /orgs/{org}/organization-roles/{role_id}/users\"],\n listOrgRoles: [\"GET /orgs/{org}/organization-roles\"],\n listOrganizationFineGrainedPermissions: [\n \"GET /orgs/{org}/organization-fine-grained-permissions\"\n ],\n listOutsideCollaborators: [\"GET /orgs/{org}/outside_collaborators\"],\n listPatGrantRepositories: [\n \"GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories\"\n ],\n listPatGrantRequestRepositories: [\n \"GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories\"\n ],\n listPatGrantRequests: [\"GET /orgs/{org}/personal-access-token-requests\"],\n listPatGrants: [\"GET /orgs/{org}/personal-access-tokens\"],\n listPendingInvitations: [\"GET /orgs/{org}/invitations\"],\n listPublicMembers: [\"GET /orgs/{org}/public_members\"],\n listSecurityManagerTeams: [\"GET /orgs/{org}/security-managers\"],\n listWebhookDeliveries: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /orgs/{org}/hooks\"],\n patchCustomOrganizationRole: [\n \"PATCH /orgs/{org}/organization-roles/{role_id}\"\n ],\n pingWebhook: [\"POST /orgs/{org}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\n \"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"\n ],\n removeCustomProperty: [\n \"DELETE /orgs/{org}/properties/schema/{custom_property_name}\"\n ],\n removeMember: [\"DELETE /orgs/{org}/members/{username}\"],\n removeMembershipForUser: [\"DELETE /orgs/{org}/memberships/{username}\"],\n removeOutsideCollaborator: [\n \"DELETE /orgs/{org}/outside_collaborators/{username}\"\n ],\n removePublicMembershipForAuthenticatedUser: [\n \"DELETE /orgs/{org}/public_members/{username}\"\n ],\n removeSecurityManagerTeam: [\n \"DELETE /orgs/{org}/security-managers/teams/{team_slug}\"\n ],\n reviewPatGrantRequest: [\n \"POST /orgs/{org}/personal-access-token-requests/{pat_request_id}\"\n ],\n reviewPatGrantRequestsInBulk: [\n \"POST /orgs/{org}/personal-access-token-requests\"\n ],\n revokeAllOrgRolesTeam: [\n \"DELETE /orgs/{org}/organization-roles/teams/{team_slug}\"\n ],\n revokeAllOrgRolesUser: [\n \"DELETE /orgs/{org}/organization-roles/users/{username}\"\n ],\n revokeOrgRoleTeam: [\n \"DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}\"\n ],\n revokeOrgRoleUser: [\n \"DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}\"\n ],\n setMembershipForUser: [\"PUT /orgs/{org}/memberships/{username}\"],\n setPublicMembershipForAuthenticatedUser: [\n \"PUT /orgs/{org}/public_members/{username}\"\n ],\n unblockUser: [\"DELETE /orgs/{org}/blocks/{username}\"],\n update: [\"PATCH /orgs/{org}\"],\n updateMembershipForAuthenticatedUser: [\n \"PATCH /user/memberships/orgs/{org}\"\n ],\n updatePatAccess: [\"POST /orgs/{org}/personal-access-tokens/{pat_id}\"],\n updatePatAccesses: [\"POST /orgs/{org}/personal-access-tokens\"],\n updateWebhook: [\"PATCH /orgs/{org}/hooks/{hook_id}\"],\n updateWebhookConfigForOrg: [\"PATCH /orgs/{org}/hooks/{hook_id}/config\"]\n },\n packages: {\n deletePackageForAuthenticatedUser: [\n \"DELETE /user/packages/{package_type}/{package_name}\"\n ],\n deletePackageForOrg: [\n \"DELETE /orgs/{org}/packages/{package_type}/{package_name}\"\n ],\n deletePackageForUser: [\n \"DELETE /users/{username}/packages/{package_type}/{package_name}\"\n ],\n deletePackageVersionForAuthenticatedUser: [\n \"DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"\n ],\n deletePackageVersionForOrg: [\n \"DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"\n ],\n deletePackageVersionForUser: [\n \"DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"\n ],\n getAllPackageVersionsForAPackageOwnedByAnOrg: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\",\n {},\n { renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByOrg\"] }\n ],\n getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}/versions\",\n {},\n {\n renamed: [\n \"packages\",\n \"getAllPackageVersionsForPackageOwnedByAuthenticatedUser\"\n ]\n }\n ],\n getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}/versions\"\n ],\n getAllPackageVersionsForPackageOwnedByOrg: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\"\n ],\n getAllPackageVersionsForPackageOwnedByUser: [\n \"GET /users/{username}/packages/{package_type}/{package_name}/versions\"\n ],\n getPackageForAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}\"\n ],\n getPackageForOrganization: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}\"\n ],\n getPackageForUser: [\n \"GET /users/{username}/packages/{package_type}/{package_name}\"\n ],\n getPackageVersionForAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"\n ],\n getPackageVersionForOrganization: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"\n ],\n getPackageVersionForUser: [\n \"GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"\n ],\n listDockerMigrationConflictingPackagesForAuthenticatedUser: [\n \"GET /user/docker/conflicts\"\n ],\n listDockerMigrationConflictingPackagesForOrganization: [\n \"GET /orgs/{org}/docker/conflicts\"\n ],\n listDockerMigrationConflictingPackagesForUser: [\n \"GET /users/{username}/docker/conflicts\"\n ],\n listPackagesForAuthenticatedUser: [\"GET /user/packages\"],\n listPackagesForOrganization: [\"GET /orgs/{org}/packages\"],\n listPackagesForUser: [\"GET /users/{username}/packages\"],\n restorePackageForAuthenticatedUser: [\n \"POST /user/packages/{package_type}/{package_name}/restore{?token}\"\n ],\n restorePackageForOrg: [\n \"POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}\"\n ],\n restorePackageForUser: [\n \"POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}\"\n ],\n restorePackageVersionForAuthenticatedUser: [\n \"POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"\n ],\n restorePackageVersionForOrg: [\n \"POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"\n ],\n restorePackageVersionForUser: [\n \"POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"\n ]\n },\n projects: {\n addCollaborator: [\"PUT /projects/{project_id}/collaborators/{username}\"],\n createCard: [\"POST /projects/columns/{column_id}/cards\"],\n createColumn: [\"POST /projects/{project_id}/columns\"],\n createForAuthenticatedUser: [\"POST /user/projects\"],\n createForOrg: [\"POST /orgs/{org}/projects\"],\n createForRepo: [\"POST /repos/{owner}/{repo}/projects\"],\n delete: [\"DELETE /projects/{project_id}\"],\n deleteCard: [\"DELETE /projects/columns/cards/{card_id}\"],\n deleteColumn: [\"DELETE /projects/columns/{column_id}\"],\n get: [\"GET /projects/{project_id}\"],\n getCard: [\"GET /projects/columns/cards/{card_id}\"],\n getColumn: [\"GET /projects/columns/{column_id}\"],\n getPermissionForUser: [\n \"GET /projects/{project_id}/collaborators/{username}/permission\"\n ],\n listCards: [\"GET /projects/columns/{column_id}/cards\"],\n listCollaborators: [\"GET /projects/{project_id}/collaborators\"],\n listColumns: [\"GET /projects/{project_id}/columns\"],\n listForOrg: [\"GET /orgs/{org}/projects\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/projects\"],\n listForUser: [\"GET /users/{username}/projects\"],\n moveCard: [\"POST /projects/columns/cards/{card_id}/moves\"],\n moveColumn: [\"POST /projects/columns/{column_id}/moves\"],\n removeCollaborator: [\n \"DELETE /projects/{project_id}/collaborators/{username}\"\n ],\n update: [\"PATCH /projects/{project_id}\"],\n updateCard: [\"PATCH /projects/columns/cards/{card_id}\"],\n updateColumn: [\"PATCH /projects/columns/{column_id}\"]\n },\n pulls: {\n checkIfMerged: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n create: [\"POST /repos/{owner}/{repo}/pulls\"],\n createReplyForReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\"\n ],\n createReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n createReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\"\n ],\n deletePendingReview: [\n \"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"\n ],\n deleteReviewComment: [\n \"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\"\n ],\n dismissReview: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\"\n ],\n get: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}\"],\n getReview: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"\n ],\n getReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n list: [\"GET /repos/{owner}/{repo}/pulls\"],\n listCommentsForReview: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\"\n ],\n listCommits: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\"],\n listFiles: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\"],\n listRequestedReviewers: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"\n ],\n listReviewComments: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\"\n ],\n listReviewCommentsForRepo: [\"GET /repos/{owner}/{repo}/pulls/comments\"],\n listReviews: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n merge: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n removeRequestedReviewers: [\n \"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"\n ],\n requestReviewers: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"\n ],\n submitReview: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\"\n ],\n update: [\"PATCH /repos/{owner}/{repo}/pulls/{pull_number}\"],\n updateBranch: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\"\n ],\n updateReview: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"\n ],\n updateReviewComment: [\n \"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\"\n ]\n },\n rateLimit: { get: [\"GET /rate_limit\"] },\n reactions: {\n createForCommitComment: [\n \"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\"\n ],\n createForIssue: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\"\n ],\n createForIssueComment: [\n \"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"\n ],\n createForPullRequestReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"\n ],\n createForRelease: [\n \"POST /repos/{owner}/{repo}/releases/{release_id}/reactions\"\n ],\n createForTeamDiscussionCommentInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"\n ],\n createForTeamDiscussionInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"\n ],\n deleteForCommitComment: [\n \"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\"\n ],\n deleteForIssue: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\"\n ],\n deleteForIssueComment: [\n \"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\"\n ],\n deleteForPullRequestComment: [\n \"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\"\n ],\n deleteForRelease: [\n \"DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}\"\n ],\n deleteForTeamDiscussion: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\"\n ],\n deleteForTeamDiscussionComment: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\"\n ],\n listForCommitComment: [\n \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\"\n ],\n listForIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n listForIssueComment: [\n \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"\n ],\n listForPullRequestReviewComment: [\n \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"\n ],\n listForRelease: [\n \"GET /repos/{owner}/{repo}/releases/{release_id}/reactions\"\n ],\n listForTeamDiscussionCommentInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"\n ],\n listForTeamDiscussionInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"\n ]\n },\n repos: {\n acceptInvitation: [\n \"PATCH /user/repository_invitations/{invitation_id}\",\n {},\n { renamed: [\"repos\", \"acceptInvitationForAuthenticatedUser\"] }\n ],\n acceptInvitationForAuthenticatedUser: [\n \"PATCH /user/repository_invitations/{invitation_id}\"\n ],\n addAppAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" }\n ],\n addCollaborator: [\"PUT /repos/{owner}/{repo}/collaborators/{username}\"],\n addStatusCheckContexts: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" }\n ],\n addTeamAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" }\n ],\n addUserAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" }\n ],\n cancelPagesDeployment: [\n \"POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel\"\n ],\n checkAutomatedSecurityFixes: [\n \"GET /repos/{owner}/{repo}/automated-security-fixes\"\n ],\n checkCollaborator: [\"GET /repos/{owner}/{repo}/collaborators/{username}\"],\n checkVulnerabilityAlerts: [\n \"GET /repos/{owner}/{repo}/vulnerability-alerts\"\n ],\n codeownersErrors: [\"GET /repos/{owner}/{repo}/codeowners/errors\"],\n compareCommits: [\"GET /repos/{owner}/{repo}/compare/{base}...{head}\"],\n compareCommitsWithBasehead: [\n \"GET /repos/{owner}/{repo}/compare/{basehead}\"\n ],\n createAutolink: [\"POST /repos/{owner}/{repo}/autolinks\"],\n createCommitComment: [\n \"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\"\n ],\n createCommitSignatureProtection: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"\n ],\n createCommitStatus: [\"POST /repos/{owner}/{repo}/statuses/{sha}\"],\n createDeployKey: [\"POST /repos/{owner}/{repo}/keys\"],\n createDeployment: [\"POST /repos/{owner}/{repo}/deployments\"],\n createDeploymentBranchPolicy: [\n \"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\"\n ],\n createDeploymentProtectionRule: [\n \"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules\"\n ],\n createDeploymentStatus: [\n \"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"\n ],\n createDispatchEvent: [\"POST /repos/{owner}/{repo}/dispatches\"],\n createForAuthenticatedUser: [\"POST /user/repos\"],\n createFork: [\"POST /repos/{owner}/{repo}/forks\"],\n createInOrg: [\"POST /orgs/{org}/repos\"],\n createOrUpdateCustomPropertiesValues: [\n \"PATCH /repos/{owner}/{repo}/properties/values\"\n ],\n createOrUpdateEnvironment: [\n \"PUT /repos/{owner}/{repo}/environments/{environment_name}\"\n ],\n createOrUpdateFileContents: [\"PUT /repos/{owner}/{repo}/contents/{path}\"],\n createOrgRuleset: [\"POST /orgs/{org}/rulesets\"],\n createPagesDeployment: [\"POST /repos/{owner}/{repo}/pages/deployments\"],\n createPagesSite: [\"POST /repos/{owner}/{repo}/pages\"],\n createRelease: [\"POST /repos/{owner}/{repo}/releases\"],\n createRepoRuleset: [\"POST /repos/{owner}/{repo}/rulesets\"],\n createTagProtection: [\"POST /repos/{owner}/{repo}/tags/protection\"],\n createUsingTemplate: [\n \"POST /repos/{template_owner}/{template_repo}/generate\"\n ],\n createWebhook: [\"POST /repos/{owner}/{repo}/hooks\"],\n declineInvitation: [\n \"DELETE /user/repository_invitations/{invitation_id}\",\n {},\n { renamed: [\"repos\", \"declineInvitationForAuthenticatedUser\"] }\n ],\n declineInvitationForAuthenticatedUser: [\n \"DELETE /user/repository_invitations/{invitation_id}\"\n ],\n delete: [\"DELETE /repos/{owner}/{repo}\"],\n deleteAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"\n ],\n deleteAdminBranchProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"\n ],\n deleteAnEnvironment: [\n \"DELETE /repos/{owner}/{repo}/environments/{environment_name}\"\n ],\n deleteAutolink: [\"DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n deleteBranchProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection\"\n ],\n deleteCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}\"],\n deleteCommitSignatureProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"\n ],\n deleteDeployKey: [\"DELETE /repos/{owner}/{repo}/keys/{key_id}\"],\n deleteDeployment: [\n \"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\"\n ],\n deleteDeploymentBranchPolicy: [\n \"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\"\n ],\n deleteFile: [\"DELETE /repos/{owner}/{repo}/contents/{path}\"],\n deleteInvitation: [\n \"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\"\n ],\n deleteOrgRuleset: [\"DELETE /orgs/{org}/rulesets/{ruleset_id}\"],\n deletePagesSite: [\"DELETE /repos/{owner}/{repo}/pages\"],\n deletePullRequestReviewProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"\n ],\n deleteRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}\"],\n deleteReleaseAsset: [\n \"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\"\n ],\n deleteRepoRuleset: [\"DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}\"],\n deleteTagProtection: [\n \"DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}\"\n ],\n deleteWebhook: [\"DELETE /repos/{owner}/{repo}/hooks/{hook_id}\"],\n disableAutomatedSecurityFixes: [\n \"DELETE /repos/{owner}/{repo}/automated-security-fixes\"\n ],\n disableDeploymentProtectionRule: [\n \"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}\"\n ],\n disablePrivateVulnerabilityReporting: [\n \"DELETE /repos/{owner}/{repo}/private-vulnerability-reporting\"\n ],\n disableVulnerabilityAlerts: [\n \"DELETE /repos/{owner}/{repo}/vulnerability-alerts\"\n ],\n downloadArchive: [\n \"GET /repos/{owner}/{repo}/zipball/{ref}\",\n {},\n { renamed: [\"repos\", \"downloadZipballArchive\"] }\n ],\n downloadTarballArchive: [\"GET /repos/{owner}/{repo}/tarball/{ref}\"],\n downloadZipballArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\"],\n enableAutomatedSecurityFixes: [\n \"PUT /repos/{owner}/{repo}/automated-security-fixes\"\n ],\n enablePrivateVulnerabilityReporting: [\n \"PUT /repos/{owner}/{repo}/private-vulnerability-reporting\"\n ],\n enableVulnerabilityAlerts: [\n \"PUT /repos/{owner}/{repo}/vulnerability-alerts\"\n ],\n generateReleaseNotes: [\n \"POST /repos/{owner}/{repo}/releases/generate-notes\"\n ],\n get: [\"GET /repos/{owner}/{repo}\"],\n getAccessRestrictions: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"\n ],\n getAdminBranchProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"\n ],\n getAllDeploymentProtectionRules: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules\"\n ],\n getAllEnvironments: [\"GET /repos/{owner}/{repo}/environments\"],\n getAllStatusCheckContexts: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\"\n ],\n getAllTopics: [\"GET /repos/{owner}/{repo}/topics\"],\n getAppsWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\"\n ],\n getAutolink: [\"GET /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n getBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}\"],\n getBranchProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection\"\n ],\n getBranchRules: [\"GET /repos/{owner}/{repo}/rules/branches/{branch}\"],\n getClones: [\"GET /repos/{owner}/{repo}/traffic/clones\"],\n getCodeFrequencyStats: [\"GET /repos/{owner}/{repo}/stats/code_frequency\"],\n getCollaboratorPermissionLevel: [\n \"GET /repos/{owner}/{repo}/collaborators/{username}/permission\"\n ],\n getCombinedStatusForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/status\"],\n getCommit: [\"GET /repos/{owner}/{repo}/commits/{ref}\"],\n getCommitActivityStats: [\"GET /repos/{owner}/{repo}/stats/commit_activity\"],\n getCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}\"],\n getCommitSignatureProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"\n ],\n getCommunityProfileMetrics: [\"GET /repos/{owner}/{repo}/community/profile\"],\n getContent: [\"GET /repos/{owner}/{repo}/contents/{path}\"],\n getContributorsStats: [\"GET /repos/{owner}/{repo}/stats/contributors\"],\n getCustomDeploymentProtectionRule: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}\"\n ],\n getCustomPropertiesValues: [\"GET /repos/{owner}/{repo}/properties/values\"],\n getDeployKey: [\"GET /repos/{owner}/{repo}/keys/{key_id}\"],\n getDeployment: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n getDeploymentBranchPolicy: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\"\n ],\n getDeploymentStatus: [\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\"\n ],\n getEnvironment: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}\"\n ],\n getLatestPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/latest\"],\n getLatestRelease: [\"GET /repos/{owner}/{repo}/releases/latest\"],\n getOrgRuleSuite: [\"GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}\"],\n getOrgRuleSuites: [\"GET /orgs/{org}/rulesets/rule-suites\"],\n getOrgRuleset: [\"GET /orgs/{org}/rulesets/{ruleset_id}\"],\n getOrgRulesets: [\"GET /orgs/{org}/rulesets\"],\n getPages: [\"GET /repos/{owner}/{repo}/pages\"],\n getPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/{build_id}\"],\n getPagesDeployment: [\n \"GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}\"\n ],\n getPagesHealthCheck: [\"GET /repos/{owner}/{repo}/pages/health\"],\n getParticipationStats: [\"GET /repos/{owner}/{repo}/stats/participation\"],\n getPullRequestReviewProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"\n ],\n getPunchCardStats: [\"GET /repos/{owner}/{repo}/stats/punch_card\"],\n getReadme: [\"GET /repos/{owner}/{repo}/readme\"],\n getReadmeInDirectory: [\"GET /repos/{owner}/{repo}/readme/{dir}\"],\n getRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}\"],\n getReleaseAsset: [\"GET /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n getReleaseByTag: [\"GET /repos/{owner}/{repo}/releases/tags/{tag}\"],\n getRepoRuleSuite: [\n \"GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}\"\n ],\n getRepoRuleSuites: [\"GET /repos/{owner}/{repo}/rulesets/rule-suites\"],\n getRepoRuleset: [\"GET /repos/{owner}/{repo}/rulesets/{ruleset_id}\"],\n getRepoRulesets: [\"GET /repos/{owner}/{repo}/rulesets\"],\n getStatusChecksProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"\n ],\n getTeamsWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\"\n ],\n getTopPaths: [\"GET /repos/{owner}/{repo}/traffic/popular/paths\"],\n getTopReferrers: [\"GET /repos/{owner}/{repo}/traffic/popular/referrers\"],\n getUsersWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\"\n ],\n getViews: [\"GET /repos/{owner}/{repo}/traffic/views\"],\n getWebhook: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}\"],\n getWebhookConfigForRepo: [\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/config\"\n ],\n getWebhookDelivery: [\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}\"\n ],\n listActivities: [\"GET /repos/{owner}/{repo}/activity\"],\n listAutolinks: [\"GET /repos/{owner}/{repo}/autolinks\"],\n listBranches: [\"GET /repos/{owner}/{repo}/branches\"],\n listBranchesForHeadCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\"\n ],\n listCollaborators: [\"GET /repos/{owner}/{repo}/collaborators\"],\n listCommentsForCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\"\n ],\n listCommitCommentsForRepo: [\"GET /repos/{owner}/{repo}/comments\"],\n listCommitStatusesForRef: [\n \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\"\n ],\n listCommits: [\"GET /repos/{owner}/{repo}/commits\"],\n listContributors: [\"GET /repos/{owner}/{repo}/contributors\"],\n listCustomDeploymentRuleIntegrations: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps\"\n ],\n listDeployKeys: [\"GET /repos/{owner}/{repo}/keys\"],\n listDeploymentBranchPolicies: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\"\n ],\n listDeploymentStatuses: [\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"\n ],\n listDeployments: [\"GET /repos/{owner}/{repo}/deployments\"],\n listForAuthenticatedUser: [\"GET /user/repos\"],\n listForOrg: [\"GET /orgs/{org}/repos\"],\n listForUser: [\"GET /users/{username}/repos\"],\n listForks: [\"GET /repos/{owner}/{repo}/forks\"],\n listInvitations: [\"GET /repos/{owner}/{repo}/invitations\"],\n listInvitationsForAuthenticatedUser: [\"GET /user/repository_invitations\"],\n listLanguages: [\"GET /repos/{owner}/{repo}/languages\"],\n listPagesBuilds: [\"GET /repos/{owner}/{repo}/pages/builds\"],\n listPublic: [\"GET /repositories\"],\n listPullRequestsAssociatedWithCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\"\n ],\n listReleaseAssets: [\n \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\"\n ],\n listReleases: [\"GET /repos/{owner}/{repo}/releases\"],\n listTagProtection: [\"GET /repos/{owner}/{repo}/tags/protection\"],\n listTags: [\"GET /repos/{owner}/{repo}/tags\"],\n listTeams: [\"GET /repos/{owner}/{repo}/teams\"],\n listWebhookDeliveries: [\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\"\n ],\n listWebhooks: [\"GET /repos/{owner}/{repo}/hooks\"],\n merge: [\"POST /repos/{owner}/{repo}/merges\"],\n mergeUpstream: [\"POST /repos/{owner}/{repo}/merge-upstream\"],\n pingWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\n \"POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"\n ],\n removeAppAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" }\n ],\n removeCollaborator: [\n \"DELETE /repos/{owner}/{repo}/collaborators/{username}\"\n ],\n removeStatusCheckContexts: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" }\n ],\n removeStatusCheckProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"\n ],\n removeTeamAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" }\n ],\n removeUserAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" }\n ],\n renameBranch: [\"POST /repos/{owner}/{repo}/branches/{branch}/rename\"],\n replaceAllTopics: [\"PUT /repos/{owner}/{repo}/topics\"],\n requestPagesBuild: [\"POST /repos/{owner}/{repo}/pages/builds\"],\n setAdminBranchProtection: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"\n ],\n setAppAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" }\n ],\n setStatusCheckContexts: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" }\n ],\n setTeamAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" }\n ],\n setUserAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" }\n ],\n testPushWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\"],\n transfer: [\"POST /repos/{owner}/{repo}/transfer\"],\n update: [\"PATCH /repos/{owner}/{repo}\"],\n updateBranchProtection: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection\"\n ],\n updateCommitComment: [\"PATCH /repos/{owner}/{repo}/comments/{comment_id}\"],\n updateDeploymentBranchPolicy: [\n \"PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\"\n ],\n updateInformationAboutPagesSite: [\"PUT /repos/{owner}/{repo}/pages\"],\n updateInvitation: [\n \"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\"\n ],\n updateOrgRuleset: [\"PUT /orgs/{org}/rulesets/{ruleset_id}\"],\n updatePullRequestReviewProtection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"\n ],\n updateRelease: [\"PATCH /repos/{owner}/{repo}/releases/{release_id}\"],\n updateReleaseAsset: [\n \"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\"\n ],\n updateRepoRuleset: [\"PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}\"],\n updateStatusCheckPotection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n {},\n { renamed: [\"repos\", \"updateStatusCheckProtection\"] }\n ],\n updateStatusCheckProtection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"\n ],\n updateWebhook: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}\"],\n updateWebhookConfigForRepo: [\n \"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\"\n ],\n uploadReleaseAsset: [\n \"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}\",\n { baseUrl: \"https://uploads.github.com\" }\n ]\n },\n search: {\n code: [\"GET /search/code\"],\n commits: [\"GET /search/commits\"],\n issuesAndPullRequests: [\"GET /search/issues\"],\n labels: [\"GET /search/labels\"],\n repos: [\"GET /search/repositories\"],\n topics: [\"GET /search/topics\"],\n users: [\"GET /search/users\"]\n },\n secretScanning: {\n getAlert: [\n \"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"\n ],\n listAlertsForEnterprise: [\n \"GET /enterprises/{enterprise}/secret-scanning/alerts\"\n ],\n listAlertsForOrg: [\"GET /orgs/{org}/secret-scanning/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts\"],\n listLocationsForAlert: [\n \"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations\"\n ],\n updateAlert: [\n \"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"\n ]\n },\n securityAdvisories: {\n createFork: [\n \"POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks\"\n ],\n createPrivateVulnerabilityReport: [\n \"POST /repos/{owner}/{repo}/security-advisories/reports\"\n ],\n createRepositoryAdvisory: [\n \"POST /repos/{owner}/{repo}/security-advisories\"\n ],\n createRepositoryAdvisoryCveRequest: [\n \"POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve\"\n ],\n getGlobalAdvisory: [\"GET /advisories/{ghsa_id}\"],\n getRepositoryAdvisory: [\n \"GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}\"\n ],\n listGlobalAdvisories: [\"GET /advisories\"],\n listOrgRepositoryAdvisories: [\"GET /orgs/{org}/security-advisories\"],\n listRepositoryAdvisories: [\"GET /repos/{owner}/{repo}/security-advisories\"],\n updateRepositoryAdvisory: [\n \"PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}\"\n ]\n },\n teams: {\n addOrUpdateMembershipForUserInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\"\n ],\n addOrUpdateProjectPermissionsInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\"\n ],\n addOrUpdateRepoPermissionsInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"\n ],\n checkPermissionsForProjectInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\"\n ],\n checkPermissionsForRepoInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"\n ],\n create: [\"POST /orgs/{org}/teams\"],\n createDiscussionCommentInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"\n ],\n createDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions\"],\n deleteDiscussionCommentInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"\n ],\n deleteDiscussionInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"\n ],\n deleteInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}\"],\n getByName: [\"GET /orgs/{org}/teams/{team_slug}\"],\n getDiscussionCommentInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"\n ],\n getDiscussionInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"\n ],\n getMembershipForUserInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/memberships/{username}\"\n ],\n list: [\"GET /orgs/{org}/teams\"],\n listChildInOrg: [\"GET /orgs/{org}/teams/{team_slug}/teams\"],\n listDiscussionCommentsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"\n ],\n listDiscussionsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions\"],\n listForAuthenticatedUser: [\"GET /user/teams\"],\n listMembersInOrg: [\"GET /orgs/{org}/teams/{team_slug}/members\"],\n listPendingInvitationsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/invitations\"\n ],\n listProjectsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects\"],\n listReposInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos\"],\n removeMembershipForUserInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\"\n ],\n removeProjectInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\"\n ],\n removeRepoInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"\n ],\n updateDiscussionCommentInOrg: [\n \"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"\n ],\n updateDiscussionInOrg: [\n \"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"\n ],\n updateInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}\"]\n },\n users: {\n addEmailForAuthenticated: [\n \"POST /user/emails\",\n {},\n { renamed: [\"users\", \"addEmailForAuthenticatedUser\"] }\n ],\n addEmailForAuthenticatedUser: [\"POST /user/emails\"],\n addSocialAccountForAuthenticatedUser: [\"POST /user/social_accounts\"],\n block: [\"PUT /user/blocks/{username}\"],\n checkBlocked: [\"GET /user/blocks/{username}\"],\n checkFollowingForUser: [\"GET /users/{username}/following/{target_user}\"],\n checkPersonIsFollowedByAuthenticated: [\"GET /user/following/{username}\"],\n createGpgKeyForAuthenticated: [\n \"POST /user/gpg_keys\",\n {},\n { renamed: [\"users\", \"createGpgKeyForAuthenticatedUser\"] }\n ],\n createGpgKeyForAuthenticatedUser: [\"POST /user/gpg_keys\"],\n createPublicSshKeyForAuthenticated: [\n \"POST /user/keys\",\n {},\n { renamed: [\"users\", \"createPublicSshKeyForAuthenticatedUser\"] }\n ],\n createPublicSshKeyForAuthenticatedUser: [\"POST /user/keys\"],\n createSshSigningKeyForAuthenticatedUser: [\"POST /user/ssh_signing_keys\"],\n deleteEmailForAuthenticated: [\n \"DELETE /user/emails\",\n {},\n { renamed: [\"users\", \"deleteEmailForAuthenticatedUser\"] }\n ],\n deleteEmailForAuthenticatedUser: [\"DELETE /user/emails\"],\n deleteGpgKeyForAuthenticated: [\n \"DELETE /user/gpg_keys/{gpg_key_id}\",\n {},\n { renamed: [\"users\", \"deleteGpgKeyForAuthenticatedUser\"] }\n ],\n deleteGpgKeyForAuthenticatedUser: [\"DELETE /user/gpg_keys/{gpg_key_id}\"],\n deletePublicSshKeyForAuthenticated: [\n \"DELETE /user/keys/{key_id}\",\n {},\n { renamed: [\"users\", \"deletePublicSshKeyForAuthenticatedUser\"] }\n ],\n deletePublicSshKeyForAuthenticatedUser: [\"DELETE /user/keys/{key_id}\"],\n deleteSocialAccountForAuthenticatedUser: [\"DELETE /user/social_accounts\"],\n deleteSshSigningKeyForAuthenticatedUser: [\n \"DELETE /user/ssh_signing_keys/{ssh_signing_key_id}\"\n ],\n follow: [\"PUT /user/following/{username}\"],\n getAuthenticated: [\"GET /user\"],\n getByUsername: [\"GET /users/{username}\"],\n getContextForUser: [\"GET /users/{username}/hovercard\"],\n getGpgKeyForAuthenticated: [\n \"GET /user/gpg_keys/{gpg_key_id}\",\n {},\n { renamed: [\"users\", \"getGpgKeyForAuthenticatedUser\"] }\n ],\n getGpgKeyForAuthenticatedUser: [\"GET /user/gpg_keys/{gpg_key_id}\"],\n getPublicSshKeyForAuthenticated: [\n \"GET /user/keys/{key_id}\",\n {},\n { renamed: [\"users\", \"getPublicSshKeyForAuthenticatedUser\"] }\n ],\n getPublicSshKeyForAuthenticatedUser: [\"GET /user/keys/{key_id}\"],\n getSshSigningKeyForAuthenticatedUser: [\n \"GET /user/ssh_signing_keys/{ssh_signing_key_id}\"\n ],\n list: [\"GET /users\"],\n listBlockedByAuthenticated: [\n \"GET /user/blocks\",\n {},\n { renamed: [\"users\", \"listBlockedByAuthenticatedUser\"] }\n ],\n listBlockedByAuthenticatedUser: [\"GET /user/blocks\"],\n listEmailsForAuthenticated: [\n \"GET /user/emails\",\n {},\n { renamed: [\"users\", \"listEmailsForAuthenticatedUser\"] }\n ],\n listEmailsForAuthenticatedUser: [\"GET /user/emails\"],\n listFollowedByAuthenticated: [\n \"GET /user/following\",\n {},\n { renamed: [\"users\", \"listFollowedByAuthenticatedUser\"] }\n ],\n listFollowedByAuthenticatedUser: [\"GET /user/following\"],\n listFollowersForAuthenticatedUser: [\"GET /user/followers\"],\n listFollowersForUser: [\"GET /users/{username}/followers\"],\n listFollowingForUser: [\"GET /users/{username}/following\"],\n listGpgKeysForAuthenticated: [\n \"GET /user/gpg_keys\",\n {},\n { renamed: [\"users\", \"listGpgKeysForAuthenticatedUser\"] }\n ],\n listGpgKeysForAuthenticatedUser: [\"GET /user/gpg_keys\"],\n listGpgKeysForUser: [\"GET /users/{username}/gpg_keys\"],\n listPublicEmailsForAuthenticated: [\n \"GET /user/public_emails\",\n {},\n { renamed: [\"users\", \"listPublicEmailsForAuthenticatedUser\"] }\n ],\n listPublicEmailsForAuthenticatedUser: [\"GET /user/public_emails\"],\n listPublicKeysForUser: [\"GET /users/{username}/keys\"],\n listPublicSshKeysForAuthenticated: [\n \"GET /user/keys\",\n {},\n { renamed: [\"users\", \"listPublicSshKeysForAuthenticatedUser\"] }\n ],\n listPublicSshKeysForAuthenticatedUser: [\"GET /user/keys\"],\n listSocialAccountsForAuthenticatedUser: [\"GET /user/social_accounts\"],\n listSocialAccountsForUser: [\"GET /users/{username}/social_accounts\"],\n listSshSigningKeysForAuthenticatedUser: [\"GET /user/ssh_signing_keys\"],\n listSshSigningKeysForUser: [\"GET /users/{username}/ssh_signing_keys\"],\n setPrimaryEmailVisibilityForAuthenticated: [\n \"PATCH /user/email/visibility\",\n {},\n { renamed: [\"users\", \"setPrimaryEmailVisibilityForAuthenticatedUser\"] }\n ],\n setPrimaryEmailVisibilityForAuthenticatedUser: [\n \"PATCH /user/email/visibility\"\n ],\n unblock: [\"DELETE /user/blocks/{username}\"],\n unfollow: [\"DELETE /user/following/{username}\"],\n updateAuthenticated: [\"PATCH /user\"]\n }\n};\nvar endpoints_default = Endpoints;\nexport {\n endpoints_default as default\n};\n","import ENDPOINTS from \"./generated/endpoints.js\";\nconst endpointMethodsMap = /* @__PURE__ */ new Map();\nfor (const [scope, endpoints] of Object.entries(ENDPOINTS)) {\n for (const [methodName, endpoint] of Object.entries(endpoints)) {\n const [route, defaults, decorations] = endpoint;\n const [method, url] = route.split(/ /);\n const endpointDefaults = Object.assign(\n {\n method,\n url\n },\n defaults\n );\n if (!endpointMethodsMap.has(scope)) {\n endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());\n }\n endpointMethodsMap.get(scope).set(methodName, {\n scope,\n methodName,\n endpointDefaults,\n decorations\n });\n }\n}\nconst handler = {\n has({ scope }, methodName) {\n return endpointMethodsMap.get(scope).has(methodName);\n },\n getOwnPropertyDescriptor(target, methodName) {\n return {\n value: this.get(target, methodName),\n // ensures method is in the cache\n configurable: true,\n writable: true,\n enumerable: true\n };\n },\n defineProperty(target, methodName, descriptor) {\n Object.defineProperty(target.cache, methodName, descriptor);\n return true;\n },\n deleteProperty(target, methodName) {\n delete target.cache[methodName];\n return true;\n },\n ownKeys({ scope }) {\n return [...endpointMethodsMap.get(scope).keys()];\n },\n set(target, methodName, value) {\n return target.cache[methodName] = value;\n },\n get({ octokit, scope, cache }, methodName) {\n if (cache[methodName]) {\n return cache[methodName];\n }\n const method = endpointMethodsMap.get(scope).get(methodName);\n if (!method) {\n return void 0;\n }\n const { endpointDefaults, decorations } = method;\n if (decorations) {\n cache[methodName] = decorate(\n octokit,\n scope,\n methodName,\n endpointDefaults,\n decorations\n );\n } else {\n cache[methodName] = octokit.request.defaults(endpointDefaults);\n }\n return cache[methodName];\n }\n};\nfunction endpointsToMethods(octokit) {\n const newMethods = {};\n for (const scope of endpointMethodsMap.keys()) {\n newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);\n }\n return newMethods;\n}\nfunction decorate(octokit, scope, methodName, defaults, decorations) {\n const requestWithDefaults = octokit.request.defaults(defaults);\n function withDecorations(...args) {\n let options = requestWithDefaults.endpoint.merge(...args);\n if (decorations.mapToData) {\n options = Object.assign({}, options, {\n data: options[decorations.mapToData],\n [decorations.mapToData]: void 0\n });\n return requestWithDefaults(options);\n }\n if (decorations.renamed) {\n const [newScope, newMethodName] = decorations.renamed;\n octokit.log.warn(\n `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`\n );\n }\n if (decorations.deprecated) {\n octokit.log.warn(decorations.deprecated);\n }\n if (decorations.renamedParameters) {\n const options2 = requestWithDefaults.endpoint.merge(...args);\n for (const [name, alias] of Object.entries(\n decorations.renamedParameters\n )) {\n if (name in options2) {\n octokit.log.warn(\n `\"${name}\" parameter is deprecated for \"octokit.${scope}.${methodName}()\". Use \"${alias}\" instead`\n );\n if (!(alias in options2)) {\n options2[alias] = options2[name];\n }\n delete options2[name];\n }\n }\n return requestWithDefaults(options2);\n }\n return requestWithDefaults(...args);\n }\n return Object.assign(withDecorations, requestWithDefaults);\n}\nexport {\n endpointsToMethods\n};\n","import { VERSION } from \"./version.js\";\nimport { endpointsToMethods } from \"./endpoints-to-methods.js\";\nfunction restEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit);\n return {\n rest: api\n };\n}\nrestEndpointMethods.VERSION = VERSION;\nfunction legacyRestEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit);\n return {\n ...api,\n rest: api\n };\n}\nlegacyRestEndpointMethods.VERSION = VERSION;\nexport {\n legacyRestEndpointMethods,\n restEndpointMethods\n};\n","// pkg/dist-src/version.js\nvar VERSION = \"9.2.2\";\n\n// pkg/dist-src/normalize-paginated-list-response.js\nfunction normalizePaginatedListResponse(response) {\n if (!response.data) {\n return {\n ...response,\n data: []\n };\n }\n const responseNeedsNormalization = \"total_count\" in response.data && !(\"url\" in response.data);\n if (!responseNeedsNormalization)\n return response;\n const incompleteResults = response.data.incomplete_results;\n const repositorySelection = response.data.repository_selection;\n const totalCount = response.data.total_count;\n delete response.data.incomplete_results;\n delete response.data.repository_selection;\n delete response.data.total_count;\n const namespaceKey = Object.keys(response.data)[0];\n const data = response.data[namespaceKey];\n response.data = data;\n if (typeof incompleteResults !== \"undefined\") {\n response.data.incomplete_results = incompleteResults;\n }\n if (typeof repositorySelection !== \"undefined\") {\n response.data.repository_selection = repositorySelection;\n }\n response.data.total_count = totalCount;\n return response;\n}\n\n// pkg/dist-src/iterator.js\nfunction iterator(octokit, route, parameters) {\n const options = typeof route === \"function\" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);\n const requestMethod = typeof route === \"function\" ? route : octokit.request;\n const method = options.method;\n const headers = options.headers;\n let url = options.url;\n return {\n [Symbol.asyncIterator]: () => ({\n async next() {\n if (!url)\n return { done: true };\n try {\n const response = await requestMethod({ method, url, headers });\n const normalizedResponse = normalizePaginatedListResponse(response);\n url = ((normalizedResponse.headers.link || \"\").match(\n /<([^<>]+)>;\\s*rel=\"next\"/\n ) || [])[1];\n return { value: normalizedResponse };\n } catch (error) {\n if (error.status !== 409)\n throw error;\n url = \"\";\n return {\n value: {\n status: 200,\n headers: {},\n data: []\n }\n };\n }\n }\n })\n };\n}\n\n// pkg/dist-src/paginate.js\nfunction paginate(octokit, route, parameters, mapFn) {\n if (typeof parameters === \"function\") {\n mapFn = parameters;\n parameters = void 0;\n }\n return gather(\n octokit,\n [],\n iterator(octokit, route, parameters)[Symbol.asyncIterator](),\n mapFn\n );\n}\nfunction gather(octokit, results, iterator2, mapFn) {\n return iterator2.next().then((result) => {\n if (result.done) {\n return results;\n }\n let earlyExit = false;\n function done() {\n earlyExit = true;\n }\n results = results.concat(\n mapFn ? mapFn(result.value, done) : result.value.data\n );\n if (earlyExit) {\n return results;\n }\n return gather(octokit, results, iterator2, mapFn);\n });\n}\n\n// pkg/dist-src/compose-paginate.js\nvar composePaginateRest = Object.assign(paginate, {\n iterator\n});\n\n// pkg/dist-src/generated/paginating-endpoints.js\nvar paginatingEndpoints = [\n \"GET /advisories\",\n \"GET /app/hook/deliveries\",\n \"GET /app/installation-requests\",\n \"GET /app/installations\",\n \"GET /assignments/{assignment_id}/accepted_assignments\",\n \"GET /classrooms\",\n \"GET /classrooms/{classroom_id}/assignments\",\n \"GET /enterprises/{enterprise}/dependabot/alerts\",\n \"GET /enterprises/{enterprise}/secret-scanning/alerts\",\n \"GET /events\",\n \"GET /gists\",\n \"GET /gists/public\",\n \"GET /gists/starred\",\n \"GET /gists/{gist_id}/comments\",\n \"GET /gists/{gist_id}/commits\",\n \"GET /gists/{gist_id}/forks\",\n \"GET /installation/repositories\",\n \"GET /issues\",\n \"GET /licenses\",\n \"GET /marketplace_listing/plans\",\n \"GET /marketplace_listing/plans/{plan_id}/accounts\",\n \"GET /marketplace_listing/stubbed/plans\",\n \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\",\n \"GET /networks/{owner}/{repo}/events\",\n \"GET /notifications\",\n \"GET /organizations\",\n \"GET /orgs/{org}/actions/cache/usage-by-repository\",\n \"GET /orgs/{org}/actions/permissions/repositories\",\n \"GET /orgs/{org}/actions/runners\",\n \"GET /orgs/{org}/actions/secrets\",\n \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\",\n \"GET /orgs/{org}/actions/variables\",\n \"GET /orgs/{org}/actions/variables/{name}/repositories\",\n \"GET /orgs/{org}/blocks\",\n \"GET /orgs/{org}/code-scanning/alerts\",\n \"GET /orgs/{org}/codespaces\",\n \"GET /orgs/{org}/codespaces/secrets\",\n \"GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories\",\n \"GET /orgs/{org}/copilot/billing/seats\",\n \"GET /orgs/{org}/dependabot/alerts\",\n \"GET /orgs/{org}/dependabot/secrets\",\n \"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories\",\n \"GET /orgs/{org}/events\",\n \"GET /orgs/{org}/failed_invitations\",\n \"GET /orgs/{org}/hooks\",\n \"GET /orgs/{org}/hooks/{hook_id}/deliveries\",\n \"GET /orgs/{org}/installations\",\n \"GET /orgs/{org}/invitations\",\n \"GET /orgs/{org}/invitations/{invitation_id}/teams\",\n \"GET /orgs/{org}/issues\",\n \"GET /orgs/{org}/members\",\n \"GET /orgs/{org}/members/{username}/codespaces\",\n \"GET /orgs/{org}/migrations\",\n \"GET /orgs/{org}/migrations/{migration_id}/repositories\",\n \"GET /orgs/{org}/organization-roles/{role_id}/teams\",\n \"GET /orgs/{org}/organization-roles/{role_id}/users\",\n \"GET /orgs/{org}/outside_collaborators\",\n \"GET /orgs/{org}/packages\",\n \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\",\n \"GET /orgs/{org}/personal-access-token-requests\",\n \"GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories\",\n \"GET /orgs/{org}/personal-access-tokens\",\n \"GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories\",\n \"GET /orgs/{org}/projects\",\n \"GET /orgs/{org}/properties/values\",\n \"GET /orgs/{org}/public_members\",\n \"GET /orgs/{org}/repos\",\n \"GET /orgs/{org}/rulesets\",\n \"GET /orgs/{org}/rulesets/rule-suites\",\n \"GET /orgs/{org}/secret-scanning/alerts\",\n \"GET /orgs/{org}/security-advisories\",\n \"GET /orgs/{org}/teams\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\",\n \"GET /orgs/{org}/teams/{team_slug}/invitations\",\n \"GET /orgs/{org}/teams/{team_slug}/members\",\n \"GET /orgs/{org}/teams/{team_slug}/projects\",\n \"GET /orgs/{org}/teams/{team_slug}/repos\",\n \"GET /orgs/{org}/teams/{team_slug}/teams\",\n \"GET /projects/columns/{column_id}/cards\",\n \"GET /projects/{project_id}/collaborators\",\n \"GET /projects/{project_id}/columns\",\n \"GET /repos/{owner}/{repo}/actions/artifacts\",\n \"GET /repos/{owner}/{repo}/actions/caches\",\n \"GET /repos/{owner}/{repo}/actions/organization-secrets\",\n \"GET /repos/{owner}/{repo}/actions/organization-variables\",\n \"GET /repos/{owner}/{repo}/actions/runners\",\n \"GET /repos/{owner}/{repo}/actions/runs\",\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\",\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\",\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\",\n \"GET /repos/{owner}/{repo}/actions/secrets\",\n \"GET /repos/{owner}/{repo}/actions/variables\",\n \"GET /repos/{owner}/{repo}/actions/workflows\",\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\",\n \"GET /repos/{owner}/{repo}/activity\",\n \"GET /repos/{owner}/{repo}/assignees\",\n \"GET /repos/{owner}/{repo}/branches\",\n \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\",\n \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\",\n \"GET /repos/{owner}/{repo}/code-scanning/alerts\",\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\",\n \"GET /repos/{owner}/{repo}/code-scanning/analyses\",\n \"GET /repos/{owner}/{repo}/codespaces\",\n \"GET /repos/{owner}/{repo}/codespaces/devcontainers\",\n \"GET /repos/{owner}/{repo}/codespaces/secrets\",\n \"GET /repos/{owner}/{repo}/collaborators\",\n \"GET /repos/{owner}/{repo}/comments\",\n \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\",\n \"GET /repos/{owner}/{repo}/commits\",\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\",\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\",\n \"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\",\n \"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\",\n \"GET /repos/{owner}/{repo}/commits/{ref}/status\",\n \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\",\n \"GET /repos/{owner}/{repo}/contributors\",\n \"GET /repos/{owner}/{repo}/dependabot/alerts\",\n \"GET /repos/{owner}/{repo}/dependabot/secrets\",\n \"GET /repos/{owner}/{repo}/deployments\",\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\",\n \"GET /repos/{owner}/{repo}/environments\",\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\",\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps\",\n \"GET /repos/{owner}/{repo}/events\",\n \"GET /repos/{owner}/{repo}/forks\",\n \"GET /repos/{owner}/{repo}/hooks\",\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\",\n \"GET /repos/{owner}/{repo}/invitations\",\n \"GET /repos/{owner}/{repo}/issues\",\n \"GET /repos/{owner}/{repo}/issues/comments\",\n \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\",\n \"GET /repos/{owner}/{repo}/issues/events\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/events\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\",\n \"GET /repos/{owner}/{repo}/keys\",\n \"GET /repos/{owner}/{repo}/labels\",\n \"GET /repos/{owner}/{repo}/milestones\",\n \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\",\n \"GET /repos/{owner}/{repo}/notifications\",\n \"GET /repos/{owner}/{repo}/pages/builds\",\n \"GET /repos/{owner}/{repo}/projects\",\n \"GET /repos/{owner}/{repo}/pulls\",\n \"GET /repos/{owner}/{repo}/pulls/comments\",\n \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\",\n \"GET /repos/{owner}/{repo}/releases\",\n \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\",\n \"GET /repos/{owner}/{repo}/releases/{release_id}/reactions\",\n \"GET /repos/{owner}/{repo}/rules/branches/{branch}\",\n \"GET /repos/{owner}/{repo}/rulesets\",\n \"GET /repos/{owner}/{repo}/rulesets/rule-suites\",\n \"GET /repos/{owner}/{repo}/secret-scanning/alerts\",\n \"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations\",\n \"GET /repos/{owner}/{repo}/security-advisories\",\n \"GET /repos/{owner}/{repo}/stargazers\",\n \"GET /repos/{owner}/{repo}/subscribers\",\n \"GET /repos/{owner}/{repo}/tags\",\n \"GET /repos/{owner}/{repo}/teams\",\n \"GET /repos/{owner}/{repo}/topics\",\n \"GET /repositories\",\n \"GET /repositories/{repository_id}/environments/{environment_name}/secrets\",\n \"GET /repositories/{repository_id}/environments/{environment_name}/variables\",\n \"GET /search/code\",\n \"GET /search/commits\",\n \"GET /search/issues\",\n \"GET /search/labels\",\n \"GET /search/repositories\",\n \"GET /search/topics\",\n \"GET /search/users\",\n \"GET /teams/{team_id}/discussions\",\n \"GET /teams/{team_id}/discussions/{discussion_number}/comments\",\n \"GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n \"GET /teams/{team_id}/discussions/{discussion_number}/reactions\",\n \"GET /teams/{team_id}/invitations\",\n \"GET /teams/{team_id}/members\",\n \"GET /teams/{team_id}/projects\",\n \"GET /teams/{team_id}/repos\",\n \"GET /teams/{team_id}/teams\",\n \"GET /user/blocks\",\n \"GET /user/codespaces\",\n \"GET /user/codespaces/secrets\",\n \"GET /user/emails\",\n \"GET /user/followers\",\n \"GET /user/following\",\n \"GET /user/gpg_keys\",\n \"GET /user/installations\",\n \"GET /user/installations/{installation_id}/repositories\",\n \"GET /user/issues\",\n \"GET /user/keys\",\n \"GET /user/marketplace_purchases\",\n \"GET /user/marketplace_purchases/stubbed\",\n \"GET /user/memberships/orgs\",\n \"GET /user/migrations\",\n \"GET /user/migrations/{migration_id}/repositories\",\n \"GET /user/orgs\",\n \"GET /user/packages\",\n \"GET /user/packages/{package_type}/{package_name}/versions\",\n \"GET /user/public_emails\",\n \"GET /user/repos\",\n \"GET /user/repository_invitations\",\n \"GET /user/social_accounts\",\n \"GET /user/ssh_signing_keys\",\n \"GET /user/starred\",\n \"GET /user/subscriptions\",\n \"GET /user/teams\",\n \"GET /users\",\n \"GET /users/{username}/events\",\n \"GET /users/{username}/events/orgs/{org}\",\n \"GET /users/{username}/events/public\",\n \"GET /users/{username}/followers\",\n \"GET /users/{username}/following\",\n \"GET /users/{username}/gists\",\n \"GET /users/{username}/gpg_keys\",\n \"GET /users/{username}/keys\",\n \"GET /users/{username}/orgs\",\n \"GET /users/{username}/packages\",\n \"GET /users/{username}/projects\",\n \"GET /users/{username}/received_events\",\n \"GET /users/{username}/received_events/public\",\n \"GET /users/{username}/repos\",\n \"GET /users/{username}/social_accounts\",\n \"GET /users/{username}/ssh_signing_keys\",\n \"GET /users/{username}/starred\",\n \"GET /users/{username}/subscriptions\"\n];\n\n// pkg/dist-src/paginating-endpoints.js\nfunction isPaginatingEndpoint(arg) {\n if (typeof arg === \"string\") {\n return paginatingEndpoints.includes(arg);\n } else {\n return false;\n }\n}\n\n// pkg/dist-src/index.js\nfunction paginateRest(octokit) {\n return {\n paginate: Object.assign(paginate.bind(null, octokit), {\n iterator: iterator.bind(null, octokit)\n })\n };\n}\npaginateRest.VERSION = VERSION;\nexport {\n composePaginateRest,\n isPaginatingEndpoint,\n paginateRest,\n paginatingEndpoints\n};\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst Utils = __importStar(require(\"./internal/utils\"));\n// octokit + plugins\nconst core_1 = require(\"@octokit/core\");\nconst plugin_rest_endpoint_methods_1 = require(\"@octokit/plugin-rest-endpoint-methods\");\nconst plugin_paginate_rest_1 = require(\"@octokit/plugin-paginate-rest\");\nexports.context = new Context.Context();\nconst baseUrl = Utils.getApiBaseUrl();\nexports.defaults = {\n baseUrl,\n request: {\n agent: Utils.getProxyAgent(baseUrl),\n fetch: Utils.getProxyFetch(baseUrl)\n }\n};\nexports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);\n/**\n * Convience function to correctly format Octokit Options to pass into the constructor.\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}\nexports.getOctokitOptions = getOctokitOptions;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokit = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst utils_1 = require(\"./utils\");\nexports.context = new Context.Context();\n/**\n * Returns a hydrated octokit ready to use for GitHub Actions\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokit(token, options, ...additionalPlugins) {\n const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);\n return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));\n}\nexports.getOctokit = getOctokit;\n//# sourceMappingURL=github.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOptions = void 0;\nconst core = __importStar(require(\"@actions/core\"));\n/**\n * Returns a copy with defaults filled in.\n */\nfunction getOptions(copy) {\n const result = {\n followSymbolicLinks: true,\n implicitDescendants: true,\n matchDirectories: true,\n omitBrokenSymbolicLinks: true,\n excludeHiddenFiles: false\n };\n if (copy) {\n if (typeof copy.followSymbolicLinks === 'boolean') {\n result.followSymbolicLinks = copy.followSymbolicLinks;\n core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`);\n }\n if (typeof copy.implicitDescendants === 'boolean') {\n result.implicitDescendants = copy.implicitDescendants;\n core.debug(`implicitDescendants '${result.implicitDescendants}'`);\n }\n if (typeof copy.matchDirectories === 'boolean') {\n result.matchDirectories = copy.matchDirectories;\n core.debug(`matchDirectories '${result.matchDirectories}'`);\n }\n if (typeof copy.omitBrokenSymbolicLinks === 'boolean') {\n result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks;\n core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`);\n }\n if (typeof copy.excludeHiddenFiles === 'boolean') {\n result.excludeHiddenFiles = copy.excludeHiddenFiles;\n core.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`);\n }\n }\n return result;\n}\nexports.getOptions = getOptions;\n//# sourceMappingURL=internal-glob-options-helper.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.safeTrimTrailingSeparator = exports.normalizeSeparators = exports.hasRoot = exports.hasAbsoluteRoot = exports.ensureAbsoluteRoot = exports.dirname = void 0;\nconst path = __importStar(require(\"path\"));\nconst assert_1 = __importDefault(require(\"assert\"));\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.\n *\n * For example, on Linux/macOS:\n * - `/ => /`\n * - `/hello => /`\n *\n * For example, on Windows:\n * - `C:\\ => C:\\`\n * - `C:\\hello => C:\\`\n * - `C: => C:`\n * - `C:hello => C:`\n * - `\\ => \\`\n * - `\\hello => \\`\n * - `\\\\hello => \\\\hello`\n * - `\\\\hello\\world => \\\\hello\\world`\n */\nfunction dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}\nexports.dirname = dirname;\n/**\n * Roots the path if not already rooted. On Windows, relative roots like `\\`\n * or `C:` are expanded based on the current working directory.\n */\nfunction ensureAbsoluteRoot(root, itemPath) {\n (0, assert_1.default)(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);\n (0, assert_1.default)(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Already rooted\n if (hasAbsoluteRoot(itemPath)) {\n return itemPath;\n }\n // Windows\n if (IS_WINDOWS) {\n // Check for itemPath like C: or C:foo\n if (itemPath.match(/^[A-Z]:[^\\\\/]|^[A-Z]:$/i)) {\n let cwd = process.cwd();\n (0, assert_1.default)(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n // Drive letter matches cwd? Expand to cwd\n if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) {\n // Drive only, e.g. C:\n if (itemPath.length === 2) {\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}`;\n }\n // Drive + path, e.g. C:foo\n else {\n if (!cwd.endsWith('\\\\')) {\n cwd += '\\\\';\n }\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}${itemPath.substr(2)}`;\n }\n }\n // Different drive\n else {\n return `${itemPath[0]}:\\\\${itemPath.substr(2)}`;\n }\n }\n // Check for itemPath like \\ or \\foo\n else if (normalizeSeparators(itemPath).match(/^\\\\$|^\\\\[^\\\\]/)) {\n const cwd = process.cwd();\n (0, assert_1.default)(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n return `${cwd[0]}:\\\\${itemPath.substr(1)}`;\n }\n }\n (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);\n // Otherwise ensure root ends with a separator\n if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\\\'))) {\n // Intentionally empty\n }\n else {\n // Append separator\n root += path.sep;\n }\n return root + itemPath;\n}\nexports.ensureAbsoluteRoot = ensureAbsoluteRoot;\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\\\hello\\share` and `C:\\hello` (and using alternate separator).\n */\nfunction hasAbsoluteRoot(itemPath) {\n (0, assert_1.default)(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\\\hello\\share or C:\\hello\n return itemPath.startsWith('\\\\\\\\') || /^[A-Z]:\\\\/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\nexports.hasAbsoluteRoot = hasAbsoluteRoot;\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\`, `\\hello`, `\\\\hello\\share`, `C:`, and `C:\\hello` (and using alternate separator).\n */\nfunction hasRoot(itemPath) {\n (0, assert_1.default)(itemPath, `isRooted parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\ or \\hello or \\\\hello\n // E.g. C: or C:\\hello\n return itemPath.startsWith('\\\\') || /^[A-Z]:/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\nexports.hasRoot = hasRoot;\n/**\n * Removes redundant slashes and converts `/` to `\\` on Windows\n */\nfunction normalizeSeparators(p) {\n p = p || '';\n // Windows\n if (IS_WINDOWS) {\n // Convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // Remove redundant slashes\n const isUnc = /^\\\\\\\\+[^\\\\]/.test(p); // e.g. \\\\hello\n return (isUnc ? '\\\\' : '') + p.replace(/\\\\\\\\+/g, '\\\\'); // preserve leading \\\\ for UNC\n }\n // Remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\nexports.normalizeSeparators = normalizeSeparators;\n/**\n * Normalizes the path separators and trims the trailing separator (when safe).\n * For example, `/foo/ => /foo` but `/ => /`\n */\nfunction safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}\nexports.safeTrimTrailingSeparator = safeTrimTrailingSeparator;\n//# sourceMappingURL=internal-path-helper.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MatchKind = void 0;\n/**\n * Indicates whether a pattern matches a path\n */\nvar MatchKind;\n(function (MatchKind) {\n /** Not matched */\n MatchKind[MatchKind[\"None\"] = 0] = \"None\";\n /** Matched if the path is a directory */\n MatchKind[MatchKind[\"Directory\"] = 1] = \"Directory\";\n /** Matched if the path is a regular file */\n MatchKind[MatchKind[\"File\"] = 2] = \"File\";\n /** Matched */\n MatchKind[MatchKind[\"All\"] = 3] = \"All\";\n})(MatchKind || (exports.MatchKind = MatchKind = {}));\n//# sourceMappingURL=internal-match-kind.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.partialMatch = exports.match = exports.getSearchPaths = void 0;\nconst pathHelper = __importStar(require(\"./internal-path-helper\"));\nconst internal_match_kind_1 = require(\"./internal-match-kind\");\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Given an array of patterns, returns an array of paths to search.\n * Duplicates and paths under other included paths are filtered out.\n */\nfunction getSearchPaths(patterns) {\n // Ignore negate patterns\n patterns = patterns.filter(x => !x.negate);\n // Create a map of all search paths\n const searchPathMap = {};\n for (const pattern of patterns) {\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n searchPathMap[key] = 'candidate';\n }\n const result = [];\n for (const pattern of patterns) {\n // Check if already included\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n if (searchPathMap[key] === 'included') {\n continue;\n }\n // Check for an ancestor search path\n let foundAncestor = false;\n let tempKey = key;\n let parent = pathHelper.dirname(tempKey);\n while (parent !== tempKey) {\n if (searchPathMap[parent]) {\n foundAncestor = true;\n break;\n }\n tempKey = parent;\n parent = pathHelper.dirname(tempKey);\n }\n // Include the search pattern in the result\n if (!foundAncestor) {\n result.push(pattern.searchPath);\n searchPathMap[key] = 'included';\n }\n }\n return result;\n}\nexports.getSearchPaths = getSearchPaths;\n/**\n * Matches the patterns against the path\n */\nfunction match(patterns, itemPath) {\n let result = internal_match_kind_1.MatchKind.None;\n for (const pattern of patterns) {\n if (pattern.negate) {\n result &= ~pattern.match(itemPath);\n }\n else {\n result |= pattern.match(itemPath);\n }\n }\n return result;\n}\nexports.match = match;\n/**\n * Checks whether to descend further into the directory\n */\nfunction partialMatch(patterns, itemPath) {\n return patterns.some(x => !x.negate && x.partialMatch(itemPath));\n}\nexports.partialMatch = partialMatch;\n//# sourceMappingURL=internal-pattern-helper.js.map","module.exports = function (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n var x = fn(xs[i], i);\n if (isArray(x)) res.push.apply(res, x);\n else res.push(x);\n }\n return res;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n","'use strict';\nmodule.exports = balanced;\nfunction balanced(a, b, str) {\n if (a instanceof RegExp) a = maybeMatch(a, str);\n if (b instanceof RegExp) b = maybeMatch(b, str);\n\n var r = range(a, b, str);\n\n return r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + a.length, r[1]),\n post: str.slice(r[1] + b.length)\n };\n}\n\nfunction maybeMatch(reg, str) {\n var m = str.match(reg);\n return m ? m[0] : null;\n}\n\nbalanced.range = range;\nfunction range(a, b, str) {\n var begs, beg, left, right, result;\n var ai = str.indexOf(a);\n var bi = str.indexOf(b, ai + 1);\n var i = ai;\n\n if (ai >= 0 && bi > 0) {\n if(a===b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n\n while (i >= 0 && !result) {\n if (i == ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n } else if (begs.length == 1) {\n result = [ begs.pop(), bi ];\n } else {\n beg = begs.pop();\n if (beg < left) {\n left = beg;\n right = bi;\n }\n\n bi = str.indexOf(b, i + 1);\n }\n\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n\n if (begs.length) {\n result = [ left, right ];\n }\n }\n\n return result;\n}\n","var concatMap = require('concat-map');\nvar balanced = require('balanced-match');\n\nmodule.exports = expandTop;\n\nvar escSlash = '\\0SLASH'+Math.random()+'\\0';\nvar escOpen = '\\0OPEN'+Math.random()+'\\0';\nvar escClose = '\\0CLOSE'+Math.random()+'\\0';\nvar escComma = '\\0COMMA'+Math.random()+'\\0';\nvar escPeriod = '\\0PERIOD'+Math.random()+'\\0';\n\nfunction numeric(str) {\n return parseInt(str, 10) == str\n ? parseInt(str, 10)\n : str.charCodeAt(0);\n}\n\nfunction escapeBraces(str) {\n return str.split('\\\\\\\\').join(escSlash)\n .split('\\\\{').join(escOpen)\n .split('\\\\}').join(escClose)\n .split('\\\\,').join(escComma)\n .split('\\\\.').join(escPeriod);\n}\n\nfunction unescapeBraces(str) {\n return str.split(escSlash).join('\\\\')\n .split(escOpen).join('{')\n .split(escClose).join('}')\n .split(escComma).join(',')\n .split(escPeriod).join('.');\n}\n\n\n// Basically just str.split(\",\"), but handling cases\n// where we have nested braced sections, which should be\n// treated as individual members, like {a,{b,c},d}\nfunction parseCommaParts(str) {\n if (!str)\n return [''];\n\n var parts = [];\n var m = balanced('{', '}', str);\n\n if (!m)\n return str.split(',');\n\n var pre = m.pre;\n var body = m.body;\n var post = m.post;\n var p = pre.split(',');\n\n p[p.length-1] += '{' + body + '}';\n var postParts = parseCommaParts(post);\n if (post.length) {\n p[p.length-1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n\n parts.push.apply(parts, p);\n\n return parts;\n}\n\nfunction expandTop(str) {\n if (!str)\n return [];\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.substr(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.substr(2);\n }\n\n return expand(escapeBraces(str), true).map(unescapeBraces);\n}\n\nfunction identity(e) {\n return e;\n}\n\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\n\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\n\nfunction expand(str, isTop) {\n var expansions = [];\n\n var m = balanced('{', '}', str);\n if (!m || /\\$$/.test(m.pre)) return [str];\n\n var isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n var isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n var isSequence = isNumericSequence || isAlphaSequence;\n var isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand(str);\n }\n return [str];\n }\n\n var n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n } else {\n n = parseCommaParts(m.body);\n if (n.length === 1) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand(n[0], false).map(embrace);\n if (n.length === 1) {\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n return post.map(function(p) {\n return m.pre + n[0] + p;\n });\n }\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n var pre = m.pre;\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n\n var N;\n\n if (isSequence) {\n var x = numeric(n[0]);\n var y = numeric(n[1]);\n var width = Math.max(n[0].length, n[1].length)\n var incr = n.length == 3\n ? Math.abs(numeric(n[2]))\n : 1;\n var test = lte;\n var reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n var pad = n.some(isPadded);\n\n N = [];\n\n for (var i = x; test(i, y); i += incr) {\n var c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\')\n c = '';\n } else {\n c = String(i);\n if (pad) {\n var need = width - c.length;\n if (need > 0) {\n var z = new Array(need + 1).join('0');\n if (i < 0)\n c = '-' + z + c.slice(1);\n else\n c = z + c;\n }\n }\n }\n N.push(c);\n }\n } else {\n N = concatMap(n, function(el) { return expand(el, false) });\n }\n\n for (var j = 0; j < N.length; j++) {\n for (var k = 0; k < post.length; k++) {\n var expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion)\n expansions.push(expansion);\n }\n }\n\n return expansions;\n}\n\n","module.exports = minimatch\nminimatch.Minimatch = Minimatch\n\nvar path = (function () { try { return require('path') } catch (e) {}}()) || {\n sep: '/'\n}\nminimatch.sep = path.sep\n\nvar GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}\nvar expand = require('brace-expansion')\n\nvar plTypes = {\n '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},\n '?': { open: '(?:', close: ')?' },\n '+': { open: '(?:', close: ')+' },\n '*': { open: '(?:', close: ')*' },\n '@': { open: '(?:', close: ')' }\n}\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nvar qmark = '[^/]'\n\n// * => any number of characters\nvar star = qmark + '*?'\n\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nvar twoStarDot = '(?:(?!(?:\\\\\\/|^)(?:\\\\.{1,2})($|\\\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nvar twoStarNoDot = '(?:(?!(?:\\\\\\/|^)\\\\.).)*?'\n\n// characters that need to be escaped in RegExp.\nvar reSpecials = charSet('().*{}+?[]^$\\\\!')\n\n// \"abc\" -> { a:true, b:true, c:true }\nfunction charSet (s) {\n return s.split('').reduce(function (set, c) {\n set[c] = true\n return set\n }, {})\n}\n\n// normalizes slashes.\nvar slashSplit = /\\/+/\n\nminimatch.filter = filter\nfunction filter (pattern, options) {\n options = options || {}\n return function (p, i, list) {\n return minimatch(p, pattern, options)\n }\n}\n\nfunction ext (a, b) {\n b = b || {}\n var t = {}\n Object.keys(a).forEach(function (k) {\n t[k] = a[k]\n })\n Object.keys(b).forEach(function (k) {\n t[k] = b[k]\n })\n return t\n}\n\nminimatch.defaults = function (def) {\n if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n return minimatch\n }\n\n var orig = minimatch\n\n var m = function minimatch (p, pattern, options) {\n return orig(p, pattern, ext(def, options))\n }\n\n m.Minimatch = function Minimatch (pattern, options) {\n return new orig.Minimatch(pattern, ext(def, options))\n }\n m.Minimatch.defaults = function defaults (options) {\n return orig.defaults(ext(def, options)).Minimatch\n }\n\n m.filter = function filter (pattern, options) {\n return orig.filter(pattern, ext(def, options))\n }\n\n m.defaults = function defaults (options) {\n return orig.defaults(ext(def, options))\n }\n\n m.makeRe = function makeRe (pattern, options) {\n return orig.makeRe(pattern, ext(def, options))\n }\n\n m.braceExpand = function braceExpand (pattern, options) {\n return orig.braceExpand(pattern, ext(def, options))\n }\n\n m.match = function (list, pattern, options) {\n return orig.match(list, pattern, ext(def, options))\n }\n\n return m\n}\n\nMinimatch.defaults = function (def) {\n return minimatch.defaults(def).Minimatch\n}\n\nfunction minimatch (p, pattern, options) {\n assertValidPattern(pattern)\n\n if (!options) options = {}\n\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false\n }\n\n return new Minimatch(pattern, options).match(p)\n}\n\nfunction Minimatch (pattern, options) {\n if (!(this instanceof Minimatch)) {\n return new Minimatch(pattern, options)\n }\n\n assertValidPattern(pattern)\n\n if (!options) options = {}\n\n pattern = pattern.trim()\n\n // windows support: need to use /, not \\\n if (!options.allowWindowsEscape && path.sep !== '/') {\n pattern = pattern.split(path.sep).join('/')\n }\n\n this.options = options\n this.set = []\n this.pattern = pattern\n this.regexp = null\n this.negate = false\n this.comment = false\n this.empty = false\n this.partial = !!options.partial\n\n // make the set of regexps etc.\n this.make()\n}\n\nMinimatch.prototype.debug = function () {}\n\nMinimatch.prototype.make = make\nfunction make () {\n var pattern = this.pattern\n var options = this.options\n\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true\n return\n }\n if (!pattern) {\n this.empty = true\n return\n }\n\n // step 1: figure out negation, etc.\n this.parseNegate()\n\n // step 2: expand braces\n var set = this.globSet = this.braceExpand()\n\n if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) }\n\n this.debug(this.pattern, set)\n\n // step 3: now we have a set, so turn each one into a series of path-portion\n // matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n set = this.globParts = set.map(function (s) {\n return s.split(slashSplit)\n })\n\n this.debug(this.pattern, set)\n\n // glob --> regexps\n set = set.map(function (s, si, set) {\n return s.map(this.parse, this)\n }, this)\n\n this.debug(this.pattern, set)\n\n // filter out everything that didn't compile properly.\n set = set.filter(function (s) {\n return s.indexOf(false) === -1\n })\n\n this.debug(this.pattern, set)\n\n this.set = set\n}\n\nMinimatch.prototype.parseNegate = parseNegate\nfunction parseNegate () {\n var pattern = this.pattern\n var negate = false\n var options = this.options\n var negateOffset = 0\n\n if (options.nonegate) return\n\n for (var i = 0, l = pattern.length\n ; i < l && pattern.charAt(i) === '!'\n ; i++) {\n negate = !negate\n negateOffset++\n }\n\n if (negateOffset) this.pattern = pattern.substr(negateOffset)\n this.negate = negate\n}\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nminimatch.braceExpand = function (pattern, options) {\n return braceExpand(pattern, options)\n}\n\nMinimatch.prototype.braceExpand = braceExpand\n\nfunction braceExpand (pattern, options) {\n if (!options) {\n if (this instanceof Minimatch) {\n options = this.options\n } else {\n options = {}\n }\n }\n\n pattern = typeof pattern === 'undefined'\n ? this.pattern : pattern\n\n assertValidPattern(pattern)\n\n // Thanks to Yeting Li for\n // improving this regexp to avoid a ReDOS vulnerability.\n if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n // shortcut. no need to expand.\n return [pattern]\n }\n\n return expand(pattern)\n}\n\nvar MAX_PATTERN_LENGTH = 1024 * 64\nvar assertValidPattern = function (pattern) {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nMinimatch.prototype.parse = parse\nvar SUBPARSE = {}\nfunction parse (pattern, isSub) {\n assertValidPattern(pattern)\n\n var options = this.options\n\n // shortcuts\n if (pattern === '**') {\n if (!options.noglobstar)\n return GLOBSTAR\n else\n pattern = '*'\n }\n if (pattern === '') return ''\n\n var re = ''\n var hasMagic = !!options.nocase\n var escaping = false\n // ? => one single character\n var patternListStack = []\n var negativeLists = []\n var stateChar\n var inClass = false\n var reClassStart = -1\n var classStart = -1\n // . and .. never match anything that doesn't start with .,\n // even when options.dot is set.\n var patternStart = pattern.charAt(0) === '.' ? '' // anything\n // not (start or / followed by . or .. followed by / or end)\n : options.dot ? '(?!(?:^|\\\\\\/)\\\\.{1,2}(?:$|\\\\\\/))'\n : '(?!\\\\.)'\n var self = this\n\n function clearStateChar () {\n if (stateChar) {\n // we had some state-tracking character\n // that wasn't consumed by this pass.\n switch (stateChar) {\n case '*':\n re += star\n hasMagic = true\n break\n case '?':\n re += qmark\n hasMagic = true\n break\n default:\n re += '\\\\' + stateChar\n break\n }\n self.debug('clearStateChar %j %j', stateChar, re)\n stateChar = false\n }\n }\n\n for (var i = 0, len = pattern.length, c\n ; (i < len) && (c = pattern.charAt(i))\n ; i++) {\n this.debug('%s\\t%s %s %j', pattern, i, re, c)\n\n // skip over any that are escaped.\n if (escaping && reSpecials[c]) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n switch (c) {\n /* istanbul ignore next */\n case '/': {\n // completely not allowed, even escaped.\n // Should already be path-split by now.\n return false\n }\n\n case '\\\\':\n clearStateChar()\n escaping = true\n continue\n\n // the various stateChar values\n // for the \"extglob\" stuff.\n case '?':\n case '*':\n case '+':\n case '@':\n case '!':\n this.debug('%s\\t%s %s %j <-- stateChar', pattern, i, re, c)\n\n // all of those are literals inside a class, except that\n // the glob [!a] means [^a] in regexp\n if (inClass) {\n this.debug(' in class')\n if (c === '!' && i === classStart + 1) c = '^'\n re += c\n continue\n }\n\n // if we already have a stateChar, then it means\n // that there was something like ** or +? in there.\n // Handle the stateChar, then proceed with this one.\n self.debug('call clearStateChar %j', stateChar)\n clearStateChar()\n stateChar = c\n // if extglob is disabled, then +(asdf|foo) isn't a thing.\n // just clear the statechar *now*, rather than even diving into\n // the patternList stuff.\n if (options.noext) clearStateChar()\n continue\n\n case '(':\n if (inClass) {\n re += '('\n continue\n }\n\n if (!stateChar) {\n re += '\\\\('\n continue\n }\n\n patternListStack.push({\n type: stateChar,\n start: i - 1,\n reStart: re.length,\n open: plTypes[stateChar].open,\n close: plTypes[stateChar].close\n })\n // negation is (?:(?!js)[^/]*)\n re += stateChar === '!' ? '(?:(?!(?:' : '(?:'\n this.debug('plType %j %j', stateChar, re)\n stateChar = false\n continue\n\n case ')':\n if (inClass || !patternListStack.length) {\n re += '\\\\)'\n continue\n }\n\n clearStateChar()\n hasMagic = true\n var pl = patternListStack.pop()\n // negation is (?:(?!js)[^/]*)\n // The others are (?:)\n re += pl.close\n if (pl.type === '!') {\n negativeLists.push(pl)\n }\n pl.reEnd = re.length\n continue\n\n case '|':\n if (inClass || !patternListStack.length || escaping) {\n re += '\\\\|'\n escaping = false\n continue\n }\n\n clearStateChar()\n re += '|'\n continue\n\n // these are mostly the same in regexp and glob\n case '[':\n // swallow any state-tracking char before the [\n clearStateChar()\n\n if (inClass) {\n re += '\\\\' + c\n continue\n }\n\n inClass = true\n classStart = i\n reClassStart = re.length\n re += c\n continue\n\n case ']':\n // a right bracket shall lose its special\n // meaning and represent itself in\n // a bracket expression if it occurs\n // first in the list. -- POSIX.2 2.8.3.2\n if (i === classStart + 1 || !inClass) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n // handle the case where we left a class open.\n // \"[z-a]\" is valid, equivalent to \"\\[z-a\\]\"\n // split where the last [ was, make sure we don't have\n // an invalid re. if so, re-walk the contents of the\n // would-be class to re-translate any characters that\n // were passed through as-is\n // TODO: It would probably be faster to determine this\n // without a try/catch and a new RegExp, but it's tricky\n // to do safely. For now, this is safe and works.\n var cs = pattern.substring(classStart + 1, i)\n try {\n RegExp('[' + cs + ']')\n } catch (er) {\n // not a valid class!\n var sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0] + '\\\\]'\n hasMagic = hasMagic || sp[1]\n inClass = false\n continue\n }\n\n // finish up the class.\n hasMagic = true\n inClass = false\n re += c\n continue\n\n default:\n // swallow any state char that wasn't consumed\n clearStateChar()\n\n if (escaping) {\n // no need\n escaping = false\n } else if (reSpecials[c]\n && !(c === '^' && inClass)) {\n re += '\\\\'\n }\n\n re += c\n\n } // switch\n } // for\n\n // handle the case where we left a class open.\n // \"[abc\" is valid, equivalent to \"\\[abc\"\n if (inClass) {\n // split where the last [ was, and escape it\n // this is a huge pita. We now have to re-walk\n // the contents of the would-be class to re-translate\n // any characters that were passed through as-is\n cs = pattern.substr(classStart + 1)\n sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0]\n hasMagic = hasMagic || sp[1]\n }\n\n // handle the case where we had a +( thing at the *end*\n // of the pattern.\n // each pattern list stack adds 3 chars, and we need to go through\n // and escape any | chars that were passed through as-is for the regexp.\n // Go through and escape them, taking care not to double-escape any\n // | chars that were already escaped.\n for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {\n var tail = re.slice(pl.reStart + pl.open.length)\n this.debug('setting tail', re, pl)\n // maybe some even number of \\, then maybe 1 \\, followed by a |\n tail = tail.replace(/((?:\\\\{2}){0,64})(\\\\?)\\|/g, function (_, $1, $2) {\n if (!$2) {\n // the | isn't already escaped, so escape it.\n $2 = '\\\\'\n }\n\n // need to escape all those slashes *again*, without escaping the\n // one that we need for escaping the | character. As it works out,\n // escaping an even number of slashes can be done by simply repeating\n // it exactly after itself. That's why this trick works.\n //\n // I am sorry that you have to see this.\n return $1 + $1 + $2 + '|'\n })\n\n this.debug('tail=%j\\n %s', tail, tail, pl, re)\n var t = pl.type === '*' ? star\n : pl.type === '?' ? qmark\n : '\\\\' + pl.type\n\n hasMagic = true\n re = re.slice(0, pl.reStart) + t + '\\\\(' + tail\n }\n\n // handle trailing things that only matter at the very end.\n clearStateChar()\n if (escaping) {\n // trailing \\\\\n re += '\\\\\\\\'\n }\n\n // only need to apply the nodot start if the re starts with\n // something that could conceivably capture a dot\n var addPatternStart = false\n switch (re.charAt(0)) {\n case '[': case '.': case '(': addPatternStart = true\n }\n\n // Hack to work around lack of negative lookbehind in JS\n // A pattern like: *.!(x).!(y|z) needs to ensure that a name\n // like 'a.xyz.yz' doesn't match. So, the first negative\n // lookahead, has to look ALL the way ahead, to the end of\n // the pattern.\n for (var n = negativeLists.length - 1; n > -1; n--) {\n var nl = negativeLists[n]\n\n var nlBefore = re.slice(0, nl.reStart)\n var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)\n var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)\n var nlAfter = re.slice(nl.reEnd)\n\n nlLast += nlAfter\n\n // Handle nested stuff like *(*.js|!(*.json)), where open parens\n // mean that we should *not* include the ) in the bit that is considered\n // \"after\" the negated section.\n var openParensBefore = nlBefore.split('(').length - 1\n var cleanAfter = nlAfter\n for (i = 0; i < openParensBefore; i++) {\n cleanAfter = cleanAfter.replace(/\\)[+*?]?/, '')\n }\n nlAfter = cleanAfter\n\n var dollar = ''\n if (nlAfter === '' && isSub !== SUBPARSE) {\n dollar = '$'\n }\n var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast\n re = newRe\n }\n\n // if the re is not \"\" at this point, then we need to make sure\n // it doesn't match against an empty path part.\n // Otherwise a/* will match a/, which it should not.\n if (re !== '' && hasMagic) {\n re = '(?=.)' + re\n }\n\n if (addPatternStart) {\n re = patternStart + re\n }\n\n // parsing just a piece of a larger pattern.\n if (isSub === SUBPARSE) {\n return [re, hasMagic]\n }\n\n // skip the regexp for non-magical patterns\n // unescape anything in it, though, so that it'll be\n // an exact match against a file etc.\n if (!hasMagic) {\n return globUnescape(pattern)\n }\n\n var flags = options.nocase ? 'i' : ''\n try {\n var regExp = new RegExp('^' + re + '$', flags)\n } catch (er) /* istanbul ignore next - should be impossible */ {\n // If it was an invalid regular expression, then it can't match\n // anything. This trick looks for a character after the end of\n // the string, which is of course impossible, except in multi-line\n // mode, but it's not a /m regex.\n return new RegExp('$.')\n }\n\n regExp._glob = pattern\n regExp._src = re\n\n return regExp\n}\n\nminimatch.makeRe = function (pattern, options) {\n return new Minimatch(pattern, options || {}).makeRe()\n}\n\nMinimatch.prototype.makeRe = makeRe\nfunction makeRe () {\n if (this.regexp || this.regexp === false) return this.regexp\n\n // at this point, this.set is a 2d array of partial\n // pattern strings, or \"**\".\n //\n // It's better to use .match(). This function shouldn't\n // be used, really, but it's pretty convenient sometimes,\n // when you just want to work with a regex.\n var set = this.set\n\n if (!set.length) {\n this.regexp = false\n return this.regexp\n }\n var options = this.options\n\n var twoStar = options.noglobstar ? star\n : options.dot ? twoStarDot\n : twoStarNoDot\n var flags = options.nocase ? 'i' : ''\n\n var re = set.map(function (pattern) {\n return pattern.map(function (p) {\n return (p === GLOBSTAR) ? twoStar\n : (typeof p === 'string') ? regExpEscape(p)\n : p._src\n }).join('\\\\\\/')\n }).join('|')\n\n // must match entire pattern\n // ending in a * or ** will make it less strict.\n re = '^(?:' + re + ')$'\n\n // can match anything, as long as it's not this.\n if (this.negate) re = '^(?!' + re + ').*$'\n\n try {\n this.regexp = new RegExp(re, flags)\n } catch (ex) /* istanbul ignore next - should be impossible */ {\n this.regexp = false\n }\n return this.regexp\n}\n\nminimatch.match = function (list, pattern, options) {\n options = options || {}\n var mm = new Minimatch(pattern, options)\n list = list.filter(function (f) {\n return mm.match(f)\n })\n if (mm.options.nonull && !list.length) {\n list.push(pattern)\n }\n return list\n}\n\nMinimatch.prototype.match = function match (f, partial) {\n if (typeof partial === 'undefined') partial = this.partial\n this.debug('match', f, this.pattern)\n // short-circuit in the case of busted things.\n // comments, etc.\n if (this.comment) return false\n if (this.empty) return f === ''\n\n if (f === '/' && partial) return true\n\n var options = this.options\n\n // windows: need to use /, not \\\n if (path.sep !== '/') {\n f = f.split(path.sep).join('/')\n }\n\n // treat the test path as a set of pathparts.\n f = f.split(slashSplit)\n this.debug(this.pattern, 'split', f)\n\n // just ONE of the pattern sets in this.set needs to match\n // in order for it to be valid. If negating, then just one\n // match means that we have failed.\n // Either way, return on the first hit.\n\n var set = this.set\n this.debug(this.pattern, 'set', set)\n\n // Find the basename of the path by looking for the last non-empty segment\n var filename\n var i\n for (i = f.length - 1; i >= 0; i--) {\n filename = f[i]\n if (filename) break\n }\n\n for (i = 0; i < set.length; i++) {\n var pattern = set[i]\n var file = f\n if (options.matchBase && pattern.length === 1) {\n file = [filename]\n }\n var hit = this.matchOne(file, pattern, partial)\n if (hit) {\n if (options.flipNegate) return true\n return !this.negate\n }\n }\n\n // didn't get any hits. this is success if it's a negative\n // pattern, failure otherwise.\n if (options.flipNegate) return false\n return this.negate\n}\n\n// set partial to true to test if, for example,\n// \"/a/b\" matches the start of \"/*/b/*/d\"\n// Partial means, if you run out of file before you run\n// out of pattern, then that's fine, as long as all\n// the parts match.\nMinimatch.prototype.matchOne = function (file, pattern, partial) {\n var options = this.options\n\n this.debug('matchOne',\n { 'this': this, file: file, pattern: pattern })\n\n this.debug('matchOne', file.length, pattern.length)\n\n for (var fi = 0,\n pi = 0,\n fl = file.length,\n pl = pattern.length\n ; (fi < fl) && (pi < pl)\n ; fi++, pi++) {\n this.debug('matchOne loop')\n var p = pattern[pi]\n var f = file[fi]\n\n this.debug(pattern, p, f)\n\n // should be impossible.\n // some invalid regexp stuff in the set.\n /* istanbul ignore if */\n if (p === false) return false\n\n if (p === GLOBSTAR) {\n this.debug('GLOBSTAR', [pattern, p, f])\n\n // \"**\"\n // a/**/b/**/c would match the following:\n // a/b/x/y/z/c\n // a/x/y/z/b/c\n // a/b/x/b/x/c\n // a/b/c\n // To do this, take the rest of the pattern after\n // the **, and see if it would match the file remainder.\n // If so, return success.\n // If not, the ** \"swallows\" a segment, and try again.\n // This is recursively awful.\n //\n // a/**/b/**/c matching a/b/x/y/z/c\n // - a matches a\n // - doublestar\n // - matchOne(b/x/y/z/c, b/**/c)\n // - b matches b\n // - doublestar\n // - matchOne(x/y/z/c, c) -> no\n // - matchOne(y/z/c, c) -> no\n // - matchOne(z/c, c) -> no\n // - matchOne(c, c) yes, hit\n var fr = fi\n var pr = pi + 1\n if (pr === pl) {\n this.debug('** at the end')\n // a ** at the end will just swallow the rest.\n // We have found a match.\n // however, it will not swallow /.x, unless\n // options.dot is set.\n // . and .. are *never* matched by **, for explosively\n // exponential reasons.\n for (; fi < fl; fi++) {\n if (file[fi] === '.' || file[fi] === '..' ||\n (!options.dot && file[fi].charAt(0) === '.')) return false\n }\n return true\n }\n\n // ok, let's see if we can swallow whatever we can.\n while (fr < fl) {\n var swallowee = file[fr]\n\n this.debug('\\nglobstar while', file, fr, pattern, pr, swallowee)\n\n // XXX remove this slice. Just pass the start index.\n if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {\n this.debug('globstar found match!', fr, fl, swallowee)\n // found a match.\n return true\n } else {\n // can't swallow \".\" or \"..\" ever.\n // can only swallow \".foo\" when explicitly asked.\n if (swallowee === '.' || swallowee === '..' ||\n (!options.dot && swallowee.charAt(0) === '.')) {\n this.debug('dot detected!', file, fr, pattern, pr)\n break\n }\n\n // ** swallows a segment, and continue.\n this.debug('globstar swallow a segment, and continue')\n fr++\n }\n }\n\n // no match was found.\n // However, in partial mode, we can't say this is necessarily over.\n // If there's more *pattern* left, then\n /* istanbul ignore if */\n if (partial) {\n // ran out of file\n this.debug('\\n>>> no match, partial?', file, fr, pattern, pr)\n if (fr === fl) return true\n }\n return false\n }\n\n // something other than **\n // non-magic patterns just have to match exactly\n // patterns with magic have been turned into regexps.\n var hit\n if (typeof p === 'string') {\n hit = f === p\n this.debug('string match', p, f, hit)\n } else {\n hit = f.match(p)\n this.debug('pattern match', p, f, hit)\n }\n\n if (!hit) return false\n }\n\n // Note: ending in / means that we'll get a final \"\"\n // at the end of the pattern. This can only match a\n // corresponding \"\" at the end of the file.\n // If the file ends in /, then it can only match a\n // a pattern that ends in /, unless the pattern just\n // doesn't have any more for it. But, a/b/ should *not*\n // match \"a/b/*\", even though \"\" matches against the\n // [^/]*? pattern, except in partial mode, where it might\n // simply not be reached yet.\n // However, a/b/ should still satisfy a/*\n\n // now either we fell off the end of the pattern, or we're done.\n if (fi === fl && pi === pl) {\n // ran out of pattern and filename at the same time.\n // an exact hit!\n return true\n } else if (fi === fl) {\n // ran out of file, but still had pattern left.\n // this is ok if we're doing the match as part of\n // a glob fs traversal.\n return partial\n } else /* istanbul ignore else */ if (pi === pl) {\n // ran out of pattern, still have file left.\n // this is only acceptable if we're on the very last\n // empty segment of a file with a trailing slash.\n // a/* should match a/b/\n return (fi === fl - 1) && (file[fi] === '')\n }\n\n // should be unreachable.\n /* istanbul ignore next */\n throw new Error('wtf?')\n}\n\n// replace stuff like \\* with *\nfunction globUnescape (s) {\n return s.replace(/\\\\(.)/g, '$1')\n}\n\nfunction regExpEscape (s) {\n return s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n}\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Path = void 0;\nconst path = __importStar(require(\"path\"));\nconst pathHelper = __importStar(require(\"./internal-path-helper\"));\nconst assert_1 = __importDefault(require(\"assert\"));\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Helper class for parsing paths into segments\n */\nclass Path {\n /**\n * Constructs a Path\n * @param itemPath Path or array of segments\n */\n constructor(itemPath) {\n this.segments = [];\n // String\n if (typeof itemPath === 'string') {\n (0, assert_1.default)(itemPath, `Parameter 'itemPath' must not be empty`);\n // Normalize slashes and trim unnecessary trailing slash\n itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n // Not rooted\n if (!pathHelper.hasRoot(itemPath)) {\n this.segments = itemPath.split(path.sep);\n }\n // Rooted\n else {\n // Add all segments, while not at the root\n let remaining = itemPath;\n let dir = pathHelper.dirname(remaining);\n while (dir !== remaining) {\n // Add the segment\n const basename = path.basename(remaining);\n this.segments.unshift(basename);\n // Truncate the last segment\n remaining = dir;\n dir = pathHelper.dirname(remaining);\n }\n // Remainder is the root\n this.segments.unshift(remaining);\n }\n }\n // Array\n else {\n // Must not be empty\n (0, assert_1.default)(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);\n // Each segment\n for (let i = 0; i < itemPath.length; i++) {\n let segment = itemPath[i];\n // Must not be empty\n (0, assert_1.default)(segment, `Parameter 'itemPath' must not contain any empty segments`);\n // Normalize slashes\n segment = pathHelper.normalizeSeparators(itemPath[i]);\n // Root segment\n if (i === 0 && pathHelper.hasRoot(segment)) {\n segment = pathHelper.safeTrimTrailingSeparator(segment);\n (0, assert_1.default)(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);\n this.segments.push(segment);\n }\n // All other segments\n else {\n // Must not contain slash\n (0, assert_1.default)(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);\n this.segments.push(segment);\n }\n }\n }\n }\n /**\n * Converts the path to it's string representation\n */\n toString() {\n // First segment\n let result = this.segments[0];\n // All others\n let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));\n for (let i = 1; i < this.segments.length; i++) {\n if (skipSlash) {\n skipSlash = false;\n }\n else {\n result += path.sep;\n }\n result += this.segments[i];\n }\n return result;\n }\n}\nexports.Path = Path;\n//# sourceMappingURL=internal-path.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Pattern = void 0;\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst pathHelper = __importStar(require(\"./internal-path-helper\"));\nconst assert_1 = __importDefault(require(\"assert\"));\nconst minimatch_1 = require(\"minimatch\");\nconst internal_match_kind_1 = require(\"./internal-match-kind\");\nconst internal_path_1 = require(\"./internal-path\");\nconst IS_WINDOWS = process.platform === 'win32';\nclass Pattern {\n constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) {\n /**\n * Indicates whether matches should be excluded from the result set\n */\n this.negate = false;\n // Pattern overload\n let pattern;\n if (typeof patternOrNegate === 'string') {\n pattern = patternOrNegate.trim();\n }\n // Segments overload\n else {\n // Convert to pattern\n segments = segments || [];\n (0, assert_1.default)(segments.length, `Parameter 'segments' must not empty`);\n const root = Pattern.getLiteral(segments[0]);\n (0, assert_1.default)(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);\n pattern = new internal_path_1.Path(segments).toString().trim();\n if (patternOrNegate) {\n pattern = `!${pattern}`;\n }\n }\n // Negate\n while (pattern.startsWith('!')) {\n this.negate = !this.negate;\n pattern = pattern.substr(1).trim();\n }\n // Normalize slashes and ensures absolute root\n pattern = Pattern.fixupPattern(pattern, homedir);\n // Segments\n this.segments = new internal_path_1.Path(pattern).segments;\n // Trailing slash indicates the pattern should only match directories, not regular files\n this.trailingSeparator = pathHelper\n .normalizeSeparators(pattern)\n .endsWith(path.sep);\n pattern = pathHelper.safeTrimTrailingSeparator(pattern);\n // Search path (literal path prior to the first glob segment)\n let foundGlob = false;\n const searchSegments = this.segments\n .map(x => Pattern.getLiteral(x))\n .filter(x => !foundGlob && !(foundGlob = x === ''));\n this.searchPath = new internal_path_1.Path(searchSegments).toString();\n // Root RegExp (required when determining partial match)\n this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : '');\n this.isImplicitPattern = isImplicitPattern;\n // Create minimatch\n const minimatchOptions = {\n dot: true,\n nobrace: true,\n nocase: IS_WINDOWS,\n nocomment: true,\n noext: true,\n nonegate: true\n };\n pattern = IS_WINDOWS ? pattern.replace(/\\\\/g, '/') : pattern;\n this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions);\n }\n /**\n * Matches the pattern against the specified path\n */\n match(itemPath) {\n // Last segment is globstar?\n if (this.segments[this.segments.length - 1] === '**') {\n // Normalize slashes\n itemPath = pathHelper.normalizeSeparators(itemPath);\n // Append a trailing slash. Otherwise Minimatch will not match the directory immediately\n // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns\n // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.\n if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) {\n // Note, this is safe because the constructor ensures the pattern has an absolute root.\n // For example, formats like C: and C:foo on Windows are resolved to an absolute root.\n itemPath = `${itemPath}${path.sep}`;\n }\n }\n else {\n // Normalize slashes and trim unnecessary trailing slash\n itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n }\n // Match\n if (this.minimatch.match(itemPath)) {\n return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All;\n }\n return internal_match_kind_1.MatchKind.None;\n }\n /**\n * Indicates whether the pattern may match descendants of the specified path\n */\n partialMatch(itemPath) {\n // Normalize slashes and trim unnecessary trailing slash\n itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n // matchOne does not handle root path correctly\n if (pathHelper.dirname(itemPath) === itemPath) {\n return this.rootRegExp.test(itemPath);\n }\n return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\\\+/ : /\\/+/), this.minimatch.set[0], true);\n }\n /**\n * Escapes glob patterns within a path\n */\n static globEscape(s) {\n return (IS_WINDOWS ? s : s.replace(/\\\\/g, '\\\\\\\\')) // escape '\\' on Linux/macOS\n .replace(/(\\[)(?=[^/]+\\])/g, '[[]') // escape '[' when ']' follows within the path segment\n .replace(/\\?/g, '[?]') // escape '?'\n .replace(/\\*/g, '[*]'); // escape '*'\n }\n /**\n * Normalizes slashes and ensures absolute root\n */\n static fixupPattern(pattern, homedir) {\n // Empty\n (0, assert_1.default)(pattern, 'pattern cannot be empty');\n // Must not contain `.` segment, unless first segment\n // Must not contain `..` segment\n const literalSegments = new internal_path_1.Path(pattern).segments.map(x => Pattern.getLiteral(x));\n (0, assert_1.default)(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);\n // Must not contain globs in root, e.g. Windows UNC path \\\\foo\\b*r\n (0, assert_1.default)(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);\n // Normalize slashes\n pattern = pathHelper.normalizeSeparators(pattern);\n // Replace leading `.` segment\n if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) {\n pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1);\n }\n // Replace leading `~` segment\n else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) {\n homedir = homedir || os.homedir();\n (0, assert_1.default)(homedir, 'Unable to determine HOME directory');\n (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);\n pattern = Pattern.globEscape(homedir) + pattern.substr(1);\n }\n // Replace relative drive root, e.g. pattern is C: or C:foo\n else if (IS_WINDOWS &&\n (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\\\]/i))) {\n let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', pattern.substr(0, 2));\n if (pattern.length > 2 && !root.endsWith('\\\\')) {\n root += '\\\\';\n }\n pattern = Pattern.globEscape(root) + pattern.substr(2);\n }\n // Replace relative root, e.g. pattern is \\ or \\foo\n else if (IS_WINDOWS && (pattern === '\\\\' || pattern.match(/^\\\\[^\\\\]/))) {\n let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', '\\\\');\n if (!root.endsWith('\\\\')) {\n root += '\\\\';\n }\n pattern = Pattern.globEscape(root) + pattern.substr(1);\n }\n // Otherwise ensure absolute root\n else {\n pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern);\n }\n return pathHelper.normalizeSeparators(pattern);\n }\n /**\n * Attempts to unescape a pattern segment to create a literal path segment.\n * Otherwise returns empty string.\n */\n static getLiteral(segment) {\n let literal = '';\n for (let i = 0; i < segment.length; i++) {\n const c = segment[i];\n // Escape\n if (c === '\\\\' && !IS_WINDOWS && i + 1 < segment.length) {\n literal += segment[++i];\n continue;\n }\n // Wildcard\n else if (c === '*' || c === '?') {\n return '';\n }\n // Character set\n else if (c === '[' && i + 1 < segment.length) {\n let set = '';\n let closed = -1;\n for (let i2 = i + 1; i2 < segment.length; i2++) {\n const c2 = segment[i2];\n // Escape\n if (c2 === '\\\\' && !IS_WINDOWS && i2 + 1 < segment.length) {\n set += segment[++i2];\n continue;\n }\n // Closed\n else if (c2 === ']') {\n closed = i2;\n break;\n }\n // Otherwise\n else {\n set += c2;\n }\n }\n // Closed?\n if (closed >= 0) {\n // Cannot convert\n if (set.length > 1) {\n return '';\n }\n // Convert to literal\n if (set) {\n literal += set;\n i = closed;\n continue;\n }\n }\n // Otherwise fall thru\n }\n // Append\n literal += c;\n }\n return literal;\n }\n /**\n * Escapes regexp special characters\n * https://javascript.info/regexp-escaping\n */\n static regExpEscape(s) {\n return s.replace(/[[\\\\^$.|?*+()]/g, '\\\\$&');\n }\n}\nexports.Pattern = Pattern;\n//# sourceMappingURL=internal-pattern.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SearchState = void 0;\nclass SearchState {\n constructor(path, level) {\n this.path = path;\n this.level = level;\n }\n}\nexports.SearchState = SearchState;\n//# sourceMappingURL=internal-search-state.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nvar __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultGlobber = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst fs = __importStar(require(\"fs\"));\nconst globOptionsHelper = __importStar(require(\"./internal-glob-options-helper\"));\nconst path = __importStar(require(\"path\"));\nconst patternHelper = __importStar(require(\"./internal-pattern-helper\"));\nconst internal_match_kind_1 = require(\"./internal-match-kind\");\nconst internal_pattern_1 = require(\"./internal-pattern\");\nconst internal_search_state_1 = require(\"./internal-search-state\");\nconst IS_WINDOWS = process.platform === 'win32';\nclass DefaultGlobber {\n constructor(options) {\n this.patterns = [];\n this.searchPaths = [];\n this.options = globOptionsHelper.getOptions(options);\n }\n getSearchPaths() {\n // Return a copy\n return this.searchPaths.slice();\n }\n glob() {\n var _a, e_1, _b, _c;\n return __awaiter(this, void 0, void 0, function* () {\n const result = [];\n try {\n for (var _d = true, _e = __asyncValues(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {\n _c = _f.value;\n _d = false;\n const itemPath = _c;\n result.push(itemPath);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return result;\n });\n }\n globGenerator() {\n return __asyncGenerator(this, arguments, function* globGenerator_1() {\n // Fill in defaults options\n const options = globOptionsHelper.getOptions(this.options);\n // Implicit descendants?\n const patterns = [];\n for (const pattern of this.patterns) {\n patterns.push(pattern);\n if (options.implicitDescendants &&\n (pattern.trailingSeparator ||\n pattern.segments[pattern.segments.length - 1] !== '**')) {\n patterns.push(new internal_pattern_1.Pattern(pattern.negate, true, pattern.segments.concat('**')));\n }\n }\n // Push the search paths\n const stack = [];\n for (const searchPath of patternHelper.getSearchPaths(patterns)) {\n core.debug(`Search path '${searchPath}'`);\n // Exists?\n try {\n // Intentionally using lstat. Detection for broken symlink\n // will be performed later (if following symlinks).\n yield __await(fs.promises.lstat(searchPath));\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n continue;\n }\n throw err;\n }\n stack.unshift(new internal_search_state_1.SearchState(searchPath, 1));\n }\n // Search\n const traversalChain = []; // used to detect cycles\n while (stack.length) {\n // Pop\n const item = stack.pop();\n // Match?\n const match = patternHelper.match(patterns, item.path);\n const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path);\n if (!match && !partialMatch) {\n continue;\n }\n // Stat\n const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain)\n // Broken symlink, or symlink cycle detected, or no longer exists\n );\n // Broken symlink, or symlink cycle detected, or no longer exists\n if (!stats) {\n continue;\n }\n // Hidden file or directory?\n if (options.excludeHiddenFiles && path.basename(item.path).match(/^\\./)) {\n continue;\n }\n // Directory\n if (stats.isDirectory()) {\n // Matched\n if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) {\n yield yield __await(item.path);\n }\n // Descend?\n else if (!partialMatch) {\n continue;\n }\n // Push the child items in reverse\n const childLevel = item.level + 1;\n const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new internal_search_state_1.SearchState(path.join(item.path, x), childLevel));\n stack.push(...childItems.reverse());\n }\n // File\n else if (match & internal_match_kind_1.MatchKind.File) {\n yield yield __await(item.path);\n }\n }\n });\n }\n /**\n * Constructs a DefaultGlobber\n */\n static create(patterns, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const result = new DefaultGlobber(options);\n if (IS_WINDOWS) {\n patterns = patterns.replace(/\\r\\n/g, '\\n');\n patterns = patterns.replace(/\\r/g, '\\n');\n }\n const lines = patterns.split('\\n').map(x => x.trim());\n for (const line of lines) {\n // Empty or comment\n if (!line || line.startsWith('#')) {\n continue;\n }\n // Pattern\n else {\n result.patterns.push(new internal_pattern_1.Pattern(line));\n }\n }\n result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns));\n return result;\n });\n }\n static stat(item, options, traversalChain) {\n return __awaiter(this, void 0, void 0, function* () {\n // Note:\n // `stat` returns info about the target of a symlink (or symlink chain)\n // `lstat` returns info about a symlink itself\n let stats;\n if (options.followSymbolicLinks) {\n try {\n // Use `stat` (following symlinks)\n stats = yield fs.promises.stat(item.path);\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n if (options.omitBrokenSymbolicLinks) {\n core.debug(`Broken symlink '${item.path}'`);\n return undefined;\n }\n throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`);\n }\n throw err;\n }\n }\n else {\n // Use `lstat` (not following symlinks)\n stats = yield fs.promises.lstat(item.path);\n }\n // Note, isDirectory() returns false for the lstat of a symlink\n if (stats.isDirectory() && options.followSymbolicLinks) {\n // Get the realpath\n const realPath = yield fs.promises.realpath(item.path);\n // Fixup the traversal chain to match the item level\n while (traversalChain.length >= item.level) {\n traversalChain.pop();\n }\n // Test for a cycle\n if (traversalChain.some((x) => x === realPath)) {\n core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`);\n return undefined;\n }\n // Update the traversal chain\n traversalChain.push(realPath);\n }\n return stats;\n });\n }\n}\nexports.DefaultGlobber = DefaultGlobber;\n//# sourceMappingURL=internal-globber.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hashFiles = void 0;\nconst crypto = __importStar(require(\"crypto\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst fs = __importStar(require(\"fs\"));\nconst stream = __importStar(require(\"stream\"));\nconst util = __importStar(require(\"util\"));\nconst path = __importStar(require(\"path\"));\nfunction hashFiles(globber, currentWorkspace, verbose = false) {\n var _a, e_1, _b, _c;\n var _d;\n return __awaiter(this, void 0, void 0, function* () {\n const writeDelegate = verbose ? core.info : core.debug;\n let hasMatch = false;\n const githubWorkspace = currentWorkspace\n ? currentWorkspace\n : (_d = process.env['GITHUB_WORKSPACE']) !== null && _d !== void 0 ? _d : process.cwd();\n const result = crypto.createHash('sha256');\n let count = 0;\n try {\n for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {\n _c = _g.value;\n _e = false;\n const file = _c;\n writeDelegate(file);\n if (!file.startsWith(`${githubWorkspace}${path.sep}`)) {\n writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);\n continue;\n }\n if (fs.statSync(file).isDirectory()) {\n writeDelegate(`Skip directory '${file}'.`);\n continue;\n }\n const hash = crypto.createHash('sha256');\n const pipeline = util.promisify(stream.pipeline);\n yield pipeline(fs.createReadStream(file), hash);\n result.write(hash.digest());\n count++;\n if (!hasMatch) {\n hasMatch = true;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (!_e && !_a && (_b = _f.return)) yield _b.call(_f);\n }\n finally { if (e_1) throw e_1.error; }\n }\n result.end();\n if (hasMatch) {\n writeDelegate(`Found ${count} files to hash.`);\n return result.digest('hex');\n }\n else {\n writeDelegate(`No matches found for glob`);\n return '';\n }\n });\n}\nexports.hashFiles = hashFiles;\n//# sourceMappingURL=internal-hash-files.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hashFiles = exports.create = void 0;\nconst internal_globber_1 = require(\"./internal-globber\");\nconst internal_hash_files_1 = require(\"./internal-hash-files\");\n/**\n * Constructs a globber\n *\n * @param patterns Patterns separated by newlines\n * @param options Glob options\n */\nfunction create(patterns, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield internal_globber_1.DefaultGlobber.create(patterns, options);\n });\n}\nexports.create = create;\n/**\n * Computes the sha256 hash of a glob\n *\n * @param patterns Patterns separated by newlines\n * @param currentWorkspace Workspace used when matching files\n * @param options Glob options\n * @param verbose Enables verbose logging\n */\nfunction hashFiles(patterns, currentWorkspace = '', options, verbose = false) {\n return __awaiter(this, void 0, void 0, function* () {\n let followSymbolicLinks = true;\n if (options && typeof options.followSymbolicLinks === 'boolean') {\n followSymbolicLinks = options.followSymbolicLinks;\n }\n const globber = yield create(patterns, { followSymbolicLinks });\n return (0, internal_hash_files_1.hashFiles)(globber, currentWorkspace, verbose);\n });\n}\nexports.hashFiles = hashFiles;\n//# sourceMappingURL=glob.js.map","const ALIAS = Symbol.for('yaml.alias');\nconst DOC = Symbol.for('yaml.document');\nconst MAP = Symbol.for('yaml.map');\nconst PAIR = Symbol.for('yaml.pair');\nconst SCALAR = Symbol.for('yaml.scalar');\nconst SEQ = Symbol.for('yaml.seq');\nconst NODE_TYPE = Symbol.for('yaml.node.type');\nconst isAlias = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === ALIAS;\nconst isDocument = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === DOC;\nconst isMap = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === MAP;\nconst isPair = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === PAIR;\nconst isScalar = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SCALAR;\nconst isSeq = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SEQ;\nfunction isCollection(node) {\n if (node && typeof node === 'object')\n switch (node[NODE_TYPE]) {\n case MAP:\n case SEQ:\n return true;\n }\n return false;\n}\nfunction isNode(node) {\n if (node && typeof node === 'object')\n switch (node[NODE_TYPE]) {\n case ALIAS:\n case MAP:\n case SCALAR:\n case SEQ:\n return true;\n }\n return false;\n}\nconst hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor;\n\nexport { ALIAS, DOC, MAP, NODE_TYPE, PAIR, SCALAR, SEQ, hasAnchor, isAlias, isCollection, isDocument, isMap, isNode, isPair, isScalar, isSeq };\n","import { isDocument, isNode, isPair, isCollection, isMap, isSeq, isScalar, isAlias } from './nodes/identity.js';\n\nconst BREAK = Symbol('break visit');\nconst SKIP = Symbol('skip children');\nconst REMOVE = Symbol('remove node');\n/**\n * Apply a visitor to an AST node or document.\n *\n * Walks through the tree (depth-first) starting from `node`, calling a\n * `visitor` function with three arguments:\n * - `key`: For sequence values and map `Pair`, the node's index in the\n * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.\n * `null` for the root node.\n * - `node`: The current node.\n * - `path`: The ancestry of the current node.\n *\n * The return value of the visitor may be used to control the traversal:\n * - `undefined` (default): Do nothing and continue\n * - `visit.SKIP`: Do not visit the children of this node, continue with next\n * sibling\n * - `visit.BREAK`: Terminate traversal completely\n * - `visit.REMOVE`: Remove the current node, then continue with the next one\n * - `Node`: Replace the current node, then continue by visiting it\n * - `number`: While iterating the items of a sequence or map, set the index\n * of the next step. This is useful especially if the index of the current\n * node has changed.\n *\n * If `visitor` is a single function, it will be called with all values\n * encountered in the tree, including e.g. `null` values. Alternatively,\n * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,\n * `Alias` and `Scalar` node. To define the same visitor function for more than\n * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)\n * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most\n * specific defined one will be used for each node.\n */\nfunction visit(node, visitor) {\n const visitor_ = initVisitor(visitor);\n if (isDocument(node)) {\n const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));\n if (cd === REMOVE)\n node.contents = null;\n }\n else\n visit_(null, node, visitor_, Object.freeze([]));\n}\n// Without the `as symbol` casts, TS declares these in the `visit`\n// namespace using `var`, but then complains about that because\n// `unique symbol` must be `const`.\n/** Terminate visit traversal completely */\nvisit.BREAK = BREAK;\n/** Do not visit the children of the current node */\nvisit.SKIP = SKIP;\n/** Remove the current node */\nvisit.REMOVE = REMOVE;\nfunction visit_(key, node, visitor, path) {\n const ctrl = callVisitor(key, node, visitor, path);\n if (isNode(ctrl) || isPair(ctrl)) {\n replaceNode(key, path, ctrl);\n return visit_(key, ctrl, visitor, path);\n }\n if (typeof ctrl !== 'symbol') {\n if (isCollection(node)) {\n path = Object.freeze(path.concat(node));\n for (let i = 0; i < node.items.length; ++i) {\n const ci = visit_(i, node.items[i], visitor, path);\n if (typeof ci === 'number')\n i = ci - 1;\n else if (ci === BREAK)\n return BREAK;\n else if (ci === REMOVE) {\n node.items.splice(i, 1);\n i -= 1;\n }\n }\n }\n else if (isPair(node)) {\n path = Object.freeze(path.concat(node));\n const ck = visit_('key', node.key, visitor, path);\n if (ck === BREAK)\n return BREAK;\n else if (ck === REMOVE)\n node.key = null;\n const cv = visit_('value', node.value, visitor, path);\n if (cv === BREAK)\n return BREAK;\n else if (cv === REMOVE)\n node.value = null;\n }\n }\n return ctrl;\n}\n/**\n * Apply an async visitor to an AST node or document.\n *\n * Walks through the tree (depth-first) starting from `node`, calling a\n * `visitor` function with three arguments:\n * - `key`: For sequence values and map `Pair`, the node's index in the\n * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.\n * `null` for the root node.\n * - `node`: The current node.\n * - `path`: The ancestry of the current node.\n *\n * The return value of the visitor may be used to control the traversal:\n * - `Promise`: Must resolve to one of the following values\n * - `undefined` (default): Do nothing and continue\n * - `visit.SKIP`: Do not visit the children of this node, continue with next\n * sibling\n * - `visit.BREAK`: Terminate traversal completely\n * - `visit.REMOVE`: Remove the current node, then continue with the next one\n * - `Node`: Replace the current node, then continue by visiting it\n * - `number`: While iterating the items of a sequence or map, set the index\n * of the next step. This is useful especially if the index of the current\n * node has changed.\n *\n * If `visitor` is a single function, it will be called with all values\n * encountered in the tree, including e.g. `null` values. Alternatively,\n * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,\n * `Alias` and `Scalar` node. To define the same visitor function for more than\n * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)\n * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most\n * specific defined one will be used for each node.\n */\nasync function visitAsync(node, visitor) {\n const visitor_ = initVisitor(visitor);\n if (isDocument(node)) {\n const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node]));\n if (cd === REMOVE)\n node.contents = null;\n }\n else\n await visitAsync_(null, node, visitor_, Object.freeze([]));\n}\n// Without the `as symbol` casts, TS declares these in the `visit`\n// namespace using `var`, but then complains about that because\n// `unique symbol` must be `const`.\n/** Terminate visit traversal completely */\nvisitAsync.BREAK = BREAK;\n/** Do not visit the children of the current node */\nvisitAsync.SKIP = SKIP;\n/** Remove the current node */\nvisitAsync.REMOVE = REMOVE;\nasync function visitAsync_(key, node, visitor, path) {\n const ctrl = await callVisitor(key, node, visitor, path);\n if (isNode(ctrl) || isPair(ctrl)) {\n replaceNode(key, path, ctrl);\n return visitAsync_(key, ctrl, visitor, path);\n }\n if (typeof ctrl !== 'symbol') {\n if (isCollection(node)) {\n path = Object.freeze(path.concat(node));\n for (let i = 0; i < node.items.length; ++i) {\n const ci = await visitAsync_(i, node.items[i], visitor, path);\n if (typeof ci === 'number')\n i = ci - 1;\n else if (ci === BREAK)\n return BREAK;\n else if (ci === REMOVE) {\n node.items.splice(i, 1);\n i -= 1;\n }\n }\n }\n else if (isPair(node)) {\n path = Object.freeze(path.concat(node));\n const ck = await visitAsync_('key', node.key, visitor, path);\n if (ck === BREAK)\n return BREAK;\n else if (ck === REMOVE)\n node.key = null;\n const cv = await visitAsync_('value', node.value, visitor, path);\n if (cv === BREAK)\n return BREAK;\n else if (cv === REMOVE)\n node.value = null;\n }\n }\n return ctrl;\n}\nfunction initVisitor(visitor) {\n if (typeof visitor === 'object' &&\n (visitor.Collection || visitor.Node || visitor.Value)) {\n return Object.assign({\n Alias: visitor.Node,\n Map: visitor.Node,\n Scalar: visitor.Node,\n Seq: visitor.Node\n }, visitor.Value && {\n Map: visitor.Value,\n Scalar: visitor.Value,\n Seq: visitor.Value\n }, visitor.Collection && {\n Map: visitor.Collection,\n Seq: visitor.Collection\n }, visitor);\n }\n return visitor;\n}\nfunction callVisitor(key, node, visitor, path) {\n if (typeof visitor === 'function')\n return visitor(key, node, path);\n if (isMap(node))\n return visitor.Map?.(key, node, path);\n if (isSeq(node))\n return visitor.Seq?.(key, node, path);\n if (isPair(node))\n return visitor.Pair?.(key, node, path);\n if (isScalar(node))\n return visitor.Scalar?.(key, node, path);\n if (isAlias(node))\n return visitor.Alias?.(key, node, path);\n return undefined;\n}\nfunction replaceNode(key, path, node) {\n const parent = path[path.length - 1];\n if (isCollection(parent)) {\n parent.items[key] = node;\n }\n else if (isPair(parent)) {\n if (key === 'key')\n parent.key = node;\n else\n parent.value = node;\n }\n else if (isDocument(parent)) {\n parent.contents = node;\n }\n else {\n const pt = isAlias(parent) ? 'alias' : 'scalar';\n throw new Error(`Cannot replace node with ${pt} parent`);\n }\n}\n\nexport { visit, visitAsync };\n","import { isNode } from '../nodes/identity.js';\nimport { visit } from '../visit.js';\n\nconst escapeChars = {\n '!': '%21',\n ',': '%2C',\n '[': '%5B',\n ']': '%5D',\n '{': '%7B',\n '}': '%7D'\n};\nconst escapeTagName = (tn) => tn.replace(/[!,[\\]{}]/g, ch => escapeChars[ch]);\nclass Directives {\n constructor(yaml, tags) {\n /**\n * The directives-end/doc-start marker `---`. If `null`, a marker may still be\n * included in the document's stringified representation.\n */\n this.docStart = null;\n /** The doc-end marker `...`. */\n this.docEnd = false;\n this.yaml = Object.assign({}, Directives.defaultYaml, yaml);\n this.tags = Object.assign({}, Directives.defaultTags, tags);\n }\n clone() {\n const copy = new Directives(this.yaml, this.tags);\n copy.docStart = this.docStart;\n return copy;\n }\n /**\n * During parsing, get a Directives instance for the current document and\n * update the stream state according to the current version's spec.\n */\n atDocument() {\n const res = new Directives(this.yaml, this.tags);\n switch (this.yaml.version) {\n case '1.1':\n this.atNextDocument = true;\n break;\n case '1.2':\n this.atNextDocument = false;\n this.yaml = {\n explicit: Directives.defaultYaml.explicit,\n version: '1.2'\n };\n this.tags = Object.assign({}, Directives.defaultTags);\n break;\n }\n return res;\n }\n /**\n * @param onError - May be called even if the action was successful\n * @returns `true` on success\n */\n add(line, onError) {\n if (this.atNextDocument) {\n this.yaml = { explicit: Directives.defaultYaml.explicit, version: '1.1' };\n this.tags = Object.assign({}, Directives.defaultTags);\n this.atNextDocument = false;\n }\n const parts = line.trim().split(/[ \\t]+/);\n const name = parts.shift();\n switch (name) {\n case '%TAG': {\n if (parts.length !== 2) {\n onError(0, '%TAG directive should contain exactly two parts');\n if (parts.length < 2)\n return false;\n }\n const [handle, prefix] = parts;\n this.tags[handle] = prefix;\n return true;\n }\n case '%YAML': {\n this.yaml.explicit = true;\n if (parts.length !== 1) {\n onError(0, '%YAML directive should contain exactly one part');\n return false;\n }\n const [version] = parts;\n if (version === '1.1' || version === '1.2') {\n this.yaml.version = version;\n return true;\n }\n else {\n const isValid = /^\\d+\\.\\d+$/.test(version);\n onError(6, `Unsupported YAML version ${version}`, isValid);\n return false;\n }\n }\n default:\n onError(0, `Unknown directive ${name}`, true);\n return false;\n }\n }\n /**\n * Resolves a tag, matching handles to those defined in %TAG directives.\n *\n * @returns Resolved tag, which may also be the non-specific tag `'!'` or a\n * `'!local'` tag, or `null` if unresolvable.\n */\n tagName(source, onError) {\n if (source === '!')\n return '!'; // non-specific tag\n if (source[0] !== '!') {\n onError(`Not a valid tag: ${source}`);\n return null;\n }\n if (source[1] === '<') {\n const verbatim = source.slice(2, -1);\n if (verbatim === '!' || verbatim === '!!') {\n onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);\n return null;\n }\n if (source[source.length - 1] !== '>')\n onError('Verbatim tags must end with a >');\n return verbatim;\n }\n const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);\n if (!suffix)\n onError(`The ${source} tag has no suffix`);\n const prefix = this.tags[handle];\n if (prefix) {\n try {\n return prefix + decodeURIComponent(suffix);\n }\n catch (error) {\n onError(String(error));\n return null;\n }\n }\n if (handle === '!')\n return source; // local tag\n onError(`Could not resolve tag: ${source}`);\n return null;\n }\n /**\n * Given a fully resolved tag, returns its printable string form,\n * taking into account current tag prefixes and defaults.\n */\n tagString(tag) {\n for (const [handle, prefix] of Object.entries(this.tags)) {\n if (tag.startsWith(prefix))\n return handle + escapeTagName(tag.substring(prefix.length));\n }\n return tag[0] === '!' ? tag : `!<${tag}>`;\n }\n toString(doc) {\n const lines = this.yaml.explicit\n ? [`%YAML ${this.yaml.version || '1.2'}`]\n : [];\n const tagEntries = Object.entries(this.tags);\n let tagNames;\n if (doc && tagEntries.length > 0 && isNode(doc.contents)) {\n const tags = {};\n visit(doc.contents, (_key, node) => {\n if (isNode(node) && node.tag)\n tags[node.tag] = true;\n });\n tagNames = Object.keys(tags);\n }\n else\n tagNames = [];\n for (const [handle, prefix] of tagEntries) {\n if (handle === '!!' && prefix === 'tag:yaml.org,2002:')\n continue;\n if (!doc || tagNames.some(tn => tn.startsWith(prefix)))\n lines.push(`%TAG ${handle} ${prefix}`);\n }\n return lines.join('\\n');\n }\n}\nDirectives.defaultYaml = { explicit: false, version: '1.2' };\nDirectives.defaultTags = { '!!': 'tag:yaml.org,2002:' };\n\nexport { Directives };\n","import { isScalar, isCollection } from '../nodes/identity.js';\nimport { visit } from '../visit.js';\n\n/**\n * Verify that the input string is a valid anchor.\n *\n * Will throw on errors.\n */\nfunction anchorIsValid(anchor) {\n if (/[\\x00-\\x19\\s,[\\]{}]/.test(anchor)) {\n const sa = JSON.stringify(anchor);\n const msg = `Anchor must not contain whitespace or control characters: ${sa}`;\n throw new Error(msg);\n }\n return true;\n}\nfunction anchorNames(root) {\n const anchors = new Set();\n visit(root, {\n Value(_key, node) {\n if (node.anchor)\n anchors.add(node.anchor);\n }\n });\n return anchors;\n}\n/** Find a new anchor name with the given `prefix` and a one-indexed suffix. */\nfunction findNewAnchor(prefix, exclude) {\n for (let i = 1; true; ++i) {\n const name = `${prefix}${i}`;\n if (!exclude.has(name))\n return name;\n }\n}\nfunction createNodeAnchors(doc, prefix) {\n const aliasObjects = [];\n const sourceObjects = new Map();\n let prevAnchors = null;\n return {\n onAnchor: (source) => {\n aliasObjects.push(source);\n prevAnchors ?? (prevAnchors = anchorNames(doc));\n const anchor = findNewAnchor(prefix, prevAnchors);\n prevAnchors.add(anchor);\n return anchor;\n },\n /**\n * With circular references, the source node is only resolved after all\n * of its child nodes are. This is why anchors are set only after all of\n * the nodes have been created.\n */\n setAnchors: () => {\n for (const source of aliasObjects) {\n const ref = sourceObjects.get(source);\n if (typeof ref === 'object' &&\n ref.anchor &&\n (isScalar(ref.node) || isCollection(ref.node))) {\n ref.node.anchor = ref.anchor;\n }\n else {\n const error = new Error('Failed to resolve repeated object (this should not happen)');\n error.source = source;\n throw error;\n }\n }\n },\n sourceObjects\n };\n}\n\nexport { anchorIsValid, anchorNames, createNodeAnchors, findNewAnchor };\n","/**\n * Applies the JSON.parse reviver algorithm as defined in the ECMA-262 spec,\n * in section 24.5.1.1 \"Runtime Semantics: InternalizeJSONProperty\" of the\n * 2021 edition: https://tc39.es/ecma262/#sec-json.parse\n *\n * Includes extensions for handling Map and Set objects.\n */\nfunction applyReviver(reviver, obj, key, val) {\n if (val && typeof val === 'object') {\n if (Array.isArray(val)) {\n for (let i = 0, len = val.length; i < len; ++i) {\n const v0 = val[i];\n const v1 = applyReviver(reviver, val, String(i), v0);\n // eslint-disable-next-line @typescript-eslint/no-array-delete\n if (v1 === undefined)\n delete val[i];\n else if (v1 !== v0)\n val[i] = v1;\n }\n }\n else if (val instanceof Map) {\n for (const k of Array.from(val.keys())) {\n const v0 = val.get(k);\n const v1 = applyReviver(reviver, val, k, v0);\n if (v1 === undefined)\n val.delete(k);\n else if (v1 !== v0)\n val.set(k, v1);\n }\n }\n else if (val instanceof Set) {\n for (const v0 of Array.from(val)) {\n const v1 = applyReviver(reviver, val, v0, v0);\n if (v1 === undefined)\n val.delete(v0);\n else if (v1 !== v0) {\n val.delete(v0);\n val.add(v1);\n }\n }\n }\n else {\n for (const [k, v0] of Object.entries(val)) {\n const v1 = applyReviver(reviver, val, k, v0);\n if (v1 === undefined)\n delete val[k];\n else if (v1 !== v0)\n val[k] = v1;\n }\n }\n }\n return reviver.call(obj, key, val);\n}\n\nexport { applyReviver };\n","import { hasAnchor } from './identity.js';\n\n/**\n * Recursively convert any node or its contents to native JavaScript\n *\n * @param value - The input value\n * @param arg - If `value` defines a `toJSON()` method, use this\n * as its first argument\n * @param ctx - Conversion context, originally set in Document#toJS(). If\n * `{ keep: true }` is not set, output should be suitable for JSON\n * stringification.\n */\nfunction toJS(value, arg, ctx) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n if (Array.isArray(value))\n return value.map((v, i) => toJS(v, String(i), ctx));\n if (value && typeof value.toJSON === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n if (!ctx || !hasAnchor(value))\n return value.toJSON(arg, ctx);\n const data = { aliasCount: 0, count: 1, res: undefined };\n ctx.anchors.set(value, data);\n ctx.onCreate = res => {\n data.res = res;\n delete ctx.onCreate;\n };\n const res = value.toJSON(arg, ctx);\n if (ctx.onCreate)\n ctx.onCreate(res);\n return res;\n }\n if (typeof value === 'bigint' && !ctx?.keep)\n return Number(value);\n return value;\n}\n\nexport { toJS };\n","import { applyReviver } from '../doc/applyReviver.js';\nimport { NODE_TYPE, isDocument } from './identity.js';\nimport { toJS } from './toJS.js';\n\nclass NodeBase {\n constructor(type) {\n Object.defineProperty(this, NODE_TYPE, { value: type });\n }\n /** Create a copy of this node. */\n clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }\n /** A plain JavaScript representation of this node. */\n toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {\n if (!isDocument(doc))\n throw new TypeError('A document argument is required');\n const ctx = {\n anchors: new Map(),\n doc,\n keep: true,\n mapAsMap: mapAsMap === true,\n mapKeyWarned: false,\n maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100\n };\n const res = toJS(this, '', ctx);\n if (typeof onAnchor === 'function')\n for (const { count, res } of ctx.anchors.values())\n onAnchor(res, count);\n return typeof reviver === 'function'\n ? applyReviver(reviver, { '': res }, '', res)\n : res;\n }\n}\n\nexport { NodeBase };\n","import { anchorIsValid } from '../doc/anchors.js';\nimport { visit } from '../visit.js';\nimport { ALIAS, isAlias, isCollection, isPair, hasAnchor } from './identity.js';\nimport { NodeBase } from './Node.js';\nimport { toJS } from './toJS.js';\n\nclass Alias extends NodeBase {\n constructor(source) {\n super(ALIAS);\n this.source = source;\n Object.defineProperty(this, 'tag', {\n set() {\n throw new Error('Alias nodes cannot have tags');\n }\n });\n }\n /**\n * Resolve the value of this alias within `doc`, finding the last\n * instance of the `source` anchor before this node.\n */\n resolve(doc, ctx) {\n let nodes;\n if (ctx?.aliasResolveCache) {\n nodes = ctx.aliasResolveCache;\n }\n else {\n nodes = [];\n visit(doc, {\n Node: (_key, node) => {\n if (isAlias(node) || hasAnchor(node))\n nodes.push(node);\n }\n });\n if (ctx)\n ctx.aliasResolveCache = nodes;\n }\n let found = undefined;\n for (const node of nodes) {\n if (node === this)\n break;\n if (node.anchor === this.source)\n found = node;\n }\n return found;\n }\n toJSON(_arg, ctx) {\n if (!ctx)\n return { source: this.source };\n const { anchors, doc, maxAliasCount } = ctx;\n const source = this.resolve(doc, ctx);\n if (!source) {\n const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;\n throw new ReferenceError(msg);\n }\n let data = anchors.get(source);\n if (!data) {\n // Resolve anchors for Node.prototype.toJS()\n toJS(source, null, ctx);\n data = anchors.get(source);\n }\n /* istanbul ignore if */\n if (!data || data.res === undefined) {\n const msg = 'This should not happen: Alias anchor was not resolved?';\n throw new ReferenceError(msg);\n }\n if (maxAliasCount >= 0) {\n data.count += 1;\n if (data.aliasCount === 0)\n data.aliasCount = getAliasCount(doc, source, anchors);\n if (data.count * data.aliasCount > maxAliasCount) {\n const msg = 'Excessive alias count indicates a resource exhaustion attack';\n throw new ReferenceError(msg);\n }\n }\n return data.res;\n }\n toString(ctx, _onComment, _onChompKeep) {\n const src = `*${this.source}`;\n if (ctx) {\n anchorIsValid(this.source);\n if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) {\n const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;\n throw new Error(msg);\n }\n if (ctx.implicitKey)\n return `${src} `;\n }\n return src;\n }\n}\nfunction getAliasCount(doc, node, anchors) {\n if (isAlias(node)) {\n const source = node.resolve(doc);\n const anchor = anchors && source && anchors.get(source);\n return anchor ? anchor.count * anchor.aliasCount : 0;\n }\n else if (isCollection(node)) {\n let count = 0;\n for (const item of node.items) {\n const c = getAliasCount(doc, item, anchors);\n if (c > count)\n count = c;\n }\n return count;\n }\n else if (isPair(node)) {\n const kc = getAliasCount(doc, node.key, anchors);\n const vc = getAliasCount(doc, node.value, anchors);\n return Math.max(kc, vc);\n }\n return 1;\n}\n\nexport { Alias };\n","import { SCALAR } from './identity.js';\nimport { NodeBase } from './Node.js';\nimport { toJS } from './toJS.js';\n\nconst isScalarValue = (value) => !value || (typeof value !== 'function' && typeof value !== 'object');\nclass Scalar extends NodeBase {\n constructor(value) {\n super(SCALAR);\n this.value = value;\n }\n toJSON(arg, ctx) {\n return ctx?.keep ? this.value : toJS(this.value, arg, ctx);\n }\n toString() {\n return String(this.value);\n }\n}\nScalar.BLOCK_FOLDED = 'BLOCK_FOLDED';\nScalar.BLOCK_LITERAL = 'BLOCK_LITERAL';\nScalar.PLAIN = 'PLAIN';\nScalar.QUOTE_DOUBLE = 'QUOTE_DOUBLE';\nScalar.QUOTE_SINGLE = 'QUOTE_SINGLE';\n\nexport { Scalar, isScalarValue };\n","import { Alias } from '../nodes/Alias.js';\nimport { isNode, isPair, MAP, SEQ, isDocument } from '../nodes/identity.js';\nimport { Scalar } from '../nodes/Scalar.js';\n\nconst defaultTagPrefix = 'tag:yaml.org,2002:';\nfunction findTagObject(value, tagName, tags) {\n if (tagName) {\n const match = tags.filter(t => t.tag === tagName);\n const tagObj = match.find(t => !t.format) ?? match[0];\n if (!tagObj)\n throw new Error(`Tag ${tagName} not found`);\n return tagObj;\n }\n return tags.find(t => t.identify?.(value) && !t.format);\n}\nfunction createNode(value, tagName, ctx) {\n if (isDocument(value))\n value = value.contents;\n if (isNode(value))\n return value;\n if (isPair(value)) {\n const map = ctx.schema[MAP].createNode?.(ctx.schema, null, ctx);\n map.items.push(value);\n return map;\n }\n if (value instanceof String ||\n value instanceof Number ||\n value instanceof Boolean ||\n (typeof BigInt !== 'undefined' && value instanceof BigInt) // not supported everywhere\n ) {\n // https://tc39.es/ecma262/#sec-serializejsonproperty\n value = value.valueOf();\n }\n const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx;\n // Detect duplicate references to the same object & use Alias nodes for all\n // after first. The `ref` wrapper allows for circular references to resolve.\n let ref = undefined;\n if (aliasDuplicateObjects && value && typeof value === 'object') {\n ref = sourceObjects.get(value);\n if (ref) {\n ref.anchor ?? (ref.anchor = onAnchor(value));\n return new Alias(ref.anchor);\n }\n else {\n ref = { anchor: null, node: null };\n sourceObjects.set(value, ref);\n }\n }\n if (tagName?.startsWith('!!'))\n tagName = defaultTagPrefix + tagName.slice(2);\n let tagObj = findTagObject(value, tagName, schema.tags);\n if (!tagObj) {\n if (value && typeof value.toJSON === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n value = value.toJSON();\n }\n if (!value || typeof value !== 'object') {\n const node = new Scalar(value);\n if (ref)\n ref.node = node;\n return node;\n }\n tagObj =\n value instanceof Map\n ? schema[MAP]\n : Symbol.iterator in Object(value)\n ? schema[SEQ]\n : schema[MAP];\n }\n if (onTagObj) {\n onTagObj(tagObj);\n delete ctx.onTagObj;\n }\n const node = tagObj?.createNode\n ? tagObj.createNode(ctx.schema, value, ctx)\n : typeof tagObj?.nodeClass?.from === 'function'\n ? tagObj.nodeClass.from(ctx.schema, value, ctx)\n : new Scalar(value);\n if (tagName)\n node.tag = tagName;\n else if (!tagObj.default)\n node.tag = tagObj.tag;\n if (ref)\n ref.node = node;\n return node;\n}\n\nexport { createNode };\n","import { createNode } from '../doc/createNode.js';\nimport { isNode, isPair, isCollection, isScalar } from './identity.js';\nimport { NodeBase } from './Node.js';\n\nfunction collectionFromPath(schema, path, value) {\n let v = value;\n for (let i = path.length - 1; i >= 0; --i) {\n const k = path[i];\n if (typeof k === 'number' && Number.isInteger(k) && k >= 0) {\n const a = [];\n a[k] = v;\n v = a;\n }\n else {\n v = new Map([[k, v]]);\n }\n }\n return createNode(v, undefined, {\n aliasDuplicateObjects: false,\n keepUndefined: false,\n onAnchor: () => {\n throw new Error('This should not happen, please report a bug.');\n },\n schema,\n sourceObjects: new Map()\n });\n}\n// Type guard is intentionally a little wrong so as to be more useful,\n// as it does not cover untypable empty non-string iterables (e.g. []).\nconst isEmptyPath = (path) => path == null ||\n (typeof path === 'object' && !!path[Symbol.iterator]().next().done);\nclass Collection extends NodeBase {\n constructor(type, schema) {\n super(type);\n Object.defineProperty(this, 'schema', {\n value: schema,\n configurable: true,\n enumerable: false,\n writable: true\n });\n }\n /**\n * Create a copy of this collection.\n *\n * @param schema - If defined, overwrites the original's schema\n */\n clone(schema) {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (schema)\n copy.schema = schema;\n copy.items = copy.items.map(it => isNode(it) || isPair(it) ? it.clone(schema) : it);\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }\n /**\n * Adds a value to the collection. For `!!map` and `!!omap` the value must\n * be a Pair instance or a `{ key, value }` object, which may not have a key\n * that already exists in the map.\n */\n addIn(path, value) {\n if (isEmptyPath(path))\n this.add(value);\n else {\n const [key, ...rest] = path;\n const node = this.get(key, true);\n if (isCollection(node))\n node.addIn(rest, value);\n else if (node === undefined && this.schema)\n this.set(key, collectionFromPath(this.schema, rest, value));\n else\n throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);\n }\n }\n /**\n * Removes a value from the collection.\n * @returns `true` if the item was found and removed.\n */\n deleteIn(path) {\n const [key, ...rest] = path;\n if (rest.length === 0)\n return this.delete(key);\n const node = this.get(key, true);\n if (isCollection(node))\n return node.deleteIn(rest);\n else\n throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);\n }\n /**\n * Returns item at `key`, or `undefined` if not found. By default unwraps\n * scalar values from their surrounding node; to disable set `keepScalar` to\n * `true` (collections are always returned intact).\n */\n getIn(path, keepScalar) {\n const [key, ...rest] = path;\n const node = this.get(key, true);\n if (rest.length === 0)\n return !keepScalar && isScalar(node) ? node.value : node;\n else\n return isCollection(node) ? node.getIn(rest, keepScalar) : undefined;\n }\n hasAllNullValues(allowScalar) {\n return this.items.every(node => {\n if (!isPair(node))\n return false;\n const n = node.value;\n return (n == null ||\n (allowScalar &&\n isScalar(n) &&\n n.value == null &&\n !n.commentBefore &&\n !n.comment &&\n !n.tag));\n });\n }\n /**\n * Checks if the collection includes a value with the key `key`.\n */\n hasIn(path) {\n const [key, ...rest] = path;\n if (rest.length === 0)\n return this.has(key);\n const node = this.get(key, true);\n return isCollection(node) ? node.hasIn(rest) : false;\n }\n /**\n * Sets a value in this collection. For `!!set`, `value` needs to be a\n * boolean to add/remove the item from the set.\n */\n setIn(path, value) {\n const [key, ...rest] = path;\n if (rest.length === 0) {\n this.set(key, value);\n }\n else {\n const node = this.get(key, true);\n if (isCollection(node))\n node.setIn(rest, value);\n else if (node === undefined && this.schema)\n this.set(key, collectionFromPath(this.schema, rest, value));\n else\n throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);\n }\n }\n}\n\nexport { Collection, collectionFromPath, isEmptyPath };\n","/**\n * Stringifies a comment.\n *\n * Empty comment lines are left empty,\n * lines consisting of a single space are replaced by `#`,\n * and all other lines are prefixed with a `#`.\n */\nconst stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, '#');\nfunction indentComment(comment, indent) {\n if (/^\\n+$/.test(comment))\n return comment.substring(1);\n return indent ? comment.replace(/^(?! *$)/gm, indent) : comment;\n}\nconst lineComment = (str, indent, comment) => str.endsWith('\\n')\n ? indentComment(comment, indent)\n : comment.includes('\\n')\n ? '\\n' + indentComment(comment, indent)\n : (str.endsWith(' ') ? '' : ' ') + comment;\n\nexport { indentComment, lineComment, stringifyComment };\n","const FOLD_FLOW = 'flow';\nconst FOLD_BLOCK = 'block';\nconst FOLD_QUOTED = 'quoted';\n/**\n * Tries to keep input at up to `lineWidth` characters, splitting only on spaces\n * not followed by newlines or spaces unless `mode` is `'quoted'`. Lines are\n * terminated with `\\n` and started with `indent`.\n */\nfunction foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {\n if (!lineWidth || lineWidth < 0)\n return text;\n if (lineWidth < minContentWidth)\n minContentWidth = 0;\n const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);\n if (text.length <= endStep)\n return text;\n const folds = [];\n const escapedFolds = {};\n let end = lineWidth - indent.length;\n if (typeof indentAtStart === 'number') {\n if (indentAtStart > lineWidth - Math.max(2, minContentWidth))\n folds.push(0);\n else\n end = lineWidth - indentAtStart;\n }\n let split = undefined;\n let prev = undefined;\n let overflow = false;\n let i = -1;\n let escStart = -1;\n let escEnd = -1;\n if (mode === FOLD_BLOCK) {\n i = consumeMoreIndentedLines(text, i, indent.length);\n if (i !== -1)\n end = i + endStep;\n }\n for (let ch; (ch = text[(i += 1)]);) {\n if (mode === FOLD_QUOTED && ch === '\\\\') {\n escStart = i;\n switch (text[i + 1]) {\n case 'x':\n i += 3;\n break;\n case 'u':\n i += 5;\n break;\n case 'U':\n i += 9;\n break;\n default:\n i += 1;\n }\n escEnd = i;\n }\n if (ch === '\\n') {\n if (mode === FOLD_BLOCK)\n i = consumeMoreIndentedLines(text, i, indent.length);\n end = i + indent.length + endStep;\n split = undefined;\n }\n else {\n if (ch === ' ' &&\n prev &&\n prev !== ' ' &&\n prev !== '\\n' &&\n prev !== '\\t') {\n // space surrounded by non-space can be replaced with newline + indent\n const next = text[i + 1];\n if (next && next !== ' ' && next !== '\\n' && next !== '\\t')\n split = i;\n }\n if (i >= end) {\n if (split) {\n folds.push(split);\n end = split + endStep;\n split = undefined;\n }\n else if (mode === FOLD_QUOTED) {\n // white-space collected at end may stretch past lineWidth\n while (prev === ' ' || prev === '\\t') {\n prev = ch;\n ch = text[(i += 1)];\n overflow = true;\n }\n // Account for newline escape, but don't break preceding escape\n const j = i > escEnd + 1 ? i - 2 : escStart - 1;\n // Bail out if lineWidth & minContentWidth are shorter than an escape string\n if (escapedFolds[j])\n return text;\n folds.push(j);\n escapedFolds[j] = true;\n end = j + endStep;\n split = undefined;\n }\n else {\n overflow = true;\n }\n }\n }\n prev = ch;\n }\n if (overflow && onOverflow)\n onOverflow();\n if (folds.length === 0)\n return text;\n if (onFold)\n onFold();\n let res = text.slice(0, folds[0]);\n for (let i = 0; i < folds.length; ++i) {\n const fold = folds[i];\n const end = folds[i + 1] || text.length;\n if (fold === 0)\n res = `\\n${indent}${text.slice(0, end)}`;\n else {\n if (mode === FOLD_QUOTED && escapedFolds[fold])\n res += `${text[fold]}\\\\`;\n res += `\\n${indent}${text.slice(fold + 1, end)}`;\n }\n }\n return res;\n}\n/**\n * Presumes `i + 1` is at the start of a line\n * @returns index of last newline in more-indented block\n */\nfunction consumeMoreIndentedLines(text, i, indent) {\n let end = i;\n let start = i + 1;\n let ch = text[start];\n while (ch === ' ' || ch === '\\t') {\n if (i < start + indent) {\n ch = text[++i];\n }\n else {\n do {\n ch = text[++i];\n } while (ch && ch !== '\\n');\n end = i;\n start = i + 1;\n ch = text[start];\n }\n }\n return end;\n}\n\nexport { FOLD_BLOCK, FOLD_FLOW, FOLD_QUOTED, foldFlowLines };\n","import { Scalar } from '../nodes/Scalar.js';\nimport { foldFlowLines, FOLD_FLOW, FOLD_QUOTED, FOLD_BLOCK } from './foldFlowLines.js';\n\nconst getFoldOptions = (ctx, isBlock) => ({\n indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,\n lineWidth: ctx.options.lineWidth,\n minContentWidth: ctx.options.minContentWidth\n});\n// Also checks for lines starting with %, as parsing the output as YAML 1.1 will\n// presume that's starting a new document.\nconst containsDocumentMarker = (str) => /^(%|---|\\.\\.\\.)/m.test(str);\nfunction lineLengthOverLimit(str, lineWidth, indentLength) {\n if (!lineWidth || lineWidth < 0)\n return false;\n const limit = lineWidth - indentLength;\n const strLen = str.length;\n if (strLen <= limit)\n return false;\n for (let i = 0, start = 0; i < strLen; ++i) {\n if (str[i] === '\\n') {\n if (i - start > limit)\n return true;\n start = i + 1;\n if (strLen - start <= limit)\n return false;\n }\n }\n return true;\n}\nfunction doubleQuotedString(value, ctx) {\n const json = JSON.stringify(value);\n if (ctx.options.doubleQuotedAsJSON)\n return json;\n const { implicitKey } = ctx;\n const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;\n const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');\n let str = '';\n let start = 0;\n for (let i = 0, ch = json[i]; ch; ch = json[++i]) {\n if (ch === ' ' && json[i + 1] === '\\\\' && json[i + 2] === 'n') {\n // space before newline needs to be escaped to not be folded\n str += json.slice(start, i) + '\\\\ ';\n i += 1;\n start = i;\n ch = '\\\\';\n }\n if (ch === '\\\\')\n switch (json[i + 1]) {\n case 'u':\n {\n str += json.slice(start, i);\n const code = json.substr(i + 2, 4);\n switch (code) {\n case '0000':\n str += '\\\\0';\n break;\n case '0007':\n str += '\\\\a';\n break;\n case '000b':\n str += '\\\\v';\n break;\n case '001b':\n str += '\\\\e';\n break;\n case '0085':\n str += '\\\\N';\n break;\n case '00a0':\n str += '\\\\_';\n break;\n case '2028':\n str += '\\\\L';\n break;\n case '2029':\n str += '\\\\P';\n break;\n default:\n if (code.substr(0, 2) === '00')\n str += '\\\\x' + code.substr(2);\n else\n str += json.substr(i, 6);\n }\n i += 5;\n start = i + 1;\n }\n break;\n case 'n':\n if (implicitKey ||\n json[i + 2] === '\"' ||\n json.length < minMultiLineLength) {\n i += 1;\n }\n else {\n // folding will eat first newline\n str += json.slice(start, i) + '\\n\\n';\n while (json[i + 2] === '\\\\' &&\n json[i + 3] === 'n' &&\n json[i + 4] !== '\"') {\n str += '\\n';\n i += 2;\n }\n str += indent;\n // space after newline needs to be escaped to not be folded\n if (json[i + 2] === ' ')\n str += '\\\\';\n i += 1;\n start = i + 1;\n }\n break;\n default:\n i += 1;\n }\n }\n str = start ? str + json.slice(start) : json;\n return implicitKey\n ? str\n : foldFlowLines(str, indent, FOLD_QUOTED, getFoldOptions(ctx, false));\n}\nfunction singleQuotedString(value, ctx) {\n if (ctx.options.singleQuote === false ||\n (ctx.implicitKey && value.includes('\\n')) ||\n /[ \\t]\\n|\\n[ \\t]/.test(value) // single quoted string can't have leading or trailing whitespace around newline\n )\n return doubleQuotedString(value, ctx);\n const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');\n const res = \"'\" + value.replace(/'/g, \"''\").replace(/\\n+/g, `$&\\n${indent}`) + \"'\";\n return ctx.implicitKey\n ? res\n : foldFlowLines(res, indent, FOLD_FLOW, getFoldOptions(ctx, false));\n}\nfunction quotedString(value, ctx) {\n const { singleQuote } = ctx.options;\n let qs;\n if (singleQuote === false)\n qs = doubleQuotedString;\n else {\n const hasDouble = value.includes('\"');\n const hasSingle = value.includes(\"'\");\n if (hasDouble && !hasSingle)\n qs = singleQuotedString;\n else if (hasSingle && !hasDouble)\n qs = doubleQuotedString;\n else\n qs = singleQuote ? singleQuotedString : doubleQuotedString;\n }\n return qs(value, ctx);\n}\n// The negative lookbehind avoids a polynomial search,\n// but isn't supported yet on Safari: https://caniuse.com/js-regexp-lookbehind\nlet blockEndNewlines;\ntry {\n blockEndNewlines = new RegExp('(^|(?\\n';\n // determine chomping from whitespace at value end\n let chomp;\n let endStart;\n for (endStart = value.length; endStart > 0; --endStart) {\n const ch = value[endStart - 1];\n if (ch !== '\\n' && ch !== '\\t' && ch !== ' ')\n break;\n }\n let end = value.substring(endStart);\n const endNlPos = end.indexOf('\\n');\n if (endNlPos === -1) {\n chomp = '-'; // strip\n }\n else if (value === end || endNlPos !== end.length - 1) {\n chomp = '+'; // keep\n if (onChompKeep)\n onChompKeep();\n }\n else {\n chomp = ''; // clip\n }\n if (end) {\n value = value.slice(0, -end.length);\n if (end[end.length - 1] === '\\n')\n end = end.slice(0, -1);\n end = end.replace(blockEndNewlines, `$&${indent}`);\n }\n // determine indent indicator from whitespace at value start\n let startWithSpace = false;\n let startEnd;\n let startNlPos = -1;\n for (startEnd = 0; startEnd < value.length; ++startEnd) {\n const ch = value[startEnd];\n if (ch === ' ')\n startWithSpace = true;\n else if (ch === '\\n')\n startNlPos = startEnd;\n else\n break;\n }\n let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);\n if (start) {\n value = value.substring(start.length);\n start = start.replace(/\\n+/g, `$&${indent}`);\n }\n const indentSize = indent ? '2' : '1'; // root is at -1\n // Leading | or > is added later\n let header = (startWithSpace ? indentSize : '') + chomp;\n if (comment) {\n header += ' ' + commentString(comment.replace(/ ?[\\r\\n]+/g, ' '));\n if (onComment)\n onComment();\n }\n if (!literal) {\n const foldedValue = value\n .replace(/\\n+/g, '\\n$&')\n .replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g, '$1$2') // more-indented lines aren't folded\n // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent\n .replace(/\\n+/g, `$&${indent}`);\n let literalFallback = false;\n const foldOptions = getFoldOptions(ctx, true);\n if (blockQuote !== 'folded' && type !== Scalar.BLOCK_FOLDED) {\n foldOptions.onOverflow = () => {\n literalFallback = true;\n };\n }\n const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);\n if (!literalFallback)\n return `>${header}\\n${indent}${body}`;\n }\n value = value.replace(/\\n+/g, `$&${indent}`);\n return `|${header}\\n${indent}${start}${value}${end}`;\n}\nfunction plainString(item, ctx, onComment, onChompKeep) {\n const { type, value } = item;\n const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;\n if ((implicitKey && value.includes('\\n')) ||\n (inFlow && /[[\\]{},]/.test(value))) {\n return quotedString(value, ctx);\n }\n if (/^[\\n\\t ,[\\]{}#&*!|>'\"%@`]|^[?-]$|^[?-][ \\t]|[\\n:][ \\t]|[ \\t]\\n|[\\n\\t ]#|[\\n\\t :]$/.test(value)) {\n // not allowed:\n // - '-' or '?'\n // - start with an indicator character (except [?:-]) or /[?-] /\n // - '\\n ', ': ' or ' \\n' anywhere\n // - '#' not preceded by a non-space char\n // - end with ' ' or ':'\n return implicitKey || inFlow || !value.includes('\\n')\n ? quotedString(value, ctx)\n : blockString(item, ctx, onComment, onChompKeep);\n }\n if (!implicitKey &&\n !inFlow &&\n type !== Scalar.PLAIN &&\n value.includes('\\n')) {\n // Where allowed & type not set explicitly, prefer block style for multiline strings\n return blockString(item, ctx, onComment, onChompKeep);\n }\n if (containsDocumentMarker(value)) {\n if (indent === '') {\n ctx.forceBlockIndent = true;\n return blockString(item, ctx, onComment, onChompKeep);\n }\n else if (implicitKey && indent === indentStep) {\n return quotedString(value, ctx);\n }\n }\n const str = value.replace(/\\n+/g, `$&\\n${indent}`);\n // Verify that output will be parsed as a string, as e.g. plain numbers and\n // booleans get parsed with those types in v1.2 (e.g. '42', 'true' & '0.9e-3'),\n // and others in v1.1.\n if (actualString) {\n const test = (tag) => tag.default && tag.tag !== 'tag:yaml.org,2002:str' && tag.test?.test(str);\n const { compat, tags } = ctx.doc.schema;\n if (tags.some(test) || compat?.some(test))\n return quotedString(value, ctx);\n }\n return implicitKey\n ? str\n : foldFlowLines(str, indent, FOLD_FLOW, getFoldOptions(ctx, false));\n}\nfunction stringifyString(item, ctx, onComment, onChompKeep) {\n const { implicitKey, inFlow } = ctx;\n const ss = typeof item.value === 'string'\n ? item\n : Object.assign({}, item, { value: String(item.value) });\n let { type } = item;\n if (type !== Scalar.QUOTE_DOUBLE) {\n // force double quotes on control characters & unpaired surrogates\n if (/[\\x00-\\x08\\x0b-\\x1f\\x7f-\\x9f\\u{D800}-\\u{DFFF}]/u.test(ss.value))\n type = Scalar.QUOTE_DOUBLE;\n }\n const _stringify = (_type) => {\n switch (_type) {\n case Scalar.BLOCK_FOLDED:\n case Scalar.BLOCK_LITERAL:\n return implicitKey || inFlow\n ? quotedString(ss.value, ctx) // blocks are not valid inside flow containers\n : blockString(ss, ctx, onComment, onChompKeep);\n case Scalar.QUOTE_DOUBLE:\n return doubleQuotedString(ss.value, ctx);\n case Scalar.QUOTE_SINGLE:\n return singleQuotedString(ss.value, ctx);\n case Scalar.PLAIN:\n return plainString(ss, ctx, onComment, onChompKeep);\n default:\n return null;\n }\n };\n let res = _stringify(type);\n if (res === null) {\n const { defaultKeyType, defaultStringType } = ctx.options;\n const t = (implicitKey && defaultKeyType) || defaultStringType;\n res = _stringify(t);\n if (res === null)\n throw new Error(`Unsupported default string type ${t}`);\n }\n return res;\n}\n\nexport { stringifyString };\n","import { anchorIsValid } from '../doc/anchors.js';\nimport { isPair, isAlias, isNode, isScalar, isCollection } from '../nodes/identity.js';\nimport { stringifyComment } from './stringifyComment.js';\nimport { stringifyString } from './stringifyString.js';\n\nfunction createStringifyContext(doc, options) {\n const opt = Object.assign({\n blockQuote: true,\n commentString: stringifyComment,\n defaultKeyType: null,\n defaultStringType: 'PLAIN',\n directives: null,\n doubleQuotedAsJSON: false,\n doubleQuotedMinMultiLineLength: 40,\n falseStr: 'false',\n flowCollectionPadding: true,\n indentSeq: true,\n lineWidth: 80,\n minContentWidth: 20,\n nullStr: 'null',\n simpleKeys: false,\n singleQuote: null,\n trueStr: 'true',\n verifyAliasOrder: true\n }, doc.schema.toStringOptions, options);\n let inFlow;\n switch (opt.collectionStyle) {\n case 'block':\n inFlow = false;\n break;\n case 'flow':\n inFlow = true;\n break;\n default:\n inFlow = null;\n }\n return {\n anchors: new Set(),\n doc,\n flowCollectionPadding: opt.flowCollectionPadding ? ' ' : '',\n indent: '',\n indentStep: typeof opt.indent === 'number' ? ' '.repeat(opt.indent) : ' ',\n inFlow,\n options: opt\n };\n}\nfunction getTagObject(tags, item) {\n if (item.tag) {\n const match = tags.filter(t => t.tag === item.tag);\n if (match.length > 0)\n return match.find(t => t.format === item.format) ?? match[0];\n }\n let tagObj = undefined;\n let obj;\n if (isScalar(item)) {\n obj = item.value;\n let match = tags.filter(t => t.identify?.(obj));\n if (match.length > 1) {\n const testMatch = match.filter(t => t.test);\n if (testMatch.length > 0)\n match = testMatch;\n }\n tagObj =\n match.find(t => t.format === item.format) ?? match.find(t => !t.format);\n }\n else {\n obj = item;\n tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);\n }\n if (!tagObj) {\n const name = obj?.constructor?.name ?? (obj === null ? 'null' : typeof obj);\n throw new Error(`Tag not resolved for ${name} value`);\n }\n return tagObj;\n}\n// needs to be called before value stringifier to allow for circular anchor refs\nfunction stringifyProps(node, tagObj, { anchors, doc }) {\n if (!doc.directives)\n return '';\n const props = [];\n const anchor = (isScalar(node) || isCollection(node)) && node.anchor;\n if (anchor && anchorIsValid(anchor)) {\n anchors.add(anchor);\n props.push(`&${anchor}`);\n }\n const tag = node.tag ?? (tagObj.default ? null : tagObj.tag);\n if (tag)\n props.push(doc.directives.tagString(tag));\n return props.join(' ');\n}\nfunction stringify(item, ctx, onComment, onChompKeep) {\n if (isPair(item))\n return item.toString(ctx, onComment, onChompKeep);\n if (isAlias(item)) {\n if (ctx.doc.directives)\n return item.toString(ctx);\n if (ctx.resolvedAliases?.has(item)) {\n throw new TypeError(`Cannot stringify circular structure without alias nodes`);\n }\n else {\n if (ctx.resolvedAliases)\n ctx.resolvedAliases.add(item);\n else\n ctx.resolvedAliases = new Set([item]);\n item = item.resolve(ctx.doc);\n }\n }\n let tagObj = undefined;\n const node = isNode(item)\n ? item\n : ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });\n tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));\n const props = stringifyProps(node, tagObj, ctx);\n if (props.length > 0)\n ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;\n const str = typeof tagObj.stringify === 'function'\n ? tagObj.stringify(node, ctx, onComment, onChompKeep)\n : isScalar(node)\n ? stringifyString(node, ctx, onComment, onChompKeep)\n : node.toString(ctx, onComment, onChompKeep);\n if (!props)\n return str;\n return isScalar(node) || str[0] === '{' || str[0] === '['\n ? `${props} ${str}`\n : `${props}\\n${ctx.indent}${str}`;\n}\n\nexport { createStringifyContext, stringify };\n","import { isCollection, isNode, isScalar, isSeq } from '../nodes/identity.js';\nimport { Scalar } from '../nodes/Scalar.js';\nimport { stringify } from './stringify.js';\nimport { lineComment, indentComment } from './stringifyComment.js';\n\nfunction stringifyPair({ key, value }, ctx, onComment, onChompKeep) {\n const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;\n let keyComment = (isNode(key) && key.comment) || null;\n if (simpleKeys) {\n if (keyComment) {\n throw new Error('With simple keys, key nodes cannot have comments');\n }\n if (isCollection(key) || (!isNode(key) && typeof key === 'object')) {\n const msg = 'With simple keys, collection cannot be used as a key value';\n throw new Error(msg);\n }\n }\n let explicitKey = !simpleKeys &&\n (!key ||\n (keyComment && value == null && !ctx.inFlow) ||\n isCollection(key) ||\n (isScalar(key)\n ? key.type === Scalar.BLOCK_FOLDED || key.type === Scalar.BLOCK_LITERAL\n : typeof key === 'object'));\n ctx = Object.assign({}, ctx, {\n allNullValues: false,\n implicitKey: !explicitKey && (simpleKeys || !allNullValues),\n indent: indent + indentStep\n });\n let keyCommentDone = false;\n let chompKeep = false;\n let str = stringify(key, ctx, () => (keyCommentDone = true), () => (chompKeep = true));\n if (!explicitKey && !ctx.inFlow && str.length > 1024) {\n if (simpleKeys)\n throw new Error('With simple keys, single line scalar must not span more than 1024 characters');\n explicitKey = true;\n }\n if (ctx.inFlow) {\n if (allNullValues || value == null) {\n if (keyCommentDone && onComment)\n onComment();\n return str === '' ? '?' : explicitKey ? `? ${str}` : str;\n }\n }\n else if ((allNullValues && !simpleKeys) || (value == null && explicitKey)) {\n str = `? ${str}`;\n if (keyComment && !keyCommentDone) {\n str += lineComment(str, ctx.indent, commentString(keyComment));\n }\n else if (chompKeep && onChompKeep)\n onChompKeep();\n return str;\n }\n if (keyCommentDone)\n keyComment = null;\n if (explicitKey) {\n if (keyComment)\n str += lineComment(str, ctx.indent, commentString(keyComment));\n str = `? ${str}\\n${indent}:`;\n }\n else {\n str = `${str}:`;\n if (keyComment)\n str += lineComment(str, ctx.indent, commentString(keyComment));\n }\n let vsb, vcb, valueComment;\n if (isNode(value)) {\n vsb = !!value.spaceBefore;\n vcb = value.commentBefore;\n valueComment = value.comment;\n }\n else {\n vsb = false;\n vcb = null;\n valueComment = null;\n if (value && typeof value === 'object')\n value = doc.createNode(value);\n }\n ctx.implicitKey = false;\n if (!explicitKey && !keyComment && isScalar(value))\n ctx.indentAtStart = str.length + 1;\n chompKeep = false;\n if (!indentSeq &&\n indentStep.length >= 2 &&\n !ctx.inFlow &&\n !explicitKey &&\n isSeq(value) &&\n !value.flow &&\n !value.tag &&\n !value.anchor) {\n // If indentSeq === false, consider '- ' as part of indentation where possible\n ctx.indent = ctx.indent.substring(2);\n }\n let valueCommentDone = false;\n const valueStr = stringify(value, ctx, () => (valueCommentDone = true), () => (chompKeep = true));\n let ws = ' ';\n if (keyComment || vsb || vcb) {\n ws = vsb ? '\\n' : '';\n if (vcb) {\n const cs = commentString(vcb);\n ws += `\\n${indentComment(cs, ctx.indent)}`;\n }\n if (valueStr === '' && !ctx.inFlow) {\n if (ws === '\\n')\n ws = '\\n\\n';\n }\n else {\n ws += `\\n${ctx.indent}`;\n }\n }\n else if (!explicitKey && isCollection(value)) {\n const vs0 = valueStr[0];\n const nl0 = valueStr.indexOf('\\n');\n const hasNewline = nl0 !== -1;\n const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0;\n if (hasNewline || !flow) {\n let hasPropsLine = false;\n if (hasNewline && (vs0 === '&' || vs0 === '!')) {\n let sp0 = valueStr.indexOf(' ');\n if (vs0 === '&' &&\n sp0 !== -1 &&\n sp0 < nl0 &&\n valueStr[sp0 + 1] === '!') {\n sp0 = valueStr.indexOf(' ', sp0 + 1);\n }\n if (sp0 === -1 || nl0 < sp0)\n hasPropsLine = true;\n }\n if (!hasPropsLine)\n ws = `\\n${ctx.indent}`;\n }\n }\n else if (valueStr === '' || valueStr[0] === '\\n') {\n ws = '';\n }\n str += ws + valueStr;\n if (ctx.inFlow) {\n if (valueCommentDone && onComment)\n onComment();\n }\n else if (valueComment && !valueCommentDone) {\n str += lineComment(str, ctx.indent, commentString(valueComment));\n }\n else if (chompKeep && onChompKeep) {\n onChompKeep();\n }\n return str;\n}\n\nexport { stringifyPair };\n","function debug(logLevel, ...messages) {\n if (logLevel === 'debug')\n console.log(...messages);\n}\nfunction warn(logLevel, warning) {\n if (logLevel === 'debug' || logLevel === 'warn') {\n console.warn(warning);\n }\n}\n\nexport { debug, warn };\n","import { isScalar, isAlias, isSeq, isMap } from '../../nodes/identity.js';\nimport { Scalar } from '../../nodes/Scalar.js';\n\n// If the value associated with a merge key is a single mapping node, each of\n// its key/value pairs is inserted into the current mapping, unless the key\n// already exists in it. If the value associated with the merge key is a\n// sequence, then this sequence is expected to contain mapping nodes and each\n// of these nodes is merged in turn according to its order in the sequence.\n// Keys in mapping nodes earlier in the sequence override keys specified in\n// later mapping nodes. -- http://yaml.org/type/merge.html\nconst MERGE_KEY = '<<';\nconst merge = {\n identify: value => value === MERGE_KEY ||\n (typeof value === 'symbol' && value.description === MERGE_KEY),\n default: 'key',\n tag: 'tag:yaml.org,2002:merge',\n test: /^<<$/,\n resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {\n addToJSMap: addMergeToJSMap\n }),\n stringify: () => MERGE_KEY\n};\nconst isMergeKey = (ctx, key) => (merge.identify(key) ||\n (isScalar(key) &&\n (!key.type || key.type === Scalar.PLAIN) &&\n merge.identify(key.value))) &&\n ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);\nfunction addMergeToJSMap(ctx, map, value) {\n value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;\n if (isSeq(value))\n for (const it of value.items)\n mergeValue(ctx, map, it);\n else if (Array.isArray(value))\n for (const it of value)\n mergeValue(ctx, map, it);\n else\n mergeValue(ctx, map, value);\n}\nfunction mergeValue(ctx, map, value) {\n const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;\n if (!isMap(source))\n throw new Error('Merge sources must be maps or map aliases');\n const srcMap = source.toJSON(null, ctx, Map);\n for (const [key, value] of srcMap) {\n if (map instanceof Map) {\n if (!map.has(key))\n map.set(key, value);\n }\n else if (map instanceof Set) {\n map.add(key);\n }\n else if (!Object.prototype.hasOwnProperty.call(map, key)) {\n Object.defineProperty(map, key, {\n value,\n writable: true,\n enumerable: true,\n configurable: true\n });\n }\n }\n return map;\n}\n\nexport { addMergeToJSMap, isMergeKey, merge };\n","import { warn } from '../log.js';\nimport { isMergeKey, addMergeToJSMap } from '../schema/yaml-1.1/merge.js';\nimport { createStringifyContext } from '../stringify/stringify.js';\nimport { isNode } from './identity.js';\nimport { toJS } from './toJS.js';\n\nfunction addPairToJSMap(ctx, map, { key, value }) {\n if (isNode(key) && key.addToJSMap)\n key.addToJSMap(ctx, map, value);\n // TODO: Should drop this special case for bare << handling\n else if (isMergeKey(ctx, key))\n addMergeToJSMap(ctx, map, value);\n else {\n const jsKey = toJS(key, '', ctx);\n if (map instanceof Map) {\n map.set(jsKey, toJS(value, jsKey, ctx));\n }\n else if (map instanceof Set) {\n map.add(jsKey);\n }\n else {\n const stringKey = stringifyKey(key, jsKey, ctx);\n const jsValue = toJS(value, stringKey, ctx);\n if (stringKey in map)\n Object.defineProperty(map, stringKey, {\n value: jsValue,\n writable: true,\n enumerable: true,\n configurable: true\n });\n else\n map[stringKey] = jsValue;\n }\n }\n return map;\n}\nfunction stringifyKey(key, jsKey, ctx) {\n if (jsKey === null)\n return '';\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n if (typeof jsKey !== 'object')\n return String(jsKey);\n if (isNode(key) && ctx?.doc) {\n const strCtx = createStringifyContext(ctx.doc, {});\n strCtx.anchors = new Set();\n for (const node of ctx.anchors.keys())\n strCtx.anchors.add(node.anchor);\n strCtx.inFlow = true;\n strCtx.inStringifyKey = true;\n const strKey = key.toString(strCtx);\n if (!ctx.mapKeyWarned) {\n let jsonStr = JSON.stringify(strKey);\n if (jsonStr.length > 40)\n jsonStr = jsonStr.substring(0, 36) + '...\"';\n warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`);\n ctx.mapKeyWarned = true;\n }\n return strKey;\n }\n return JSON.stringify(jsKey);\n}\n\nexport { addPairToJSMap };\n","import { createNode } from '../doc/createNode.js';\nimport { stringifyPair } from '../stringify/stringifyPair.js';\nimport { addPairToJSMap } from './addPairToJSMap.js';\nimport { NODE_TYPE, PAIR, isNode } from './identity.js';\n\nfunction createPair(key, value, ctx) {\n const k = createNode(key, undefined, ctx);\n const v = createNode(value, undefined, ctx);\n return new Pair(k, v);\n}\nclass Pair {\n constructor(key, value = null) {\n Object.defineProperty(this, NODE_TYPE, { value: PAIR });\n this.key = key;\n this.value = value;\n }\n clone(schema) {\n let { key, value } = this;\n if (isNode(key))\n key = key.clone(schema);\n if (isNode(value))\n value = value.clone(schema);\n return new Pair(key, value);\n }\n toJSON(_, ctx) {\n const pair = ctx?.mapAsMap ? new Map() : {};\n return addPairToJSMap(ctx, pair, this);\n }\n toString(ctx, onComment, onChompKeep) {\n return ctx?.doc\n ? stringifyPair(this, ctx, onComment, onChompKeep)\n : JSON.stringify(this);\n }\n}\n\nexport { Pair, createPair };\n","import { isNode, isPair } from '../nodes/identity.js';\nimport { stringify } from './stringify.js';\nimport { lineComment, indentComment } from './stringifyComment.js';\n\nfunction stringifyCollection(collection, ctx, options) {\n const flow = ctx.inFlow ?? collection.flow;\n const stringify = flow ? stringifyFlowCollection : stringifyBlockCollection;\n return stringify(collection, ctx, options);\n}\nfunction stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {\n const { indent, options: { commentString } } = ctx;\n const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null });\n let chompKeep = false; // flag for the preceding node's status\n const lines = [];\n for (let i = 0; i < items.length; ++i) {\n const item = items[i];\n let comment = null;\n if (isNode(item)) {\n if (!chompKeep && item.spaceBefore)\n lines.push('');\n addCommentBefore(ctx, lines, item.commentBefore, chompKeep);\n if (item.comment)\n comment = item.comment;\n }\n else if (isPair(item)) {\n const ik = isNode(item.key) ? item.key : null;\n if (ik) {\n if (!chompKeep && ik.spaceBefore)\n lines.push('');\n addCommentBefore(ctx, lines, ik.commentBefore, chompKeep);\n }\n }\n chompKeep = false;\n let str = stringify(item, itemCtx, () => (comment = null), () => (chompKeep = true));\n if (comment)\n str += lineComment(str, itemIndent, commentString(comment));\n if (chompKeep && comment)\n chompKeep = false;\n lines.push(blockItemPrefix + str);\n }\n let str;\n if (lines.length === 0) {\n str = flowChars.start + flowChars.end;\n }\n else {\n str = lines[0];\n for (let i = 1; i < lines.length; ++i) {\n const line = lines[i];\n str += line ? `\\n${indent}${line}` : '\\n';\n }\n }\n if (comment) {\n str += '\\n' + indentComment(commentString(comment), indent);\n if (onComment)\n onComment();\n }\n else if (chompKeep && onChompKeep)\n onChompKeep();\n return str;\n}\nfunction stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {\n const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;\n itemIndent += indentStep;\n const itemCtx = Object.assign({}, ctx, {\n indent: itemIndent,\n inFlow: true,\n type: null\n });\n let reqNewline = false;\n let linesAtValue = 0;\n const lines = [];\n for (let i = 0; i < items.length; ++i) {\n const item = items[i];\n let comment = null;\n if (isNode(item)) {\n if (item.spaceBefore)\n lines.push('');\n addCommentBefore(ctx, lines, item.commentBefore, false);\n if (item.comment)\n comment = item.comment;\n }\n else if (isPair(item)) {\n const ik = isNode(item.key) ? item.key : null;\n if (ik) {\n if (ik.spaceBefore)\n lines.push('');\n addCommentBefore(ctx, lines, ik.commentBefore, false);\n if (ik.comment)\n reqNewline = true;\n }\n const iv = isNode(item.value) ? item.value : null;\n if (iv) {\n if (iv.comment)\n comment = iv.comment;\n if (iv.commentBefore)\n reqNewline = true;\n }\n else if (item.value == null && ik?.comment) {\n comment = ik.comment;\n }\n }\n if (comment)\n reqNewline = true;\n let str = stringify(item, itemCtx, () => (comment = null));\n if (i < items.length - 1)\n str += ',';\n if (comment)\n str += lineComment(str, itemIndent, commentString(comment));\n if (!reqNewline && (lines.length > linesAtValue || str.includes('\\n')))\n reqNewline = true;\n lines.push(str);\n linesAtValue = lines.length;\n }\n const { start, end } = flowChars;\n if (lines.length === 0) {\n return start + end;\n }\n else {\n if (!reqNewline) {\n const len = lines.reduce((sum, line) => sum + line.length + 2, 2);\n reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;\n }\n if (reqNewline) {\n let str = start;\n for (const line of lines)\n str += line ? `\\n${indentStep}${indent}${line}` : '\\n';\n return `${str}\\n${indent}${end}`;\n }\n else {\n return `${start}${fcPadding}${lines.join(' ')}${fcPadding}${end}`;\n }\n }\n}\nfunction addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) {\n if (comment && chompKeep)\n comment = comment.replace(/^\\n+/, '');\n if (comment) {\n const ic = indentComment(commentString(comment), indent);\n lines.push(ic.trimStart()); // Avoid double indent on first line\n }\n}\n\nexport { stringifyCollection };\n","import { stringifyCollection } from '../stringify/stringifyCollection.js';\nimport { addPairToJSMap } from './addPairToJSMap.js';\nimport { Collection } from './Collection.js';\nimport { MAP, isPair, isScalar } from './identity.js';\nimport { Pair, createPair } from './Pair.js';\nimport { isScalarValue } from './Scalar.js';\n\nfunction findPair(items, key) {\n const k = isScalar(key) ? key.value : key;\n for (const it of items) {\n if (isPair(it)) {\n if (it.key === key || it.key === k)\n return it;\n if (isScalar(it.key) && it.key.value === k)\n return it;\n }\n }\n return undefined;\n}\nclass YAMLMap extends Collection {\n static get tagName() {\n return 'tag:yaml.org,2002:map';\n }\n constructor(schema) {\n super(MAP, schema);\n this.items = [];\n }\n /**\n * A generic collection parsing method that can be extended\n * to other node classes that inherit from YAMLMap\n */\n static from(schema, obj, ctx) {\n const { keepUndefined, replacer } = ctx;\n const map = new this(schema);\n const add = (key, value) => {\n if (typeof replacer === 'function')\n value = replacer.call(obj, key, value);\n else if (Array.isArray(replacer) && !replacer.includes(key))\n return;\n if (value !== undefined || keepUndefined)\n map.items.push(createPair(key, value, ctx));\n };\n if (obj instanceof Map) {\n for (const [key, value] of obj)\n add(key, value);\n }\n else if (obj && typeof obj === 'object') {\n for (const key of Object.keys(obj))\n add(key, obj[key]);\n }\n if (typeof schema.sortMapEntries === 'function') {\n map.items.sort(schema.sortMapEntries);\n }\n return map;\n }\n /**\n * Adds a value to the collection.\n *\n * @param overwrite - If not set `true`, using a key that is already in the\n * collection will throw. Otherwise, overwrites the previous value.\n */\n add(pair, overwrite) {\n let _pair;\n if (isPair(pair))\n _pair = pair;\n else if (!pair || typeof pair !== 'object' || !('key' in pair)) {\n // In TypeScript, this never happens.\n _pair = new Pair(pair, pair?.value);\n }\n else\n _pair = new Pair(pair.key, pair.value);\n const prev = findPair(this.items, _pair.key);\n const sortEntries = this.schema?.sortMapEntries;\n if (prev) {\n if (!overwrite)\n throw new Error(`Key ${_pair.key} already set`);\n // For scalars, keep the old node & its comments and anchors\n if (isScalar(prev.value) && isScalarValue(_pair.value))\n prev.value.value = _pair.value;\n else\n prev.value = _pair.value;\n }\n else if (sortEntries) {\n const i = this.items.findIndex(item => sortEntries(_pair, item) < 0);\n if (i === -1)\n this.items.push(_pair);\n else\n this.items.splice(i, 0, _pair);\n }\n else {\n this.items.push(_pair);\n }\n }\n delete(key) {\n const it = findPair(this.items, key);\n if (!it)\n return false;\n const del = this.items.splice(this.items.indexOf(it), 1);\n return del.length > 0;\n }\n get(key, keepScalar) {\n const it = findPair(this.items, key);\n const node = it?.value;\n return (!keepScalar && isScalar(node) ? node.value : node) ?? undefined;\n }\n has(key) {\n return !!findPair(this.items, key);\n }\n set(key, value) {\n this.add(new Pair(key, value), true);\n }\n /**\n * @param ctx - Conversion context, originally set in Document#toJS()\n * @param {Class} Type - If set, forces the returned collection type\n * @returns Instance of Type, Map, or Object\n */\n toJSON(_, ctx, Type) {\n const map = Type ? new Type() : ctx?.mapAsMap ? new Map() : {};\n if (ctx?.onCreate)\n ctx.onCreate(map);\n for (const item of this.items)\n addPairToJSMap(ctx, map, item);\n return map;\n }\n toString(ctx, onComment, onChompKeep) {\n if (!ctx)\n return JSON.stringify(this);\n for (const item of this.items) {\n if (!isPair(item))\n throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`);\n }\n if (!ctx.allNullValues && this.hasAllNullValues(false))\n ctx = Object.assign({}, ctx, { allNullValues: true });\n return stringifyCollection(this, ctx, {\n blockItemPrefix: '',\n flowChars: { start: '{', end: '}' },\n itemIndent: ctx.indent || '',\n onChompKeep,\n onComment\n });\n }\n}\n\nexport { YAMLMap, findPair };\n","import { isMap } from '../../nodes/identity.js';\nimport { YAMLMap } from '../../nodes/YAMLMap.js';\n\nconst map = {\n collection: 'map',\n default: true,\n nodeClass: YAMLMap,\n tag: 'tag:yaml.org,2002:map',\n resolve(map, onError) {\n if (!isMap(map))\n onError('Expected a mapping for this tag');\n return map;\n },\n createNode: (schema, obj, ctx) => YAMLMap.from(schema, obj, ctx)\n};\n\nexport { map };\n","import { createNode } from '../doc/createNode.js';\nimport { stringifyCollection } from '../stringify/stringifyCollection.js';\nimport { Collection } from './Collection.js';\nimport { SEQ, isScalar } from './identity.js';\nimport { isScalarValue } from './Scalar.js';\nimport { toJS } from './toJS.js';\n\nclass YAMLSeq extends Collection {\n static get tagName() {\n return 'tag:yaml.org,2002:seq';\n }\n constructor(schema) {\n super(SEQ, schema);\n this.items = [];\n }\n add(value) {\n this.items.push(value);\n }\n /**\n * Removes a value from the collection.\n *\n * `key` must contain a representation of an integer for this to succeed.\n * It may be wrapped in a `Scalar`.\n *\n * @returns `true` if the item was found and removed.\n */\n delete(key) {\n const idx = asItemIndex(key);\n if (typeof idx !== 'number')\n return false;\n const del = this.items.splice(idx, 1);\n return del.length > 0;\n }\n get(key, keepScalar) {\n const idx = asItemIndex(key);\n if (typeof idx !== 'number')\n return undefined;\n const it = this.items[idx];\n return !keepScalar && isScalar(it) ? it.value : it;\n }\n /**\n * Checks if the collection includes a value with the key `key`.\n *\n * `key` must contain a representation of an integer for this to succeed.\n * It may be wrapped in a `Scalar`.\n */\n has(key) {\n const idx = asItemIndex(key);\n return typeof idx === 'number' && idx < this.items.length;\n }\n /**\n * Sets a value in this collection. For `!!set`, `value` needs to be a\n * boolean to add/remove the item from the set.\n *\n * If `key` does not contain a representation of an integer, this will throw.\n * It may be wrapped in a `Scalar`.\n */\n set(key, value) {\n const idx = asItemIndex(key);\n if (typeof idx !== 'number')\n throw new Error(`Expected a valid index, not ${key}.`);\n const prev = this.items[idx];\n if (isScalar(prev) && isScalarValue(value))\n prev.value = value;\n else\n this.items[idx] = value;\n }\n toJSON(_, ctx) {\n const seq = [];\n if (ctx?.onCreate)\n ctx.onCreate(seq);\n let i = 0;\n for (const item of this.items)\n seq.push(toJS(item, String(i++), ctx));\n return seq;\n }\n toString(ctx, onComment, onChompKeep) {\n if (!ctx)\n return JSON.stringify(this);\n return stringifyCollection(this, ctx, {\n blockItemPrefix: '- ',\n flowChars: { start: '[', end: ']' },\n itemIndent: (ctx.indent || '') + ' ',\n onChompKeep,\n onComment\n });\n }\n static from(schema, obj, ctx) {\n const { replacer } = ctx;\n const seq = new this(schema);\n if (obj && Symbol.iterator in Object(obj)) {\n let i = 0;\n for (let it of obj) {\n if (typeof replacer === 'function') {\n const key = obj instanceof Set ? it : String(i++);\n it = replacer.call(obj, key, it);\n }\n seq.items.push(createNode(it, undefined, ctx));\n }\n }\n return seq;\n }\n}\nfunction asItemIndex(key) {\n let idx = isScalar(key) ? key.value : key;\n if (idx && typeof idx === 'string')\n idx = Number(idx);\n return typeof idx === 'number' && Number.isInteger(idx) && idx >= 0\n ? idx\n : null;\n}\n\nexport { YAMLSeq };\n","import { isSeq } from '../../nodes/identity.js';\nimport { YAMLSeq } from '../../nodes/YAMLSeq.js';\n\nconst seq = {\n collection: 'seq',\n default: true,\n nodeClass: YAMLSeq,\n tag: 'tag:yaml.org,2002:seq',\n resolve(seq, onError) {\n if (!isSeq(seq))\n onError('Expected a sequence for this tag');\n return seq;\n },\n createNode: (schema, obj, ctx) => YAMLSeq.from(schema, obj, ctx)\n};\n\nexport { seq };\n","import { stringifyString } from '../../stringify/stringifyString.js';\n\nconst string = {\n identify: value => typeof value === 'string',\n default: true,\n tag: 'tag:yaml.org,2002:str',\n resolve: str => str,\n stringify(item, ctx, onComment, onChompKeep) {\n ctx = Object.assign({ actualString: true }, ctx);\n return stringifyString(item, ctx, onComment, onChompKeep);\n }\n};\n\nexport { string };\n","import { Scalar } from '../../nodes/Scalar.js';\n\nconst nullTag = {\n identify: value => value == null,\n createNode: () => new Scalar(null),\n default: true,\n tag: 'tag:yaml.org,2002:null',\n test: /^(?:~|[Nn]ull|NULL)?$/,\n resolve: () => new Scalar(null),\n stringify: ({ source }, ctx) => typeof source === 'string' && nullTag.test.test(source)\n ? source\n : ctx.options.nullStr\n};\n\nexport { nullTag };\n","import { Scalar } from '../../nodes/Scalar.js';\n\nconst boolTag = {\n identify: value => typeof value === 'boolean',\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,\n resolve: str => new Scalar(str[0] === 't' || str[0] === 'T'),\n stringify({ source, value }, ctx) {\n if (source && boolTag.test.test(source)) {\n const sv = source[0] === 't' || source[0] === 'T';\n if (value === sv)\n return source;\n }\n return value ? ctx.options.trueStr : ctx.options.falseStr;\n }\n};\n\nexport { boolTag };\n","function stringifyNumber({ format, minFractionDigits, tag, value }) {\n if (typeof value === 'bigint')\n return String(value);\n const num = typeof value === 'number' ? value : Number(value);\n if (!isFinite(num))\n return isNaN(num) ? '.nan' : num < 0 ? '-.inf' : '.inf';\n let n = JSON.stringify(value);\n if (!format &&\n minFractionDigits &&\n (!tag || tag === 'tag:yaml.org,2002:float') &&\n /^\\d/.test(n)) {\n let i = n.indexOf('.');\n if (i < 0) {\n i = n.length;\n n += '.';\n }\n let d = minFractionDigits - (n.length - i - 1);\n while (d-- > 0)\n n += '0';\n }\n return n;\n}\n\nexport { stringifyNumber };\n","import { Scalar } from '../../nodes/Scalar.js';\nimport { stringifyNumber } from '../../stringify/stringifyNumber.js';\n\nconst floatNaN = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^(?:[-+]?\\.(?:inf|Inf|INF)|\\.nan|\\.NaN|\\.NAN)$/,\n resolve: str => str.slice(-3).toLowerCase() === 'nan'\n ? NaN\n : str[0] === '-'\n ? Number.NEGATIVE_INFINITY\n : Number.POSITIVE_INFINITY,\n stringify: stringifyNumber\n};\nconst floatExp = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n format: 'EXP',\n test: /^[-+]?(?:\\.[0-9]+|[0-9]+(?:\\.[0-9]*)?)[eE][-+]?[0-9]+$/,\n resolve: str => parseFloat(str),\n stringify(node) {\n const num = Number(node.value);\n return isFinite(num) ? num.toExponential() : stringifyNumber(node);\n }\n};\nconst float = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^[-+]?(?:\\.[0-9]+|[0-9]+\\.[0-9]*)$/,\n resolve(str) {\n const node = new Scalar(parseFloat(str));\n const dot = str.indexOf('.');\n if (dot !== -1 && str[str.length - 1] === '0')\n node.minFractionDigits = str.length - dot - 1;\n return node;\n },\n stringify: stringifyNumber\n};\n\nexport { float, floatExp, floatNaN };\n","import { stringifyNumber } from '../../stringify/stringifyNumber.js';\n\nconst intIdentify = (value) => typeof value === 'bigint' || Number.isInteger(value);\nconst intResolve = (str, offset, radix, { intAsBigInt }) => (intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix));\nfunction intStringify(node, radix, prefix) {\n const { value } = node;\n if (intIdentify(value) && value >= 0)\n return prefix + value.toString(radix);\n return stringifyNumber(node);\n}\nconst intOct = {\n identify: value => intIdentify(value) && value >= 0,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'OCT',\n test: /^0o[0-7]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 2, 8, opt),\n stringify: node => intStringify(node, 8, '0o')\n};\nconst int = {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n test: /^[-+]?[0-9]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),\n stringify: stringifyNumber\n};\nconst intHex = {\n identify: value => intIdentify(value) && value >= 0,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'HEX',\n test: /^0x[0-9a-fA-F]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),\n stringify: node => intStringify(node, 16, '0x')\n};\n\nexport { int, intHex, intOct };\n","import { map } from '../common/map.js';\nimport { nullTag } from '../common/null.js';\nimport { seq } from '../common/seq.js';\nimport { string } from '../common/string.js';\nimport { boolTag } from './bool.js';\nimport { floatNaN, floatExp, float } from './float.js';\nimport { intOct, int, intHex } from './int.js';\n\nconst schema = [\n map,\n seq,\n string,\n nullTag,\n boolTag,\n intOct,\n int,\n intHex,\n floatNaN,\n floatExp,\n float\n];\n\nexport { schema };\n","import { Scalar } from '../../nodes/Scalar.js';\nimport { map } from '../common/map.js';\nimport { seq } from '../common/seq.js';\n\nfunction intIdentify(value) {\n return typeof value === 'bigint' || Number.isInteger(value);\n}\nconst stringifyJSON = ({ value }) => JSON.stringify(value);\nconst jsonScalars = [\n {\n identify: value => typeof value === 'string',\n default: true,\n tag: 'tag:yaml.org,2002:str',\n resolve: str => str,\n stringify: stringifyJSON\n },\n {\n identify: value => value == null,\n createNode: () => new Scalar(null),\n default: true,\n tag: 'tag:yaml.org,2002:null',\n test: /^null$/,\n resolve: () => null,\n stringify: stringifyJSON\n },\n {\n identify: value => typeof value === 'boolean',\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^true$|^false$/,\n resolve: str => str === 'true',\n stringify: stringifyJSON\n },\n {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n test: /^-?(?:0|[1-9][0-9]*)$/,\n resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10),\n stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value)\n },\n {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,\n resolve: str => parseFloat(str),\n stringify: stringifyJSON\n }\n];\nconst jsonError = {\n default: true,\n tag: '',\n test: /^/,\n resolve(str, onError) {\n onError(`Unresolved plain scalar ${JSON.stringify(str)}`);\n return str;\n }\n};\nconst schema = [map, seq].concat(jsonScalars, jsonError);\n\nexport { schema };\n","import { Scalar } from '../../nodes/Scalar.js';\nimport { stringifyString } from '../../stringify/stringifyString.js';\n\nconst binary = {\n identify: value => value instanceof Uint8Array, // Buffer inherits from Uint8Array\n default: false,\n tag: 'tag:yaml.org,2002:binary',\n /**\n * Returns a Buffer in node and an Uint8Array in browsers\n *\n * To use the resulting buffer as an image, you'll want to do something like:\n *\n * const blob = new Blob([buffer], { type: 'image/jpeg' })\n * document.querySelector('#photo').src = URL.createObjectURL(blob)\n */\n resolve(src, onError) {\n if (typeof atob === 'function') {\n // On IE 11, atob() can't handle newlines\n const str = atob(src.replace(/[\\n\\r]/g, ''));\n const buffer = new Uint8Array(str.length);\n for (let i = 0; i < str.length; ++i)\n buffer[i] = str.charCodeAt(i);\n return buffer;\n }\n else {\n onError('This environment does not support reading binary tags; either Buffer or atob is required');\n return src;\n }\n },\n stringify({ comment, type, value }, ctx, onComment, onChompKeep) {\n if (!value)\n return '';\n const buf = value; // checked earlier by binary.identify()\n let str;\n if (typeof btoa === 'function') {\n let s = '';\n for (let i = 0; i < buf.length; ++i)\n s += String.fromCharCode(buf[i]);\n str = btoa(s);\n }\n else {\n throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');\n }\n type ?? (type = Scalar.BLOCK_LITERAL);\n if (type !== Scalar.QUOTE_DOUBLE) {\n const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);\n const n = Math.ceil(str.length / lineWidth);\n const lines = new Array(n);\n for (let i = 0, o = 0; i < n; ++i, o += lineWidth) {\n lines[i] = str.substr(o, lineWidth);\n }\n str = lines.join(type === Scalar.BLOCK_LITERAL ? '\\n' : ' ');\n }\n return stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);\n }\n};\n\nexport { binary };\n","import { isSeq, isPair, isMap } from '../../nodes/identity.js';\nimport { createPair, Pair } from '../../nodes/Pair.js';\nimport { Scalar } from '../../nodes/Scalar.js';\nimport { YAMLSeq } from '../../nodes/YAMLSeq.js';\n\nfunction resolvePairs(seq, onError) {\n if (isSeq(seq)) {\n for (let i = 0; i < seq.items.length; ++i) {\n let item = seq.items[i];\n if (isPair(item))\n continue;\n else if (isMap(item)) {\n if (item.items.length > 1)\n onError('Each pair must have its own sequence indicator');\n const pair = item.items[0] || new Pair(new Scalar(null));\n if (item.commentBefore)\n pair.key.commentBefore = pair.key.commentBefore\n ? `${item.commentBefore}\\n${pair.key.commentBefore}`\n : item.commentBefore;\n if (item.comment) {\n const cn = pair.value ?? pair.key;\n cn.comment = cn.comment\n ? `${item.comment}\\n${cn.comment}`\n : item.comment;\n }\n item = pair;\n }\n seq.items[i] = isPair(item) ? item : new Pair(item);\n }\n }\n else\n onError('Expected a sequence for this tag');\n return seq;\n}\nfunction createPairs(schema, iterable, ctx) {\n const { replacer } = ctx;\n const pairs = new YAMLSeq(schema);\n pairs.tag = 'tag:yaml.org,2002:pairs';\n let i = 0;\n if (iterable && Symbol.iterator in Object(iterable))\n for (let it of iterable) {\n if (typeof replacer === 'function')\n it = replacer.call(iterable, String(i++), it);\n let key, value;\n if (Array.isArray(it)) {\n if (it.length === 2) {\n key = it[0];\n value = it[1];\n }\n else\n throw new TypeError(`Expected [key, value] tuple: ${it}`);\n }\n else if (it && it instanceof Object) {\n const keys = Object.keys(it);\n if (keys.length === 1) {\n key = keys[0];\n value = it[key];\n }\n else {\n throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);\n }\n }\n else {\n key = it;\n }\n pairs.items.push(createPair(key, value, ctx));\n }\n return pairs;\n}\nconst pairs = {\n collection: 'seq',\n default: false,\n tag: 'tag:yaml.org,2002:pairs',\n resolve: resolvePairs,\n createNode: createPairs\n};\n\nexport { createPairs, pairs, resolvePairs };\n","import { isScalar, isPair } from '../../nodes/identity.js';\nimport { toJS } from '../../nodes/toJS.js';\nimport { YAMLMap } from '../../nodes/YAMLMap.js';\nimport { YAMLSeq } from '../../nodes/YAMLSeq.js';\nimport { resolvePairs, createPairs } from './pairs.js';\n\nclass YAMLOMap extends YAMLSeq {\n constructor() {\n super();\n this.add = YAMLMap.prototype.add.bind(this);\n this.delete = YAMLMap.prototype.delete.bind(this);\n this.get = YAMLMap.prototype.get.bind(this);\n this.has = YAMLMap.prototype.has.bind(this);\n this.set = YAMLMap.prototype.set.bind(this);\n this.tag = YAMLOMap.tag;\n }\n /**\n * If `ctx` is given, the return type is actually `Map`,\n * but TypeScript won't allow widening the signature of a child method.\n */\n toJSON(_, ctx) {\n if (!ctx)\n return super.toJSON(_);\n const map = new Map();\n if (ctx?.onCreate)\n ctx.onCreate(map);\n for (const pair of this.items) {\n let key, value;\n if (isPair(pair)) {\n key = toJS(pair.key, '', ctx);\n value = toJS(pair.value, key, ctx);\n }\n else {\n key = toJS(pair, '', ctx);\n }\n if (map.has(key))\n throw new Error('Ordered maps must not include duplicate keys');\n map.set(key, value);\n }\n return map;\n }\n static from(schema, iterable, ctx) {\n const pairs = createPairs(schema, iterable, ctx);\n const omap = new this();\n omap.items = pairs.items;\n return omap;\n }\n}\nYAMLOMap.tag = 'tag:yaml.org,2002:omap';\nconst omap = {\n collection: 'seq',\n identify: value => value instanceof Map,\n nodeClass: YAMLOMap,\n default: false,\n tag: 'tag:yaml.org,2002:omap',\n resolve(seq, onError) {\n const pairs = resolvePairs(seq, onError);\n const seenKeys = [];\n for (const { key } of pairs.items) {\n if (isScalar(key)) {\n if (seenKeys.includes(key.value)) {\n onError(`Ordered maps must not include duplicate keys: ${key.value}`);\n }\n else {\n seenKeys.push(key.value);\n }\n }\n }\n return Object.assign(new YAMLOMap(), pairs);\n },\n createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx)\n};\n\nexport { YAMLOMap, omap };\n","import { Scalar } from '../../nodes/Scalar.js';\n\nfunction boolStringify({ value, source }, ctx) {\n const boolObj = value ? trueTag : falseTag;\n if (source && boolObj.test.test(source))\n return source;\n return value ? ctx.options.trueStr : ctx.options.falseStr;\n}\nconst trueTag = {\n identify: value => value === true,\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,\n resolve: () => new Scalar(true),\n stringify: boolStringify\n};\nconst falseTag = {\n identify: value => value === false,\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,\n resolve: () => new Scalar(false),\n stringify: boolStringify\n};\n\nexport { falseTag, trueTag };\n","import { Scalar } from '../../nodes/Scalar.js';\nimport { stringifyNumber } from '../../stringify/stringifyNumber.js';\n\nconst floatNaN = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^(?:[-+]?\\.(?:inf|Inf|INF)|\\.nan|\\.NaN|\\.NAN)$/,\n resolve: (str) => str.slice(-3).toLowerCase() === 'nan'\n ? NaN\n : str[0] === '-'\n ? Number.NEGATIVE_INFINITY\n : Number.POSITIVE_INFINITY,\n stringify: stringifyNumber\n};\nconst floatExp = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n format: 'EXP',\n test: /^[-+]?(?:[0-9][0-9_]*)?(?:\\.[0-9_]*)?[eE][-+]?[0-9]+$/,\n resolve: (str) => parseFloat(str.replace(/_/g, '')),\n stringify(node) {\n const num = Number(node.value);\n return isFinite(num) ? num.toExponential() : stringifyNumber(node);\n }\n};\nconst float = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^[-+]?(?:[0-9][0-9_]*)?\\.[0-9_]*$/,\n resolve(str) {\n const node = new Scalar(parseFloat(str.replace(/_/g, '')));\n const dot = str.indexOf('.');\n if (dot !== -1) {\n const f = str.substring(dot + 1).replace(/_/g, '');\n if (f[f.length - 1] === '0')\n node.minFractionDigits = f.length;\n }\n return node;\n },\n stringify: stringifyNumber\n};\n\nexport { float, floatExp, floatNaN };\n","import { stringifyNumber } from '../../stringify/stringifyNumber.js';\n\nconst intIdentify = (value) => typeof value === 'bigint' || Number.isInteger(value);\nfunction intResolve(str, offset, radix, { intAsBigInt }) {\n const sign = str[0];\n if (sign === '-' || sign === '+')\n offset += 1;\n str = str.substring(offset).replace(/_/g, '');\n if (intAsBigInt) {\n switch (radix) {\n case 2:\n str = `0b${str}`;\n break;\n case 8:\n str = `0o${str}`;\n break;\n case 16:\n str = `0x${str}`;\n break;\n }\n const n = BigInt(str);\n return sign === '-' ? BigInt(-1) * n : n;\n }\n const n = parseInt(str, radix);\n return sign === '-' ? -1 * n : n;\n}\nfunction intStringify(node, radix, prefix) {\n const { value } = node;\n if (intIdentify(value)) {\n const str = value.toString(radix);\n return value < 0 ? '-' + prefix + str.substr(1) : prefix + str;\n }\n return stringifyNumber(node);\n}\nconst intBin = {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'BIN',\n test: /^[-+]?0b[0-1_]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 2, 2, opt),\n stringify: node => intStringify(node, 2, '0b')\n};\nconst intOct = {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'OCT',\n test: /^[-+]?0[0-7_]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 1, 8, opt),\n stringify: node => intStringify(node, 8, '0')\n};\nconst int = {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n test: /^[-+]?[0-9][0-9_]*$/,\n resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),\n stringify: stringifyNumber\n};\nconst intHex = {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'HEX',\n test: /^[-+]?0x[0-9a-fA-F_]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),\n stringify: node => intStringify(node, 16, '0x')\n};\n\nexport { int, intBin, intHex, intOct };\n","import { isMap, isPair, isScalar } from '../../nodes/identity.js';\nimport { Pair, createPair } from '../../nodes/Pair.js';\nimport { YAMLMap, findPair } from '../../nodes/YAMLMap.js';\n\nclass YAMLSet extends YAMLMap {\n constructor(schema) {\n super(schema);\n this.tag = YAMLSet.tag;\n }\n add(key) {\n let pair;\n if (isPair(key))\n pair = key;\n else if (key &&\n typeof key === 'object' &&\n 'key' in key &&\n 'value' in key &&\n key.value === null)\n pair = new Pair(key.key, null);\n else\n pair = new Pair(key, null);\n const prev = findPair(this.items, pair.key);\n if (!prev)\n this.items.push(pair);\n }\n /**\n * If `keepPair` is `true`, returns the Pair matching `key`.\n * Otherwise, returns the value of that Pair's key.\n */\n get(key, keepPair) {\n const pair = findPair(this.items, key);\n return !keepPair && isPair(pair)\n ? isScalar(pair.key)\n ? pair.key.value\n : pair.key\n : pair;\n }\n set(key, value) {\n if (typeof value !== 'boolean')\n throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`);\n const prev = findPair(this.items, key);\n if (prev && !value) {\n this.items.splice(this.items.indexOf(prev), 1);\n }\n else if (!prev && value) {\n this.items.push(new Pair(key));\n }\n }\n toJSON(_, ctx) {\n return super.toJSON(_, ctx, Set);\n }\n toString(ctx, onComment, onChompKeep) {\n if (!ctx)\n return JSON.stringify(this);\n if (this.hasAllNullValues(true))\n return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep);\n else\n throw new Error('Set items must all have null values');\n }\n static from(schema, iterable, ctx) {\n const { replacer } = ctx;\n const set = new this(schema);\n if (iterable && Symbol.iterator in Object(iterable))\n for (let value of iterable) {\n if (typeof replacer === 'function')\n value = replacer.call(iterable, value, value);\n set.items.push(createPair(value, null, ctx));\n }\n return set;\n }\n}\nYAMLSet.tag = 'tag:yaml.org,2002:set';\nconst set = {\n collection: 'map',\n identify: value => value instanceof Set,\n nodeClass: YAMLSet,\n default: false,\n tag: 'tag:yaml.org,2002:set',\n createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx),\n resolve(map, onError) {\n if (isMap(map)) {\n if (map.hasAllNullValues(true))\n return Object.assign(new YAMLSet(), map);\n else\n onError('Set items must all have null values');\n }\n else\n onError('Expected a mapping for this tag');\n return map;\n }\n};\n\nexport { YAMLSet, set };\n","import { stringifyNumber } from '../../stringify/stringifyNumber.js';\n\n/** Internal types handle bigint as number, because TS can't figure it out. */\nfunction parseSexagesimal(str, asBigInt) {\n const sign = str[0];\n const parts = sign === '-' || sign === '+' ? str.substring(1) : str;\n const num = (n) => asBigInt ? BigInt(n) : Number(n);\n const res = parts\n .replace(/_/g, '')\n .split(':')\n .reduce((res, p) => res * num(60) + num(p), num(0));\n return (sign === '-' ? num(-1) * res : res);\n}\n/**\n * hhhh:mm:ss.sss\n *\n * Internal types handle bigint as number, because TS can't figure it out.\n */\nfunction stringifySexagesimal(node) {\n let { value } = node;\n let num = (n) => n;\n if (typeof value === 'bigint')\n num = n => BigInt(n);\n else if (isNaN(value) || !isFinite(value))\n return stringifyNumber(node);\n let sign = '';\n if (value < 0) {\n sign = '-';\n value *= num(-1);\n }\n const _60 = num(60);\n const parts = [value % _60]; // seconds, including ms\n if (value < 60) {\n parts.unshift(0); // at least one : is required\n }\n else {\n value = (value - parts[0]) / _60;\n parts.unshift(value % _60); // minutes\n if (value >= 60) {\n value = (value - parts[0]) / _60;\n parts.unshift(value); // hours\n }\n }\n return (sign +\n parts\n .map(n => String(n).padStart(2, '0'))\n .join(':')\n .replace(/000000\\d*$/, '') // % 60 may introduce error\n );\n}\nconst intTime = {\n identify: value => typeof value === 'bigint' || Number.isInteger(value),\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'TIME',\n test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,\n resolve: (str, _onError, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt),\n stringify: stringifySexagesimal\n};\nconst floatTime = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n format: 'TIME',\n test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*$/,\n resolve: str => parseSexagesimal(str, false),\n stringify: stringifySexagesimal\n};\nconst timestamp = {\n identify: value => value instanceof Date,\n default: true,\n tag: 'tag:yaml.org,2002:timestamp',\n // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part\n // may be omitted altogether, resulting in a date format. In such a case, the time part is\n // assumed to be 00:00:00Z (start of day, UTC).\n test: RegExp('^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})' + // YYYY-Mm-Dd\n '(?:' + // time is optional\n '(?:t|T|[ \\\\t]+)' + // t | T | whitespace\n '([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\\\.[0-9]+)?)' + // Hh:Mm:Ss(.ss)?\n '(?:[ \\\\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?' + // Z | +5 | -03:30\n ')?$'),\n resolve(str) {\n const match = str.match(timestamp.test);\n if (!match)\n throw new Error('!!timestamp expects a date, starting with yyyy-mm-dd');\n const [, year, month, day, hour, minute, second] = match.map(Number);\n const millisec = match[7] ? Number((match[7] + '00').substr(1, 3)) : 0;\n let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);\n const tz = match[8];\n if (tz && tz !== 'Z') {\n let d = parseSexagesimal(tz, false);\n if (Math.abs(d) < 30)\n d *= 60;\n date -= 60000 * d;\n }\n return new Date(date);\n },\n stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\\.000Z$/, '') ?? ''\n};\n\nexport { floatTime, intTime, timestamp };\n","import { map } from '../common/map.js';\nimport { nullTag } from '../common/null.js';\nimport { seq } from '../common/seq.js';\nimport { string } from '../common/string.js';\nimport { binary } from './binary.js';\nimport { trueTag, falseTag } from './bool.js';\nimport { floatNaN, floatExp, float } from './float.js';\nimport { intBin, intOct, int, intHex } from './int.js';\nimport { merge } from './merge.js';\nimport { omap } from './omap.js';\nimport { pairs } from './pairs.js';\nimport { set } from './set.js';\nimport { intTime, floatTime, timestamp } from './timestamp.js';\n\nconst schema = [\n map,\n seq,\n string,\n nullTag,\n trueTag,\n falseTag,\n intBin,\n intOct,\n int,\n intHex,\n floatNaN,\n floatExp,\n float,\n binary,\n merge,\n omap,\n pairs,\n set,\n intTime,\n floatTime,\n timestamp\n];\n\nexport { schema };\n","import { map } from './common/map.js';\nimport { nullTag } from './common/null.js';\nimport { seq } from './common/seq.js';\nimport { string } from './common/string.js';\nimport { boolTag } from './core/bool.js';\nimport { floatNaN, floatExp, float } from './core/float.js';\nimport { intOct, intHex, int } from './core/int.js';\nimport { schema } from './core/schema.js';\nimport { schema as schema$1 } from './json/schema.js';\nimport { binary } from './yaml-1.1/binary.js';\nimport { merge } from './yaml-1.1/merge.js';\nimport { omap } from './yaml-1.1/omap.js';\nimport { pairs } from './yaml-1.1/pairs.js';\nimport { schema as schema$2 } from './yaml-1.1/schema.js';\nimport { set } from './yaml-1.1/set.js';\nimport { timestamp, intTime, floatTime } from './yaml-1.1/timestamp.js';\n\nconst schemas = new Map([\n ['core', schema],\n ['failsafe', [map, seq, string]],\n ['json', schema$1],\n ['yaml11', schema$2],\n ['yaml-1.1', schema$2]\n]);\nconst tagsByName = {\n binary,\n bool: boolTag,\n float,\n floatExp,\n floatNaN,\n floatTime,\n int,\n intHex,\n intOct,\n intTime,\n map,\n merge,\n null: nullTag,\n omap,\n pairs,\n seq,\n set,\n timestamp\n};\nconst coreKnownTags = {\n 'tag:yaml.org,2002:binary': binary,\n 'tag:yaml.org,2002:merge': merge,\n 'tag:yaml.org,2002:omap': omap,\n 'tag:yaml.org,2002:pairs': pairs,\n 'tag:yaml.org,2002:set': set,\n 'tag:yaml.org,2002:timestamp': timestamp\n};\nfunction getTags(customTags, schemaName, addMergeTag) {\n const schemaTags = schemas.get(schemaName);\n if (schemaTags && !customTags) {\n return addMergeTag && !schemaTags.includes(merge)\n ? schemaTags.concat(merge)\n : schemaTags.slice();\n }\n let tags = schemaTags;\n if (!tags) {\n if (Array.isArray(customTags))\n tags = [];\n else {\n const keys = Array.from(schemas.keys())\n .filter(key => key !== 'yaml11')\n .map(key => JSON.stringify(key))\n .join(', ');\n throw new Error(`Unknown schema \"${schemaName}\"; use one of ${keys} or define customTags array`);\n }\n }\n if (Array.isArray(customTags)) {\n for (const tag of customTags)\n tags = tags.concat(tag);\n }\n else if (typeof customTags === 'function') {\n tags = customTags(tags.slice());\n }\n if (addMergeTag)\n tags = tags.concat(merge);\n return tags.reduce((tags, tag) => {\n const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;\n if (!tagObj) {\n const tagName = JSON.stringify(tag);\n const keys = Object.keys(tagsByName)\n .map(key => JSON.stringify(key))\n .join(', ');\n throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);\n }\n if (!tags.includes(tagObj))\n tags.push(tagObj);\n return tags;\n }, []);\n}\n\nexport { coreKnownTags, getTags };\n","import { MAP, SCALAR, SEQ } from '../nodes/identity.js';\nimport { map } from './common/map.js';\nimport { seq } from './common/seq.js';\nimport { string } from './common/string.js';\nimport { getTags, coreKnownTags } from './tags.js';\n\nconst sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;\nclass Schema {\n constructor({ compat, customTags, merge, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) {\n this.compat = Array.isArray(compat)\n ? getTags(compat, 'compat')\n : compat\n ? getTags(null, compat)\n : null;\n this.name = (typeof schema === 'string' && schema) || 'core';\n this.knownTags = resolveKnownTags ? coreKnownTags : {};\n this.tags = getTags(customTags, this.name, merge);\n this.toStringOptions = toStringDefaults ?? null;\n Object.defineProperty(this, MAP, { value: map });\n Object.defineProperty(this, SCALAR, { value: string });\n Object.defineProperty(this, SEQ, { value: seq });\n // Used by createMap()\n this.sortMapEntries =\n typeof sortMapEntries === 'function'\n ? sortMapEntries\n : sortMapEntries === true\n ? sortMapEntriesByKey\n : null;\n }\n clone() {\n const copy = Object.create(Schema.prototype, Object.getOwnPropertyDescriptors(this));\n copy.tags = this.tags.slice();\n return copy;\n }\n}\n\nexport { Schema };\n","import { isNode } from '../nodes/identity.js';\nimport { createStringifyContext, stringify } from './stringify.js';\nimport { indentComment, lineComment } from './stringifyComment.js';\n\nfunction stringifyDocument(doc, options) {\n const lines = [];\n let hasDirectives = options.directives === true;\n if (options.directives !== false && doc.directives) {\n const dir = doc.directives.toString(doc);\n if (dir) {\n lines.push(dir);\n hasDirectives = true;\n }\n else if (doc.directives.docStart)\n hasDirectives = true;\n }\n if (hasDirectives)\n lines.push('---');\n const ctx = createStringifyContext(doc, options);\n const { commentString } = ctx.options;\n if (doc.commentBefore) {\n if (lines.length !== 1)\n lines.unshift('');\n const cs = commentString(doc.commentBefore);\n lines.unshift(indentComment(cs, ''));\n }\n let chompKeep = false;\n let contentComment = null;\n if (doc.contents) {\n if (isNode(doc.contents)) {\n if (doc.contents.spaceBefore && hasDirectives)\n lines.push('');\n if (doc.contents.commentBefore) {\n const cs = commentString(doc.contents.commentBefore);\n lines.push(indentComment(cs, ''));\n }\n // top-level block scalars need to be indented if followed by a comment\n ctx.forceBlockIndent = !!doc.comment;\n contentComment = doc.contents.comment;\n }\n const onChompKeep = contentComment ? undefined : () => (chompKeep = true);\n let body = stringify(doc.contents, ctx, () => (contentComment = null), onChompKeep);\n if (contentComment)\n body += lineComment(body, '', commentString(contentComment));\n if ((body[0] === '|' || body[0] === '>') &&\n lines[lines.length - 1] === '---') {\n // Top-level block scalars with a preceding doc marker ought to use the\n // same line for their header.\n lines[lines.length - 1] = `--- ${body}`;\n }\n else\n lines.push(body);\n }\n else {\n lines.push(stringify(doc.contents, ctx));\n }\n if (doc.directives?.docEnd) {\n if (doc.comment) {\n const cs = commentString(doc.comment);\n if (cs.includes('\\n')) {\n lines.push('...');\n lines.push(indentComment(cs, ''));\n }\n else {\n lines.push(`... ${cs}`);\n }\n }\n else {\n lines.push('...');\n }\n }\n else {\n let dc = doc.comment;\n if (dc && chompKeep)\n dc = dc.replace(/^\\n+/, '');\n if (dc) {\n if ((!chompKeep || contentComment) && lines[lines.length - 1] !== '')\n lines.push('');\n lines.push(indentComment(commentString(dc), ''));\n }\n }\n return lines.join('\\n') + '\\n';\n}\n\nexport { stringifyDocument };\n","import { Alias } from '../nodes/Alias.js';\nimport { isEmptyPath, collectionFromPath } from '../nodes/Collection.js';\nimport { NODE_TYPE, DOC, isNode, isCollection, isScalar } from '../nodes/identity.js';\nimport { Pair } from '../nodes/Pair.js';\nimport { toJS } from '../nodes/toJS.js';\nimport { Schema } from '../schema/Schema.js';\nimport { stringifyDocument } from '../stringify/stringifyDocument.js';\nimport { anchorNames, findNewAnchor, createNodeAnchors } from './anchors.js';\nimport { applyReviver } from './applyReviver.js';\nimport { createNode } from './createNode.js';\nimport { Directives } from './directives.js';\n\nclass Document {\n constructor(value, replacer, options) {\n /** A comment before this Document */\n this.commentBefore = null;\n /** A comment immediately after this Document */\n this.comment = null;\n /** Errors encountered during parsing. */\n this.errors = [];\n /** Warnings encountered during parsing. */\n this.warnings = [];\n Object.defineProperty(this, NODE_TYPE, { value: DOC });\n let _replacer = null;\n if (typeof replacer === 'function' || Array.isArray(replacer)) {\n _replacer = replacer;\n }\n else if (options === undefined && replacer) {\n options = replacer;\n replacer = undefined;\n }\n const opt = Object.assign({\n intAsBigInt: false,\n keepSourceTokens: false,\n logLevel: 'warn',\n prettyErrors: true,\n strict: true,\n stringKeys: false,\n uniqueKeys: true,\n version: '1.2'\n }, options);\n this.options = opt;\n let { version } = opt;\n if (options?._directives) {\n this.directives = options._directives.atDocument();\n if (this.directives.yaml.explicit)\n version = this.directives.yaml.version;\n }\n else\n this.directives = new Directives({ version });\n this.setSchema(version, options);\n // @ts-expect-error We can't really know that this matches Contents.\n this.contents =\n value === undefined ? null : this.createNode(value, _replacer, options);\n }\n /**\n * Create a deep copy of this Document and its contents.\n *\n * Custom Node values that inherit from `Object` still refer to their original instances.\n */\n clone() {\n const copy = Object.create(Document.prototype, {\n [NODE_TYPE]: { value: DOC }\n });\n copy.commentBefore = this.commentBefore;\n copy.comment = this.comment;\n copy.errors = this.errors.slice();\n copy.warnings = this.warnings.slice();\n copy.options = Object.assign({}, this.options);\n if (this.directives)\n copy.directives = this.directives.clone();\n copy.schema = this.schema.clone();\n // @ts-expect-error We can't really know that this matches Contents.\n copy.contents = isNode(this.contents)\n ? this.contents.clone(copy.schema)\n : this.contents;\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }\n /** Adds a value to the document. */\n add(value) {\n if (assertCollection(this.contents))\n this.contents.add(value);\n }\n /** Adds a value to the document. */\n addIn(path, value) {\n if (assertCollection(this.contents))\n this.contents.addIn(path, value);\n }\n /**\n * Create a new `Alias` node, ensuring that the target `node` has the required anchor.\n *\n * If `node` already has an anchor, `name` is ignored.\n * Otherwise, the `node.anchor` value will be set to `name`,\n * or if an anchor with that name is already present in the document,\n * `name` will be used as a prefix for a new unique anchor.\n * If `name` is undefined, the generated anchor will use 'a' as a prefix.\n */\n createAlias(node, name) {\n if (!node.anchor) {\n const prev = anchorNames(this);\n node.anchor =\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n !name || prev.has(name) ? findNewAnchor(name || 'a', prev) : name;\n }\n return new Alias(node.anchor);\n }\n createNode(value, replacer, options) {\n let _replacer = undefined;\n if (typeof replacer === 'function') {\n value = replacer.call({ '': value }, '', value);\n _replacer = replacer;\n }\n else if (Array.isArray(replacer)) {\n const keyToStr = (v) => typeof v === 'number' || v instanceof String || v instanceof Number;\n const asStr = replacer.filter(keyToStr).map(String);\n if (asStr.length > 0)\n replacer = replacer.concat(asStr);\n _replacer = replacer;\n }\n else if (options === undefined && replacer) {\n options = replacer;\n replacer = undefined;\n }\n const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options ?? {};\n const { onAnchor, setAnchors, sourceObjects } = createNodeAnchors(this, \n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n anchorPrefix || 'a');\n const ctx = {\n aliasDuplicateObjects: aliasDuplicateObjects ?? true,\n keepUndefined: keepUndefined ?? false,\n onAnchor,\n onTagObj,\n replacer: _replacer,\n schema: this.schema,\n sourceObjects\n };\n const node = createNode(value, tag, ctx);\n if (flow && isCollection(node))\n node.flow = true;\n setAnchors();\n return node;\n }\n /**\n * Convert a key and a value into a `Pair` using the current schema,\n * recursively wrapping all values as `Scalar` or `Collection` nodes.\n */\n createPair(key, value, options = {}) {\n const k = this.createNode(key, null, options);\n const v = this.createNode(value, null, options);\n return new Pair(k, v);\n }\n /**\n * Removes a value from the document.\n * @returns `true` if the item was found and removed.\n */\n delete(key) {\n return assertCollection(this.contents) ? this.contents.delete(key) : false;\n }\n /**\n * Removes a value from the document.\n * @returns `true` if the item was found and removed.\n */\n deleteIn(path) {\n if (isEmptyPath(path)) {\n if (this.contents == null)\n return false;\n // @ts-expect-error Presumed impossible if Strict extends false\n this.contents = null;\n return true;\n }\n return assertCollection(this.contents)\n ? this.contents.deleteIn(path)\n : false;\n }\n /**\n * Returns item at `key`, or `undefined` if not found. By default unwraps\n * scalar values from their surrounding node; to disable set `keepScalar` to\n * `true` (collections are always returned intact).\n */\n get(key, keepScalar) {\n return isCollection(this.contents)\n ? this.contents.get(key, keepScalar)\n : undefined;\n }\n /**\n * Returns item at `path`, or `undefined` if not found. By default unwraps\n * scalar values from their surrounding node; to disable set `keepScalar` to\n * `true` (collections are always returned intact).\n */\n getIn(path, keepScalar) {\n if (isEmptyPath(path))\n return !keepScalar && isScalar(this.contents)\n ? this.contents.value\n : this.contents;\n return isCollection(this.contents)\n ? this.contents.getIn(path, keepScalar)\n : undefined;\n }\n /**\n * Checks if the document includes a value with the key `key`.\n */\n has(key) {\n return isCollection(this.contents) ? this.contents.has(key) : false;\n }\n /**\n * Checks if the document includes a value at `path`.\n */\n hasIn(path) {\n if (isEmptyPath(path))\n return this.contents !== undefined;\n return isCollection(this.contents) ? this.contents.hasIn(path) : false;\n }\n /**\n * Sets a value in this document. For `!!set`, `value` needs to be a\n * boolean to add/remove the item from the set.\n */\n set(key, value) {\n if (this.contents == null) {\n // @ts-expect-error We can't really know that this matches Contents.\n this.contents = collectionFromPath(this.schema, [key], value);\n }\n else if (assertCollection(this.contents)) {\n this.contents.set(key, value);\n }\n }\n /**\n * Sets a value in this document. For `!!set`, `value` needs to be a\n * boolean to add/remove the item from the set.\n */\n setIn(path, value) {\n if (isEmptyPath(path)) {\n // @ts-expect-error We can't really know that this matches Contents.\n this.contents = value;\n }\n else if (this.contents == null) {\n // @ts-expect-error We can't really know that this matches Contents.\n this.contents = collectionFromPath(this.schema, Array.from(path), value);\n }\n else if (assertCollection(this.contents)) {\n this.contents.setIn(path, value);\n }\n }\n /**\n * Change the YAML version and schema used by the document.\n * A `null` version disables support for directives, explicit tags, anchors, and aliases.\n * It also requires the `schema` option to be given as a `Schema` instance value.\n *\n * Overrides all previously set schema options.\n */\n setSchema(version, options = {}) {\n if (typeof version === 'number')\n version = String(version);\n let opt;\n switch (version) {\n case '1.1':\n if (this.directives)\n this.directives.yaml.version = '1.1';\n else\n this.directives = new Directives({ version: '1.1' });\n opt = { resolveKnownTags: false, schema: 'yaml-1.1' };\n break;\n case '1.2':\n case 'next':\n if (this.directives)\n this.directives.yaml.version = version;\n else\n this.directives = new Directives({ version });\n opt = { resolveKnownTags: true, schema: 'core' };\n break;\n case null:\n if (this.directives)\n delete this.directives;\n opt = null;\n break;\n default: {\n const sv = JSON.stringify(version);\n throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`);\n }\n }\n // Not using `instanceof Schema` to allow for duck typing\n if (options.schema instanceof Object)\n this.schema = options.schema;\n else if (opt)\n this.schema = new Schema(Object.assign(opt, options));\n else\n throw new Error(`With a null YAML version, the { schema: Schema } option is required`);\n }\n // json & jsonArg are only used from toJSON()\n toJS({ json, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {\n const ctx = {\n anchors: new Map(),\n doc: this,\n keep: !json,\n mapAsMap: mapAsMap === true,\n mapKeyWarned: false,\n maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100\n };\n const res = toJS(this.contents, jsonArg ?? '', ctx);\n if (typeof onAnchor === 'function')\n for (const { count, res } of ctx.anchors.values())\n onAnchor(res, count);\n return typeof reviver === 'function'\n ? applyReviver(reviver, { '': res }, '', res)\n : res;\n }\n /**\n * A JSON representation of the document `contents`.\n *\n * @param jsonArg Used by `JSON.stringify` to indicate the array index or\n * property name.\n */\n toJSON(jsonArg, onAnchor) {\n return this.toJS({ json: true, jsonArg, mapAsMap: false, onAnchor });\n }\n /** A YAML representation of the document. */\n toString(options = {}) {\n if (this.errors.length > 0)\n throw new Error('Document with errors cannot be stringified');\n if ('indent' in options &&\n (!Number.isInteger(options.indent) || Number(options.indent) <= 0)) {\n const s = JSON.stringify(options.indent);\n throw new Error(`\"indent\" option must be a positive integer, not ${s}`);\n }\n return stringifyDocument(this, options);\n }\n}\nfunction assertCollection(contents) {\n if (isCollection(contents))\n return true;\n throw new Error('Expected a YAML collection as document contents');\n}\n\nexport { Document };\n","class YAMLError extends Error {\n constructor(name, pos, code, message) {\n super();\n this.name = name;\n this.code = code;\n this.message = message;\n this.pos = pos;\n }\n}\nclass YAMLParseError extends YAMLError {\n constructor(pos, code, message) {\n super('YAMLParseError', pos, code, message);\n }\n}\nclass YAMLWarning extends YAMLError {\n constructor(pos, code, message) {\n super('YAMLWarning', pos, code, message);\n }\n}\nconst prettifyError = (src, lc) => (error) => {\n if (error.pos[0] === -1)\n return;\n error.linePos = error.pos.map(pos => lc.linePos(pos));\n const { line, col } = error.linePos[0];\n error.message += ` at line ${line}, column ${col}`;\n let ci = col - 1;\n let lineStr = src\n .substring(lc.lineStarts[line - 1], lc.lineStarts[line])\n .replace(/[\\n\\r]+$/, '');\n // Trim to max 80 chars, keeping col position near the middle\n if (ci >= 60 && lineStr.length > 80) {\n const trimStart = Math.min(ci - 39, lineStr.length - 79);\n lineStr = '…' + lineStr.substring(trimStart);\n ci -= trimStart - 1;\n }\n if (lineStr.length > 80)\n lineStr = lineStr.substring(0, 79) + '…';\n // Include previous line in context if pointing at line start\n if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) {\n // Regexp won't match if start is trimmed\n let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]);\n if (prev.length > 80)\n prev = prev.substring(0, 79) + '…\\n';\n lineStr = prev + lineStr;\n }\n if (/[^ ]/.test(lineStr)) {\n let count = 1;\n const end = error.linePos[1];\n if (end && end.line === line && end.col > col) {\n count = Math.max(1, Math.min(end.col - col, 80 - ci));\n }\n const pointer = ' '.repeat(ci) + '^'.repeat(count);\n error.message += `:\\n\\n${lineStr}\\n${pointer}\\n`;\n }\n};\n\nexport { YAMLError, YAMLParseError, YAMLWarning, prettifyError };\n","function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {\n let spaceBefore = false;\n let atNewline = startOnNewline;\n let hasSpace = startOnNewline;\n let comment = '';\n let commentSep = '';\n let hasNewline = false;\n let reqSpace = false;\n let tab = null;\n let anchor = null;\n let tag = null;\n let newlineAfterProp = null;\n let comma = null;\n let found = null;\n let start = null;\n for (const token of tokens) {\n if (reqSpace) {\n if (token.type !== 'space' &&\n token.type !== 'newline' &&\n token.type !== 'comma')\n onError(token.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');\n reqSpace = false;\n }\n if (tab) {\n if (atNewline && token.type !== 'comment' && token.type !== 'newline') {\n onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');\n }\n tab = null;\n }\n switch (token.type) {\n case 'space':\n // At the doc level, tabs at line start may be parsed\n // as leading white space rather than indentation.\n // In a flow collection, only the parser handles indent.\n if (!flow &&\n (indicator !== 'doc-start' || next?.type !== 'flow-collection') &&\n token.source.includes('\\t')) {\n tab = token;\n }\n hasSpace = true;\n break;\n case 'comment': {\n if (!hasSpace)\n onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters');\n const cb = token.source.substring(1) || ' ';\n if (!comment)\n comment = cb;\n else\n comment += commentSep + cb;\n commentSep = '';\n atNewline = false;\n break;\n }\n case 'newline':\n if (atNewline) {\n if (comment)\n comment += token.source;\n else if (!found || indicator !== 'seq-item-ind')\n spaceBefore = true;\n }\n else\n commentSep += token.source;\n atNewline = true;\n hasNewline = true;\n if (anchor || tag)\n newlineAfterProp = token;\n hasSpace = true;\n break;\n case 'anchor':\n if (anchor)\n onError(token, 'MULTIPLE_ANCHORS', 'A node can have at most one anchor');\n if (token.source.endsWith(':'))\n onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);\n anchor = token;\n start ?? (start = token.offset);\n atNewline = false;\n hasSpace = false;\n reqSpace = true;\n break;\n case 'tag': {\n if (tag)\n onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');\n tag = token;\n start ?? (start = token.offset);\n atNewline = false;\n hasSpace = false;\n reqSpace = true;\n break;\n }\n case indicator:\n // Could here handle preceding comments differently\n if (anchor || tag)\n onError(token, 'BAD_PROP_ORDER', `Anchors and tags must be after the ${token.source} indicator`);\n if (found)\n onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.source} in ${flow ?? 'collection'}`);\n found = token;\n atNewline =\n indicator === 'seq-item-ind' || indicator === 'explicit-key-ind';\n hasSpace = false;\n break;\n case 'comma':\n if (flow) {\n if (comma)\n onError(token, 'UNEXPECTED_TOKEN', `Unexpected , in ${flow}`);\n comma = token;\n atNewline = false;\n hasSpace = false;\n break;\n }\n // else fallthrough\n default:\n onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.type} token`);\n atNewline = false;\n hasSpace = false;\n }\n }\n const last = tokens[tokens.length - 1];\n const end = last ? last.offset + last.source.length : offset;\n if (reqSpace &&\n next &&\n next.type !== 'space' &&\n next.type !== 'newline' &&\n next.type !== 'comma' &&\n (next.type !== 'scalar' || next.source !== '')) {\n onError(next.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');\n }\n if (tab &&\n ((atNewline && tab.indent <= parentIndent) ||\n next?.type === 'block-map' ||\n next?.type === 'block-seq'))\n onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');\n return {\n comma,\n found,\n spaceBefore,\n comment,\n hasNewline,\n anchor,\n tag,\n newlineAfterProp,\n end,\n start: start ?? end\n };\n}\n\nexport { resolveProps };\n","function containsNewline(key) {\n if (!key)\n return null;\n switch (key.type) {\n case 'alias':\n case 'scalar':\n case 'double-quoted-scalar':\n case 'single-quoted-scalar':\n if (key.source.includes('\\n'))\n return true;\n if (key.end)\n for (const st of key.end)\n if (st.type === 'newline')\n return true;\n return false;\n case 'flow-collection':\n for (const it of key.items) {\n for (const st of it.start)\n if (st.type === 'newline')\n return true;\n if (it.sep)\n for (const st of it.sep)\n if (st.type === 'newline')\n return true;\n if (containsNewline(it.key) || containsNewline(it.value))\n return true;\n }\n return false;\n default:\n return true;\n }\n}\n\nexport { containsNewline };\n","import { containsNewline } from './util-contains-newline.js';\n\nfunction flowIndentCheck(indent, fc, onError) {\n if (fc?.type === 'flow-collection') {\n const end = fc.end[0];\n if (end.indent === indent &&\n (end.source === ']' || end.source === '}') &&\n containsNewline(fc)) {\n const msg = 'Flow end indicator should be more indented than parent';\n onError(end, 'BAD_INDENT', msg, true);\n }\n }\n}\n\nexport { flowIndentCheck };\n","import { isScalar } from '../nodes/identity.js';\n\nfunction mapIncludes(ctx, items, search) {\n const { uniqueKeys } = ctx.options;\n if (uniqueKeys === false)\n return false;\n const isEqual = typeof uniqueKeys === 'function'\n ? uniqueKeys\n : (a, b) => a === b || (isScalar(a) && isScalar(b) && a.value === b.value);\n return items.some(pair => isEqual(pair.key, search));\n}\n\nexport { mapIncludes };\n","import { Pair } from '../nodes/Pair.js';\nimport { YAMLMap } from '../nodes/YAMLMap.js';\nimport { resolveProps } from './resolve-props.js';\nimport { containsNewline } from './util-contains-newline.js';\nimport { flowIndentCheck } from './util-flow-indent-check.js';\nimport { mapIncludes } from './util-map-includes.js';\n\nconst startColMsg = 'All mapping items must start at the same column';\nfunction resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) {\n const NodeClass = tag?.nodeClass ?? YAMLMap;\n const map = new NodeClass(ctx.schema);\n if (ctx.atRoot)\n ctx.atRoot = false;\n let offset = bm.offset;\n let commentEnd = null;\n for (const collItem of bm.items) {\n const { start, key, sep, value } = collItem;\n // key properties\n const keyProps = resolveProps(start, {\n indicator: 'explicit-key-ind',\n next: key ?? sep?.[0],\n offset,\n onError,\n parentIndent: bm.indent,\n startOnNewline: true\n });\n const implicitKey = !keyProps.found;\n if (implicitKey) {\n if (key) {\n if (key.type === 'block-seq')\n onError(offset, 'BLOCK_AS_IMPLICIT_KEY', 'A block sequence may not be used as an implicit map key');\n else if ('indent' in key && key.indent !== bm.indent)\n onError(offset, 'BAD_INDENT', startColMsg);\n }\n if (!keyProps.anchor && !keyProps.tag && !sep) {\n commentEnd = keyProps.end;\n if (keyProps.comment) {\n if (map.comment)\n map.comment += '\\n' + keyProps.comment;\n else\n map.comment = keyProps.comment;\n }\n continue;\n }\n if (keyProps.newlineAfterProp || containsNewline(key)) {\n onError(key ?? start[start.length - 1], 'MULTILINE_IMPLICIT_KEY', 'Implicit keys need to be on a single line');\n }\n }\n else if (keyProps.found?.indent !== bm.indent) {\n onError(offset, 'BAD_INDENT', startColMsg);\n }\n // key value\n ctx.atKey = true;\n const keyStart = keyProps.end;\n const keyNode = key\n ? composeNode(ctx, key, keyProps, onError)\n : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);\n if (ctx.schema.compat)\n flowIndentCheck(bm.indent, key, onError);\n ctx.atKey = false;\n if (mapIncludes(ctx, map.items, keyNode))\n onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');\n // value properties\n const valueProps = resolveProps(sep ?? [], {\n indicator: 'map-value-ind',\n next: value,\n offset: keyNode.range[2],\n onError,\n parentIndent: bm.indent,\n startOnNewline: !key || key.type === 'block-scalar'\n });\n offset = valueProps.end;\n if (valueProps.found) {\n if (implicitKey) {\n if (value?.type === 'block-map' && !valueProps.hasNewline)\n onError(offset, 'BLOCK_AS_IMPLICIT_KEY', 'Nested mappings are not allowed in compact mappings');\n if (ctx.options.strict &&\n keyProps.start < valueProps.found.offset - 1024)\n onError(keyNode.range, 'KEY_OVER_1024_CHARS', 'The : indicator must be at most 1024 chars after the start of an implicit block mapping key');\n }\n // value value\n const valueNode = value\n ? composeNode(ctx, value, valueProps, onError)\n : composeEmptyNode(ctx, offset, sep, null, valueProps, onError);\n if (ctx.schema.compat)\n flowIndentCheck(bm.indent, value, onError);\n offset = valueNode.range[2];\n const pair = new Pair(keyNode, valueNode);\n if (ctx.options.keepSourceTokens)\n pair.srcToken = collItem;\n map.items.push(pair);\n }\n else {\n // key with no value\n if (implicitKey)\n onError(keyNode.range, 'MISSING_CHAR', 'Implicit map keys need to be followed by map values');\n if (valueProps.comment) {\n if (keyNode.comment)\n keyNode.comment += '\\n' + valueProps.comment;\n else\n keyNode.comment = valueProps.comment;\n }\n const pair = new Pair(keyNode);\n if (ctx.options.keepSourceTokens)\n pair.srcToken = collItem;\n map.items.push(pair);\n }\n }\n if (commentEnd && commentEnd < offset)\n onError(commentEnd, 'IMPOSSIBLE', 'Map comment with trailing content');\n map.range = [bm.offset, offset, commentEnd ?? offset];\n return map;\n}\n\nexport { resolveBlockMap };\n","import { YAMLSeq } from '../nodes/YAMLSeq.js';\nimport { resolveProps } from './resolve-props.js';\nimport { flowIndentCheck } from './util-flow-indent-check.js';\n\nfunction resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) {\n const NodeClass = tag?.nodeClass ?? YAMLSeq;\n const seq = new NodeClass(ctx.schema);\n if (ctx.atRoot)\n ctx.atRoot = false;\n if (ctx.atKey)\n ctx.atKey = false;\n let offset = bs.offset;\n let commentEnd = null;\n for (const { start, value } of bs.items) {\n const props = resolveProps(start, {\n indicator: 'seq-item-ind',\n next: value,\n offset,\n onError,\n parentIndent: bs.indent,\n startOnNewline: true\n });\n if (!props.found) {\n if (props.anchor || props.tag || value) {\n if (value && value.type === 'block-seq')\n onError(props.end, 'BAD_INDENT', 'All sequence items must start at the same column');\n else\n onError(offset, 'MISSING_CHAR', 'Sequence item without - indicator');\n }\n else {\n commentEnd = props.end;\n if (props.comment)\n seq.comment = props.comment;\n continue;\n }\n }\n const node = value\n ? composeNode(ctx, value, props, onError)\n : composeEmptyNode(ctx, props.end, start, null, props, onError);\n if (ctx.schema.compat)\n flowIndentCheck(bs.indent, value, onError);\n offset = node.range[2];\n seq.items.push(node);\n }\n seq.range = [bs.offset, offset, commentEnd ?? offset];\n return seq;\n}\n\nexport { resolveBlockSeq };\n","function resolveEnd(end, offset, reqSpace, onError) {\n let comment = '';\n if (end) {\n let hasSpace = false;\n let sep = '';\n for (const token of end) {\n const { source, type } = token;\n switch (type) {\n case 'space':\n hasSpace = true;\n break;\n case 'comment': {\n if (reqSpace && !hasSpace)\n onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters');\n const cb = source.substring(1) || ' ';\n if (!comment)\n comment = cb;\n else\n comment += sep + cb;\n sep = '';\n break;\n }\n case 'newline':\n if (comment)\n sep += source;\n hasSpace = true;\n break;\n default:\n onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${type} at node end`);\n }\n offset += source.length;\n }\n }\n return { comment, offset };\n}\n\nexport { resolveEnd };\n","import { isPair } from '../nodes/identity.js';\nimport { Pair } from '../nodes/Pair.js';\nimport { YAMLMap } from '../nodes/YAMLMap.js';\nimport { YAMLSeq } from '../nodes/YAMLSeq.js';\nimport { resolveEnd } from './resolve-end.js';\nimport { resolveProps } from './resolve-props.js';\nimport { containsNewline } from './util-contains-newline.js';\nimport { mapIncludes } from './util-map-includes.js';\n\nconst blockMsg = 'Block collections are not allowed within flow collections';\nconst isBlock = (token) => token && (token.type === 'block-map' || token.type === 'block-seq');\nfunction resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) {\n const isMap = fc.start.source === '{';\n const fcName = isMap ? 'flow map' : 'flow sequence';\n const NodeClass = (tag?.nodeClass ?? (isMap ? YAMLMap : YAMLSeq));\n const coll = new NodeClass(ctx.schema);\n coll.flow = true;\n const atRoot = ctx.atRoot;\n if (atRoot)\n ctx.atRoot = false;\n if (ctx.atKey)\n ctx.atKey = false;\n let offset = fc.offset + fc.start.source.length;\n for (let i = 0; i < fc.items.length; ++i) {\n const collItem = fc.items[i];\n const { start, key, sep, value } = collItem;\n const props = resolveProps(start, {\n flow: fcName,\n indicator: 'explicit-key-ind',\n next: key ?? sep?.[0],\n offset,\n onError,\n parentIndent: fc.indent,\n startOnNewline: false\n });\n if (!props.found) {\n if (!props.anchor && !props.tag && !sep && !value) {\n if (i === 0 && props.comma)\n onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`);\n else if (i < fc.items.length - 1)\n onError(props.start, 'UNEXPECTED_TOKEN', `Unexpected empty item in ${fcName}`);\n if (props.comment) {\n if (coll.comment)\n coll.comment += '\\n' + props.comment;\n else\n coll.comment = props.comment;\n }\n offset = props.end;\n continue;\n }\n if (!isMap && ctx.options.strict && containsNewline(key))\n onError(key, // checked by containsNewline()\n 'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line');\n }\n if (i === 0) {\n if (props.comma)\n onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`);\n }\n else {\n if (!props.comma)\n onError(props.start, 'MISSING_CHAR', `Missing , between ${fcName} items`);\n if (props.comment) {\n let prevItemComment = '';\n loop: for (const st of start) {\n switch (st.type) {\n case 'comma':\n case 'space':\n break;\n case 'comment':\n prevItemComment = st.source.substring(1);\n break loop;\n default:\n break loop;\n }\n }\n if (prevItemComment) {\n let prev = coll.items[coll.items.length - 1];\n if (isPair(prev))\n prev = prev.value ?? prev.key;\n if (prev.comment)\n prev.comment += '\\n' + prevItemComment;\n else\n prev.comment = prevItemComment;\n props.comment = props.comment.substring(prevItemComment.length + 1);\n }\n }\n }\n if (!isMap && !sep && !props.found) {\n // item is a value in a seq\n // → key & sep are empty, start does not include ? or :\n const valueNode = value\n ? composeNode(ctx, value, props, onError)\n : composeEmptyNode(ctx, props.end, sep, null, props, onError);\n coll.items.push(valueNode);\n offset = valueNode.range[2];\n if (isBlock(value))\n onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);\n }\n else {\n // item is a key+value pair\n // key value\n ctx.atKey = true;\n const keyStart = props.end;\n const keyNode = key\n ? composeNode(ctx, key, props, onError)\n : composeEmptyNode(ctx, keyStart, start, null, props, onError);\n if (isBlock(key))\n onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);\n ctx.atKey = false;\n // value properties\n const valueProps = resolveProps(sep ?? [], {\n flow: fcName,\n indicator: 'map-value-ind',\n next: value,\n offset: keyNode.range[2],\n onError,\n parentIndent: fc.indent,\n startOnNewline: false\n });\n if (valueProps.found) {\n if (!isMap && !props.found && ctx.options.strict) {\n if (sep)\n for (const st of sep) {\n if (st === valueProps.found)\n break;\n if (st.type === 'newline') {\n onError(st, 'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line');\n break;\n }\n }\n if (props.start < valueProps.found.offset - 1024)\n onError(valueProps.found, 'KEY_OVER_1024_CHARS', 'The : indicator must be at most 1024 chars after the start of an implicit flow sequence key');\n }\n }\n else if (value) {\n if ('source' in value && value.source && value.source[0] === ':')\n onError(value, 'MISSING_CHAR', `Missing space after : in ${fcName}`);\n else\n onError(valueProps.start, 'MISSING_CHAR', `Missing , or : between ${fcName} items`);\n }\n // value value\n const valueNode = value\n ? composeNode(ctx, value, valueProps, onError)\n : valueProps.found\n ? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError)\n : null;\n if (valueNode) {\n if (isBlock(value))\n onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);\n }\n else if (valueProps.comment) {\n if (keyNode.comment)\n keyNode.comment += '\\n' + valueProps.comment;\n else\n keyNode.comment = valueProps.comment;\n }\n const pair = new Pair(keyNode, valueNode);\n if (ctx.options.keepSourceTokens)\n pair.srcToken = collItem;\n if (isMap) {\n const map = coll;\n if (mapIncludes(ctx, map.items, keyNode))\n onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');\n map.items.push(pair);\n }\n else {\n const map = new YAMLMap(ctx.schema);\n map.flow = true;\n map.items.push(pair);\n const endRange = (valueNode ?? keyNode).range;\n map.range = [keyNode.range[0], endRange[1], endRange[2]];\n coll.items.push(map);\n }\n offset = valueNode ? valueNode.range[2] : valueProps.end;\n }\n }\n const expectedEnd = isMap ? '}' : ']';\n const [ce, ...ee] = fc.end;\n let cePos = offset;\n if (ce && ce.source === expectedEnd)\n cePos = ce.offset + ce.source.length;\n else {\n const name = fcName[0].toUpperCase() + fcName.substring(1);\n const msg = atRoot\n ? `${name} must end with a ${expectedEnd}`\n : `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`;\n onError(offset, atRoot ? 'MISSING_CHAR' : 'BAD_INDENT', msg);\n if (ce && ce.source.length !== 1)\n ee.unshift(ce);\n }\n if (ee.length > 0) {\n const end = resolveEnd(ee, cePos, ctx.options.strict, onError);\n if (end.comment) {\n if (coll.comment)\n coll.comment += '\\n' + end.comment;\n else\n coll.comment = end.comment;\n }\n coll.range = [fc.offset, cePos, end.offset];\n }\n else {\n coll.range = [fc.offset, cePos, cePos];\n }\n return coll;\n}\n\nexport { resolveFlowCollection };\n","import { isNode } from '../nodes/identity.js';\nimport { Scalar } from '../nodes/Scalar.js';\nimport { YAMLMap } from '../nodes/YAMLMap.js';\nimport { YAMLSeq } from '../nodes/YAMLSeq.js';\nimport { resolveBlockMap } from './resolve-block-map.js';\nimport { resolveBlockSeq } from './resolve-block-seq.js';\nimport { resolveFlowCollection } from './resolve-flow-collection.js';\n\nfunction resolveCollection(CN, ctx, token, onError, tagName, tag) {\n const coll = token.type === 'block-map'\n ? resolveBlockMap(CN, ctx, token, onError, tag)\n : token.type === 'block-seq'\n ? resolveBlockSeq(CN, ctx, token, onError, tag)\n : resolveFlowCollection(CN, ctx, token, onError, tag);\n const Coll = coll.constructor;\n // If we got a tagName matching the class, or the tag name is '!',\n // then use the tagName from the node class used to create it.\n if (tagName === '!' || tagName === Coll.tagName) {\n coll.tag = Coll.tagName;\n return coll;\n }\n if (tagName)\n coll.tag = tagName;\n return coll;\n}\nfunction composeCollection(CN, ctx, token, props, onError) {\n const tagToken = props.tag;\n const tagName = !tagToken\n ? null\n : ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg));\n if (token.type === 'block-seq') {\n const { anchor, newlineAfterProp: nl } = props;\n const lastProp = anchor && tagToken\n ? anchor.offset > tagToken.offset\n ? anchor\n : tagToken\n : (anchor ?? tagToken);\n if (lastProp && (!nl || nl.offset < lastProp.offset)) {\n const message = 'Missing newline after block sequence props';\n onError(lastProp, 'MISSING_CHAR', message);\n }\n }\n const expType = token.type === 'block-map'\n ? 'map'\n : token.type === 'block-seq'\n ? 'seq'\n : token.start.source === '{'\n ? 'map'\n : 'seq';\n // shortcut: check if it's a generic YAMLMap or YAMLSeq\n // before jumping into the custom tag logic.\n if (!tagToken ||\n !tagName ||\n tagName === '!' ||\n (tagName === YAMLMap.tagName && expType === 'map') ||\n (tagName === YAMLSeq.tagName && expType === 'seq')) {\n return resolveCollection(CN, ctx, token, onError, tagName);\n }\n let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType);\n if (!tag) {\n const kt = ctx.schema.knownTags[tagName];\n if (kt && kt.collection === expType) {\n ctx.schema.tags.push(Object.assign({}, kt, { default: false }));\n tag = kt;\n }\n else {\n if (kt) {\n onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);\n }\n else {\n onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);\n }\n return resolveCollection(CN, ctx, token, onError, tagName);\n }\n }\n const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);\n const res = tag.resolve?.(coll, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg), ctx.options) ?? coll;\n const node = isNode(res)\n ? res\n : new Scalar(res);\n node.range = coll.range;\n node.tag = tagName;\n if (tag?.format)\n node.format = tag.format;\n return node;\n}\n\nexport { composeCollection };\n","import { Scalar } from '../nodes/Scalar.js';\n\nfunction resolveBlockScalar(ctx, scalar, onError) {\n const start = scalar.offset;\n const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);\n if (!header)\n return { value: '', type: null, comment: '', range: [start, start, start] };\n const type = header.mode === '>' ? Scalar.BLOCK_FOLDED : Scalar.BLOCK_LITERAL;\n const lines = scalar.source ? splitLines(scalar.source) : [];\n // determine the end of content & start of chomping\n let chompStart = lines.length;\n for (let i = lines.length - 1; i >= 0; --i) {\n const content = lines[i][1];\n if (content === '' || content === '\\r')\n chompStart = i;\n else\n break;\n }\n // shortcut for empty contents\n if (chompStart === 0) {\n const value = header.chomp === '+' && lines.length > 0\n ? '\\n'.repeat(Math.max(1, lines.length - 1))\n : '';\n let end = start + header.length;\n if (scalar.source)\n end += scalar.source.length;\n return { value, type, comment: header.comment, range: [start, end, end] };\n }\n // find the indentation level to trim from start\n let trimIndent = scalar.indent + header.indent;\n let offset = scalar.offset + header.length;\n let contentStart = 0;\n for (let i = 0; i < chompStart; ++i) {\n const [indent, content] = lines[i];\n if (content === '' || content === '\\r') {\n if (header.indent === 0 && indent.length > trimIndent)\n trimIndent = indent.length;\n }\n else {\n if (indent.length < trimIndent) {\n const message = 'Block scalars with more-indented leading empty lines must use an explicit indentation indicator';\n onError(offset + indent.length, 'MISSING_CHAR', message);\n }\n if (header.indent === 0)\n trimIndent = indent.length;\n contentStart = i;\n if (trimIndent === 0 && !ctx.atRoot) {\n const message = 'Block scalar values in collections must be indented';\n onError(offset, 'BAD_INDENT', message);\n }\n break;\n }\n offset += indent.length + content.length + 1;\n }\n // include trailing more-indented empty lines in content\n for (let i = lines.length - 1; i >= chompStart; --i) {\n if (lines[i][0].length > trimIndent)\n chompStart = i + 1;\n }\n let value = '';\n let sep = '';\n let prevMoreIndented = false;\n // leading whitespace is kept intact\n for (let i = 0; i < contentStart; ++i)\n value += lines[i][0].slice(trimIndent) + '\\n';\n for (let i = contentStart; i < chompStart; ++i) {\n let [indent, content] = lines[i];\n offset += indent.length + content.length + 1;\n const crlf = content[content.length - 1] === '\\r';\n if (crlf)\n content = content.slice(0, -1);\n /* istanbul ignore if already caught in lexer */\n if (content && indent.length < trimIndent) {\n const src = header.indent\n ? 'explicit indentation indicator'\n : 'first line';\n const message = `Block scalar lines must not be less indented than their ${src}`;\n onError(offset - content.length - (crlf ? 2 : 1), 'BAD_INDENT', message);\n indent = '';\n }\n if (type === Scalar.BLOCK_LITERAL) {\n value += sep + indent.slice(trimIndent) + content;\n sep = '\\n';\n }\n else if (indent.length > trimIndent || content[0] === '\\t') {\n // more-indented content within a folded block\n if (sep === ' ')\n sep = '\\n';\n else if (!prevMoreIndented && sep === '\\n')\n sep = '\\n\\n';\n value += sep + indent.slice(trimIndent) + content;\n sep = '\\n';\n prevMoreIndented = true;\n }\n else if (content === '') {\n // empty line\n if (sep === '\\n')\n value += '\\n';\n else\n sep = '\\n';\n }\n else {\n value += sep + content;\n sep = ' ';\n prevMoreIndented = false;\n }\n }\n switch (header.chomp) {\n case '-':\n break;\n case '+':\n for (let i = chompStart; i < lines.length; ++i)\n value += '\\n' + lines[i][0].slice(trimIndent);\n if (value[value.length - 1] !== '\\n')\n value += '\\n';\n break;\n default:\n value += '\\n';\n }\n const end = start + header.length + scalar.source.length;\n return { value, type, comment: header.comment, range: [start, end, end] };\n}\nfunction parseBlockScalarHeader({ offset, props }, strict, onError) {\n /* istanbul ignore if should not happen */\n if (props[0].type !== 'block-scalar-header') {\n onError(props[0], 'IMPOSSIBLE', 'Block scalar header not found');\n return null;\n }\n const { source } = props[0];\n const mode = source[0];\n let indent = 0;\n let chomp = '';\n let error = -1;\n for (let i = 1; i < source.length; ++i) {\n const ch = source[i];\n if (!chomp && (ch === '-' || ch === '+'))\n chomp = ch;\n else {\n const n = Number(ch);\n if (!indent && n)\n indent = n;\n else if (error === -1)\n error = offset + i;\n }\n }\n if (error !== -1)\n onError(error, 'UNEXPECTED_TOKEN', `Block scalar header includes extra characters: ${source}`);\n let hasSpace = false;\n let comment = '';\n let length = source.length;\n for (let i = 1; i < props.length; ++i) {\n const token = props[i];\n switch (token.type) {\n case 'space':\n hasSpace = true;\n // fallthrough\n case 'newline':\n length += token.source.length;\n break;\n case 'comment':\n if (strict && !hasSpace) {\n const message = 'Comments must be separated from other tokens by white space characters';\n onError(token, 'MISSING_CHAR', message);\n }\n length += token.source.length;\n comment = token.source.substring(1);\n break;\n case 'error':\n onError(token, 'UNEXPECTED_TOKEN', token.message);\n length += token.source.length;\n break;\n /* istanbul ignore next should not happen */\n default: {\n const message = `Unexpected token in block scalar header: ${token.type}`;\n onError(token, 'UNEXPECTED_TOKEN', message);\n const ts = token.source;\n if (ts && typeof ts === 'string')\n length += ts.length;\n }\n }\n }\n return { mode, indent, chomp, comment, length };\n}\n/** @returns Array of lines split up as `[indent, content]` */\nfunction splitLines(source) {\n const split = source.split(/\\n( *)/);\n const first = split[0];\n const m = first.match(/^( *)/);\n const line0 = m?.[1]\n ? [m[1], first.slice(m[1].length)]\n : ['', first];\n const lines = [line0];\n for (let i = 1; i < split.length; i += 2)\n lines.push([split[i], split[i + 1]]);\n return lines;\n}\n\nexport { resolveBlockScalar };\n","import { Scalar } from '../nodes/Scalar.js';\nimport { resolveEnd } from './resolve-end.js';\n\nfunction resolveFlowScalar(scalar, strict, onError) {\n const { offset, type, source, end } = scalar;\n let _type;\n let value;\n const _onError = (rel, code, msg) => onError(offset + rel, code, msg);\n switch (type) {\n case 'scalar':\n _type = Scalar.PLAIN;\n value = plainValue(source, _onError);\n break;\n case 'single-quoted-scalar':\n _type = Scalar.QUOTE_SINGLE;\n value = singleQuotedValue(source, _onError);\n break;\n case 'double-quoted-scalar':\n _type = Scalar.QUOTE_DOUBLE;\n value = doubleQuotedValue(source, _onError);\n break;\n /* istanbul ignore next should not happen */\n default:\n onError(scalar, 'UNEXPECTED_TOKEN', `Expected a flow scalar value, but found: ${type}`);\n return {\n value: '',\n type: null,\n comment: '',\n range: [offset, offset + source.length, offset + source.length]\n };\n }\n const valueEnd = offset + source.length;\n const re = resolveEnd(end, valueEnd, strict, onError);\n return {\n value,\n type: _type,\n comment: re.comment,\n range: [offset, valueEnd, re.offset]\n };\n}\nfunction plainValue(source, onError) {\n let badChar = '';\n switch (source[0]) {\n /* istanbul ignore next should not happen */\n case '\\t':\n badChar = 'a tab character';\n break;\n case ',':\n badChar = 'flow indicator character ,';\n break;\n case '%':\n badChar = 'directive indicator character %';\n break;\n case '|':\n case '>': {\n badChar = `block scalar indicator ${source[0]}`;\n break;\n }\n case '@':\n case '`': {\n badChar = `reserved character ${source[0]}`;\n break;\n }\n }\n if (badChar)\n onError(0, 'BAD_SCALAR_START', `Plain value cannot start with ${badChar}`);\n return foldLines(source);\n}\nfunction singleQuotedValue(source, onError) {\n if (source[source.length - 1] !== \"'\" || source.length === 1)\n onError(source.length, 'MISSING_CHAR', \"Missing closing 'quote\");\n return foldLines(source.slice(1, -1)).replace(/''/g, \"'\");\n}\nfunction foldLines(source) {\n /**\n * The negative lookbehind here and in the `re` RegExp is to\n * prevent causing a polynomial search time in certain cases.\n *\n * The try-catch is for Safari, which doesn't support this yet:\n * https://caniuse.com/js-regexp-lookbehind\n */\n let first, line;\n try {\n first = new RegExp('(.*?)(? wsStart ? source.slice(wsStart, i + 1) : ch;\n }\n else {\n res += ch;\n }\n }\n if (source[source.length - 1] !== '\"' || source.length === 1)\n onError(source.length, 'MISSING_CHAR', 'Missing closing \"quote');\n return res;\n}\n/**\n * Fold a single newline into a space, multiple newlines to N - 1 newlines.\n * Presumes `source[offset] === '\\n'`\n */\nfunction foldNewline(source, offset) {\n let fold = '';\n let ch = source[offset + 1];\n while (ch === ' ' || ch === '\\t' || ch === '\\n' || ch === '\\r') {\n if (ch === '\\r' && source[offset + 2] !== '\\n')\n break;\n if (ch === '\\n')\n fold += '\\n';\n offset += 1;\n ch = source[offset + 1];\n }\n if (!fold)\n fold = ' ';\n return { fold, offset };\n}\nconst escapeCodes = {\n '0': '\\0', // null character\n a: '\\x07', // bell character\n b: '\\b', // backspace\n e: '\\x1b', // escape character\n f: '\\f', // form feed\n n: '\\n', // line feed\n r: '\\r', // carriage return\n t: '\\t', // horizontal tab\n v: '\\v', // vertical tab\n N: '\\u0085', // Unicode next line\n _: '\\u00a0', // Unicode non-breaking space\n L: '\\u2028', // Unicode line separator\n P: '\\u2029', // Unicode paragraph separator\n ' ': ' ',\n '\"': '\"',\n '/': '/',\n '\\\\': '\\\\',\n '\\t': '\\t'\n};\nfunction parseCharCode(source, offset, length, onError) {\n const cc = source.substr(offset, length);\n const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);\n const code = ok ? parseInt(cc, 16) : NaN;\n if (isNaN(code)) {\n const raw = source.substr(offset - 2, length + 2);\n onError(offset - 2, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);\n return raw;\n }\n return String.fromCodePoint(code);\n}\n\nexport { resolveFlowScalar };\n","import { isScalar, SCALAR } from '../nodes/identity.js';\nimport { Scalar } from '../nodes/Scalar.js';\nimport { resolveBlockScalar } from './resolve-block-scalar.js';\nimport { resolveFlowScalar } from './resolve-flow-scalar.js';\n\nfunction composeScalar(ctx, token, tagToken, onError) {\n const { value, type, comment, range } = token.type === 'block-scalar'\n ? resolveBlockScalar(ctx, token, onError)\n : resolveFlowScalar(token, ctx.options.strict, onError);\n const tagName = tagToken\n ? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))\n : null;\n let tag;\n if (ctx.options.stringKeys && ctx.atKey) {\n tag = ctx.schema[SCALAR];\n }\n else if (tagName)\n tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);\n else if (token.type === 'scalar')\n tag = findScalarTagByTest(ctx, value, token, onError);\n else\n tag = ctx.schema[SCALAR];\n let scalar;\n try {\n const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);\n scalar = isScalar(res) ? res : new Scalar(res);\n }\n catch (error) {\n const msg = error instanceof Error ? error.message : String(error);\n onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg);\n scalar = new Scalar(value);\n }\n scalar.range = range;\n scalar.source = value;\n if (type)\n scalar.type = type;\n if (tagName)\n scalar.tag = tagName;\n if (tag.format)\n scalar.format = tag.format;\n if (comment)\n scalar.comment = comment;\n return scalar;\n}\nfunction findScalarTagByName(schema, value, tagName, tagToken, onError) {\n if (tagName === '!')\n return schema[SCALAR]; // non-specific tag\n const matchWithTest = [];\n for (const tag of schema.tags) {\n if (!tag.collection && tag.tag === tagName) {\n if (tag.default && tag.test)\n matchWithTest.push(tag);\n else\n return tag;\n }\n }\n for (const tag of matchWithTest)\n if (tag.test?.test(value))\n return tag;\n const kt = schema.knownTags[tagName];\n if (kt && !kt.collection) {\n // Ensure that the known tag is available for stringifying,\n // but does not get used by default.\n schema.tags.push(Object.assign({}, kt, { default: false, test: undefined }));\n return kt;\n }\n onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');\n return schema[SCALAR];\n}\nfunction findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {\n const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&\n tag.test?.test(value)) || schema[SCALAR];\n if (schema.compat) {\n const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??\n schema[SCALAR];\n if (tag.tag !== compat.tag) {\n const ts = directives.tagString(tag.tag);\n const cs = directives.tagString(compat.tag);\n const msg = `Value may be parsed as either ${ts} or ${cs}`;\n onError(token, 'TAG_RESOLVE_FAILED', msg, true);\n }\n }\n return tag;\n}\n\nexport { composeScalar };\n","function emptyScalarPosition(offset, before, pos) {\n if (before) {\n pos ?? (pos = before.length);\n for (let i = pos - 1; i >= 0; --i) {\n let st = before[i];\n switch (st.type) {\n case 'space':\n case 'comment':\n case 'newline':\n offset -= st.source.length;\n continue;\n }\n // Technically, an empty scalar is immediately after the last non-empty\n // node, but it's more useful to place it after any whitespace.\n st = before[++i];\n while (st?.type === 'space') {\n offset += st.source.length;\n st = before[++i];\n }\n break;\n }\n }\n return offset;\n}\n\nexport { emptyScalarPosition };\n","import { Alias } from '../nodes/Alias.js';\nimport { isScalar } from '../nodes/identity.js';\nimport { composeCollection } from './compose-collection.js';\nimport { composeScalar } from './compose-scalar.js';\nimport { resolveEnd } from './resolve-end.js';\nimport { emptyScalarPosition } from './util-empty-scalar-position.js';\n\nconst CN = { composeNode, composeEmptyNode };\nfunction composeNode(ctx, token, props, onError) {\n const atKey = ctx.atKey;\n const { spaceBefore, comment, anchor, tag } = props;\n let node;\n let isSrcToken = true;\n switch (token.type) {\n case 'alias':\n node = composeAlias(ctx, token, onError);\n if (anchor || tag)\n onError(token, 'ALIAS_PROPS', 'An alias node must not specify any properties');\n break;\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar':\n case 'block-scalar':\n node = composeScalar(ctx, token, tag, onError);\n if (anchor)\n node.anchor = anchor.source.substring(1);\n break;\n case 'block-map':\n case 'block-seq':\n case 'flow-collection':\n node = composeCollection(CN, ctx, token, props, onError);\n if (anchor)\n node.anchor = anchor.source.substring(1);\n break;\n default: {\n const message = token.type === 'error'\n ? token.message\n : `Unsupported token (type: ${token.type})`;\n onError(token, 'UNEXPECTED_TOKEN', message);\n node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError);\n isSrcToken = false;\n }\n }\n if (anchor && node.anchor === '')\n onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');\n if (atKey &&\n ctx.options.stringKeys &&\n (!isScalar(node) ||\n typeof node.value !== 'string' ||\n (node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {\n const msg = 'With stringKeys, all keys must be strings';\n onError(tag ?? token, 'NON_STRING_KEY', msg);\n }\n if (spaceBefore)\n node.spaceBefore = true;\n if (comment) {\n if (token.type === 'scalar' && token.source === '')\n node.comment = comment;\n else\n node.commentBefore = comment;\n }\n // @ts-expect-error Type checking misses meaning of isSrcToken\n if (ctx.options.keepSourceTokens && isSrcToken)\n node.srcToken = token;\n return node;\n}\nfunction composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {\n const token = {\n type: 'scalar',\n offset: emptyScalarPosition(offset, before, pos),\n indent: -1,\n source: ''\n };\n const node = composeScalar(ctx, token, tag, onError);\n if (anchor) {\n node.anchor = anchor.source.substring(1);\n if (node.anchor === '')\n onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');\n }\n if (spaceBefore)\n node.spaceBefore = true;\n if (comment) {\n node.comment = comment;\n node.range[2] = end;\n }\n return node;\n}\nfunction composeAlias({ options }, { offset, source, end }, onError) {\n const alias = new Alias(source.substring(1));\n if (alias.source === '')\n onError(offset, 'BAD_ALIAS', 'Alias cannot be an empty string');\n if (alias.source.endsWith(':'))\n onError(offset + source.length - 1, 'BAD_ALIAS', 'Alias ending in : is ambiguous', true);\n const valueEnd = offset + source.length;\n const re = resolveEnd(end, valueEnd, options.strict, onError);\n alias.range = [offset, valueEnd, re.offset];\n if (re.comment)\n alias.comment = re.comment;\n return alias;\n}\n\nexport { composeEmptyNode, composeNode };\n","import { Document } from '../doc/Document.js';\nimport { composeNode, composeEmptyNode } from './compose-node.js';\nimport { resolveEnd } from './resolve-end.js';\nimport { resolveProps } from './resolve-props.js';\n\nfunction composeDoc(options, directives, { offset, start, value, end }, onError) {\n const opts = Object.assign({ _directives: directives }, options);\n const doc = new Document(undefined, opts);\n const ctx = {\n atKey: false,\n atRoot: true,\n directives: doc.directives,\n options: doc.options,\n schema: doc.schema\n };\n const props = resolveProps(start, {\n indicator: 'doc-start',\n next: value ?? end?.[0],\n offset,\n onError,\n parentIndent: 0,\n startOnNewline: true\n });\n if (props.found) {\n doc.directives.docStart = true;\n if (value &&\n (value.type === 'block-map' || value.type === 'block-seq') &&\n !props.hasNewline)\n onError(props.end, 'MISSING_CHAR', 'Block collection cannot start on same line with directives-end marker');\n }\n // @ts-expect-error If Contents is set, let's trust the user\n doc.contents = value\n ? composeNode(ctx, value, props, onError)\n : composeEmptyNode(ctx, props.end, start, null, props, onError);\n const contentEnd = doc.contents.range[2];\n const re = resolveEnd(end, contentEnd, false, onError);\n if (re.comment)\n doc.comment = re.comment;\n doc.range = [offset, contentEnd, re.offset];\n return doc;\n}\n\nexport { composeDoc };\n","import { Directives } from '../doc/directives.js';\nimport { Document } from '../doc/Document.js';\nimport { YAMLWarning, YAMLParseError } from '../errors.js';\nimport { isCollection, isPair } from '../nodes/identity.js';\nimport { composeDoc } from './compose-doc.js';\nimport { resolveEnd } from './resolve-end.js';\n\nfunction getErrorPos(src) {\n if (typeof src === 'number')\n return [src, src + 1];\n if (Array.isArray(src))\n return src.length === 2 ? src : [src[0], src[1]];\n const { offset, source } = src;\n return [offset, offset + (typeof source === 'string' ? source.length : 1)];\n}\nfunction parsePrelude(prelude) {\n let comment = '';\n let atComment = false;\n let afterEmptyLine = false;\n for (let i = 0; i < prelude.length; ++i) {\n const source = prelude[i];\n switch (source[0]) {\n case '#':\n comment +=\n (comment === '' ? '' : afterEmptyLine ? '\\n\\n' : '\\n') +\n (source.substring(1) || ' ');\n atComment = true;\n afterEmptyLine = false;\n break;\n case '%':\n if (prelude[i + 1]?.[0] !== '#')\n i += 1;\n atComment = false;\n break;\n default:\n // This may be wrong after doc-end, but in that case it doesn't matter\n if (!atComment)\n afterEmptyLine = true;\n atComment = false;\n }\n }\n return { comment, afterEmptyLine };\n}\n/**\n * Compose a stream of CST nodes into a stream of YAML Documents.\n *\n * ```ts\n * import { Composer, Parser } from 'yaml'\n *\n * const src: string = ...\n * const tokens = new Parser().parse(src)\n * const docs = new Composer().compose(tokens)\n * ```\n */\nclass Composer {\n constructor(options = {}) {\n this.doc = null;\n this.atDirectives = false;\n this.prelude = [];\n this.errors = [];\n this.warnings = [];\n this.onError = (source, code, message, warning) => {\n const pos = getErrorPos(source);\n if (warning)\n this.warnings.push(new YAMLWarning(pos, code, message));\n else\n this.errors.push(new YAMLParseError(pos, code, message));\n };\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n this.directives = new Directives({ version: options.version || '1.2' });\n this.options = options;\n }\n decorate(doc, afterDoc) {\n const { comment, afterEmptyLine } = parsePrelude(this.prelude);\n //console.log({ dc: doc.comment, prelude, comment })\n if (comment) {\n const dc = doc.contents;\n if (afterDoc) {\n doc.comment = doc.comment ? `${doc.comment}\\n${comment}` : comment;\n }\n else if (afterEmptyLine || doc.directives.docStart || !dc) {\n doc.commentBefore = comment;\n }\n else if (isCollection(dc) && !dc.flow && dc.items.length > 0) {\n let it = dc.items[0];\n if (isPair(it))\n it = it.key;\n const cb = it.commentBefore;\n it.commentBefore = cb ? `${comment}\\n${cb}` : comment;\n }\n else {\n const cb = dc.commentBefore;\n dc.commentBefore = cb ? `${comment}\\n${cb}` : comment;\n }\n }\n if (afterDoc) {\n Array.prototype.push.apply(doc.errors, this.errors);\n Array.prototype.push.apply(doc.warnings, this.warnings);\n }\n else {\n doc.errors = this.errors;\n doc.warnings = this.warnings;\n }\n this.prelude = [];\n this.errors = [];\n this.warnings = [];\n }\n /**\n * Current stream status information.\n *\n * Mostly useful at the end of input for an empty stream.\n */\n streamInfo() {\n return {\n comment: parsePrelude(this.prelude).comment,\n directives: this.directives,\n errors: this.errors,\n warnings: this.warnings\n };\n }\n /**\n * Compose tokens into documents.\n *\n * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.\n * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.\n */\n *compose(tokens, forceDoc = false, endOffset = -1) {\n for (const token of tokens)\n yield* this.next(token);\n yield* this.end(forceDoc, endOffset);\n }\n /** Advance the composer by one CST token. */\n *next(token) {\n switch (token.type) {\n case 'directive':\n this.directives.add(token.source, (offset, message, warning) => {\n const pos = getErrorPos(token);\n pos[0] += offset;\n this.onError(pos, 'BAD_DIRECTIVE', message, warning);\n });\n this.prelude.push(token.source);\n this.atDirectives = true;\n break;\n case 'document': {\n const doc = composeDoc(this.options, this.directives, token, this.onError);\n if (this.atDirectives && !doc.directives.docStart)\n this.onError(token, 'MISSING_CHAR', 'Missing directives-end/doc-start indicator line');\n this.decorate(doc, false);\n if (this.doc)\n yield this.doc;\n this.doc = doc;\n this.atDirectives = false;\n break;\n }\n case 'byte-order-mark':\n case 'space':\n break;\n case 'comment':\n case 'newline':\n this.prelude.push(token.source);\n break;\n case 'error': {\n const msg = token.source\n ? `${token.message}: ${JSON.stringify(token.source)}`\n : token.message;\n const error = new YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg);\n if (this.atDirectives || !this.doc)\n this.errors.push(error);\n else\n this.doc.errors.push(error);\n break;\n }\n case 'doc-end': {\n if (!this.doc) {\n const msg = 'Unexpected doc-end without preceding document';\n this.errors.push(new YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg));\n break;\n }\n this.doc.directives.docEnd = true;\n const end = resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError);\n this.decorate(this.doc, true);\n if (end.comment) {\n const dc = this.doc.comment;\n this.doc.comment = dc ? `${dc}\\n${end.comment}` : end.comment;\n }\n this.doc.range[2] = end.offset;\n break;\n }\n default:\n this.errors.push(new YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', `Unsupported token ${token.type}`));\n }\n }\n /**\n * Call at end of input to yield any remaining document.\n *\n * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.\n * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.\n */\n *end(forceDoc = false, endOffset = -1) {\n if (this.doc) {\n this.decorate(this.doc, true);\n yield this.doc;\n this.doc = null;\n }\n else if (forceDoc) {\n const opts = Object.assign({ _directives: this.directives }, this.options);\n const doc = new Document(undefined, opts);\n if (this.atDirectives)\n this.onError(endOffset, 'MISSING_CHAR', 'Missing directives-end indicator line');\n doc.range = [0, endOffset, endOffset];\n this.decorate(doc, false);\n yield doc;\n }\n }\n}\n\nexport { Composer };\n","import { resolveBlockScalar } from '../compose/resolve-block-scalar.js';\nimport { resolveFlowScalar } from '../compose/resolve-flow-scalar.js';\nimport { YAMLParseError } from '../errors.js';\nimport { stringifyString } from '../stringify/stringifyString.js';\n\nfunction resolveAsScalar(token, strict = true, onError) {\n if (token) {\n const _onError = (pos, code, message) => {\n const offset = typeof pos === 'number' ? pos : Array.isArray(pos) ? pos[0] : pos.offset;\n if (onError)\n onError(offset, code, message);\n else\n throw new YAMLParseError([offset, offset + 1], code, message);\n };\n switch (token.type) {\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar':\n return resolveFlowScalar(token, strict, _onError);\n case 'block-scalar':\n return resolveBlockScalar({ options: { strict } }, token, _onError);\n }\n }\n return null;\n}\n/**\n * Create a new scalar token with `value`\n *\n * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,\n * as this function does not support any schema operations and won't check for such conflicts.\n *\n * @param value The string representation of the value, which will have its content properly indented.\n * @param context.end Comments and whitespace after the end of the value, or after the block scalar header. If undefined, a newline will be added.\n * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.\n * @param context.indent The indent level of the token.\n * @param context.inFlow Is this scalar within a flow collection? This may affect the resolved type of the token's value.\n * @param context.offset The offset position of the token.\n * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.\n */\nfunction createScalarToken(value, context) {\n const { implicitKey = false, indent, inFlow = false, offset = -1, type = 'PLAIN' } = context;\n const source = stringifyString({ type, value }, {\n implicitKey,\n indent: indent > 0 ? ' '.repeat(indent) : '',\n inFlow,\n options: { blockQuote: true, lineWidth: -1 }\n });\n const end = context.end ?? [\n { type: 'newline', offset: -1, indent, source: '\\n' }\n ];\n switch (source[0]) {\n case '|':\n case '>': {\n const he = source.indexOf('\\n');\n const head = source.substring(0, he);\n const body = source.substring(he + 1) + '\\n';\n const props = [\n { type: 'block-scalar-header', offset, indent, source: head }\n ];\n if (!addEndtoBlockProps(props, end))\n props.push({ type: 'newline', offset: -1, indent, source: '\\n' });\n return { type: 'block-scalar', offset, indent, props, source: body };\n }\n case '\"':\n return { type: 'double-quoted-scalar', offset, indent, source, end };\n case \"'\":\n return { type: 'single-quoted-scalar', offset, indent, source, end };\n default:\n return { type: 'scalar', offset, indent, source, end };\n }\n}\n/**\n * Set the value of `token` to the given string `value`, overwriting any previous contents and type that it may have.\n *\n * Best efforts are made to retain any comments previously associated with the `token`,\n * though all contents within a collection's `items` will be overwritten.\n *\n * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,\n * as this function does not support any schema operations and won't check for such conflicts.\n *\n * @param token Any token. If it does not include an `indent` value, the value will be stringified as if it were an implicit key.\n * @param value The string representation of the value, which will have its content properly indented.\n * @param context.afterKey In most cases, values after a key should have an additional level of indentation.\n * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.\n * @param context.inFlow Being within a flow collection may affect the resolved type of the token's value.\n * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.\n */\nfunction setScalarValue(token, value, context = {}) {\n let { afterKey = false, implicitKey = false, inFlow = false, type } = context;\n let indent = 'indent' in token ? token.indent : null;\n if (afterKey && typeof indent === 'number')\n indent += 2;\n if (!type)\n switch (token.type) {\n case 'single-quoted-scalar':\n type = 'QUOTE_SINGLE';\n break;\n case 'double-quoted-scalar':\n type = 'QUOTE_DOUBLE';\n break;\n case 'block-scalar': {\n const header = token.props[0];\n if (header.type !== 'block-scalar-header')\n throw new Error('Invalid block scalar header');\n type = header.source[0] === '>' ? 'BLOCK_FOLDED' : 'BLOCK_LITERAL';\n break;\n }\n default:\n type = 'PLAIN';\n }\n const source = stringifyString({ type, value }, {\n implicitKey: implicitKey || indent === null,\n indent: indent !== null && indent > 0 ? ' '.repeat(indent) : '',\n inFlow,\n options: { blockQuote: true, lineWidth: -1 }\n });\n switch (source[0]) {\n case '|':\n case '>':\n setBlockScalarValue(token, source);\n break;\n case '\"':\n setFlowScalarValue(token, source, 'double-quoted-scalar');\n break;\n case \"'\":\n setFlowScalarValue(token, source, 'single-quoted-scalar');\n break;\n default:\n setFlowScalarValue(token, source, 'scalar');\n }\n}\nfunction setBlockScalarValue(token, source) {\n const he = source.indexOf('\\n');\n const head = source.substring(0, he);\n const body = source.substring(he + 1) + '\\n';\n if (token.type === 'block-scalar') {\n const header = token.props[0];\n if (header.type !== 'block-scalar-header')\n throw new Error('Invalid block scalar header');\n header.source = head;\n token.source = body;\n }\n else {\n const { offset } = token;\n const indent = 'indent' in token ? token.indent : -1;\n const props = [\n { type: 'block-scalar-header', offset, indent, source: head }\n ];\n if (!addEndtoBlockProps(props, 'end' in token ? token.end : undefined))\n props.push({ type: 'newline', offset: -1, indent, source: '\\n' });\n for (const key of Object.keys(token))\n if (key !== 'type' && key !== 'offset')\n delete token[key];\n Object.assign(token, { type: 'block-scalar', indent, props, source: body });\n }\n}\n/** @returns `true` if last token is a newline */\nfunction addEndtoBlockProps(props, end) {\n if (end)\n for (const st of end)\n switch (st.type) {\n case 'space':\n case 'comment':\n props.push(st);\n break;\n case 'newline':\n props.push(st);\n return true;\n }\n return false;\n}\nfunction setFlowScalarValue(token, source, type) {\n switch (token.type) {\n case 'scalar':\n case 'double-quoted-scalar':\n case 'single-quoted-scalar':\n token.type = type;\n token.source = source;\n break;\n case 'block-scalar': {\n const end = token.props.slice(1);\n let oa = source.length;\n if (token.props[0].type === 'block-scalar-header')\n oa -= token.props[0].source.length;\n for (const tok of end)\n tok.offset += oa;\n delete token.props;\n Object.assign(token, { type, source, end });\n break;\n }\n case 'block-map':\n case 'block-seq': {\n const offset = token.offset + source.length;\n const nl = { type: 'newline', offset, indent: token.indent, source: '\\n' };\n delete token.items;\n Object.assign(token, { type, source, end: [nl] });\n break;\n }\n default: {\n const indent = 'indent' in token ? token.indent : -1;\n const end = 'end' in token && Array.isArray(token.end)\n ? token.end.filter(st => st.type === 'space' ||\n st.type === 'comment' ||\n st.type === 'newline')\n : [];\n for (const key of Object.keys(token))\n if (key !== 'type' && key !== 'offset')\n delete token[key];\n Object.assign(token, { type, indent, source, end });\n }\n }\n}\n\nexport { createScalarToken, resolveAsScalar, setScalarValue };\n","/**\n * Stringify a CST document, token, or collection item\n *\n * Fair warning: This applies no validation whatsoever, and\n * simply concatenates the sources in their logical order.\n */\nconst stringify = (cst) => 'type' in cst ? stringifyToken(cst) : stringifyItem(cst);\nfunction stringifyToken(token) {\n switch (token.type) {\n case 'block-scalar': {\n let res = '';\n for (const tok of token.props)\n res += stringifyToken(tok);\n return res + token.source;\n }\n case 'block-map':\n case 'block-seq': {\n let res = '';\n for (const item of token.items)\n res += stringifyItem(item);\n return res;\n }\n case 'flow-collection': {\n let res = token.start.source;\n for (const item of token.items)\n res += stringifyItem(item);\n for (const st of token.end)\n res += st.source;\n return res;\n }\n case 'document': {\n let res = stringifyItem(token);\n if (token.end)\n for (const st of token.end)\n res += st.source;\n return res;\n }\n default: {\n let res = token.source;\n if ('end' in token && token.end)\n for (const st of token.end)\n res += st.source;\n return res;\n }\n }\n}\nfunction stringifyItem({ start, key, sep, value }) {\n let res = '';\n for (const st of start)\n res += st.source;\n if (key)\n res += stringifyToken(key);\n if (sep)\n for (const st of sep)\n res += st.source;\n if (value)\n res += stringifyToken(value);\n return res;\n}\n\nexport { stringify };\n","export { createScalarToken, resolveAsScalar, setScalarValue } from './cst-scalar.js';\nexport { stringify } from './cst-stringify.js';\nexport { visit } from './cst-visit.js';\n\n/** The byte order mark */\nconst BOM = '\\u{FEFF}';\n/** Start of doc-mode */\nconst DOCUMENT = '\\x02'; // C0: Start of Text\n/** Unexpected end of flow-mode */\nconst FLOW_END = '\\x18'; // C0: Cancel\n/** Next token is a scalar value */\nconst SCALAR = '\\x1f'; // C0: Unit Separator\n/** @returns `true` if `token` is a flow or block collection */\nconst isCollection = (token) => !!token && 'items' in token;\n/** @returns `true` if `token` is a flow or block scalar; not an alias */\nconst isScalar = (token) => !!token &&\n (token.type === 'scalar' ||\n token.type === 'single-quoted-scalar' ||\n token.type === 'double-quoted-scalar' ||\n token.type === 'block-scalar');\n/* istanbul ignore next */\n/** Get a printable representation of a lexer token */\nfunction prettyToken(token) {\n switch (token) {\n case BOM:\n return '';\n case DOCUMENT:\n return '';\n case FLOW_END:\n return '';\n case SCALAR:\n return '';\n default:\n return JSON.stringify(token);\n }\n}\n/** Identify the type of a lexer token. May return `null` for unknown tokens. */\nfunction tokenType(source) {\n switch (source) {\n case BOM:\n return 'byte-order-mark';\n case DOCUMENT:\n return 'doc-mode';\n case FLOW_END:\n return 'flow-error-end';\n case SCALAR:\n return 'scalar';\n case '---':\n return 'doc-start';\n case '...':\n return 'doc-end';\n case '':\n case '\\n':\n case '\\r\\n':\n return 'newline';\n case '-':\n return 'seq-item-ind';\n case '?':\n return 'explicit-key-ind';\n case ':':\n return 'map-value-ind';\n case '{':\n return 'flow-map-start';\n case '}':\n return 'flow-map-end';\n case '[':\n return 'flow-seq-start';\n case ']':\n return 'flow-seq-end';\n case ',':\n return 'comma';\n }\n switch (source[0]) {\n case ' ':\n case '\\t':\n return 'space';\n case '#':\n return 'comment';\n case '%':\n return 'directive-line';\n case '*':\n return 'alias';\n case '&':\n return 'anchor';\n case '!':\n return 'tag';\n case \"'\":\n return 'single-quoted-scalar';\n case '\"':\n return 'double-quoted-scalar';\n case '|':\n case '>':\n return 'block-scalar-header';\n }\n return null;\n}\n\nexport { BOM, DOCUMENT, FLOW_END, SCALAR, isCollection, isScalar, prettyToken, tokenType };\n","import { BOM, DOCUMENT, FLOW_END, SCALAR } from './cst.js';\n\n/*\nSTART -> stream\n\nstream\n directive -> line-end -> stream\n indent + line-end -> stream\n [else] -> line-start\n\nline-end\n comment -> line-end\n newline -> .\n input-end -> END\n\nline-start\n doc-start -> doc\n doc-end -> stream\n [else] -> indent -> block-start\n\nblock-start\n seq-item-start -> block-start\n explicit-key-start -> block-start\n map-value-start -> block-start\n [else] -> doc\n\ndoc\n line-end -> line-start\n spaces -> doc\n anchor -> doc\n tag -> doc\n flow-start -> flow -> doc\n flow-end -> error -> doc\n seq-item-start -> error -> doc\n explicit-key-start -> error -> doc\n map-value-start -> doc\n alias -> doc\n quote-start -> quoted-scalar -> doc\n block-scalar-header -> line-end -> block-scalar(min) -> line-start\n [else] -> plain-scalar(false, min) -> doc\n\nflow\n line-end -> flow\n spaces -> flow\n anchor -> flow\n tag -> flow\n flow-start -> flow -> flow\n flow-end -> .\n seq-item-start -> error -> flow\n explicit-key-start -> flow\n map-value-start -> flow\n alias -> flow\n quote-start -> quoted-scalar -> flow\n comma -> flow\n [else] -> plain-scalar(true, 0) -> flow\n\nquoted-scalar\n quote-end -> .\n [else] -> quoted-scalar\n\nblock-scalar(min)\n newline + peek(indent < min) -> .\n [else] -> block-scalar(min)\n\nplain-scalar(is-flow, min)\n scalar-end(is-flow) -> .\n peek(newline + (indent < min)) -> .\n [else] -> plain-scalar(min)\n*/\nfunction isEmpty(ch) {\n switch (ch) {\n case undefined:\n case ' ':\n case '\\n':\n case '\\r':\n case '\\t':\n return true;\n default:\n return false;\n }\n}\nconst hexDigits = new Set('0123456789ABCDEFabcdef');\nconst tagChars = new Set(\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()\");\nconst flowIndicatorChars = new Set(',[]{}');\nconst invalidAnchorChars = new Set(' ,[]{}\\n\\r\\t');\nconst isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch);\n/**\n * Splits an input string into lexical tokens, i.e. smaller strings that are\n * easily identifiable by `tokens.tokenType()`.\n *\n * Lexing starts always in a \"stream\" context. Incomplete input may be buffered\n * until a complete token can be emitted.\n *\n * In addition to slices of the original input, the following control characters\n * may also be emitted:\n *\n * - `\\x02` (Start of Text): A document starts with the next token\n * - `\\x18` (Cancel): Unexpected end of flow-mode (indicates an error)\n * - `\\x1f` (Unit Separator): Next token is a scalar value\n * - `\\u{FEFF}` (Byte order mark): Emitted separately outside documents\n */\nclass Lexer {\n constructor() {\n /**\n * Flag indicating whether the end of the current buffer marks the end of\n * all input\n */\n this.atEnd = false;\n /**\n * Explicit indent set in block scalar header, as an offset from the current\n * minimum indent, so e.g. set to 1 from a header `|2+`. Set to -1 if not\n * explicitly set.\n */\n this.blockScalarIndent = -1;\n /**\n * Block scalars that include a + (keep) chomping indicator in their header\n * include trailing empty lines, which are otherwise excluded from the\n * scalar's contents.\n */\n this.blockScalarKeep = false;\n /** Current input */\n this.buffer = '';\n /**\n * Flag noting whether the map value indicator : can immediately follow this\n * node within a flow context.\n */\n this.flowKey = false;\n /** Count of surrounding flow collection levels. */\n this.flowLevel = 0;\n /**\n * Minimum level of indentation required for next lines to be parsed as a\n * part of the current scalar value.\n */\n this.indentNext = 0;\n /** Indentation level of the current line. */\n this.indentValue = 0;\n /** Position of the next \\n character. */\n this.lineEndPos = null;\n /** Stores the state of the lexer if reaching the end of incpomplete input */\n this.next = null;\n /** A pointer to `buffer`; the current position of the lexer. */\n this.pos = 0;\n }\n /**\n * Generate YAML tokens from the `source` string. If `incomplete`,\n * a part of the last line may be left as a buffer for the next call.\n *\n * @returns A generator of lexical tokens\n */\n *lex(source, incomplete = false) {\n if (source) {\n if (typeof source !== 'string')\n throw TypeError('source is not a string');\n this.buffer = this.buffer ? this.buffer + source : source;\n this.lineEndPos = null;\n }\n this.atEnd = !incomplete;\n let next = this.next ?? 'stream';\n while (next && (incomplete || this.hasChars(1)))\n next = yield* this.parseNext(next);\n }\n atLineEnd() {\n let i = this.pos;\n let ch = this.buffer[i];\n while (ch === ' ' || ch === '\\t')\n ch = this.buffer[++i];\n if (!ch || ch === '#' || ch === '\\n')\n return true;\n if (ch === '\\r')\n return this.buffer[i + 1] === '\\n';\n return false;\n }\n charAt(n) {\n return this.buffer[this.pos + n];\n }\n continueScalar(offset) {\n let ch = this.buffer[offset];\n if (this.indentNext > 0) {\n let indent = 0;\n while (ch === ' ')\n ch = this.buffer[++indent + offset];\n if (ch === '\\r') {\n const next = this.buffer[indent + offset + 1];\n if (next === '\\n' || (!next && !this.atEnd))\n return offset + indent + 1;\n }\n return ch === '\\n' || indent >= this.indentNext || (!ch && !this.atEnd)\n ? offset + indent\n : -1;\n }\n if (ch === '-' || ch === '.') {\n const dt = this.buffer.substr(offset, 3);\n if ((dt === '---' || dt === '...') && isEmpty(this.buffer[offset + 3]))\n return -1;\n }\n return offset;\n }\n getLine() {\n let end = this.lineEndPos;\n if (typeof end !== 'number' || (end !== -1 && end < this.pos)) {\n end = this.buffer.indexOf('\\n', this.pos);\n this.lineEndPos = end;\n }\n if (end === -1)\n return this.atEnd ? this.buffer.substring(this.pos) : null;\n if (this.buffer[end - 1] === '\\r')\n end -= 1;\n return this.buffer.substring(this.pos, end);\n }\n hasChars(n) {\n return this.pos + n <= this.buffer.length;\n }\n setNext(state) {\n this.buffer = this.buffer.substring(this.pos);\n this.pos = 0;\n this.lineEndPos = null;\n this.next = state;\n return null;\n }\n peek(n) {\n return this.buffer.substr(this.pos, n);\n }\n *parseNext(next) {\n switch (next) {\n case 'stream':\n return yield* this.parseStream();\n case 'line-start':\n return yield* this.parseLineStart();\n case 'block-start':\n return yield* this.parseBlockStart();\n case 'doc':\n return yield* this.parseDocument();\n case 'flow':\n return yield* this.parseFlowCollection();\n case 'quoted-scalar':\n return yield* this.parseQuotedScalar();\n case 'block-scalar':\n return yield* this.parseBlockScalar();\n case 'plain-scalar':\n return yield* this.parsePlainScalar();\n }\n }\n *parseStream() {\n let line = this.getLine();\n if (line === null)\n return this.setNext('stream');\n if (line[0] === BOM) {\n yield* this.pushCount(1);\n line = line.substring(1);\n }\n if (line[0] === '%') {\n let dirEnd = line.length;\n let cs = line.indexOf('#');\n while (cs !== -1) {\n const ch = line[cs - 1];\n if (ch === ' ' || ch === '\\t') {\n dirEnd = cs - 1;\n break;\n }\n else {\n cs = line.indexOf('#', cs + 1);\n }\n }\n while (true) {\n const ch = line[dirEnd - 1];\n if (ch === ' ' || ch === '\\t')\n dirEnd -= 1;\n else\n break;\n }\n const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true));\n yield* this.pushCount(line.length - n); // possible comment\n this.pushNewline();\n return 'stream';\n }\n if (this.atLineEnd()) {\n const sp = yield* this.pushSpaces(true);\n yield* this.pushCount(line.length - sp);\n yield* this.pushNewline();\n return 'stream';\n }\n yield DOCUMENT;\n return yield* this.parseLineStart();\n }\n *parseLineStart() {\n const ch = this.charAt(0);\n if (!ch && !this.atEnd)\n return this.setNext('line-start');\n if (ch === '-' || ch === '.') {\n if (!this.atEnd && !this.hasChars(4))\n return this.setNext('line-start');\n const s = this.peek(3);\n if ((s === '---' || s === '...') && isEmpty(this.charAt(3))) {\n yield* this.pushCount(3);\n this.indentValue = 0;\n this.indentNext = 0;\n return s === '---' ? 'doc' : 'stream';\n }\n }\n this.indentValue = yield* this.pushSpaces(false);\n if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1)))\n this.indentNext = this.indentValue;\n return yield* this.parseBlockStart();\n }\n *parseBlockStart() {\n const [ch0, ch1] = this.peek(2);\n if (!ch1 && !this.atEnd)\n return this.setNext('block-start');\n if ((ch0 === '-' || ch0 === '?' || ch0 === ':') && isEmpty(ch1)) {\n const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));\n this.indentNext = this.indentValue + 1;\n this.indentValue += n;\n return yield* this.parseBlockStart();\n }\n return 'doc';\n }\n *parseDocument() {\n yield* this.pushSpaces(true);\n const line = this.getLine();\n if (line === null)\n return this.setNext('doc');\n let n = yield* this.pushIndicators();\n switch (line[n]) {\n case '#':\n yield* this.pushCount(line.length - n);\n // fallthrough\n case undefined:\n yield* this.pushNewline();\n return yield* this.parseLineStart();\n case '{':\n case '[':\n yield* this.pushCount(1);\n this.flowKey = false;\n this.flowLevel = 1;\n return 'flow';\n case '}':\n case ']':\n // this is an error\n yield* this.pushCount(1);\n return 'doc';\n case '*':\n yield* this.pushUntil(isNotAnchorChar);\n return 'doc';\n case '\"':\n case \"'\":\n return yield* this.parseQuotedScalar();\n case '|':\n case '>':\n n += yield* this.parseBlockScalarHeader();\n n += yield* this.pushSpaces(true);\n yield* this.pushCount(line.length - n);\n yield* this.pushNewline();\n return yield* this.parseBlockScalar();\n default:\n return yield* this.parsePlainScalar();\n }\n }\n *parseFlowCollection() {\n let nl, sp;\n let indent = -1;\n do {\n nl = yield* this.pushNewline();\n if (nl > 0) {\n sp = yield* this.pushSpaces(false);\n this.indentValue = indent = sp;\n }\n else {\n sp = 0;\n }\n sp += yield* this.pushSpaces(true);\n } while (nl + sp > 0);\n const line = this.getLine();\n if (line === null)\n return this.setNext('flow');\n if ((indent !== -1 && indent < this.indentNext && line[0] !== '#') ||\n (indent === 0 &&\n (line.startsWith('---') || line.startsWith('...')) &&\n isEmpty(line[3]))) {\n // Allowing for the terminal ] or } at the same (rather than greater)\n // indent level as the initial [ or { is technically invalid, but\n // failing here would be surprising to users.\n const atFlowEndMarker = indent === this.indentNext - 1 &&\n this.flowLevel === 1 &&\n (line[0] === ']' || line[0] === '}');\n if (!atFlowEndMarker) {\n // this is an error\n this.flowLevel = 0;\n yield FLOW_END;\n return yield* this.parseLineStart();\n }\n }\n let n = 0;\n while (line[n] === ',') {\n n += yield* this.pushCount(1);\n n += yield* this.pushSpaces(true);\n this.flowKey = false;\n }\n n += yield* this.pushIndicators();\n switch (line[n]) {\n case undefined:\n return 'flow';\n case '#':\n yield* this.pushCount(line.length - n);\n return 'flow';\n case '{':\n case '[':\n yield* this.pushCount(1);\n this.flowKey = false;\n this.flowLevel += 1;\n return 'flow';\n case '}':\n case ']':\n yield* this.pushCount(1);\n this.flowKey = true;\n this.flowLevel -= 1;\n return this.flowLevel ? 'flow' : 'doc';\n case '*':\n yield* this.pushUntil(isNotAnchorChar);\n return 'flow';\n case '\"':\n case \"'\":\n this.flowKey = true;\n return yield* this.parseQuotedScalar();\n case ':': {\n const next = this.charAt(1);\n if (this.flowKey || isEmpty(next) || next === ',') {\n this.flowKey = false;\n yield* this.pushCount(1);\n yield* this.pushSpaces(true);\n return 'flow';\n }\n }\n // fallthrough\n default:\n this.flowKey = false;\n return yield* this.parsePlainScalar();\n }\n }\n *parseQuotedScalar() {\n const quote = this.charAt(0);\n let end = this.buffer.indexOf(quote, this.pos + 1);\n if (quote === \"'\") {\n while (end !== -1 && this.buffer[end + 1] === \"'\")\n end = this.buffer.indexOf(\"'\", end + 2);\n }\n else {\n // double-quote\n while (end !== -1) {\n let n = 0;\n while (this.buffer[end - 1 - n] === '\\\\')\n n += 1;\n if (n % 2 === 0)\n break;\n end = this.buffer.indexOf('\"', end + 1);\n }\n }\n // Only looking for newlines within the quotes\n const qb = this.buffer.substring(0, end);\n let nl = qb.indexOf('\\n', this.pos);\n if (nl !== -1) {\n while (nl !== -1) {\n const cs = this.continueScalar(nl + 1);\n if (cs === -1)\n break;\n nl = qb.indexOf('\\n', cs);\n }\n if (nl !== -1) {\n // this is an error caused by an unexpected unindent\n end = nl - (qb[nl - 1] === '\\r' ? 2 : 1);\n }\n }\n if (end === -1) {\n if (!this.atEnd)\n return this.setNext('quoted-scalar');\n end = this.buffer.length;\n }\n yield* this.pushToIndex(end + 1, false);\n return this.flowLevel ? 'flow' : 'doc';\n }\n *parseBlockScalarHeader() {\n this.blockScalarIndent = -1;\n this.blockScalarKeep = false;\n let i = this.pos;\n while (true) {\n const ch = this.buffer[++i];\n if (ch === '+')\n this.blockScalarKeep = true;\n else if (ch > '0' && ch <= '9')\n this.blockScalarIndent = Number(ch) - 1;\n else if (ch !== '-')\n break;\n }\n return yield* this.pushUntil(ch => isEmpty(ch) || ch === '#');\n }\n *parseBlockScalar() {\n let nl = this.pos - 1; // may be -1 if this.pos === 0\n let indent = 0;\n let ch;\n loop: for (let i = this.pos; (ch = this.buffer[i]); ++i) {\n switch (ch) {\n case ' ':\n indent += 1;\n break;\n case '\\n':\n nl = i;\n indent = 0;\n break;\n case '\\r': {\n const next = this.buffer[i + 1];\n if (!next && !this.atEnd)\n return this.setNext('block-scalar');\n if (next === '\\n')\n break;\n } // fallthrough\n default:\n break loop;\n }\n }\n if (!ch && !this.atEnd)\n return this.setNext('block-scalar');\n if (indent >= this.indentNext) {\n if (this.blockScalarIndent === -1)\n this.indentNext = indent;\n else {\n this.indentNext =\n this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);\n }\n do {\n const cs = this.continueScalar(nl + 1);\n if (cs === -1)\n break;\n nl = this.buffer.indexOf('\\n', cs);\n } while (nl !== -1);\n if (nl === -1) {\n if (!this.atEnd)\n return this.setNext('block-scalar');\n nl = this.buffer.length;\n }\n }\n // Trailing insufficiently indented tabs are invalid.\n // To catch that during parsing, we include them in the block scalar value.\n let i = nl + 1;\n ch = this.buffer[i];\n while (ch === ' ')\n ch = this.buffer[++i];\n if (ch === '\\t') {\n while (ch === '\\t' || ch === ' ' || ch === '\\r' || ch === '\\n')\n ch = this.buffer[++i];\n nl = i - 1;\n }\n else if (!this.blockScalarKeep) {\n do {\n let i = nl - 1;\n let ch = this.buffer[i];\n if (ch === '\\r')\n ch = this.buffer[--i];\n const lastChar = i; // Drop the line if last char not more indented\n while (ch === ' ')\n ch = this.buffer[--i];\n if (ch === '\\n' && i >= this.pos && i + 1 + indent > lastChar)\n nl = i;\n else\n break;\n } while (true);\n }\n yield SCALAR;\n yield* this.pushToIndex(nl + 1, true);\n return yield* this.parseLineStart();\n }\n *parsePlainScalar() {\n const inFlow = this.flowLevel > 0;\n let end = this.pos - 1;\n let i = this.pos - 1;\n let ch;\n while ((ch = this.buffer[++i])) {\n if (ch === ':') {\n const next = this.buffer[i + 1];\n if (isEmpty(next) || (inFlow && flowIndicatorChars.has(next)))\n break;\n end = i;\n }\n else if (isEmpty(ch)) {\n let next = this.buffer[i + 1];\n if (ch === '\\r') {\n if (next === '\\n') {\n i += 1;\n ch = '\\n';\n next = this.buffer[i + 1];\n }\n else\n end = i;\n }\n if (next === '#' || (inFlow && flowIndicatorChars.has(next)))\n break;\n if (ch === '\\n') {\n const cs = this.continueScalar(i + 1);\n if (cs === -1)\n break;\n i = Math.max(i, cs - 2); // to advance, but still account for ' #'\n }\n }\n else {\n if (inFlow && flowIndicatorChars.has(ch))\n break;\n end = i;\n }\n }\n if (!ch && !this.atEnd)\n return this.setNext('plain-scalar');\n yield SCALAR;\n yield* this.pushToIndex(end + 1, true);\n return inFlow ? 'flow' : 'doc';\n }\n *pushCount(n) {\n if (n > 0) {\n yield this.buffer.substr(this.pos, n);\n this.pos += n;\n return n;\n }\n return 0;\n }\n *pushToIndex(i, allowEmpty) {\n const s = this.buffer.slice(this.pos, i);\n if (s) {\n yield s;\n this.pos += s.length;\n return s.length;\n }\n else if (allowEmpty)\n yield '';\n return 0;\n }\n *pushIndicators() {\n switch (this.charAt(0)) {\n case '!':\n return ((yield* this.pushTag()) +\n (yield* this.pushSpaces(true)) +\n (yield* this.pushIndicators()));\n case '&':\n return ((yield* this.pushUntil(isNotAnchorChar)) +\n (yield* this.pushSpaces(true)) +\n (yield* this.pushIndicators()));\n case '-': // this is an error\n case '?': // this is an error outside flow collections\n case ':': {\n const inFlow = this.flowLevel > 0;\n const ch1 = this.charAt(1);\n if (isEmpty(ch1) || (inFlow && flowIndicatorChars.has(ch1))) {\n if (!inFlow)\n this.indentNext = this.indentValue + 1;\n else if (this.flowKey)\n this.flowKey = false;\n return ((yield* this.pushCount(1)) +\n (yield* this.pushSpaces(true)) +\n (yield* this.pushIndicators()));\n }\n }\n }\n return 0;\n }\n *pushTag() {\n if (this.charAt(1) === '<') {\n let i = this.pos + 2;\n let ch = this.buffer[i];\n while (!isEmpty(ch) && ch !== '>')\n ch = this.buffer[++i];\n return yield* this.pushToIndex(ch === '>' ? i + 1 : i, false);\n }\n else {\n let i = this.pos + 1;\n let ch = this.buffer[i];\n while (ch) {\n if (tagChars.has(ch))\n ch = this.buffer[++i];\n else if (ch === '%' &&\n hexDigits.has(this.buffer[i + 1]) &&\n hexDigits.has(this.buffer[i + 2])) {\n ch = this.buffer[(i += 3)];\n }\n else\n break;\n }\n return yield* this.pushToIndex(i, false);\n }\n }\n *pushNewline() {\n const ch = this.buffer[this.pos];\n if (ch === '\\n')\n return yield* this.pushCount(1);\n else if (ch === '\\r' && this.charAt(1) === '\\n')\n return yield* this.pushCount(2);\n else\n return 0;\n }\n *pushSpaces(allowTabs) {\n let i = this.pos - 1;\n let ch;\n do {\n ch = this.buffer[++i];\n } while (ch === ' ' || (allowTabs && ch === '\\t'));\n const n = i - this.pos;\n if (n > 0) {\n yield this.buffer.substr(this.pos, n);\n this.pos = i;\n }\n return n;\n }\n *pushUntil(test) {\n let i = this.pos;\n let ch = this.buffer[i];\n while (!test(ch))\n ch = this.buffer[++i];\n return yield* this.pushToIndex(i, false);\n }\n}\n\nexport { Lexer };\n","/**\n * Tracks newlines during parsing in order to provide an efficient API for\n * determining the one-indexed `{ line, col }` position for any offset\n * within the input.\n */\nclass LineCounter {\n constructor() {\n this.lineStarts = [];\n /**\n * Should be called in ascending order. Otherwise, call\n * `lineCounter.lineStarts.sort()` before calling `linePos()`.\n */\n this.addNewLine = (offset) => this.lineStarts.push(offset);\n /**\n * Performs a binary search and returns the 1-indexed { line, col }\n * position of `offset`. If `line === 0`, `addNewLine` has never been\n * called or `offset` is before the first known newline.\n */\n this.linePos = (offset) => {\n let low = 0;\n let high = this.lineStarts.length;\n while (low < high) {\n const mid = (low + high) >> 1; // Math.floor((low + high) / 2)\n if (this.lineStarts[mid] < offset)\n low = mid + 1;\n else\n high = mid;\n }\n if (this.lineStarts[low] === offset)\n return { line: low + 1, col: 1 };\n if (low === 0)\n return { line: 0, col: offset };\n const start = this.lineStarts[low - 1];\n return { line: low, col: offset - start + 1 };\n };\n }\n}\n\nexport { LineCounter };\n","import { tokenType } from './cst.js';\nimport { Lexer } from './lexer.js';\n\nfunction includesToken(list, type) {\n for (let i = 0; i < list.length; ++i)\n if (list[i].type === type)\n return true;\n return false;\n}\nfunction findNonEmptyIndex(list) {\n for (let i = 0; i < list.length; ++i) {\n switch (list[i].type) {\n case 'space':\n case 'comment':\n case 'newline':\n break;\n default:\n return i;\n }\n }\n return -1;\n}\nfunction isFlowToken(token) {\n switch (token?.type) {\n case 'alias':\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar':\n case 'flow-collection':\n return true;\n default:\n return false;\n }\n}\nfunction getPrevProps(parent) {\n switch (parent.type) {\n case 'document':\n return parent.start;\n case 'block-map': {\n const it = parent.items[parent.items.length - 1];\n return it.sep ?? it.start;\n }\n case 'block-seq':\n return parent.items[parent.items.length - 1].start;\n /* istanbul ignore next should not happen */\n default:\n return [];\n }\n}\n/** Note: May modify input array */\nfunction getFirstKeyStartProps(prev) {\n if (prev.length === 0)\n return [];\n let i = prev.length;\n loop: while (--i >= 0) {\n switch (prev[i].type) {\n case 'doc-start':\n case 'explicit-key-ind':\n case 'map-value-ind':\n case 'seq-item-ind':\n case 'newline':\n break loop;\n }\n }\n while (prev[++i]?.type === 'space') {\n /* loop */\n }\n return prev.splice(i, prev.length);\n}\nfunction fixFlowSeqItems(fc) {\n if (fc.start.type === 'flow-seq-start') {\n for (const it of fc.items) {\n if (it.sep &&\n !it.value &&\n !includesToken(it.start, 'explicit-key-ind') &&\n !includesToken(it.sep, 'map-value-ind')) {\n if (it.key)\n it.value = it.key;\n delete it.key;\n if (isFlowToken(it.value)) {\n if (it.value.end)\n Array.prototype.push.apply(it.value.end, it.sep);\n else\n it.value.end = it.sep;\n }\n else\n Array.prototype.push.apply(it.start, it.sep);\n delete it.sep;\n }\n }\n }\n}\n/**\n * A YAML concrete syntax tree (CST) parser\n *\n * ```ts\n * const src: string = ...\n * for (const token of new Parser().parse(src)) {\n * // token: Token\n * }\n * ```\n *\n * To use the parser with a user-provided lexer:\n *\n * ```ts\n * function* parse(source: string, lexer: Lexer) {\n * const parser = new Parser()\n * for (const lexeme of lexer.lex(source))\n * yield* parser.next(lexeme)\n * yield* parser.end()\n * }\n *\n * const src: string = ...\n * const lexer = new Lexer()\n * for (const token of parse(src, lexer)) {\n * // token: Token\n * }\n * ```\n */\nclass Parser {\n /**\n * @param onNewLine - If defined, called separately with the start position of\n * each new line (in `parse()`, including the start of input).\n */\n constructor(onNewLine) {\n /** If true, space and sequence indicators count as indentation */\n this.atNewLine = true;\n /** If true, next token is a scalar value */\n this.atScalar = false;\n /** Current indentation level */\n this.indent = 0;\n /** Current offset since the start of parsing */\n this.offset = 0;\n /** On the same line with a block map key */\n this.onKeyLine = false;\n /** Top indicates the node that's currently being built */\n this.stack = [];\n /** The source of the current token, set in parse() */\n this.source = '';\n /** The type of the current token, set in parse() */\n this.type = '';\n // Must be defined after `next()`\n this.lexer = new Lexer();\n this.onNewLine = onNewLine;\n }\n /**\n * Parse `source` as a YAML stream.\n * If `incomplete`, a part of the last line may be left as a buffer for the next call.\n *\n * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens.\n *\n * @returns A generator of tokens representing each directive, document, and other structure.\n */\n *parse(source, incomplete = false) {\n if (this.onNewLine && this.offset === 0)\n this.onNewLine(0);\n for (const lexeme of this.lexer.lex(source, incomplete))\n yield* this.next(lexeme);\n if (!incomplete)\n yield* this.end();\n }\n /**\n * Advance the parser by the `source` of one lexical token.\n */\n *next(source) {\n this.source = source;\n if (this.atScalar) {\n this.atScalar = false;\n yield* this.step();\n this.offset += source.length;\n return;\n }\n const type = tokenType(source);\n if (!type) {\n const message = `Not a YAML token: ${source}`;\n yield* this.pop({ type: 'error', offset: this.offset, message, source });\n this.offset += source.length;\n }\n else if (type === 'scalar') {\n this.atNewLine = false;\n this.atScalar = true;\n this.type = 'scalar';\n }\n else {\n this.type = type;\n yield* this.step();\n switch (type) {\n case 'newline':\n this.atNewLine = true;\n this.indent = 0;\n if (this.onNewLine)\n this.onNewLine(this.offset + source.length);\n break;\n case 'space':\n if (this.atNewLine && source[0] === ' ')\n this.indent += source.length;\n break;\n case 'explicit-key-ind':\n case 'map-value-ind':\n case 'seq-item-ind':\n if (this.atNewLine)\n this.indent += source.length;\n break;\n case 'doc-mode':\n case 'flow-error-end':\n return;\n default:\n this.atNewLine = false;\n }\n this.offset += source.length;\n }\n }\n /** Call at end of input to push out any remaining constructions */\n *end() {\n while (this.stack.length > 0)\n yield* this.pop();\n }\n get sourceToken() {\n const st = {\n type: this.type,\n offset: this.offset,\n indent: this.indent,\n source: this.source\n };\n return st;\n }\n *step() {\n const top = this.peek(1);\n if (this.type === 'doc-end' && (!top || top.type !== 'doc-end')) {\n while (this.stack.length > 0)\n yield* this.pop();\n this.stack.push({\n type: 'doc-end',\n offset: this.offset,\n source: this.source\n });\n return;\n }\n if (!top)\n return yield* this.stream();\n switch (top.type) {\n case 'document':\n return yield* this.document(top);\n case 'alias':\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar':\n return yield* this.scalar(top);\n case 'block-scalar':\n return yield* this.blockScalar(top);\n case 'block-map':\n return yield* this.blockMap(top);\n case 'block-seq':\n return yield* this.blockSequence(top);\n case 'flow-collection':\n return yield* this.flowCollection(top);\n case 'doc-end':\n return yield* this.documentEnd(top);\n }\n /* istanbul ignore next should not happen */\n yield* this.pop();\n }\n peek(n) {\n return this.stack[this.stack.length - n];\n }\n *pop(error) {\n const token = error ?? this.stack.pop();\n /* istanbul ignore if should not happen */\n if (!token) {\n const message = 'Tried to pop an empty stack';\n yield { type: 'error', offset: this.offset, source: '', message };\n }\n else if (this.stack.length === 0) {\n yield token;\n }\n else {\n const top = this.peek(1);\n if (token.type === 'block-scalar') {\n // Block scalars use their parent rather than header indent\n token.indent = 'indent' in top ? top.indent : 0;\n }\n else if (token.type === 'flow-collection' && top.type === 'document') {\n // Ignore all indent for top-level flow collections\n token.indent = 0;\n }\n if (token.type === 'flow-collection')\n fixFlowSeqItems(token);\n switch (top.type) {\n case 'document':\n top.value = token;\n break;\n case 'block-scalar':\n top.props.push(token); // error\n break;\n case 'block-map': {\n const it = top.items[top.items.length - 1];\n if (it.value) {\n top.items.push({ start: [], key: token, sep: [] });\n this.onKeyLine = true;\n return;\n }\n else if (it.sep) {\n it.value = token;\n }\n else {\n Object.assign(it, { key: token, sep: [] });\n this.onKeyLine = !it.explicitKey;\n return;\n }\n break;\n }\n case 'block-seq': {\n const it = top.items[top.items.length - 1];\n if (it.value)\n top.items.push({ start: [], value: token });\n else\n it.value = token;\n break;\n }\n case 'flow-collection': {\n const it = top.items[top.items.length - 1];\n if (!it || it.value)\n top.items.push({ start: [], key: token, sep: [] });\n else if (it.sep)\n it.value = token;\n else\n Object.assign(it, { key: token, sep: [] });\n return;\n }\n /* istanbul ignore next should not happen */\n default:\n yield* this.pop();\n yield* this.pop(token);\n }\n if ((top.type === 'document' ||\n top.type === 'block-map' ||\n top.type === 'block-seq') &&\n (token.type === 'block-map' || token.type === 'block-seq')) {\n const last = token.items[token.items.length - 1];\n if (last &&\n !last.sep &&\n !last.value &&\n last.start.length > 0 &&\n findNonEmptyIndex(last.start) === -1 &&\n (token.indent === 0 ||\n last.start.every(st => st.type !== 'comment' || st.indent < token.indent))) {\n if (top.type === 'document')\n top.end = last.start;\n else\n top.items.push({ start: last.start });\n token.items.splice(-1, 1);\n }\n }\n }\n }\n *stream() {\n switch (this.type) {\n case 'directive-line':\n yield { type: 'directive', offset: this.offset, source: this.source };\n return;\n case 'byte-order-mark':\n case 'space':\n case 'comment':\n case 'newline':\n yield this.sourceToken;\n return;\n case 'doc-mode':\n case 'doc-start': {\n const doc = {\n type: 'document',\n offset: this.offset,\n start: []\n };\n if (this.type === 'doc-start')\n doc.start.push(this.sourceToken);\n this.stack.push(doc);\n return;\n }\n }\n yield {\n type: 'error',\n offset: this.offset,\n message: `Unexpected ${this.type} token in YAML stream`,\n source: this.source\n };\n }\n *document(doc) {\n if (doc.value)\n return yield* this.lineEnd(doc);\n switch (this.type) {\n case 'doc-start': {\n if (findNonEmptyIndex(doc.start) !== -1) {\n yield* this.pop();\n yield* this.step();\n }\n else\n doc.start.push(this.sourceToken);\n return;\n }\n case 'anchor':\n case 'tag':\n case 'space':\n case 'comment':\n case 'newline':\n doc.start.push(this.sourceToken);\n return;\n }\n const bv = this.startBlockValue(doc);\n if (bv)\n this.stack.push(bv);\n else {\n yield {\n type: 'error',\n offset: this.offset,\n message: `Unexpected ${this.type} token in YAML document`,\n source: this.source\n };\n }\n }\n *scalar(scalar) {\n if (this.type === 'map-value-ind') {\n const prev = getPrevProps(this.peek(2));\n const start = getFirstKeyStartProps(prev);\n let sep;\n if (scalar.end) {\n sep = scalar.end;\n sep.push(this.sourceToken);\n delete scalar.end;\n }\n else\n sep = [this.sourceToken];\n const map = {\n type: 'block-map',\n offset: scalar.offset,\n indent: scalar.indent,\n items: [{ start, key: scalar, sep }]\n };\n this.onKeyLine = true;\n this.stack[this.stack.length - 1] = map;\n }\n else\n yield* this.lineEnd(scalar);\n }\n *blockScalar(scalar) {\n switch (this.type) {\n case 'space':\n case 'comment':\n case 'newline':\n scalar.props.push(this.sourceToken);\n return;\n case 'scalar':\n scalar.source = this.source;\n // block-scalar source includes trailing newline\n this.atNewLine = true;\n this.indent = 0;\n if (this.onNewLine) {\n let nl = this.source.indexOf('\\n') + 1;\n while (nl !== 0) {\n this.onNewLine(this.offset + nl);\n nl = this.source.indexOf('\\n', nl) + 1;\n }\n }\n yield* this.pop();\n break;\n /* istanbul ignore next should not happen */\n default:\n yield* this.pop();\n yield* this.step();\n }\n }\n *blockMap(map) {\n const it = map.items[map.items.length - 1];\n // it.sep is true-ish if pair already has key or : separator\n switch (this.type) {\n case 'newline':\n this.onKeyLine = false;\n if (it.value) {\n const end = 'end' in it.value ? it.value.end : undefined;\n const last = Array.isArray(end) ? end[end.length - 1] : undefined;\n if (last?.type === 'comment')\n end?.push(this.sourceToken);\n else\n map.items.push({ start: [this.sourceToken] });\n }\n else if (it.sep) {\n it.sep.push(this.sourceToken);\n }\n else {\n it.start.push(this.sourceToken);\n }\n return;\n case 'space':\n case 'comment':\n if (it.value) {\n map.items.push({ start: [this.sourceToken] });\n }\n else if (it.sep) {\n it.sep.push(this.sourceToken);\n }\n else {\n if (this.atIndentedComment(it.start, map.indent)) {\n const prev = map.items[map.items.length - 2];\n const end = prev?.value?.end;\n if (Array.isArray(end)) {\n Array.prototype.push.apply(end, it.start);\n end.push(this.sourceToken);\n map.items.pop();\n return;\n }\n }\n it.start.push(this.sourceToken);\n }\n return;\n }\n if (this.indent >= map.indent) {\n const atMapIndent = !this.onKeyLine && this.indent === map.indent;\n const atNextItem = atMapIndent &&\n (it.sep || it.explicitKey) &&\n this.type !== 'seq-item-ind';\n // For empty nodes, assign newline-separated not indented empty tokens to following node\n let start = [];\n if (atNextItem && it.sep && !it.value) {\n const nl = [];\n for (let i = 0; i < it.sep.length; ++i) {\n const st = it.sep[i];\n switch (st.type) {\n case 'newline':\n nl.push(i);\n break;\n case 'space':\n break;\n case 'comment':\n if (st.indent > map.indent)\n nl.length = 0;\n break;\n default:\n nl.length = 0;\n }\n }\n if (nl.length >= 2)\n start = it.sep.splice(nl[1]);\n }\n switch (this.type) {\n case 'anchor':\n case 'tag':\n if (atNextItem || it.value) {\n start.push(this.sourceToken);\n map.items.push({ start });\n this.onKeyLine = true;\n }\n else if (it.sep) {\n it.sep.push(this.sourceToken);\n }\n else {\n it.start.push(this.sourceToken);\n }\n return;\n case 'explicit-key-ind':\n if (!it.sep && !it.explicitKey) {\n it.start.push(this.sourceToken);\n it.explicitKey = true;\n }\n else if (atNextItem || it.value) {\n start.push(this.sourceToken);\n map.items.push({ start, explicitKey: true });\n }\n else {\n this.stack.push({\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start: [this.sourceToken], explicitKey: true }]\n });\n }\n this.onKeyLine = true;\n return;\n case 'map-value-ind':\n if (it.explicitKey) {\n if (!it.sep) {\n if (includesToken(it.start, 'newline')) {\n Object.assign(it, { key: null, sep: [this.sourceToken] });\n }\n else {\n const start = getFirstKeyStartProps(it.start);\n this.stack.push({\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start, key: null, sep: [this.sourceToken] }]\n });\n }\n }\n else if (it.value) {\n map.items.push({ start: [], key: null, sep: [this.sourceToken] });\n }\n else if (includesToken(it.sep, 'map-value-ind')) {\n this.stack.push({\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start, key: null, sep: [this.sourceToken] }]\n });\n }\n else if (isFlowToken(it.key) &&\n !includesToken(it.sep, 'newline')) {\n const start = getFirstKeyStartProps(it.start);\n const key = it.key;\n const sep = it.sep;\n sep.push(this.sourceToken);\n // @ts-expect-error type guard is wrong here\n delete it.key;\n // @ts-expect-error type guard is wrong here\n delete it.sep;\n this.stack.push({\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start, key, sep }]\n });\n }\n else if (start.length > 0) {\n // Not actually at next item\n it.sep = it.sep.concat(start, this.sourceToken);\n }\n else {\n it.sep.push(this.sourceToken);\n }\n }\n else {\n if (!it.sep) {\n Object.assign(it, { key: null, sep: [this.sourceToken] });\n }\n else if (it.value || atNextItem) {\n map.items.push({ start, key: null, sep: [this.sourceToken] });\n }\n else if (includesToken(it.sep, 'map-value-ind')) {\n this.stack.push({\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start: [], key: null, sep: [this.sourceToken] }]\n });\n }\n else {\n it.sep.push(this.sourceToken);\n }\n }\n this.onKeyLine = true;\n return;\n case 'alias':\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar': {\n const fs = this.flowScalar(this.type);\n if (atNextItem || it.value) {\n map.items.push({ start, key: fs, sep: [] });\n this.onKeyLine = true;\n }\n else if (it.sep) {\n this.stack.push(fs);\n }\n else {\n Object.assign(it, { key: fs, sep: [] });\n this.onKeyLine = true;\n }\n return;\n }\n default: {\n const bv = this.startBlockValue(map);\n if (bv) {\n if (bv.type === 'block-seq') {\n if (!it.explicitKey &&\n it.sep &&\n !includesToken(it.sep, 'newline')) {\n yield* this.pop({\n type: 'error',\n offset: this.offset,\n message: 'Unexpected block-seq-ind on same line with key',\n source: this.source\n });\n return;\n }\n }\n else if (atMapIndent) {\n map.items.push({ start });\n }\n this.stack.push(bv);\n return;\n }\n }\n }\n }\n yield* this.pop();\n yield* this.step();\n }\n *blockSequence(seq) {\n const it = seq.items[seq.items.length - 1];\n switch (this.type) {\n case 'newline':\n if (it.value) {\n const end = 'end' in it.value ? it.value.end : undefined;\n const last = Array.isArray(end) ? end[end.length - 1] : undefined;\n if (last?.type === 'comment')\n end?.push(this.sourceToken);\n else\n seq.items.push({ start: [this.sourceToken] });\n }\n else\n it.start.push(this.sourceToken);\n return;\n case 'space':\n case 'comment':\n if (it.value)\n seq.items.push({ start: [this.sourceToken] });\n else {\n if (this.atIndentedComment(it.start, seq.indent)) {\n const prev = seq.items[seq.items.length - 2];\n const end = prev?.value?.end;\n if (Array.isArray(end)) {\n Array.prototype.push.apply(end, it.start);\n end.push(this.sourceToken);\n seq.items.pop();\n return;\n }\n }\n it.start.push(this.sourceToken);\n }\n return;\n case 'anchor':\n case 'tag':\n if (it.value || this.indent <= seq.indent)\n break;\n it.start.push(this.sourceToken);\n return;\n case 'seq-item-ind':\n if (this.indent !== seq.indent)\n break;\n if (it.value || includesToken(it.start, 'seq-item-ind'))\n seq.items.push({ start: [this.sourceToken] });\n else\n it.start.push(this.sourceToken);\n return;\n }\n if (this.indent > seq.indent) {\n const bv = this.startBlockValue(seq);\n if (bv) {\n this.stack.push(bv);\n return;\n }\n }\n yield* this.pop();\n yield* this.step();\n }\n *flowCollection(fc) {\n const it = fc.items[fc.items.length - 1];\n if (this.type === 'flow-error-end') {\n let top;\n do {\n yield* this.pop();\n top = this.peek(1);\n } while (top && top.type === 'flow-collection');\n }\n else if (fc.end.length === 0) {\n switch (this.type) {\n case 'comma':\n case 'explicit-key-ind':\n if (!it || it.sep)\n fc.items.push({ start: [this.sourceToken] });\n else\n it.start.push(this.sourceToken);\n return;\n case 'map-value-ind':\n if (!it || it.value)\n fc.items.push({ start: [], key: null, sep: [this.sourceToken] });\n else if (it.sep)\n it.sep.push(this.sourceToken);\n else\n Object.assign(it, { key: null, sep: [this.sourceToken] });\n return;\n case 'space':\n case 'comment':\n case 'newline':\n case 'anchor':\n case 'tag':\n if (!it || it.value)\n fc.items.push({ start: [this.sourceToken] });\n else if (it.sep)\n it.sep.push(this.sourceToken);\n else\n it.start.push(this.sourceToken);\n return;\n case 'alias':\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar': {\n const fs = this.flowScalar(this.type);\n if (!it || it.value)\n fc.items.push({ start: [], key: fs, sep: [] });\n else if (it.sep)\n this.stack.push(fs);\n else\n Object.assign(it, { key: fs, sep: [] });\n return;\n }\n case 'flow-map-end':\n case 'flow-seq-end':\n fc.end.push(this.sourceToken);\n return;\n }\n const bv = this.startBlockValue(fc);\n /* istanbul ignore else should not happen */\n if (bv)\n this.stack.push(bv);\n else {\n yield* this.pop();\n yield* this.step();\n }\n }\n else {\n const parent = this.peek(2);\n if (parent.type === 'block-map' &&\n ((this.type === 'map-value-ind' && parent.indent === fc.indent) ||\n (this.type === 'newline' &&\n !parent.items[parent.items.length - 1].sep))) {\n yield* this.pop();\n yield* this.step();\n }\n else if (this.type === 'map-value-ind' &&\n parent.type !== 'flow-collection') {\n const prev = getPrevProps(parent);\n const start = getFirstKeyStartProps(prev);\n fixFlowSeqItems(fc);\n const sep = fc.end.splice(1, fc.end.length);\n sep.push(this.sourceToken);\n const map = {\n type: 'block-map',\n offset: fc.offset,\n indent: fc.indent,\n items: [{ start, key: fc, sep }]\n };\n this.onKeyLine = true;\n this.stack[this.stack.length - 1] = map;\n }\n else {\n yield* this.lineEnd(fc);\n }\n }\n }\n flowScalar(type) {\n if (this.onNewLine) {\n let nl = this.source.indexOf('\\n') + 1;\n while (nl !== 0) {\n this.onNewLine(this.offset + nl);\n nl = this.source.indexOf('\\n', nl) + 1;\n }\n }\n return {\n type,\n offset: this.offset,\n indent: this.indent,\n source: this.source\n };\n }\n startBlockValue(parent) {\n switch (this.type) {\n case 'alias':\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar':\n return this.flowScalar(this.type);\n case 'block-scalar-header':\n return {\n type: 'block-scalar',\n offset: this.offset,\n indent: this.indent,\n props: [this.sourceToken],\n source: ''\n };\n case 'flow-map-start':\n case 'flow-seq-start':\n return {\n type: 'flow-collection',\n offset: this.offset,\n indent: this.indent,\n start: this.sourceToken,\n items: [],\n end: []\n };\n case 'seq-item-ind':\n return {\n type: 'block-seq',\n offset: this.offset,\n indent: this.indent,\n items: [{ start: [this.sourceToken] }]\n };\n case 'explicit-key-ind': {\n this.onKeyLine = true;\n const prev = getPrevProps(parent);\n const start = getFirstKeyStartProps(prev);\n start.push(this.sourceToken);\n return {\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start, explicitKey: true }]\n };\n }\n case 'map-value-ind': {\n this.onKeyLine = true;\n const prev = getPrevProps(parent);\n const start = getFirstKeyStartProps(prev);\n return {\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start, key: null, sep: [this.sourceToken] }]\n };\n }\n }\n return null;\n }\n atIndentedComment(start, indent) {\n if (this.type !== 'comment')\n return false;\n if (this.indent <= indent)\n return false;\n return start.every(st => st.type === 'newline' || st.type === 'space');\n }\n *documentEnd(docEnd) {\n if (this.type !== 'doc-mode') {\n if (docEnd.end)\n docEnd.end.push(this.sourceToken);\n else\n docEnd.end = [this.sourceToken];\n if (this.type === 'newline')\n yield* this.pop();\n }\n }\n *lineEnd(token) {\n switch (this.type) {\n case 'comma':\n case 'doc-start':\n case 'doc-end':\n case 'flow-seq-end':\n case 'flow-map-end':\n case 'map-value-ind':\n yield* this.pop();\n yield* this.step();\n break;\n case 'newline':\n this.onKeyLine = false;\n // fallthrough\n case 'space':\n case 'comment':\n default:\n // all other values are errors\n if (token.end)\n token.end.push(this.sourceToken);\n else\n token.end = [this.sourceToken];\n if (this.type === 'newline')\n yield* this.pop();\n }\n }\n}\n\nexport { Parser };\n","import { Composer } from './compose/composer.js';\nimport { Document } from './doc/Document.js';\nimport { prettifyError, YAMLParseError } from './errors.js';\nimport { warn } from './log.js';\nimport { isDocument } from './nodes/identity.js';\nimport { LineCounter } from './parse/line-counter.js';\nimport { Parser } from './parse/parser.js';\n\nfunction parseOptions(options) {\n const prettyErrors = options.prettyErrors !== false;\n const lineCounter = options.lineCounter || (prettyErrors && new LineCounter()) || null;\n return { lineCounter, prettyErrors };\n}\n/**\n * Parse the input as a stream of YAML documents.\n *\n * Documents should be separated from each other by `...` or `---` marker lines.\n *\n * @returns If an empty `docs` array is returned, it will be of type\n * EmptyStream and contain additional stream information. In\n * TypeScript, you should use `'empty' in docs` as a type guard for it.\n */\nfunction parseAllDocuments(source, options = {}) {\n const { lineCounter, prettyErrors } = parseOptions(options);\n const parser = new Parser(lineCounter?.addNewLine);\n const composer = new Composer(options);\n const docs = Array.from(composer.compose(parser.parse(source)));\n if (prettyErrors && lineCounter)\n for (const doc of docs) {\n doc.errors.forEach(prettifyError(source, lineCounter));\n doc.warnings.forEach(prettifyError(source, lineCounter));\n }\n if (docs.length > 0)\n return docs;\n return Object.assign([], { empty: true }, composer.streamInfo());\n}\n/** Parse an input string into a single YAML.Document */\nfunction parseDocument(source, options = {}) {\n const { lineCounter, prettyErrors } = parseOptions(options);\n const parser = new Parser(lineCounter?.addNewLine);\n const composer = new Composer(options);\n // `doc` is always set by compose.end(true) at the very latest\n let doc = null;\n for (const _doc of composer.compose(parser.parse(source), true, source.length)) {\n if (!doc)\n doc = _doc;\n else if (doc.options.logLevel !== 'silent') {\n doc.errors.push(new YAMLParseError(_doc.range.slice(0, 2), 'MULTIPLE_DOCS', 'Source contains multiple documents; please use YAML.parseAllDocuments()'));\n break;\n }\n }\n if (prettyErrors && lineCounter) {\n doc.errors.forEach(prettifyError(source, lineCounter));\n doc.warnings.forEach(prettifyError(source, lineCounter));\n }\n return doc;\n}\nfunction parse(src, reviver, options) {\n let _reviver = undefined;\n if (typeof reviver === 'function') {\n _reviver = reviver;\n }\n else if (options === undefined && reviver && typeof reviver === 'object') {\n options = reviver;\n }\n const doc = parseDocument(src, options);\n if (!doc)\n return null;\n doc.warnings.forEach(warning => warn(doc.options.logLevel, warning));\n if (doc.errors.length > 0) {\n if (doc.options.logLevel !== 'silent')\n throw doc.errors[0];\n else\n doc.errors = [];\n }\n return doc.toJS(Object.assign({ reviver: _reviver }, options));\n}\nfunction stringify(value, replacer, options) {\n let _replacer = null;\n if (typeof replacer === 'function' || Array.isArray(replacer)) {\n _replacer = replacer;\n }\n else if (options === undefined && replacer) {\n options = replacer;\n }\n if (typeof options === 'string')\n options = options.length;\n if (typeof options === 'number') {\n const indent = Math.round(options);\n options = indent < 1 ? undefined : indent > 8 ? { indent: 8 } : { indent };\n }\n if (value === undefined) {\n const { keepUndefined } = options ?? replacer ?? {};\n if (!keepUndefined)\n return undefined;\n }\n if (isDocument(value) && !_replacer)\n return value.toString(options);\n return new Document(value, _replacer, options).toString(options);\n}\n\nexport { parse, parseAllDocuments, parseDocument, stringify };\n","/**\n * This file contains the Bottleneck library (MIT), compiled to ES2017, and without Clustering support.\n * https://github.com/SGrondin/bottleneck\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.Bottleneck = factory());\n}(this, (function () { 'use strict';\n\n\tvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\n\tfunction getCjsExportFromNamespace (n) {\n\t\treturn n && n['default'] || n;\n\t}\n\n\tvar load = function(received, defaults, onto = {}) {\n\t var k, ref, v;\n\t for (k in defaults) {\n\t v = defaults[k];\n\t onto[k] = (ref = received[k]) != null ? ref : v;\n\t }\n\t return onto;\n\t};\n\n\tvar overwrite = function(received, defaults, onto = {}) {\n\t var k, v;\n\t for (k in received) {\n\t v = received[k];\n\t if (defaults[k] !== void 0) {\n\t onto[k] = v;\n\t }\n\t }\n\t return onto;\n\t};\n\n\tvar parser = {\n\t\tload: load,\n\t\toverwrite: overwrite\n\t};\n\n\tvar DLList;\n\n\tDLList = class DLList {\n\t constructor(incr, decr) {\n\t this.incr = incr;\n\t this.decr = decr;\n\t this._first = null;\n\t this._last = null;\n\t this.length = 0;\n\t }\n\n\t push(value) {\n\t var node;\n\t this.length++;\n\t if (typeof this.incr === \"function\") {\n\t this.incr();\n\t }\n\t node = {\n\t value,\n\t prev: this._last,\n\t next: null\n\t };\n\t if (this._last != null) {\n\t this._last.next = node;\n\t this._last = node;\n\t } else {\n\t this._first = this._last = node;\n\t }\n\t return void 0;\n\t }\n\n\t shift() {\n\t var value;\n\t if (this._first == null) {\n\t return;\n\t } else {\n\t this.length--;\n\t if (typeof this.decr === \"function\") {\n\t this.decr();\n\t }\n\t }\n\t value = this._first.value;\n\t if ((this._first = this._first.next) != null) {\n\t this._first.prev = null;\n\t } else {\n\t this._last = null;\n\t }\n\t return value;\n\t }\n\n\t first() {\n\t if (this._first != null) {\n\t return this._first.value;\n\t }\n\t }\n\n\t getArray() {\n\t var node, ref, results;\n\t node = this._first;\n\t results = [];\n\t while (node != null) {\n\t results.push((ref = node, node = node.next, ref.value));\n\t }\n\t return results;\n\t }\n\n\t forEachShift(cb) {\n\t var node;\n\t node = this.shift();\n\t while (node != null) {\n\t (cb(node), node = this.shift());\n\t }\n\t return void 0;\n\t }\n\n\t debug() {\n\t var node, ref, ref1, ref2, results;\n\t node = this._first;\n\t results = [];\n\t while (node != null) {\n\t results.push((ref = node, node = node.next, {\n\t value: ref.value,\n\t prev: (ref1 = ref.prev) != null ? ref1.value : void 0,\n\t next: (ref2 = ref.next) != null ? ref2.value : void 0\n\t }));\n\t }\n\t return results;\n\t }\n\n\t};\n\n\tvar DLList_1 = DLList;\n\n\tvar Events;\n\n\tEvents = class Events {\n\t constructor(instance) {\n\t this.instance = instance;\n\t this._events = {};\n\t if ((this.instance.on != null) || (this.instance.once != null) || (this.instance.removeAllListeners != null)) {\n\t throw new Error(\"An Emitter already exists for this object\");\n\t }\n\t this.instance.on = (name, cb) => {\n\t return this._addListener(name, \"many\", cb);\n\t };\n\t this.instance.once = (name, cb) => {\n\t return this._addListener(name, \"once\", cb);\n\t };\n\t this.instance.removeAllListeners = (name = null) => {\n\t if (name != null) {\n\t return delete this._events[name];\n\t } else {\n\t return this._events = {};\n\t }\n\t };\n\t }\n\n\t _addListener(name, status, cb) {\n\t var base;\n\t if ((base = this._events)[name] == null) {\n\t base[name] = [];\n\t }\n\t this._events[name].push({cb, status});\n\t return this.instance;\n\t }\n\n\t listenerCount(name) {\n\t if (this._events[name] != null) {\n\t return this._events[name].length;\n\t } else {\n\t return 0;\n\t }\n\t }\n\n\t async trigger(name, ...args) {\n\t var e, promises;\n\t try {\n\t if (name !== \"debug\") {\n\t this.trigger(\"debug\", `Event triggered: ${name}`, args);\n\t }\n\t if (this._events[name] == null) {\n\t return;\n\t }\n\t this._events[name] = this._events[name].filter(function(listener) {\n\t return listener.status !== \"none\";\n\t });\n\t promises = this._events[name].map(async(listener) => {\n\t var e, returned;\n\t if (listener.status === \"none\") {\n\t return;\n\t }\n\t if (listener.status === \"once\") {\n\t listener.status = \"none\";\n\t }\n\t try {\n\t returned = typeof listener.cb === \"function\" ? listener.cb(...args) : void 0;\n\t if (typeof (returned != null ? returned.then : void 0) === \"function\") {\n\t return (await returned);\n\t } else {\n\t return returned;\n\t }\n\t } catch (error) {\n\t e = error;\n\t {\n\t this.trigger(\"error\", e);\n\t }\n\t return null;\n\t }\n\t });\n\t return ((await Promise.all(promises))).find(function(x) {\n\t return x != null;\n\t });\n\t } catch (error) {\n\t e = error;\n\t {\n\t this.trigger(\"error\", e);\n\t }\n\t return null;\n\t }\n\t }\n\n\t};\n\n\tvar Events_1 = Events;\n\n\tvar DLList$1, Events$1, Queues;\n\n\tDLList$1 = DLList_1;\n\n\tEvents$1 = Events_1;\n\n\tQueues = class Queues {\n\t constructor(num_priorities) {\n\t var i;\n\t this.Events = new Events$1(this);\n\t this._length = 0;\n\t this._lists = (function() {\n\t var j, ref, results;\n\t results = [];\n\t for (i = j = 1, ref = num_priorities; (1 <= ref ? j <= ref : j >= ref); i = 1 <= ref ? ++j : --j) {\n\t results.push(new DLList$1((() => {\n\t return this.incr();\n\t }), (() => {\n\t return this.decr();\n\t })));\n\t }\n\t return results;\n\t }).call(this);\n\t }\n\n\t incr() {\n\t if (this._length++ === 0) {\n\t return this.Events.trigger(\"leftzero\");\n\t }\n\t }\n\n\t decr() {\n\t if (--this._length === 0) {\n\t return this.Events.trigger(\"zero\");\n\t }\n\t }\n\n\t push(job) {\n\t return this._lists[job.options.priority].push(job);\n\t }\n\n\t queued(priority) {\n\t if (priority != null) {\n\t return this._lists[priority].length;\n\t } else {\n\t return this._length;\n\t }\n\t }\n\n\t shiftAll(fn) {\n\t return this._lists.forEach(function(list) {\n\t return list.forEachShift(fn);\n\t });\n\t }\n\n\t getFirst(arr = this._lists) {\n\t var j, len, list;\n\t for (j = 0, len = arr.length; j < len; j++) {\n\t list = arr[j];\n\t if (list.length > 0) {\n\t return list;\n\t }\n\t }\n\t return [];\n\t }\n\n\t shiftLastFrom(priority) {\n\t return this.getFirst(this._lists.slice(priority).reverse()).shift();\n\t }\n\n\t};\n\n\tvar Queues_1 = Queues;\n\n\tvar BottleneckError;\n\n\tBottleneckError = class BottleneckError extends Error {};\n\n\tvar BottleneckError_1 = BottleneckError;\n\n\tvar BottleneckError$1, DEFAULT_PRIORITY, Job, NUM_PRIORITIES, parser$1;\n\n\tNUM_PRIORITIES = 10;\n\n\tDEFAULT_PRIORITY = 5;\n\n\tparser$1 = parser;\n\n\tBottleneckError$1 = BottleneckError_1;\n\n\tJob = class Job {\n\t constructor(task, args, options, jobDefaults, rejectOnDrop, Events, _states, Promise) {\n\t this.task = task;\n\t this.args = args;\n\t this.rejectOnDrop = rejectOnDrop;\n\t this.Events = Events;\n\t this._states = _states;\n\t this.Promise = Promise;\n\t this.options = parser$1.load(options, jobDefaults);\n\t this.options.priority = this._sanitizePriority(this.options.priority);\n\t if (this.options.id === jobDefaults.id) {\n\t this.options.id = `${this.options.id}-${this._randomIndex()}`;\n\t }\n\t this.promise = new this.Promise((_resolve, _reject) => {\n\t this._resolve = _resolve;\n\t this._reject = _reject;\n\t });\n\t this.retryCount = 0;\n\t }\n\n\t _sanitizePriority(priority) {\n\t var sProperty;\n\t sProperty = ~~priority !== priority ? DEFAULT_PRIORITY : priority;\n\t if (sProperty < 0) {\n\t return 0;\n\t } else if (sProperty > NUM_PRIORITIES - 1) {\n\t return NUM_PRIORITIES - 1;\n\t } else {\n\t return sProperty;\n\t }\n\t }\n\n\t _randomIndex() {\n\t return Math.random().toString(36).slice(2);\n\t }\n\n\t doDrop({error, message = \"This job has been dropped by Bottleneck\"} = {}) {\n\t if (this._states.remove(this.options.id)) {\n\t if (this.rejectOnDrop) {\n\t this._reject(error != null ? error : new BottleneckError$1(message));\n\t }\n\t this.Events.trigger(\"dropped\", {args: this.args, options: this.options, task: this.task, promise: this.promise});\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t }\n\n\t _assertStatus(expected) {\n\t var status;\n\t status = this._states.jobStatus(this.options.id);\n\t if (!(status === expected || (expected === \"DONE\" && status === null))) {\n\t throw new BottleneckError$1(`Invalid job status ${status}, expected ${expected}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`);\n\t }\n\t }\n\n\t doReceive() {\n\t this._states.start(this.options.id);\n\t return this.Events.trigger(\"received\", {args: this.args, options: this.options});\n\t }\n\n\t doQueue(reachedHWM, blocked) {\n\t this._assertStatus(\"RECEIVED\");\n\t this._states.next(this.options.id);\n\t return this.Events.trigger(\"queued\", {args: this.args, options: this.options, reachedHWM, blocked});\n\t }\n\n\t doRun() {\n\t if (this.retryCount === 0) {\n\t this._assertStatus(\"QUEUED\");\n\t this._states.next(this.options.id);\n\t } else {\n\t this._assertStatus(\"EXECUTING\");\n\t }\n\t return this.Events.trigger(\"scheduled\", {args: this.args, options: this.options});\n\t }\n\n\t async doExecute(chained, clearGlobalState, run, free) {\n\t var error, eventInfo, passed;\n\t if (this.retryCount === 0) {\n\t this._assertStatus(\"RUNNING\");\n\t this._states.next(this.options.id);\n\t } else {\n\t this._assertStatus(\"EXECUTING\");\n\t }\n\t eventInfo = {args: this.args, options: this.options, retryCount: this.retryCount};\n\t this.Events.trigger(\"executing\", eventInfo);\n\t try {\n\t passed = (await (chained != null ? chained.schedule(this.options, this.task, ...this.args) : this.task(...this.args)));\n\t if (clearGlobalState()) {\n\t this.doDone(eventInfo);\n\t await free(this.options, eventInfo);\n\t this._assertStatus(\"DONE\");\n\t return this._resolve(passed);\n\t }\n\t } catch (error1) {\n\t error = error1;\n\t return this._onFailure(error, eventInfo, clearGlobalState, run, free);\n\t }\n\t }\n\n\t doExpire(clearGlobalState, run, free) {\n\t var error, eventInfo;\n\t if (this._states.jobStatus(this.options.id === \"RUNNING\")) {\n\t this._states.next(this.options.id);\n\t }\n\t this._assertStatus(\"EXECUTING\");\n\t eventInfo = {args: this.args, options: this.options, retryCount: this.retryCount};\n\t error = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`);\n\t return this._onFailure(error, eventInfo, clearGlobalState, run, free);\n\t }\n\n\t async _onFailure(error, eventInfo, clearGlobalState, run, free) {\n\t var retry, retryAfter;\n\t if (clearGlobalState()) {\n\t retry = (await this.Events.trigger(\"failed\", error, eventInfo));\n\t if (retry != null) {\n\t retryAfter = ~~retry;\n\t this.Events.trigger(\"retry\", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo);\n\t this.retryCount++;\n\t return run(retryAfter);\n\t } else {\n\t this.doDone(eventInfo);\n\t await free(this.options, eventInfo);\n\t this._assertStatus(\"DONE\");\n\t return this._reject(error);\n\t }\n\t }\n\t }\n\n\t doDone(eventInfo) {\n\t this._assertStatus(\"EXECUTING\");\n\t this._states.next(this.options.id);\n\t return this.Events.trigger(\"done\", eventInfo);\n\t }\n\n\t};\n\n\tvar Job_1 = Job;\n\n\tvar BottleneckError$2, LocalDatastore, parser$2;\n\n\tparser$2 = parser;\n\n\tBottleneckError$2 = BottleneckError_1;\n\n\tLocalDatastore = class LocalDatastore {\n\t constructor(instance, storeOptions, storeInstanceOptions) {\n\t this.instance = instance;\n\t this.storeOptions = storeOptions;\n\t this.clientId = this.instance._randomIndex();\n\t parser$2.load(storeInstanceOptions, storeInstanceOptions, this);\n\t this._nextRequest = this._lastReservoirRefresh = this._lastReservoirIncrease = Date.now();\n\t this._running = 0;\n\t this._done = 0;\n\t this._unblockTime = 0;\n\t this.ready = this.Promise.resolve();\n\t this.clients = {};\n\t this._startHeartbeat();\n\t }\n\n\t _startHeartbeat() {\n\t var base;\n\t if ((this.heartbeat == null) && (((this.storeOptions.reservoirRefreshInterval != null) && (this.storeOptions.reservoirRefreshAmount != null)) || ((this.storeOptions.reservoirIncreaseInterval != null) && (this.storeOptions.reservoirIncreaseAmount != null)))) {\n\t return typeof (base = (this.heartbeat = setInterval(() => {\n\t var amount, incr, maximum, now, reservoir;\n\t now = Date.now();\n\t if ((this.storeOptions.reservoirRefreshInterval != null) && now >= this._lastReservoirRefresh + this.storeOptions.reservoirRefreshInterval) {\n\t this._lastReservoirRefresh = now;\n\t this.storeOptions.reservoir = this.storeOptions.reservoirRefreshAmount;\n\t this.instance._drainAll(this.computeCapacity());\n\t }\n\t if ((this.storeOptions.reservoirIncreaseInterval != null) && now >= this._lastReservoirIncrease + this.storeOptions.reservoirIncreaseInterval) {\n\t ({\n\t reservoirIncreaseAmount: amount,\n\t reservoirIncreaseMaximum: maximum,\n\t reservoir\n\t } = this.storeOptions);\n\t this._lastReservoirIncrease = now;\n\t incr = maximum != null ? Math.min(amount, maximum - reservoir) : amount;\n\t if (incr > 0) {\n\t this.storeOptions.reservoir += incr;\n\t return this.instance._drainAll(this.computeCapacity());\n\t }\n\t }\n\t }, this.heartbeatInterval))).unref === \"function\" ? base.unref() : void 0;\n\t } else {\n\t return clearInterval(this.heartbeat);\n\t }\n\t }\n\n\t async __publish__(message) {\n\t await this.yieldLoop();\n\t return this.instance.Events.trigger(\"message\", message.toString());\n\t }\n\n\t async __disconnect__(flush) {\n\t await this.yieldLoop();\n\t clearInterval(this.heartbeat);\n\t return this.Promise.resolve();\n\t }\n\n\t yieldLoop(t = 0) {\n\t return new this.Promise(function(resolve, reject) {\n\t return setTimeout(resolve, t);\n\t });\n\t }\n\n\t computePenalty() {\n\t var ref;\n\t return (ref = this.storeOptions.penalty) != null ? ref : (15 * this.storeOptions.minTime) || 5000;\n\t }\n\n\t async __updateSettings__(options) {\n\t await this.yieldLoop();\n\t parser$2.overwrite(options, options, this.storeOptions);\n\t this._startHeartbeat();\n\t this.instance._drainAll(this.computeCapacity());\n\t return true;\n\t }\n\n\t async __running__() {\n\t await this.yieldLoop();\n\t return this._running;\n\t }\n\n\t async __queued__() {\n\t await this.yieldLoop();\n\t return this.instance.queued();\n\t }\n\n\t async __done__() {\n\t await this.yieldLoop();\n\t return this._done;\n\t }\n\n\t async __groupCheck__(time) {\n\t await this.yieldLoop();\n\t return (this._nextRequest + this.timeout) < time;\n\t }\n\n\t computeCapacity() {\n\t var maxConcurrent, reservoir;\n\t ({maxConcurrent, reservoir} = this.storeOptions);\n\t if ((maxConcurrent != null) && (reservoir != null)) {\n\t return Math.min(maxConcurrent - this._running, reservoir);\n\t } else if (maxConcurrent != null) {\n\t return maxConcurrent - this._running;\n\t } else if (reservoir != null) {\n\t return reservoir;\n\t } else {\n\t return null;\n\t }\n\t }\n\n\t conditionsCheck(weight) {\n\t var capacity;\n\t capacity = this.computeCapacity();\n\t return (capacity == null) || weight <= capacity;\n\t }\n\n\t async __incrementReservoir__(incr) {\n\t var reservoir;\n\t await this.yieldLoop();\n\t reservoir = this.storeOptions.reservoir += incr;\n\t this.instance._drainAll(this.computeCapacity());\n\t return reservoir;\n\t }\n\n\t async __currentReservoir__() {\n\t await this.yieldLoop();\n\t return this.storeOptions.reservoir;\n\t }\n\n\t isBlocked(now) {\n\t return this._unblockTime >= now;\n\t }\n\n\t check(weight, now) {\n\t return this.conditionsCheck(weight) && (this._nextRequest - now) <= 0;\n\t }\n\n\t async __check__(weight) {\n\t var now;\n\t await this.yieldLoop();\n\t now = Date.now();\n\t return this.check(weight, now);\n\t }\n\n\t async __register__(index, weight, expiration) {\n\t var now, wait;\n\t await this.yieldLoop();\n\t now = Date.now();\n\t if (this.conditionsCheck(weight)) {\n\t this._running += weight;\n\t if (this.storeOptions.reservoir != null) {\n\t this.storeOptions.reservoir -= weight;\n\t }\n\t wait = Math.max(this._nextRequest - now, 0);\n\t this._nextRequest = now + wait + this.storeOptions.minTime;\n\t return {\n\t success: true,\n\t wait,\n\t reservoir: this.storeOptions.reservoir\n\t };\n\t } else {\n\t return {\n\t success: false\n\t };\n\t }\n\t }\n\n\t strategyIsBlock() {\n\t return this.storeOptions.strategy === 3;\n\t }\n\n\t async __submit__(queueLength, weight) {\n\t var blocked, now, reachedHWM;\n\t await this.yieldLoop();\n\t if ((this.storeOptions.maxConcurrent != null) && weight > this.storeOptions.maxConcurrent) {\n\t throw new BottleneckError$2(`Impossible to add a job having a weight of ${weight} to a limiter having a maxConcurrent setting of ${this.storeOptions.maxConcurrent}`);\n\t }\n\t now = Date.now();\n\t reachedHWM = (this.storeOptions.highWater != null) && queueLength === this.storeOptions.highWater && !this.check(weight, now);\n\t blocked = this.strategyIsBlock() && (reachedHWM || this.isBlocked(now));\n\t if (blocked) {\n\t this._unblockTime = now + this.computePenalty();\n\t this._nextRequest = this._unblockTime + this.storeOptions.minTime;\n\t this.instance._dropAllQueued();\n\t }\n\t return {\n\t reachedHWM,\n\t blocked,\n\t strategy: this.storeOptions.strategy\n\t };\n\t }\n\n\t async __free__(index, weight) {\n\t await this.yieldLoop();\n\t this._running -= weight;\n\t this._done += weight;\n\t this.instance._drainAll(this.computeCapacity());\n\t return {\n\t running: this._running\n\t };\n\t }\n\n\t};\n\n\tvar LocalDatastore_1 = LocalDatastore;\n\n\tvar BottleneckError$3, States;\n\n\tBottleneckError$3 = BottleneckError_1;\n\n\tStates = class States {\n\t constructor(status1) {\n\t this.status = status1;\n\t this._jobs = {};\n\t this.counts = this.status.map(function() {\n\t return 0;\n\t });\n\t }\n\n\t next(id) {\n\t var current, next;\n\t current = this._jobs[id];\n\t next = current + 1;\n\t if ((current != null) && next < this.status.length) {\n\t this.counts[current]--;\n\t this.counts[next]++;\n\t return this._jobs[id]++;\n\t } else if (current != null) {\n\t this.counts[current]--;\n\t return delete this._jobs[id];\n\t }\n\t }\n\n\t start(id) {\n\t var initial;\n\t initial = 0;\n\t this._jobs[id] = initial;\n\t return this.counts[initial]++;\n\t }\n\n\t remove(id) {\n\t var current;\n\t current = this._jobs[id];\n\t if (current != null) {\n\t this.counts[current]--;\n\t delete this._jobs[id];\n\t }\n\t return current != null;\n\t }\n\n\t jobStatus(id) {\n\t var ref;\n\t return (ref = this.status[this._jobs[id]]) != null ? ref : null;\n\t }\n\n\t statusJobs(status) {\n\t var k, pos, ref, results, v;\n\t if (status != null) {\n\t pos = this.status.indexOf(status);\n\t if (pos < 0) {\n\t throw new BottleneckError$3(`status must be one of ${this.status.join(', ')}`);\n\t }\n\t ref = this._jobs;\n\t results = [];\n\t for (k in ref) {\n\t v = ref[k];\n\t if (v === pos) {\n\t results.push(k);\n\t }\n\t }\n\t return results;\n\t } else {\n\t return Object.keys(this._jobs);\n\t }\n\t }\n\n\t statusCounts() {\n\t return this.counts.reduce(((acc, v, i) => {\n\t acc[this.status[i]] = v;\n\t return acc;\n\t }), {});\n\t }\n\n\t};\n\n\tvar States_1 = States;\n\n\tvar DLList$2, Sync;\n\n\tDLList$2 = DLList_1;\n\n\tSync = class Sync {\n\t constructor(name, Promise) {\n\t this.schedule = this.schedule.bind(this);\n\t this.name = name;\n\t this.Promise = Promise;\n\t this._running = 0;\n\t this._queue = new DLList$2();\n\t }\n\n\t isEmpty() {\n\t return this._queue.length === 0;\n\t }\n\n\t async _tryToRun() {\n\t var args, cb, error, reject, resolve, returned, task;\n\t if ((this._running < 1) && this._queue.length > 0) {\n\t this._running++;\n\t ({task, args, resolve, reject} = this._queue.shift());\n\t cb = (await (async function() {\n\t try {\n\t returned = (await task(...args));\n\t return function() {\n\t return resolve(returned);\n\t };\n\t } catch (error1) {\n\t error = error1;\n\t return function() {\n\t return reject(error);\n\t };\n\t }\n\t })());\n\t this._running--;\n\t this._tryToRun();\n\t return cb();\n\t }\n\t }\n\n\t schedule(task, ...args) {\n\t var promise, reject, resolve;\n\t resolve = reject = null;\n\t promise = new this.Promise(function(_resolve, _reject) {\n\t resolve = _resolve;\n\t return reject = _reject;\n\t });\n\t this._queue.push({task, args, resolve, reject});\n\t this._tryToRun();\n\t return promise;\n\t }\n\n\t};\n\n\tvar Sync_1 = Sync;\n\n\tvar version = \"2.19.5\";\n\tvar version$1 = {\n\t\tversion: version\n\t};\n\n\tvar version$2 = /*#__PURE__*/Object.freeze({\n\t\tversion: version,\n\t\tdefault: version$1\n\t});\n\n\tvar require$$2 = () => console.log('You must import the full version of Bottleneck in order to use this feature.');\n\n\tvar require$$3 = () => console.log('You must import the full version of Bottleneck in order to use this feature.');\n\n\tvar require$$4 = () => console.log('You must import the full version of Bottleneck in order to use this feature.');\n\n\tvar Events$2, Group, IORedisConnection$1, RedisConnection$1, Scripts$1, parser$3;\n\n\tparser$3 = parser;\n\n\tEvents$2 = Events_1;\n\n\tRedisConnection$1 = require$$2;\n\n\tIORedisConnection$1 = require$$3;\n\n\tScripts$1 = require$$4;\n\n\tGroup = (function() {\n\t class Group {\n\t constructor(limiterOptions = {}) {\n\t this.deleteKey = this.deleteKey.bind(this);\n\t this.limiterOptions = limiterOptions;\n\t parser$3.load(this.limiterOptions, this.defaults, this);\n\t this.Events = new Events$2(this);\n\t this.instances = {};\n\t this.Bottleneck = Bottleneck_1;\n\t this._startAutoCleanup();\n\t this.sharedConnection = this.connection != null;\n\t if (this.connection == null) {\n\t if (this.limiterOptions.datastore === \"redis\") {\n\t this.connection = new RedisConnection$1(Object.assign({}, this.limiterOptions, {Events: this.Events}));\n\t } else if (this.limiterOptions.datastore === \"ioredis\") {\n\t this.connection = new IORedisConnection$1(Object.assign({}, this.limiterOptions, {Events: this.Events}));\n\t }\n\t }\n\t }\n\n\t key(key = \"\") {\n\t var ref;\n\t return (ref = this.instances[key]) != null ? ref : (() => {\n\t var limiter;\n\t limiter = this.instances[key] = new this.Bottleneck(Object.assign(this.limiterOptions, {\n\t id: `${this.id}-${key}`,\n\t timeout: this.timeout,\n\t connection: this.connection\n\t }));\n\t this.Events.trigger(\"created\", limiter, key);\n\t return limiter;\n\t })();\n\t }\n\n\t async deleteKey(key = \"\") {\n\t var deleted, instance;\n\t instance = this.instances[key];\n\t if (this.connection) {\n\t deleted = (await this.connection.__runCommand__(['del', ...Scripts$1.allKeys(`${this.id}-${key}`)]));\n\t }\n\t if (instance != null) {\n\t delete this.instances[key];\n\t await instance.disconnect();\n\t }\n\t return (instance != null) || deleted > 0;\n\t }\n\n\t limiters() {\n\t var k, ref, results, v;\n\t ref = this.instances;\n\t results = [];\n\t for (k in ref) {\n\t v = ref[k];\n\t results.push({\n\t key: k,\n\t limiter: v\n\t });\n\t }\n\t return results;\n\t }\n\n\t keys() {\n\t return Object.keys(this.instances);\n\t }\n\n\t async clusterKeys() {\n\t var cursor, end, found, i, k, keys, len, next, start;\n\t if (this.connection == null) {\n\t return this.Promise.resolve(this.keys());\n\t }\n\t keys = [];\n\t cursor = null;\n\t start = `b_${this.id}-`.length;\n\t end = \"_settings\".length;\n\t while (cursor !== 0) {\n\t [next, found] = (await this.connection.__runCommand__([\"scan\", cursor != null ? cursor : 0, \"match\", `b_${this.id}-*_settings`, \"count\", 10000]));\n\t cursor = ~~next;\n\t for (i = 0, len = found.length; i < len; i++) {\n\t k = found[i];\n\t keys.push(k.slice(start, -end));\n\t }\n\t }\n\t return keys;\n\t }\n\n\t _startAutoCleanup() {\n\t var base;\n\t clearInterval(this.interval);\n\t return typeof (base = (this.interval = setInterval(async() => {\n\t var e, k, ref, results, time, v;\n\t time = Date.now();\n\t ref = this.instances;\n\t results = [];\n\t for (k in ref) {\n\t v = ref[k];\n\t try {\n\t if ((await v._store.__groupCheck__(time))) {\n\t results.push(this.deleteKey(k));\n\t } else {\n\t results.push(void 0);\n\t }\n\t } catch (error) {\n\t e = error;\n\t results.push(v.Events.trigger(\"error\", e));\n\t }\n\t }\n\t return results;\n\t }, this.timeout / 2))).unref === \"function\" ? base.unref() : void 0;\n\t }\n\n\t updateSettings(options = {}) {\n\t parser$3.overwrite(options, this.defaults, this);\n\t parser$3.overwrite(options, options, this.limiterOptions);\n\t if (options.timeout != null) {\n\t return this._startAutoCleanup();\n\t }\n\t }\n\n\t disconnect(flush = true) {\n\t var ref;\n\t if (!this.sharedConnection) {\n\t return (ref = this.connection) != null ? ref.disconnect(flush) : void 0;\n\t }\n\t }\n\n\t }\n\t Group.prototype.defaults = {\n\t timeout: 1000 * 60 * 5,\n\t connection: null,\n\t Promise: Promise,\n\t id: \"group-key\"\n\t };\n\n\t return Group;\n\n\t}).call(commonjsGlobal);\n\n\tvar Group_1 = Group;\n\n\tvar Batcher, Events$3, parser$4;\n\n\tparser$4 = parser;\n\n\tEvents$3 = Events_1;\n\n\tBatcher = (function() {\n\t class Batcher {\n\t constructor(options = {}) {\n\t this.options = options;\n\t parser$4.load(this.options, this.defaults, this);\n\t this.Events = new Events$3(this);\n\t this._arr = [];\n\t this._resetPromise();\n\t this._lastFlush = Date.now();\n\t }\n\n\t _resetPromise() {\n\t return this._promise = new this.Promise((res, rej) => {\n\t return this._resolve = res;\n\t });\n\t }\n\n\t _flush() {\n\t clearTimeout(this._timeout);\n\t this._lastFlush = Date.now();\n\t this._resolve();\n\t this.Events.trigger(\"batch\", this._arr);\n\t this._arr = [];\n\t return this._resetPromise();\n\t }\n\n\t add(data) {\n\t var ret;\n\t this._arr.push(data);\n\t ret = this._promise;\n\t if (this._arr.length === this.maxSize) {\n\t this._flush();\n\t } else if ((this.maxTime != null) && this._arr.length === 1) {\n\t this._timeout = setTimeout(() => {\n\t return this._flush();\n\t }, this.maxTime);\n\t }\n\t return ret;\n\t }\n\n\t }\n\t Batcher.prototype.defaults = {\n\t maxTime: null,\n\t maxSize: null,\n\t Promise: Promise\n\t };\n\n\t return Batcher;\n\n\t}).call(commonjsGlobal);\n\n\tvar Batcher_1 = Batcher;\n\n\tvar require$$4$1 = () => console.log('You must import the full version of Bottleneck in order to use this feature.');\n\n\tvar require$$8 = getCjsExportFromNamespace(version$2);\n\n\tvar Bottleneck, DEFAULT_PRIORITY$1, Events$4, Job$1, LocalDatastore$1, NUM_PRIORITIES$1, Queues$1, RedisDatastore$1, States$1, Sync$1, parser$5,\n\t splice = [].splice;\n\n\tNUM_PRIORITIES$1 = 10;\n\n\tDEFAULT_PRIORITY$1 = 5;\n\n\tparser$5 = parser;\n\n\tQueues$1 = Queues_1;\n\n\tJob$1 = Job_1;\n\n\tLocalDatastore$1 = LocalDatastore_1;\n\n\tRedisDatastore$1 = require$$4$1;\n\n\tEvents$4 = Events_1;\n\n\tStates$1 = States_1;\n\n\tSync$1 = Sync_1;\n\n\tBottleneck = (function() {\n\t class Bottleneck {\n\t constructor(options = {}, ...invalid) {\n\t var storeInstanceOptions, storeOptions;\n\t this._addToQueue = this._addToQueue.bind(this);\n\t this._validateOptions(options, invalid);\n\t parser$5.load(options, this.instanceDefaults, this);\n\t this._queues = new Queues$1(NUM_PRIORITIES$1);\n\t this._scheduled = {};\n\t this._states = new States$1([\"RECEIVED\", \"QUEUED\", \"RUNNING\", \"EXECUTING\"].concat(this.trackDoneStatus ? [\"DONE\"] : []));\n\t this._limiter = null;\n\t this.Events = new Events$4(this);\n\t this._submitLock = new Sync$1(\"submit\", this.Promise);\n\t this._registerLock = new Sync$1(\"register\", this.Promise);\n\t storeOptions = parser$5.load(options, this.storeDefaults, {});\n\t this._store = (function() {\n\t if (this.datastore === \"redis\" || this.datastore === \"ioredis\" || (this.connection != null)) {\n\t storeInstanceOptions = parser$5.load(options, this.redisStoreDefaults, {});\n\t return new RedisDatastore$1(this, storeOptions, storeInstanceOptions);\n\t } else if (this.datastore === \"local\") {\n\t storeInstanceOptions = parser$5.load(options, this.localStoreDefaults, {});\n\t return new LocalDatastore$1(this, storeOptions, storeInstanceOptions);\n\t } else {\n\t throw new Bottleneck.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`);\n\t }\n\t }).call(this);\n\t this._queues.on(\"leftzero\", () => {\n\t var ref;\n\t return (ref = this._store.heartbeat) != null ? typeof ref.ref === \"function\" ? ref.ref() : void 0 : void 0;\n\t });\n\t this._queues.on(\"zero\", () => {\n\t var ref;\n\t return (ref = this._store.heartbeat) != null ? typeof ref.unref === \"function\" ? ref.unref() : void 0 : void 0;\n\t });\n\t }\n\n\t _validateOptions(options, invalid) {\n\t if (!((options != null) && typeof options === \"object\" && invalid.length === 0)) {\n\t throw new Bottleneck.prototype.BottleneckError(\"Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1.\");\n\t }\n\t }\n\n\t ready() {\n\t return this._store.ready;\n\t }\n\n\t clients() {\n\t return this._store.clients;\n\t }\n\n\t channel() {\n\t return `b_${this.id}`;\n\t }\n\n\t channel_client() {\n\t return `b_${this.id}_${this._store.clientId}`;\n\t }\n\n\t publish(message) {\n\t return this._store.__publish__(message);\n\t }\n\n\t disconnect(flush = true) {\n\t return this._store.__disconnect__(flush);\n\t }\n\n\t chain(_limiter) {\n\t this._limiter = _limiter;\n\t return this;\n\t }\n\n\t queued(priority) {\n\t return this._queues.queued(priority);\n\t }\n\n\t clusterQueued() {\n\t return this._store.__queued__();\n\t }\n\n\t empty() {\n\t return this.queued() === 0 && this._submitLock.isEmpty();\n\t }\n\n\t running() {\n\t return this._store.__running__();\n\t }\n\n\t done() {\n\t return this._store.__done__();\n\t }\n\n\t jobStatus(id) {\n\t return this._states.jobStatus(id);\n\t }\n\n\t jobs(status) {\n\t return this._states.statusJobs(status);\n\t }\n\n\t counts() {\n\t return this._states.statusCounts();\n\t }\n\n\t _randomIndex() {\n\t return Math.random().toString(36).slice(2);\n\t }\n\n\t check(weight = 1) {\n\t return this._store.__check__(weight);\n\t }\n\n\t _clearGlobalState(index) {\n\t if (this._scheduled[index] != null) {\n\t clearTimeout(this._scheduled[index].expiration);\n\t delete this._scheduled[index];\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t }\n\n\t async _free(index, job, options, eventInfo) {\n\t var e, running;\n\t try {\n\t ({running} = (await this._store.__free__(index, options.weight)));\n\t this.Events.trigger(\"debug\", `Freed ${options.id}`, eventInfo);\n\t if (running === 0 && this.empty()) {\n\t return this.Events.trigger(\"idle\");\n\t }\n\t } catch (error1) {\n\t e = error1;\n\t return this.Events.trigger(\"error\", e);\n\t }\n\t }\n\n\t _run(index, job, wait) {\n\t var clearGlobalState, free, run;\n\t job.doRun();\n\t clearGlobalState = this._clearGlobalState.bind(this, index);\n\t run = this._run.bind(this, index, job);\n\t free = this._free.bind(this, index, job);\n\t return this._scheduled[index] = {\n\t timeout: setTimeout(() => {\n\t return job.doExecute(this._limiter, clearGlobalState, run, free);\n\t }, wait),\n\t expiration: job.options.expiration != null ? setTimeout(function() {\n\t return job.doExpire(clearGlobalState, run, free);\n\t }, wait + job.options.expiration) : void 0,\n\t job: job\n\t };\n\t }\n\n\t _drainOne(capacity) {\n\t return this._registerLock.schedule(() => {\n\t var args, index, next, options, queue;\n\t if (this.queued() === 0) {\n\t return this.Promise.resolve(null);\n\t }\n\t queue = this._queues.getFirst();\n\t ({options, args} = next = queue.first());\n\t if ((capacity != null) && options.weight > capacity) {\n\t return this.Promise.resolve(null);\n\t }\n\t this.Events.trigger(\"debug\", `Draining ${options.id}`, {args, options});\n\t index = this._randomIndex();\n\t return this._store.__register__(index, options.weight, options.expiration).then(({success, wait, reservoir}) => {\n\t var empty;\n\t this.Events.trigger(\"debug\", `Drained ${options.id}`, {success, args, options});\n\t if (success) {\n\t queue.shift();\n\t empty = this.empty();\n\t if (empty) {\n\t this.Events.trigger(\"empty\");\n\t }\n\t if (reservoir === 0) {\n\t this.Events.trigger(\"depleted\", empty);\n\t }\n\t this._run(index, next, wait);\n\t return this.Promise.resolve(options.weight);\n\t } else {\n\t return this.Promise.resolve(null);\n\t }\n\t });\n\t });\n\t }\n\n\t _drainAll(capacity, total = 0) {\n\t return this._drainOne(capacity).then((drained) => {\n\t var newCapacity;\n\t if (drained != null) {\n\t newCapacity = capacity != null ? capacity - drained : capacity;\n\t return this._drainAll(newCapacity, total + drained);\n\t } else {\n\t return this.Promise.resolve(total);\n\t }\n\t }).catch((e) => {\n\t return this.Events.trigger(\"error\", e);\n\t });\n\t }\n\n\t _dropAllQueued(message) {\n\t return this._queues.shiftAll(function(job) {\n\t return job.doDrop({message});\n\t });\n\t }\n\n\t stop(options = {}) {\n\t var done, waitForExecuting;\n\t options = parser$5.load(options, this.stopDefaults);\n\t waitForExecuting = (at) => {\n\t var finished;\n\t finished = () => {\n\t var counts;\n\t counts = this._states.counts;\n\t return (counts[0] + counts[1] + counts[2] + counts[3]) === at;\n\t };\n\t return new this.Promise((resolve, reject) => {\n\t if (finished()) {\n\t return resolve();\n\t } else {\n\t return this.on(\"done\", () => {\n\t if (finished()) {\n\t this.removeAllListeners(\"done\");\n\t return resolve();\n\t }\n\t });\n\t }\n\t });\n\t };\n\t done = options.dropWaitingJobs ? (this._run = function(index, next) {\n\t return next.doDrop({\n\t message: options.dropErrorMessage\n\t });\n\t }, this._drainOne = () => {\n\t return this.Promise.resolve(null);\n\t }, this._registerLock.schedule(() => {\n\t return this._submitLock.schedule(() => {\n\t var k, ref, v;\n\t ref = this._scheduled;\n\t for (k in ref) {\n\t v = ref[k];\n\t if (this.jobStatus(v.job.options.id) === \"RUNNING\") {\n\t clearTimeout(v.timeout);\n\t clearTimeout(v.expiration);\n\t v.job.doDrop({\n\t message: options.dropErrorMessage\n\t });\n\t }\n\t }\n\t this._dropAllQueued(options.dropErrorMessage);\n\t return waitForExecuting(0);\n\t });\n\t })) : this.schedule({\n\t priority: NUM_PRIORITIES$1 - 1,\n\t weight: 0\n\t }, () => {\n\t return waitForExecuting(1);\n\t });\n\t this._receive = function(job) {\n\t return job._reject(new Bottleneck.prototype.BottleneckError(options.enqueueErrorMessage));\n\t };\n\t this.stop = () => {\n\t return this.Promise.reject(new Bottleneck.prototype.BottleneckError(\"stop() has already been called\"));\n\t };\n\t return done;\n\t }\n\n\t async _addToQueue(job) {\n\t var args, blocked, error, options, reachedHWM, shifted, strategy;\n\t ({args, options} = job);\n\t try {\n\t ({reachedHWM, blocked, strategy} = (await this._store.__submit__(this.queued(), options.weight)));\n\t } catch (error1) {\n\t error = error1;\n\t this.Events.trigger(\"debug\", `Could not queue ${options.id}`, {args, options, error});\n\t job.doDrop({error});\n\t return false;\n\t }\n\t if (blocked) {\n\t job.doDrop();\n\t return true;\n\t } else if (reachedHWM) {\n\t shifted = strategy === Bottleneck.prototype.strategy.LEAK ? this._queues.shiftLastFrom(options.priority) : strategy === Bottleneck.prototype.strategy.OVERFLOW_PRIORITY ? this._queues.shiftLastFrom(options.priority + 1) : strategy === Bottleneck.prototype.strategy.OVERFLOW ? job : void 0;\n\t if (shifted != null) {\n\t shifted.doDrop();\n\t }\n\t if ((shifted == null) || strategy === Bottleneck.prototype.strategy.OVERFLOW) {\n\t if (shifted == null) {\n\t job.doDrop();\n\t }\n\t return reachedHWM;\n\t }\n\t }\n\t job.doQueue(reachedHWM, blocked);\n\t this._queues.push(job);\n\t await this._drainAll();\n\t return reachedHWM;\n\t }\n\n\t _receive(job) {\n\t if (this._states.jobStatus(job.options.id) != null) {\n\t job._reject(new Bottleneck.prototype.BottleneckError(`A job with the same id already exists (id=${job.options.id})`));\n\t return false;\n\t } else {\n\t job.doReceive();\n\t return this._submitLock.schedule(this._addToQueue, job);\n\t }\n\t }\n\n\t submit(...args) {\n\t var cb, fn, job, options, ref, ref1, task;\n\t if (typeof args[0] === \"function\") {\n\t ref = args, [fn, ...args] = ref, [cb] = splice.call(args, -1);\n\t options = parser$5.load({}, this.jobDefaults);\n\t } else {\n\t ref1 = args, [options, fn, ...args] = ref1, [cb] = splice.call(args, -1);\n\t options = parser$5.load(options, this.jobDefaults);\n\t }\n\t task = (...args) => {\n\t return new this.Promise(function(resolve, reject) {\n\t return fn(...args, function(...args) {\n\t return (args[0] != null ? reject : resolve)(args);\n\t });\n\t });\n\t };\n\t job = new Job$1(task, args, options, this.jobDefaults, this.rejectOnDrop, this.Events, this._states, this.Promise);\n\t job.promise.then(function(args) {\n\t return typeof cb === \"function\" ? cb(...args) : void 0;\n\t }).catch(function(args) {\n\t if (Array.isArray(args)) {\n\t return typeof cb === \"function\" ? cb(...args) : void 0;\n\t } else {\n\t return typeof cb === \"function\" ? cb(args) : void 0;\n\t }\n\t });\n\t return this._receive(job);\n\t }\n\n\t schedule(...args) {\n\t var job, options, task;\n\t if (typeof args[0] === \"function\") {\n\t [task, ...args] = args;\n\t options = {};\n\t } else {\n\t [options, task, ...args] = args;\n\t }\n\t job = new Job$1(task, args, options, this.jobDefaults, this.rejectOnDrop, this.Events, this._states, this.Promise);\n\t this._receive(job);\n\t return job.promise;\n\t }\n\n\t wrap(fn) {\n\t var schedule, wrapped;\n\t schedule = this.schedule.bind(this);\n\t wrapped = function(...args) {\n\t return schedule(fn.bind(this), ...args);\n\t };\n\t wrapped.withOptions = function(options, ...args) {\n\t return schedule(options, fn, ...args);\n\t };\n\t return wrapped;\n\t }\n\n\t async updateSettings(options = {}) {\n\t await this._store.__updateSettings__(parser$5.overwrite(options, this.storeDefaults));\n\t parser$5.overwrite(options, this.instanceDefaults, this);\n\t return this;\n\t }\n\n\t currentReservoir() {\n\t return this._store.__currentReservoir__();\n\t }\n\n\t incrementReservoir(incr = 0) {\n\t return this._store.__incrementReservoir__(incr);\n\t }\n\n\t }\n\t Bottleneck.default = Bottleneck;\n\n\t Bottleneck.Events = Events$4;\n\n\t Bottleneck.version = Bottleneck.prototype.version = require$$8.version;\n\n\t Bottleneck.strategy = Bottleneck.prototype.strategy = {\n\t LEAK: 1,\n\t OVERFLOW: 2,\n\t OVERFLOW_PRIORITY: 4,\n\t BLOCK: 3\n\t };\n\n\t Bottleneck.BottleneckError = Bottleneck.prototype.BottleneckError = BottleneckError_1;\n\n\t Bottleneck.Group = Bottleneck.prototype.Group = Group_1;\n\n\t Bottleneck.RedisConnection = Bottleneck.prototype.RedisConnection = require$$2;\n\n\t Bottleneck.IORedisConnection = Bottleneck.prototype.IORedisConnection = require$$3;\n\n\t Bottleneck.Batcher = Bottleneck.prototype.Batcher = Batcher_1;\n\n\t Bottleneck.prototype.jobDefaults = {\n\t priority: DEFAULT_PRIORITY$1,\n\t weight: 1,\n\t expiration: null,\n\t id: \"\"\n\t };\n\n\t Bottleneck.prototype.storeDefaults = {\n\t maxConcurrent: null,\n\t minTime: 0,\n\t highWater: null,\n\t strategy: Bottleneck.prototype.strategy.LEAK,\n\t penalty: null,\n\t reservoir: null,\n\t reservoirRefreshInterval: null,\n\t reservoirRefreshAmount: null,\n\t reservoirIncreaseInterval: null,\n\t reservoirIncreaseAmount: null,\n\t reservoirIncreaseMaximum: null\n\t };\n\n\t Bottleneck.prototype.localStoreDefaults = {\n\t Promise: Promise,\n\t timeout: null,\n\t heartbeatInterval: 250\n\t };\n\n\t Bottleneck.prototype.redisStoreDefaults = {\n\t Promise: Promise,\n\t timeout: null,\n\t heartbeatInterval: 5000,\n\t clientTimeout: 10000,\n\t Redis: null,\n\t clientOptions: {},\n\t clusterNodes: null,\n\t clearDatastore: false,\n\t connection: null\n\t };\n\n\t Bottleneck.prototype.instanceDefaults = {\n\t datastore: \"local\",\n\t connection: null,\n\t id: \"\",\n\t rejectOnDrop: true,\n\t trackDoneStatus: false,\n\t Promise: Promise\n\t };\n\n\t Bottleneck.prototype.stopDefaults = {\n\t enqueueErrorMessage: \"This limiter has been stopped and cannot accept new jobs.\",\n\t dropWaitingJobs: true,\n\t dropErrorMessage: \"This limiter has been stopped.\"\n\t };\n\n\t return Bottleneck;\n\n\t}).call(commonjsGlobal);\n\n\tvar Bottleneck_1 = Bottleneck;\n\n\tvar lib = Bottleneck_1;\n\n\treturn lib;\n\n})));\n","// pkg/dist-src/index.js\nimport BottleneckLight from \"bottleneck/light.js\";\n\n// pkg/dist-src/version.js\nvar VERSION = \"0.0.0-development\";\n\n// pkg/dist-src/wrap-request.js\nvar noop = () => Promise.resolve();\nfunction wrapRequest(state, request, options) {\n return state.retryLimiter.schedule(doRequest, state, request, options);\n}\nasync function doRequest(state, request, options) {\n const { pathname } = new URL(options.url, \"http://github.test\");\n const isAuth = isAuthRequest(options.method, pathname);\n const isWrite = !isAuth && options.method !== \"GET\" && options.method !== \"HEAD\";\n const isSearch = options.method === \"GET\" && pathname.startsWith(\"/search/\");\n const isGraphQL = pathname.startsWith(\"/graphql\");\n const retryCount = ~~request.retryCount;\n const jobOptions = retryCount > 0 ? { priority: 0, weight: 0 } : {};\n if (state.clustering) {\n jobOptions.expiration = 1e3 * 60;\n }\n if (isWrite || isGraphQL) {\n await state.write.key(state.id).schedule(jobOptions, noop);\n }\n if (isWrite && state.triggersNotification(pathname)) {\n await state.notifications.key(state.id).schedule(jobOptions, noop);\n }\n if (isSearch) {\n await state.search.key(state.id).schedule(jobOptions, noop);\n }\n const req = (isAuth ? state.auth : state.global).key(state.id).schedule(jobOptions, request, options);\n if (isGraphQL) {\n const res = await req;\n if (res.data.errors != null && res.data.errors.some((error) => error.type === \"RATE_LIMITED\")) {\n const error = Object.assign(new Error(\"GraphQL Rate Limit Exceeded\"), {\n response: res,\n data: res.data\n });\n throw error;\n }\n }\n return req;\n}\nfunction isAuthRequest(method, pathname) {\n return method === \"PATCH\" && // https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-a-scoped-access-token\n /^\\/applications\\/[^/]+\\/token\\/scoped$/.test(pathname) || method === \"POST\" && // https://docs.github.com/en/rest/apps/oauth-applications?apiVersion=2022-11-28#reset-a-token\n (/^\\/applications\\/[^/]+\\/token$/.test(pathname) || // https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app\n /^\\/app\\/installations\\/[^/]+\\/access_tokens$/.test(pathname) || // https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps\n pathname === \"/login/oauth/access_token\");\n}\n\n// pkg/dist-src/generated/triggers-notification-paths.js\nvar triggers_notification_paths_default = [\n \"/orgs/{org}/invitations\",\n \"/orgs/{org}/invitations/{invitation_id}\",\n \"/orgs/{org}/teams/{team_slug}/discussions\",\n \"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\",\n \"/repos/{owner}/{repo}/collaborators/{username}\",\n \"/repos/{owner}/{repo}/commits/{commit_sha}/comments\",\n \"/repos/{owner}/{repo}/issues\",\n \"/repos/{owner}/{repo}/issues/{issue_number}/comments\",\n \"/repos/{owner}/{repo}/issues/{issue_number}/sub_issue\",\n \"/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority\",\n \"/repos/{owner}/{repo}/pulls\",\n \"/repos/{owner}/{repo}/pulls/{pull_number}/comments\",\n \"/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\",\n \"/repos/{owner}/{repo}/pulls/{pull_number}/merge\",\n \"/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n \"/repos/{owner}/{repo}/pulls/{pull_number}/reviews\",\n \"/repos/{owner}/{repo}/releases\",\n \"/teams/{team_id}/discussions\",\n \"/teams/{team_id}/discussions/{discussion_number}/comments\"\n];\n\n// pkg/dist-src/route-matcher.js\nfunction routeMatcher(paths) {\n const regexes = paths.map(\n (path) => path.split(\"/\").map((c) => c.startsWith(\"{\") ? \"(?:.+?)\" : c).join(\"/\")\n );\n const regex2 = `^(?:${regexes.map((r) => `(?:${r})`).join(\"|\")})[^/]*$`;\n return new RegExp(regex2, \"i\");\n}\n\n// pkg/dist-src/index.js\nvar regex = routeMatcher(triggers_notification_paths_default);\nvar triggersNotification = regex.test.bind(regex);\nvar groups = {};\nvar createGroups = function(Bottleneck, common) {\n groups.global = new Bottleneck.Group({\n id: \"octokit-global\",\n maxConcurrent: 10,\n ...common\n });\n groups.auth = new Bottleneck.Group({\n id: \"octokit-auth\",\n maxConcurrent: 1,\n ...common\n });\n groups.search = new Bottleneck.Group({\n id: \"octokit-search\",\n maxConcurrent: 1,\n minTime: 2e3,\n ...common\n });\n groups.write = new Bottleneck.Group({\n id: \"octokit-write\",\n maxConcurrent: 1,\n minTime: 1e3,\n ...common\n });\n groups.notifications = new Bottleneck.Group({\n id: \"octokit-notifications\",\n maxConcurrent: 1,\n minTime: 3e3,\n ...common\n });\n};\nfunction throttling(octokit, octokitOptions) {\n const {\n enabled = true,\n Bottleneck = BottleneckLight,\n id = \"no-id\",\n timeout = 1e3 * 60 * 2,\n // Redis TTL: 2 minutes\n connection\n } = octokitOptions.throttle || {};\n if (!enabled) {\n return {};\n }\n const common = { timeout };\n if (typeof connection !== \"undefined\") {\n common.connection = connection;\n }\n if (groups.global == null) {\n createGroups(Bottleneck, common);\n }\n const state = Object.assign(\n {\n clustering: connection != null,\n triggersNotification,\n fallbackSecondaryRateRetryAfter: 60,\n retryAfterBaseValue: 1e3,\n retryLimiter: new Bottleneck(),\n id,\n ...groups\n },\n octokitOptions.throttle\n );\n if (typeof state.onSecondaryRateLimit !== \"function\" || typeof state.onRateLimit !== \"function\") {\n throw new Error(`octokit/plugin-throttling error:\n You must pass the onSecondaryRateLimit and onRateLimit error handlers.\n See https://octokit.github.io/rest.js/#throttling\n\n const octokit = new Octokit({\n throttle: {\n onSecondaryRateLimit: (retryAfter, options) => {/* ... */},\n onRateLimit: (retryAfter, options) => {/* ... */}\n }\n })\n `);\n }\n const events = {};\n const emitter = new Bottleneck.Events(events);\n events.on(\"secondary-limit\", state.onSecondaryRateLimit);\n events.on(\"rate-limit\", state.onRateLimit);\n events.on(\n \"error\",\n (e) => octokit.log.warn(\"Error in throttling-plugin limit handler\", e)\n );\n state.retryLimiter.on(\"failed\", async function(error, info) {\n const [state2, request, options] = info.args;\n const { pathname } = new URL(options.url, \"http://github.test\");\n const shouldRetryGraphQL = pathname.startsWith(\"/graphql\") && error.status !== 401;\n if (!(shouldRetryGraphQL || error.status === 403 || error.status === 429)) {\n return;\n }\n const retryCount = ~~request.retryCount;\n request.retryCount = retryCount;\n options.request.retryCount = retryCount;\n const { wantRetry, retryAfter = 0 } = await (async function() {\n if (/\\bsecondary rate\\b/i.test(error.message)) {\n const retryAfter2 = Number(error.response.headers[\"retry-after\"]) || state2.fallbackSecondaryRateRetryAfter;\n const wantRetry2 = await emitter.trigger(\n \"secondary-limit\",\n retryAfter2,\n options,\n octokit,\n retryCount\n );\n return { wantRetry: wantRetry2, retryAfter: retryAfter2 };\n }\n if (error.response.headers != null && error.response.headers[\"x-ratelimit-remaining\"] === \"0\" || (error.response.data?.errors ?? []).some(\n (error2) => error2.type === \"RATE_LIMITED\"\n )) {\n const rateLimitReset = new Date(\n ~~error.response.headers[\"x-ratelimit-reset\"] * 1e3\n ).getTime();\n const retryAfter2 = Math.max(\n // Add one second so we retry _after_ the reset time\n // https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#exceeding-the-rate-limit\n Math.ceil((rateLimitReset - Date.now()) / 1e3) + 1,\n 0\n );\n const wantRetry2 = await emitter.trigger(\n \"rate-limit\",\n retryAfter2,\n options,\n octokit,\n retryCount\n );\n return { wantRetry: wantRetry2, retryAfter: retryAfter2 };\n }\n return {};\n })();\n if (wantRetry) {\n request.retryCount++;\n return retryAfter * state2.retryAfterBaseValue;\n }\n });\n octokit.hook.wrap(\"request\", wrapRequest.bind(null, state));\n return {};\n}\nthrottling.VERSION = VERSION;\nthrottling.triggersNotification = triggersNotification;\nexport {\n throttling\n};\n","/**\n * Creates a continuation function with some arguments already applied.\n *\n * Useful as a shorthand when combined with other control flow functions. Any\n * arguments passed to the returned function are added to the arguments\n * originally passed to apply.\n *\n * @name apply\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {Function} fn - The function you want to eventually apply all\n * arguments to. Invokes with (arguments...).\n * @param {...*} arguments... - Any number of arguments to automatically apply\n * when the continuation is called.\n * @returns {Function} the partially-applied function\n * @example\n *\n * // using apply\n * async.parallel([\n * async.apply(fs.writeFile, 'testfile1', 'test1'),\n * async.apply(fs.writeFile, 'testfile2', 'test2')\n * ]);\n *\n *\n * // the same process without using apply\n * async.parallel([\n * function(callback) {\n * fs.writeFile('testfile1', 'test1', callback);\n * },\n * function(callback) {\n * fs.writeFile('testfile2', 'test2', callback);\n * }\n * ]);\n *\n * // It's possible to pass any number of additional arguments when calling the\n * // continuation:\n *\n * node> var fn = async.apply(sys.puts, 'one');\n * node> fn('two', 'three');\n * one\n * two\n * three\n */\nfunction apply(fn, ...args) {\n return (...callArgs) => fn(...args,...callArgs);\n}\n\nfunction initialParams (fn) {\n return function (...args/*, callback*/) {\n var callback = args.pop();\n return fn.call(this, args, callback);\n };\n}\n\n/* istanbul ignore file */\n\nvar hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask;\nvar hasSetImmediate = typeof setImmediate === 'function' && setImmediate;\nvar hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';\n\nfunction fallback(fn) {\n setTimeout(fn, 0);\n}\n\nfunction wrap(defer) {\n return (fn, ...args) => defer(() => fn(...args));\n}\n\nvar _defer$1;\n\nif (hasQueueMicrotask) {\n _defer$1 = queueMicrotask;\n} else if (hasSetImmediate) {\n _defer$1 = setImmediate;\n} else if (hasNextTick) {\n _defer$1 = process.nextTick;\n} else {\n _defer$1 = fallback;\n}\n\nvar setImmediate$1 = wrap(_defer$1);\n\n/**\n * Take a sync function and make it async, passing its return value to a\n * callback. This is useful for plugging sync functions into a waterfall,\n * series, or other async functions. Any arguments passed to the generated\n * function will be passed to the wrapped function (except for the final\n * callback argument). Errors thrown will be passed to the callback.\n *\n * If the function passed to `asyncify` returns a Promise, that promises's\n * resolved/rejected state will be used to call the callback, rather than simply\n * the synchronous return value.\n *\n * This also means you can asyncify ES2017 `async` functions.\n *\n * @name asyncify\n * @static\n * @memberOf module:Utils\n * @method\n * @alias wrapSync\n * @category Util\n * @param {Function} func - The synchronous function, or Promise-returning\n * function to convert to an {@link AsyncFunction}.\n * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be\n * invoked with `(args..., callback)`.\n * @example\n *\n * // passing a regular synchronous function\n * async.waterfall([\n * async.apply(fs.readFile, filename, \"utf8\"),\n * async.asyncify(JSON.parse),\n * function (data, next) {\n * // data is the result of parsing the text.\n * // If there was a parsing error, it would have been caught.\n * }\n * ], callback);\n *\n * // passing a function returning a promise\n * async.waterfall([\n * async.apply(fs.readFile, filename, \"utf8\"),\n * async.asyncify(function (contents) {\n * return db.model.create(contents);\n * }),\n * function (model, next) {\n * // `model` is the instantiated model object.\n * // If there was an error, this function would be skipped.\n * }\n * ], callback);\n *\n * // es2017 example, though `asyncify` is not needed if your JS environment\n * // supports async functions out of the box\n * var q = async.queue(async.asyncify(async function(file) {\n * var intermediateStep = await processFile(file);\n * return await somePromise(intermediateStep)\n * }));\n *\n * q.push(files);\n */\nfunction asyncify(func) {\n if (isAsync(func)) {\n return function (...args/*, callback*/) {\n const callback = args.pop();\n const promise = func.apply(this, args);\n return handlePromise(promise, callback)\n }\n }\n\n return initialParams(function (args, callback) {\n var result;\n try {\n result = func.apply(this, args);\n } catch (e) {\n return callback(e);\n }\n // if result is Promise object\n if (result && typeof result.then === 'function') {\n return handlePromise(result, callback)\n } else {\n callback(null, result);\n }\n });\n}\n\nfunction handlePromise(promise, callback) {\n return promise.then(value => {\n invokeCallback(callback, null, value);\n }, err => {\n invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err));\n });\n}\n\nfunction invokeCallback(callback, error, value) {\n try {\n callback(error, value);\n } catch (err) {\n setImmediate$1(e => { throw e }, err);\n }\n}\n\nfunction isAsync(fn) {\n return fn[Symbol.toStringTag] === 'AsyncFunction';\n}\n\nfunction isAsyncGenerator(fn) {\n return fn[Symbol.toStringTag] === 'AsyncGenerator';\n}\n\nfunction isAsyncIterable(obj) {\n return typeof obj[Symbol.asyncIterator] === 'function';\n}\n\nfunction wrapAsync(asyncFn) {\n if (typeof asyncFn !== 'function') throw new Error('expected a function')\n return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn;\n}\n\n// conditionally promisify a function.\n// only return a promise if a callback is omitted\nfunction awaitify (asyncFn, arity) {\n if (!arity) arity = asyncFn.length;\n if (!arity) throw new Error('arity is undefined')\n function awaitable (...args) {\n if (typeof args[arity - 1] === 'function') {\n return asyncFn.apply(this, args)\n }\n\n return new Promise((resolve, reject) => {\n args[arity - 1] = (err, ...cbArgs) => {\n if (err) return reject(err)\n resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]);\n };\n asyncFn.apply(this, args);\n })\n }\n\n return awaitable\n}\n\nfunction applyEach$1 (eachfn) {\n return function applyEach(fns, ...callArgs) {\n const go = awaitify(function (callback) {\n var that = this;\n return eachfn(fns, (fn, cb) => {\n wrapAsync(fn).apply(that, callArgs.concat(cb));\n }, callback);\n });\n return go;\n };\n}\n\nfunction _asyncMap(eachfn, arr, iteratee, callback) {\n arr = arr || [];\n var results = [];\n var counter = 0;\n var _iteratee = wrapAsync(iteratee);\n\n return eachfn(arr, (value, _, iterCb) => {\n var index = counter++;\n _iteratee(value, (err, v) => {\n results[index] = v;\n iterCb(err);\n });\n }, err => {\n callback(err, results);\n });\n}\n\nfunction isArrayLike(value) {\n return value &&\n typeof value.length === 'number' &&\n value.length >= 0 &&\n value.length % 1 === 0;\n}\n\n// A temporary value used to identify if the loop should be broken.\n// See #1064, #1293\nconst breakLoop = {};\nvar breakLoop$1 = breakLoop;\n\nfunction once(fn) {\n function wrapper (...args) {\n if (fn === null) return;\n var callFn = fn;\n fn = null;\n callFn.apply(this, args);\n }\n Object.assign(wrapper, fn);\n return wrapper\n}\n\nfunction getIterator (coll) {\n return coll[Symbol.iterator] && coll[Symbol.iterator]();\n}\n\nfunction createArrayIterator(coll) {\n var i = -1;\n var len = coll.length;\n return function next() {\n return ++i < len ? {value: coll[i], key: i} : null;\n }\n}\n\nfunction createES2015Iterator(iterator) {\n var i = -1;\n return function next() {\n var item = iterator.next();\n if (item.done)\n return null;\n i++;\n return {value: item.value, key: i};\n }\n}\n\nfunction createObjectIterator(obj) {\n var okeys = obj ? Object.keys(obj) : [];\n var i = -1;\n var len = okeys.length;\n return function next() {\n var key = okeys[++i];\n if (key === '__proto__') {\n return next();\n }\n return i < len ? {value: obj[key], key} : null;\n };\n}\n\nfunction createIterator(coll) {\n if (isArrayLike(coll)) {\n return createArrayIterator(coll);\n }\n\n var iterator = getIterator(coll);\n return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);\n}\n\nfunction onlyOnce(fn) {\n return function (...args) {\n if (fn === null) throw new Error(\"Callback was already called.\");\n var callFn = fn;\n fn = null;\n callFn.apply(this, args);\n };\n}\n\n// for async generators\nfunction asyncEachOfLimit(generator, limit, iteratee, callback) {\n let done = false;\n let canceled = false;\n let awaiting = false;\n let running = 0;\n let idx = 0;\n\n function replenish() {\n //console.log('replenish')\n if (running >= limit || awaiting || done) return\n //console.log('replenish awaiting')\n awaiting = true;\n generator.next().then(({value, done: iterDone}) => {\n //console.log('got value', value)\n if (canceled || done) return\n awaiting = false;\n if (iterDone) {\n done = true;\n if (running <= 0) {\n //console.log('done nextCb')\n callback(null);\n }\n return;\n }\n running++;\n iteratee(value, idx, iterateeCallback);\n idx++;\n replenish();\n }).catch(handleError);\n }\n\n function iterateeCallback(err, result) {\n //console.log('iterateeCallback')\n running -= 1;\n if (canceled) return\n if (err) return handleError(err)\n\n if (err === false) {\n done = true;\n canceled = true;\n return\n }\n\n if (result === breakLoop$1 || (done && running <= 0)) {\n done = true;\n //console.log('done iterCb')\n return callback(null);\n }\n replenish();\n }\n\n function handleError(err) {\n if (canceled) return\n awaiting = false;\n done = true;\n callback(err);\n }\n\n replenish();\n}\n\nvar eachOfLimit$2 = (limit) => {\n return (obj, iteratee, callback) => {\n callback = once(callback);\n if (limit <= 0) {\n throw new RangeError('concurrency limit cannot be less than 1')\n }\n if (!obj) {\n return callback(null);\n }\n if (isAsyncGenerator(obj)) {\n return asyncEachOfLimit(obj, limit, iteratee, callback)\n }\n if (isAsyncIterable(obj)) {\n return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback)\n }\n var nextElem = createIterator(obj);\n var done = false;\n var canceled = false;\n var running = 0;\n var looping = false;\n\n function iterateeCallback(err, value) {\n if (canceled) return\n running -= 1;\n if (err) {\n done = true;\n callback(err);\n }\n else if (err === false) {\n done = true;\n canceled = true;\n }\n else if (value === breakLoop$1 || (done && running <= 0)) {\n done = true;\n return callback(null);\n }\n else if (!looping) {\n replenish();\n }\n }\n\n function replenish () {\n looping = true;\n while (running < limit && !done) {\n var elem = nextElem();\n if (elem === null) {\n done = true;\n if (running <= 0) {\n callback(null);\n }\n return;\n }\n running += 1;\n iteratee(elem.value, elem.key, onlyOnce(iterateeCallback));\n }\n looping = false;\n }\n\n replenish();\n };\n};\n\n/**\n * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name eachOfLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`. The `key` is the item's key, or index in the case of an\n * array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachOfLimit(coll, limit, iteratee, callback) {\n return eachOfLimit$2(limit)(coll, wrapAsync(iteratee), callback);\n}\n\nvar eachOfLimit$1 = awaitify(eachOfLimit, 4);\n\n// eachOf implementation optimized for array-likes\nfunction eachOfArrayLike(coll, iteratee, callback) {\n callback = once(callback);\n var index = 0,\n completed = 0,\n {length} = coll,\n canceled = false;\n if (length === 0) {\n callback(null);\n }\n\n function iteratorCallback(err, value) {\n if (err === false) {\n canceled = true;\n }\n if (canceled === true) return\n if (err) {\n callback(err);\n } else if ((++completed === length) || value === breakLoop$1) {\n callback(null);\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, onlyOnce(iteratorCallback));\n }\n}\n\n// a generic version of eachOf which can handle array, object, and iterator cases.\nfunction eachOfGeneric (coll, iteratee, callback) {\n return eachOfLimit$1(coll, Infinity, iteratee, callback);\n}\n\n/**\n * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument\n * to the iteratee.\n *\n * @name eachOf\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEachOf\n * @category Collection\n * @see [async.each]{@link module:Collections.each}\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each\n * item in `coll`.\n * The `key` is the item's key, or index in the case of an array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * // dev.json is a file containing a valid json object config for dev environment\n * // dev.json is a file containing a valid json object config for test environment\n * // prod.json is a file containing a valid json object config for prod environment\n * // invalid.json is a file with a malformed json object\n *\n * let configs = {}; //global variable\n * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'};\n * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'};\n *\n * // asynchronous function that reads a json file and parses the contents as json object\n * function parseFile(file, key, callback) {\n * fs.readFile(file, \"utf8\", function(err, data) {\n * if (err) return calback(err);\n * try {\n * configs[key] = JSON.parse(data);\n * } catch (e) {\n * return callback(e);\n * }\n * callback();\n * });\n * }\n *\n * // Using callbacks\n * async.forEachOf(validConfigFileMap, parseFile, function (err) {\n * if (err) {\n * console.error(err);\n * } else {\n * console.log(configs);\n * // configs is now a map of JSON data, e.g.\n * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json}\n * }\n * });\n *\n * //Error handing\n * async.forEachOf(invalidConfigFileMap, parseFile, function (err) {\n * if (err) {\n * console.error(err);\n * // JSON parse error exception\n * } else {\n * console.log(configs);\n * }\n * });\n *\n * // Using Promises\n * async.forEachOf(validConfigFileMap, parseFile)\n * .then( () => {\n * console.log(configs);\n * // configs is now a map of JSON data, e.g.\n * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json}\n * }).catch( err => {\n * console.error(err);\n * });\n *\n * //Error handing\n * async.forEachOf(invalidConfigFileMap, parseFile)\n * .then( () => {\n * console.log(configs);\n * }).catch( err => {\n * console.error(err);\n * // JSON parse error exception\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.forEachOf(validConfigFileMap, parseFile);\n * console.log(configs);\n * // configs is now a map of JSON data, e.g.\n * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json}\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * //Error handing\n * async () => {\n * try {\n * let result = await async.forEachOf(invalidConfigFileMap, parseFile);\n * console.log(configs);\n * }\n * catch (err) {\n * console.log(err);\n * // JSON parse error exception\n * }\n * }\n *\n */\nfunction eachOf(coll, iteratee, callback) {\n var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric;\n return eachOfImplementation(coll, wrapAsync(iteratee), callback);\n}\n\nvar eachOf$1 = awaitify(eachOf, 3);\n\n/**\n * Produces a new collection of values by mapping each value in `coll` through\n * the `iteratee` function. The `iteratee` is called with an item from `coll`\n * and a callback for when it has finished processing. Each of these callbacks\n * takes 2 arguments: an `error`, and the transformed item from `coll`. If\n * `iteratee` passes an error to its callback, the main `callback` (for the\n * `map` function) is immediately called with the error.\n *\n * Note, that since this function applies the `iteratee` to each item in\n * parallel, there is no guarantee that the `iteratee` functions will complete\n * in order. However, the results array will be in the same order as the\n * original `coll`.\n *\n * If `map` is passed an Object, the results will be an Array. The results\n * will roughly be in the order of the original Objects' keys (but this can\n * vary across JavaScript engines).\n *\n * @name map\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an Array of the\n * transformed items from the `coll`. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // file1.txt is a file that is 1000 bytes in size\n * // file2.txt is a file that is 2000 bytes in size\n * // file3.txt is a file that is 3000 bytes in size\n * // file4.txt does not exist\n *\n * const fileList = ['file1.txt','file2.txt','file3.txt'];\n * const withMissingFileList = ['file1.txt','file2.txt','file4.txt'];\n *\n * // asynchronous function that returns the file size in bytes\n * function getFileSizeInBytes(file, callback) {\n * fs.stat(file, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * callback(null, stat.size);\n * });\n * }\n *\n * // Using callbacks\n * async.map(fileList, getFileSizeInBytes, function(err, results) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // results is now an array of the file size in bytes for each file, e.g.\n * // [ 1000, 2000, 3000]\n * }\n * });\n *\n * // Error Handling\n * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) {\n * if (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * } else {\n * console.log(results);\n * }\n * });\n *\n * // Using Promises\n * async.map(fileList, getFileSizeInBytes)\n * .then( results => {\n * console.log(results);\n * // results is now an array of the file size in bytes for each file, e.g.\n * // [ 1000, 2000, 3000]\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Error Handling\n * async.map(withMissingFileList, getFileSizeInBytes)\n * .then( results => {\n * console.log(results);\n * }).catch( err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let results = await async.map(fileList, getFileSizeInBytes);\n * console.log(results);\n * // results is now an array of the file size in bytes for each file, e.g.\n * // [ 1000, 2000, 3000]\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // Error Handling\n * async () => {\n * try {\n * let results = await async.map(withMissingFileList, getFileSizeInBytes);\n * console.log(results);\n * }\n * catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * }\n * }\n *\n */\nfunction map (coll, iteratee, callback) {\n return _asyncMap(eachOf$1, coll, iteratee, callback)\n}\nvar map$1 = awaitify(map, 3);\n\n/**\n * Applies the provided arguments to each function in the array, calling\n * `callback` after all functions have completed. If you only provide the first\n * argument, `fns`, then it will return a function which lets you pass in the\n * arguments as if it were a single function call. If more arguments are\n * provided, `callback` is required while `args` is still optional. The results\n * for each of the applied async functions are passed to the final callback\n * as an array.\n *\n * @name applyEach\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s\n * to all call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {AsyncFunction} - Returns a function that takes no args other than\n * an optional callback, that is the result of applying the `args` to each\n * of the functions.\n * @example\n *\n * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket')\n *\n * appliedFn((err, results) => {\n * // results[0] is the results for `enableSearch`\n * // results[1] is the results for `updateSchema`\n * });\n *\n * // partial application example:\n * async.each(\n * buckets,\n * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(),\n * callback\n * );\n */\nvar applyEach = applyEach$1(map$1);\n\n/**\n * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time.\n *\n * @name eachOfSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachOfSeries(coll, iteratee, callback) {\n return eachOfLimit$1(coll, 1, iteratee, callback)\n}\nvar eachOfSeries$1 = awaitify(eachOfSeries, 3);\n\n/**\n * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time.\n *\n * @name mapSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the `coll`. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapSeries (coll, iteratee, callback) {\n return _asyncMap(eachOfSeries$1, coll, iteratee, callback)\n}\nvar mapSeries$1 = awaitify(mapSeries, 3);\n\n/**\n * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.\n *\n * @name applyEachSeries\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.applyEach]{@link module:ControlFlow.applyEach}\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all\n * call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {AsyncFunction} - A function, that when called, is the result of\n * appling the `args` to the list of functions. It takes no args, other than\n * a callback.\n */\nvar applyEachSeries = applyEach$1(mapSeries$1);\n\nconst PROMISE_SYMBOL = Symbol('promiseCallback');\n\nfunction promiseCallback () {\n let resolve, reject;\n function callback (err, ...args) {\n if (err) return reject(err)\n resolve(args.length > 1 ? args : args[0]);\n }\n\n callback[PROMISE_SYMBOL] = new Promise((res, rej) => {\n resolve = res,\n reject = rej;\n });\n\n return callback\n}\n\n/**\n * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on\n * their requirements. Each function can optionally depend on other functions\n * being completed first, and each function is run as soon as its requirements\n * are satisfied.\n *\n * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence\n * will stop. Further tasks will not execute (so any other functions depending\n * on it will not run), and the main `callback` is immediately called with the\n * error.\n *\n * {@link AsyncFunction}s also receive an object containing the results of functions which\n * have completed so far as the first argument, if they have dependencies. If a\n * task function has no dependencies, it will only be passed a callback.\n *\n * @name auto\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Object} tasks - An object. Each of its properties is either a\n * function or an array of requirements, with the {@link AsyncFunction} itself the last item\n * in the array. The object's key of a property serves as the name of the task\n * defined by that property, i.e. can be used when specifying requirements for\n * other tasks. The function receives one or two arguments:\n * * a `results` object, containing the results of the previously executed\n * functions, only passed if the task has any dependencies,\n * * a `callback(err, result)` function, which must be called when finished,\n * passing an `error` (which can be `null`) and the result of the function's\n * execution.\n * @param {number} [concurrency=Infinity] - An optional `integer` for\n * determining the maximum number of tasks that can be run in parallel. By\n * default, as many as possible.\n * @param {Function} [callback] - An optional callback which is called when all\n * the tasks have been completed. It receives the `err` argument if any `tasks`\n * pass an error to their callback. Results are always returned; however, if an\n * error occurs, no further `tasks` will be performed, and the results object\n * will only contain partial results. Invoked with (err, results).\n * @returns {Promise} a promise, if a callback is not passed\n * @example\n *\n * //Using Callbacks\n * async.auto({\n * get_data: function(callback) {\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: ['get_data', 'make_folder', function(results, callback) {\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(results, callback) {\n * // once the file is written let's email a link to it...\n * callback(null, {'file':results.write_file, 'email':'user@example.com'});\n * }]\n * }, function(err, results) {\n * if (err) {\n * console.log('err = ', err);\n * }\n * console.log('results = ', results);\n * // results = {\n * // get_data: ['data', 'converted to array']\n * // make_folder; 'folder',\n * // write_file: 'filename'\n * // email_link: { file: 'filename', email: 'user@example.com' }\n * // }\n * });\n *\n * //Using Promises\n * async.auto({\n * get_data: function(callback) {\n * console.log('in get_data');\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * console.log('in make_folder');\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: ['get_data', 'make_folder', function(results, callback) {\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(results, callback) {\n * // once the file is written let's email a link to it...\n * callback(null, {'file':results.write_file, 'email':'user@example.com'});\n * }]\n * }).then(results => {\n * console.log('results = ', results);\n * // results = {\n * // get_data: ['data', 'converted to array']\n * // make_folder; 'folder',\n * // write_file: 'filename'\n * // email_link: { file: 'filename', email: 'user@example.com' }\n * // }\n * }).catch(err => {\n * console.log('err = ', err);\n * });\n *\n * //Using async/await\n * async () => {\n * try {\n * let results = await async.auto({\n * get_data: function(callback) {\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: ['get_data', 'make_folder', function(results, callback) {\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(results, callback) {\n * // once the file is written let's email a link to it...\n * callback(null, {'file':results.write_file, 'email':'user@example.com'});\n * }]\n * });\n * console.log('results = ', results);\n * // results = {\n * // get_data: ['data', 'converted to array']\n * // make_folder; 'folder',\n * // write_file: 'filename'\n * // email_link: { file: 'filename', email: 'user@example.com' }\n * // }\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction auto(tasks, concurrency, callback) {\n if (typeof concurrency !== 'number') {\n // concurrency is optional, shift the args.\n callback = concurrency;\n concurrency = null;\n }\n callback = once(callback || promiseCallback());\n var numTasks = Object.keys(tasks).length;\n if (!numTasks) {\n return callback(null);\n }\n if (!concurrency) {\n concurrency = numTasks;\n }\n\n var results = {};\n var runningTasks = 0;\n var canceled = false;\n var hasError = false;\n\n var listeners = Object.create(null);\n\n var readyTasks = [];\n\n // for cycle detection:\n var readyToCheck = []; // tasks that have been identified as reachable\n // without the possibility of returning to an ancestor task\n var uncheckedDependencies = {};\n\n Object.keys(tasks).forEach(key => {\n var task = tasks[key];\n if (!Array.isArray(task)) {\n // no dependencies\n enqueueTask(key, [task]);\n readyToCheck.push(key);\n return;\n }\n\n var dependencies = task.slice(0, task.length - 1);\n var remainingDependencies = dependencies.length;\n if (remainingDependencies === 0) {\n enqueueTask(key, task);\n readyToCheck.push(key);\n return;\n }\n uncheckedDependencies[key] = remainingDependencies;\n\n dependencies.forEach(dependencyName => {\n if (!tasks[dependencyName]) {\n throw new Error('async.auto task `' + key +\n '` has a non-existent dependency `' +\n dependencyName + '` in ' +\n dependencies.join(', '));\n }\n addListener(dependencyName, () => {\n remainingDependencies--;\n if (remainingDependencies === 0) {\n enqueueTask(key, task);\n }\n });\n });\n });\n\n checkForDeadlocks();\n processQueue();\n\n function enqueueTask(key, task) {\n readyTasks.push(() => runTask(key, task));\n }\n\n function processQueue() {\n if (canceled) return\n if (readyTasks.length === 0 && runningTasks === 0) {\n return callback(null, results);\n }\n while(readyTasks.length && runningTasks < concurrency) {\n var run = readyTasks.shift();\n run();\n }\n\n }\n\n function addListener(taskName, fn) {\n var taskListeners = listeners[taskName];\n if (!taskListeners) {\n taskListeners = listeners[taskName] = [];\n }\n\n taskListeners.push(fn);\n }\n\n function taskComplete(taskName) {\n var taskListeners = listeners[taskName] || [];\n taskListeners.forEach(fn => fn());\n processQueue();\n }\n\n\n function runTask(key, task) {\n if (hasError) return;\n\n var taskCallback = onlyOnce((err, ...result) => {\n runningTasks--;\n if (err === false) {\n canceled = true;\n return\n }\n if (result.length < 2) {\n [result] = result;\n }\n if (err) {\n var safeResults = {};\n Object.keys(results).forEach(rkey => {\n safeResults[rkey] = results[rkey];\n });\n safeResults[key] = result;\n hasError = true;\n listeners = Object.create(null);\n if (canceled) return\n callback(err, safeResults);\n } else {\n results[key] = result;\n taskComplete(key);\n }\n });\n\n runningTasks++;\n var taskFn = wrapAsync(task[task.length - 1]);\n if (task.length > 1) {\n taskFn(results, taskCallback);\n } else {\n taskFn(taskCallback);\n }\n }\n\n function checkForDeadlocks() {\n // Kahn's algorithm\n // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm\n // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html\n var currentTask;\n var counter = 0;\n while (readyToCheck.length) {\n currentTask = readyToCheck.pop();\n counter++;\n getDependents(currentTask).forEach(dependent => {\n if (--uncheckedDependencies[dependent] === 0) {\n readyToCheck.push(dependent);\n }\n });\n }\n\n if (counter !== numTasks) {\n throw new Error(\n 'async.auto cannot execute tasks due to a recursive dependency'\n );\n }\n }\n\n function getDependents(taskName) {\n var result = [];\n Object.keys(tasks).forEach(key => {\n const task = tasks[key];\n if (Array.isArray(task) && task.indexOf(taskName) >= 0) {\n result.push(key);\n }\n });\n return result;\n }\n\n return callback[PROMISE_SYMBOL]\n}\n\nvar FN_ARGS = /^(?:async\\s+)?(?:function)?\\s*\\w*\\s*\\(\\s*([^)]+)\\s*\\)(?:\\s*{)/;\nvar ARROW_FN_ARGS = /^(?:async\\s+)?\\(?\\s*([^)=]+)\\s*\\)?(?:\\s*=>)/;\nvar FN_ARG_SPLIT = /,/;\nvar FN_ARG = /(=.+)?(\\s*)$/;\n\nfunction stripComments(string) {\n let stripped = '';\n let index = 0;\n let endBlockComment = string.indexOf('*/');\n while (index < string.length) {\n if (string[index] === '/' && string[index+1] === '/') {\n // inline comment\n let endIndex = string.indexOf('\\n', index);\n index = (endIndex === -1) ? string.length : endIndex;\n } else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) {\n // block comment\n let endIndex = string.indexOf('*/', index);\n if (endIndex !== -1) {\n index = endIndex + 2;\n endBlockComment = string.indexOf('*/', index);\n } else {\n stripped += string[index];\n index++;\n }\n } else {\n stripped += string[index];\n index++;\n }\n }\n return stripped;\n}\n\nfunction parseParams(func) {\n const src = stripComments(func.toString());\n let match = src.match(FN_ARGS);\n if (!match) {\n match = src.match(ARROW_FN_ARGS);\n }\n if (!match) throw new Error('could not parse args in autoInject\\nSource:\\n' + src)\n let [, args] = match;\n return args\n .replace(/\\s/g, '')\n .split(FN_ARG_SPLIT)\n .map((arg) => arg.replace(FN_ARG, '').trim());\n}\n\n/**\n * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent\n * tasks are specified as parameters to the function, after the usual callback\n * parameter, with the parameter names matching the names of the tasks it\n * depends on. This can provide even more readable task graphs which can be\n * easier to maintain.\n *\n * If a final callback is specified, the task results are similarly injected,\n * specified as named parameters after the initial error parameter.\n *\n * The autoInject function is purely syntactic sugar and its semantics are\n * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}.\n *\n * @name autoInject\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.auto]{@link module:ControlFlow.auto}\n * @category Control Flow\n * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of\n * the form 'func([dependencies...], callback). The object's key of a property\n * serves as the name of the task defined by that property, i.e. can be used\n * when specifying requirements for other tasks.\n * * The `callback` parameter is a `callback(err, result)` which must be called\n * when finished, passing an `error` (which can be `null`) and the result of\n * the function's execution. The remaining parameters name other tasks on\n * which the task is dependent, and the results from those tasks are the\n * arguments of those parameters.\n * @param {Function} [callback] - An optional callback which is called when all\n * the tasks have been completed. It receives the `err` argument if any `tasks`\n * pass an error to their callback, and a `results` object with any completed\n * task results, similar to `auto`.\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // The example from `auto` can be rewritten as follows:\n * async.autoInject({\n * get_data: function(callback) {\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: function(get_data, make_folder, callback) {\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * },\n * email_link: function(write_file, callback) {\n * // once the file is written let's email a link to it...\n * // write_file contains the filename returned by write_file.\n * callback(null, {'file':write_file, 'email':'user@example.com'});\n * }\n * }, function(err, results) {\n * console.log('err = ', err);\n * console.log('email_link = ', results.email_link);\n * });\n *\n * // If you are using a JS minifier that mangles parameter names, `autoInject`\n * // will not work with plain functions, since the parameter names will be\n * // collapsed to a single letter identifier. To work around this, you can\n * // explicitly specify the names of the parameters your task function needs\n * // in an array, similar to Angular.js dependency injection.\n *\n * // This still has an advantage over plain `auto`, since the results a task\n * // depends on are still spread into arguments.\n * async.autoInject({\n * //...\n * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(write_file, callback) {\n * callback(null, {'file':write_file, 'email':'user@example.com'});\n * }]\n * //...\n * }, function(err, results) {\n * console.log('err = ', err);\n * console.log('email_link = ', results.email_link);\n * });\n */\nfunction autoInject(tasks, callback) {\n var newTasks = {};\n\n Object.keys(tasks).forEach(key => {\n var taskFn = tasks[key];\n var params;\n var fnIsAsync = isAsync(taskFn);\n var hasNoDeps =\n (!fnIsAsync && taskFn.length === 1) ||\n (fnIsAsync && taskFn.length === 0);\n\n if (Array.isArray(taskFn)) {\n params = [...taskFn];\n taskFn = params.pop();\n\n newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);\n } else if (hasNoDeps) {\n // no dependencies, use the function as-is\n newTasks[key] = taskFn;\n } else {\n params = parseParams(taskFn);\n if ((taskFn.length === 0 && !fnIsAsync) && params.length === 0) {\n throw new Error(\"autoInject task functions require explicit parameters.\");\n }\n\n // remove callback param\n if (!fnIsAsync) params.pop();\n\n newTasks[key] = params.concat(newTask);\n }\n\n function newTask(results, taskCb) {\n var newArgs = params.map(name => results[name]);\n newArgs.push(taskCb);\n wrapAsync(taskFn)(...newArgs);\n }\n });\n\n return auto(newTasks, callback);\n}\n\n// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation\n// used for queues. This implementation assumes that the node provided by the user can be modified\n// to adjust the next and last properties. We implement only the minimal functionality\n// for queue support.\nclass DLL {\n constructor() {\n this.head = this.tail = null;\n this.length = 0;\n }\n\n removeLink(node) {\n if (node.prev) node.prev.next = node.next;\n else this.head = node.next;\n if (node.next) node.next.prev = node.prev;\n else this.tail = node.prev;\n\n node.prev = node.next = null;\n this.length -= 1;\n return node;\n }\n\n empty () {\n while(this.head) this.shift();\n return this;\n }\n\n insertAfter(node, newNode) {\n newNode.prev = node;\n newNode.next = node.next;\n if (node.next) node.next.prev = newNode;\n else this.tail = newNode;\n node.next = newNode;\n this.length += 1;\n }\n\n insertBefore(node, newNode) {\n newNode.prev = node.prev;\n newNode.next = node;\n if (node.prev) node.prev.next = newNode;\n else this.head = newNode;\n node.prev = newNode;\n this.length += 1;\n }\n\n unshift(node) {\n if (this.head) this.insertBefore(this.head, node);\n else setInitial(this, node);\n }\n\n push(node) {\n if (this.tail) this.insertAfter(this.tail, node);\n else setInitial(this, node);\n }\n\n shift() {\n return this.head && this.removeLink(this.head);\n }\n\n pop() {\n return this.tail && this.removeLink(this.tail);\n }\n\n toArray() {\n return [...this]\n }\n\n *[Symbol.iterator] () {\n var cur = this.head;\n while (cur) {\n yield cur.data;\n cur = cur.next;\n }\n }\n\n remove (testFn) {\n var curr = this.head;\n while(curr) {\n var {next} = curr;\n if (testFn(curr)) {\n this.removeLink(curr);\n }\n curr = next;\n }\n return this;\n }\n}\n\nfunction setInitial(dll, node) {\n dll.length = 1;\n dll.head = dll.tail = node;\n}\n\nfunction queue$1(worker, concurrency, payload) {\n if (concurrency == null) {\n concurrency = 1;\n }\n else if(concurrency === 0) {\n throw new RangeError('Concurrency must not be zero');\n }\n\n var _worker = wrapAsync(worker);\n var numRunning = 0;\n var workersList = [];\n const events = {\n error: [],\n drain: [],\n saturated: [],\n unsaturated: [],\n empty: []\n };\n\n function on (event, handler) {\n events[event].push(handler);\n }\n\n function once (event, handler) {\n const handleAndRemove = (...args) => {\n off(event, handleAndRemove);\n handler(...args);\n };\n events[event].push(handleAndRemove);\n }\n\n function off (event, handler) {\n if (!event) return Object.keys(events).forEach(ev => events[ev] = [])\n if (!handler) return events[event] = []\n events[event] = events[event].filter(ev => ev !== handler);\n }\n\n function trigger (event, ...args) {\n events[event].forEach(handler => handler(...args));\n }\n\n var processingScheduled = false;\n function _insert(data, insertAtFront, rejectOnError, callback) {\n if (callback != null && typeof callback !== 'function') {\n throw new Error('task callback must be a function');\n }\n q.started = true;\n\n var res, rej;\n function promiseCallback (err, ...args) {\n // we don't care about the error, let the global error handler\n // deal with it\n if (err) return rejectOnError ? rej(err) : res()\n if (args.length <= 1) return res(args[0])\n res(args);\n }\n\n var item = q._createTaskItem(\n data,\n rejectOnError ? promiseCallback :\n (callback || promiseCallback)\n );\n\n if (insertAtFront) {\n q._tasks.unshift(item);\n } else {\n q._tasks.push(item);\n }\n\n if (!processingScheduled) {\n processingScheduled = true;\n setImmediate$1(() => {\n processingScheduled = false;\n q.process();\n });\n }\n\n if (rejectOnError || !callback) {\n return new Promise((resolve, reject) => {\n res = resolve;\n rej = reject;\n })\n }\n }\n\n function _createCB(tasks) {\n return function (err, ...args) {\n numRunning -= 1;\n\n for (var i = 0, l = tasks.length; i < l; i++) {\n var task = tasks[i];\n\n var index = workersList.indexOf(task);\n if (index === 0) {\n workersList.shift();\n } else if (index > 0) {\n workersList.splice(index, 1);\n }\n\n task.callback(err, ...args);\n\n if (err != null) {\n trigger('error', err, task.data);\n }\n }\n\n if (numRunning <= (q.concurrency - q.buffer) ) {\n trigger('unsaturated');\n }\n\n if (q.idle()) {\n trigger('drain');\n }\n q.process();\n };\n }\n\n function _maybeDrain(data) {\n if (data.length === 0 && q.idle()) {\n // call drain immediately if there are no tasks\n setImmediate$1(() => trigger('drain'));\n return true\n }\n return false\n }\n\n const eventMethod = (name) => (handler) => {\n if (!handler) {\n return new Promise((resolve, reject) => {\n once(name, (err, data) => {\n if (err) return reject(err)\n resolve(data);\n });\n })\n }\n off(name);\n on(name, handler);\n\n };\n\n var isProcessing = false;\n var q = {\n _tasks: new DLL(),\n _createTaskItem (data, callback) {\n return {\n data,\n callback\n };\n },\n *[Symbol.iterator] () {\n yield* q._tasks[Symbol.iterator]();\n },\n concurrency,\n payload,\n buffer: concurrency / 4,\n started: false,\n paused: false,\n push (data, callback) {\n if (Array.isArray(data)) {\n if (_maybeDrain(data)) return\n return data.map(datum => _insert(datum, false, false, callback))\n }\n return _insert(data, false, false, callback);\n },\n pushAsync (data, callback) {\n if (Array.isArray(data)) {\n if (_maybeDrain(data)) return\n return data.map(datum => _insert(datum, false, true, callback))\n }\n return _insert(data, false, true, callback);\n },\n kill () {\n off();\n q._tasks.empty();\n },\n unshift (data, callback) {\n if (Array.isArray(data)) {\n if (_maybeDrain(data)) return\n return data.map(datum => _insert(datum, true, false, callback))\n }\n return _insert(data, true, false, callback);\n },\n unshiftAsync (data, callback) {\n if (Array.isArray(data)) {\n if (_maybeDrain(data)) return\n return data.map(datum => _insert(datum, true, true, callback))\n }\n return _insert(data, true, true, callback);\n },\n remove (testFn) {\n q._tasks.remove(testFn);\n },\n process () {\n // Avoid trying to start too many processing operations. This can occur\n // when callbacks resolve synchronously (#1267).\n if (isProcessing) {\n return;\n }\n isProcessing = true;\n while(!q.paused && numRunning < q.concurrency && q._tasks.length){\n var tasks = [], data = [];\n var l = q._tasks.length;\n if (q.payload) l = Math.min(l, q.payload);\n for (var i = 0; i < l; i++) {\n var node = q._tasks.shift();\n tasks.push(node);\n workersList.push(node);\n data.push(node.data);\n }\n\n numRunning += 1;\n\n if (q._tasks.length === 0) {\n trigger('empty');\n }\n\n if (numRunning === q.concurrency) {\n trigger('saturated');\n }\n\n var cb = onlyOnce(_createCB(tasks));\n _worker(data, cb);\n }\n isProcessing = false;\n },\n length () {\n return q._tasks.length;\n },\n running () {\n return numRunning;\n },\n workersList () {\n return workersList;\n },\n idle() {\n return q._tasks.length + numRunning === 0;\n },\n pause () {\n q.paused = true;\n },\n resume () {\n if (q.paused === false) { return; }\n q.paused = false;\n setImmediate$1(q.process);\n }\n };\n // define these as fixed properties, so people get useful errors when updating\n Object.defineProperties(q, {\n saturated: {\n writable: false,\n value: eventMethod('saturated')\n },\n unsaturated: {\n writable: false,\n value: eventMethod('unsaturated')\n },\n empty: {\n writable: false,\n value: eventMethod('empty')\n },\n drain: {\n writable: false,\n value: eventMethod('drain')\n },\n error: {\n writable: false,\n value: eventMethod('error')\n },\n });\n return q;\n}\n\n/**\n * Creates a `cargo` object with the specified payload. Tasks added to the\n * cargo will be processed altogether (up to the `payload` limit). If the\n * `worker` is in progress, the task is queued until it becomes available. Once\n * the `worker` has completed some tasks, each callback of those tasks is\n * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)\n * for how `cargo` and `queue` work.\n *\n * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers\n * at a time, cargo passes an array of tasks to a single worker, repeating\n * when the worker is finished.\n *\n * @name cargo\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @category Control Flow\n * @param {AsyncFunction} worker - An asynchronous function for processing an array\n * of queued tasks. Invoked with `(tasks, callback)`.\n * @param {number} [payload=Infinity] - An optional `integer` for determining\n * how many tasks should be processed per round; if omitted, the default is\n * unlimited.\n * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can\n * attached as certain properties to listen for specific events during the\n * lifecycle of the cargo and inner queue.\n * @example\n *\n * // create a cargo object with payload 2\n * var cargo = async.cargo(function(tasks, callback) {\n * for (var i=0; i {\n * console.log(result);\n * // 6000\n * // which is the sum of the file sizes of the three files\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Error Handling\n * async.reduce(withMissingFileList, 0, getFileSizeInBytes)\n * .then( result => {\n * console.log(result);\n * }).catch( err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.reduce(fileList, 0, getFileSizeInBytes);\n * console.log(result);\n * // 6000\n * // which is the sum of the file sizes of the three files\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // Error Handling\n * async () => {\n * try {\n * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes);\n * console.log(result);\n * }\n * catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * }\n * }\n *\n */\nfunction reduce(coll, memo, iteratee, callback) {\n callback = once(callback);\n var _iteratee = wrapAsync(iteratee);\n return eachOfSeries$1(coll, (x, i, iterCb) => {\n _iteratee(memo, x, (err, v) => {\n memo = v;\n iterCb(err);\n });\n }, err => callback(err, memo));\n}\nvar reduce$1 = awaitify(reduce, 4);\n\n/**\n * Version of the compose function that is more natural to read. Each function\n * consumes the return value of the previous function. It is the equivalent of\n * [compose]{@link module:ControlFlow.compose} with the arguments reversed.\n *\n * Each function is executed with the `this` binding of the composed function.\n *\n * @name seq\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.compose]{@link module:ControlFlow.compose}\n * @category Control Flow\n * @param {...AsyncFunction} functions - the asynchronous functions to compose\n * @returns {Function} a function that composes the `functions` in order\n * @example\n *\n * // Requires lodash (or underscore), express3 and dresende's orm2.\n * // Part of an app, that fetches cats of the logged user.\n * // This example uses `seq` function to avoid overnesting and error\n * // handling clutter.\n * app.get('/cats', function(request, response) {\n * var User = request.models.User;\n * async.seq(\n * User.get.bind(User), // 'User.get' has signature (id, callback(err, data))\n * function(user, fn) {\n * user.getCats(fn); // 'getCats' has signature (callback(err, data))\n * }\n * )(req.session.user_id, function (err, cats) {\n * if (err) {\n * console.error(err);\n * response.json({ status: 'error', message: err.message });\n * } else {\n * response.json({ status: 'ok', message: 'Cats found', data: cats });\n * }\n * });\n * });\n */\nfunction seq(...functions) {\n var _functions = functions.map(wrapAsync);\n return function (...args) {\n var that = this;\n\n var cb = args[args.length - 1];\n if (typeof cb == 'function') {\n args.pop();\n } else {\n cb = promiseCallback();\n }\n\n reduce$1(_functions, args, (newargs, fn, iterCb) => {\n fn.apply(that, newargs.concat((err, ...nextargs) => {\n iterCb(err, nextargs);\n }));\n },\n (err, results) => cb(err, ...results));\n\n return cb[PROMISE_SYMBOL]\n };\n}\n\n/**\n * Creates a function which is a composition of the passed asynchronous\n * functions. Each function consumes the return value of the function that\n * follows. Composing functions `f()`, `g()`, and `h()` would produce the result\n * of `f(g(h()))`, only this version uses callbacks to obtain the return values.\n *\n * If the last argument to the composed function is not a function, a promise\n * is returned when you call it.\n *\n * Each function is executed with the `this` binding of the composed function.\n *\n * @name compose\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {...AsyncFunction} functions - the asynchronous functions to compose\n * @returns {Function} an asynchronous function that is the composed\n * asynchronous `functions`\n * @example\n *\n * function add1(n, callback) {\n * setTimeout(function () {\n * callback(null, n + 1);\n * }, 10);\n * }\n *\n * function mul3(n, callback) {\n * setTimeout(function () {\n * callback(null, n * 3);\n * }, 10);\n * }\n *\n * var add1mul3 = async.compose(mul3, add1);\n * add1mul3(4, function (err, result) {\n * // result now equals 15\n * });\n */\nfunction compose(...args) {\n return seq(...args.reverse());\n}\n\n/**\n * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time.\n *\n * @name mapLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the `coll`. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapLimit (coll, limit, iteratee, callback) {\n return _asyncMap(eachOfLimit$2(limit), coll, iteratee, callback)\n}\nvar mapLimit$1 = awaitify(mapLimit, 4);\n\n/**\n * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time.\n *\n * @name concatLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.concat]{@link module:Collections.concat}\n * @category Collection\n * @alias flatMapLimit\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,\n * which should use an array as its result. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is an array\n * containing the concatenated results of the `iteratee` function. Invoked with\n * (err, results).\n * @returns A Promise, if no callback is passed\n */\nfunction concatLimit(coll, limit, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n return mapLimit$1(coll, limit, (val, iterCb) => {\n _iteratee(val, (err, ...args) => {\n if (err) return iterCb(err);\n return iterCb(err, args);\n });\n }, (err, mapResults) => {\n var result = [];\n for (var i = 0; i < mapResults.length; i++) {\n if (mapResults[i]) {\n result = result.concat(...mapResults[i]);\n }\n }\n\n return callback(err, result);\n });\n}\nvar concatLimit$1 = awaitify(concatLimit, 4);\n\n/**\n * Applies `iteratee` to each item in `coll`, concatenating the results. Returns\n * the concatenated list. The `iteratee`s are called in parallel, and the\n * results are concatenated as they return. The results array will be returned in\n * the original order of `coll` passed to the `iteratee` function.\n *\n * @name concat\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @alias flatMap\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,\n * which should use an array as its result. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is an array\n * containing the concatenated results of the `iteratee` function. Invoked with\n * (err, results).\n * @returns A Promise, if no callback is passed\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n * // dir4 does not exist\n *\n * let directoryList = ['dir1','dir2','dir3'];\n * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4'];\n *\n * // Using callbacks\n * async.concat(directoryList, fs.readdir, function(err, results) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ]\n * }\n * });\n *\n * // Error Handling\n * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) {\n * if (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4 does not exist\n * } else {\n * console.log(results);\n * }\n * });\n *\n * // Using Promises\n * async.concat(directoryList, fs.readdir)\n * .then(results => {\n * console.log(results);\n * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ]\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // Error Handling\n * async.concat(withMissingDirectoryList, fs.readdir)\n * .then(results => {\n * console.log(results);\n * }).catch(err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4 does not exist\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let results = await async.concat(directoryList, fs.readdir);\n * console.log(results);\n * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ]\n * } catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // Error Handling\n * async () => {\n * try {\n * let results = await async.concat(withMissingDirectoryList, fs.readdir);\n * console.log(results);\n * } catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4 does not exist\n * }\n * }\n *\n */\nfunction concat(coll, iteratee, callback) {\n return concatLimit$1(coll, Infinity, iteratee, callback)\n}\nvar concat$1 = awaitify(concat, 3);\n\n/**\n * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time.\n *\n * @name concatSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.concat]{@link module:Collections.concat}\n * @category Collection\n * @alias flatMapSeries\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`.\n * The iteratee should complete with an array an array of results.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is an array\n * containing the concatenated results of the `iteratee` function. Invoked with\n * (err, results).\n * @returns A Promise, if no callback is passed\n */\nfunction concatSeries(coll, iteratee, callback) {\n return concatLimit$1(coll, 1, iteratee, callback)\n}\nvar concatSeries$1 = awaitify(concatSeries, 3);\n\n/**\n * Returns a function that when called, calls-back with the values provided.\n * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to\n * [`auto`]{@link module:ControlFlow.auto}.\n *\n * @name constant\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {...*} arguments... - Any number of arguments to automatically invoke\n * callback with.\n * @returns {AsyncFunction} Returns a function that when invoked, automatically\n * invokes the callback with the previous given arguments.\n * @example\n *\n * async.waterfall([\n * async.constant(42),\n * function (value, next) {\n * // value === 42\n * },\n * //...\n * ], callback);\n *\n * async.waterfall([\n * async.constant(filename, \"utf8\"),\n * fs.readFile,\n * function (fileData, next) {\n * //...\n * }\n * //...\n * ], callback);\n *\n * async.auto({\n * hostname: async.constant(\"https://server.net/\"),\n * port: findFreePort,\n * launchServer: [\"hostname\", \"port\", function (options, cb) {\n * startServer(options, cb);\n * }],\n * //...\n * }, callback);\n */\nfunction constant$1(...args) {\n return function (...ignoredArgs/*, callback*/) {\n var callback = ignoredArgs.pop();\n return callback(null, ...args);\n };\n}\n\nfunction _createTester(check, getResult) {\n return (eachfn, arr, _iteratee, cb) => {\n var testPassed = false;\n var testResult;\n const iteratee = wrapAsync(_iteratee);\n eachfn(arr, (value, _, callback) => {\n iteratee(value, (err, result) => {\n if (err || err === false) return callback(err);\n\n if (check(result) && !testResult) {\n testPassed = true;\n testResult = getResult(true, value);\n return callback(null, breakLoop$1);\n }\n callback();\n });\n }, err => {\n if (err) return cb(err);\n cb(null, testPassed ? testResult : getResult(false));\n });\n };\n}\n\n/**\n * Returns the first value in `coll` that passes an async truth test. The\n * `iteratee` is applied in parallel, meaning the first iteratee to return\n * `true` will fire the detect `callback` with that result. That means the\n * result might not be the first item in the original `coll` (in terms of order)\n * that passes the test.\n\n * If order within the original `coll` is important, then look at\n * [`detectSeries`]{@link module:Collections.detectSeries}.\n *\n * @name detect\n * @static\n * @memberOf module:Collections\n * @method\n * @alias find\n * @category Collections\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n *\n * // asynchronous function that checks if a file exists\n * function fileExists(file, callback) {\n * fs.access(file, fs.constants.F_OK, (err) => {\n * callback(null, !err);\n * });\n * }\n *\n * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists,\n * function(err, result) {\n * console.log(result);\n * // dir1/file1.txt\n * // result now equals the first file in the list that exists\n * }\n *);\n *\n * // Using Promises\n * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists)\n * .then(result => {\n * console.log(result);\n * // dir1/file1.txt\n * // result now equals the first file in the list that exists\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists);\n * console.log(result);\n * // dir1/file1.txt\n * // result now equals the file in the list that exists\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction detect(coll, iteratee, callback) {\n return _createTester(bool => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback)\n}\nvar detect$1 = awaitify(detect, 3);\n\n/**\n * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name detectLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.detect]{@link module:Collections.detect}\n * @alias findLimit\n * @category Collections\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction detectLimit(coll, limit, iteratee, callback) {\n return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(limit), coll, iteratee, callback)\n}\nvar detectLimit$1 = awaitify(detectLimit, 4);\n\n/**\n * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.\n *\n * @name detectSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.detect]{@link module:Collections.detect}\n * @alias findSeries\n * @category Collections\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction detectSeries(coll, iteratee, callback) {\n return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(1), coll, iteratee, callback)\n}\n\nvar detectSeries$1 = awaitify(detectSeries, 3);\n\nfunction consoleFunc(name) {\n return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => {\n /* istanbul ignore else */\n if (typeof console === 'object') {\n /* istanbul ignore else */\n if (err) {\n /* istanbul ignore else */\n if (console.error) {\n console.error(err);\n }\n } else if (console[name]) { /* istanbul ignore else */\n resultArgs.forEach(x => console[name](x));\n }\n }\n })\n}\n\n/**\n * Logs the result of an [`async` function]{@link AsyncFunction} to the\n * `console` using `console.dir` to display the properties of the resulting object.\n * Only works in Node.js or in browsers that support `console.dir` and\n * `console.error` (such as FF and Chrome).\n * If multiple arguments are returned from the async function,\n * `console.dir` is called on each argument in order.\n *\n * @name dir\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} function - The function you want to eventually apply\n * all arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n * setTimeout(function() {\n * callback(null, {hello: name});\n * }, 1000);\n * };\n *\n * // in the node repl\n * node> async.dir(hello, 'world');\n * {hello: 'world'}\n */\nvar dir = consoleFunc('dir');\n\n/**\n * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in\n * the order of operations, the arguments `test` and `iteratee` are switched.\n *\n * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n *\n * @name doWhilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - A function which is called each time `test`\n * passes. Invoked with (callback).\n * @param {AsyncFunction} test - asynchronous truth test to perform after each\n * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the\n * non-error args from the previous callback of `iteratee`.\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `iteratee` has stopped.\n * `callback` will be passed an error and any arguments passed to the final\n * `iteratee`'s callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction doWhilst(iteratee, test, callback) {\n callback = onlyOnce(callback);\n var _fn = wrapAsync(iteratee);\n var _test = wrapAsync(test);\n var results;\n\n function next(err, ...args) {\n if (err) return callback(err);\n if (err === false) return;\n results = args;\n _test(...args, check);\n }\n\n function check(err, truth) {\n if (err) return callback(err);\n if (err === false) return;\n if (!truth) return callback(null, ...results);\n _fn(next);\n }\n\n return check(null, true);\n}\n\nvar doWhilst$1 = awaitify(doWhilst, 3);\n\n/**\n * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the\n * argument ordering differs from `until`.\n *\n * @name doUntil\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.doWhilst]{@link module:ControlFlow.doWhilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` fails. Invoked with (callback).\n * @param {AsyncFunction} test - asynchronous truth test to perform after each\n * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the\n * non-error args from the previous callback of `iteratee`\n * @param {Function} [callback] - A callback which is called after the test\n * function has passed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction doUntil(iteratee, test, callback) {\n const _test = wrapAsync(test);\n return doWhilst$1(iteratee, (...args) => {\n const cb = args.pop();\n _test(...args, (err, truth) => cb (err, !truth));\n }, callback);\n}\n\nfunction _withoutIndex(iteratee) {\n return (value, index, callback) => iteratee(value, callback);\n}\n\n/**\n * Applies the function `iteratee` to each item in `coll`, in parallel.\n * The `iteratee` is called with an item from the list, and a callback for when\n * it has finished. If the `iteratee` passes an error to its `callback`, the\n * main `callback` (for the `each` function) is immediately called with the\n * error.\n *\n * Note, that since this function applies `iteratee` to each item in parallel,\n * there is no guarantee that the iteratee functions will complete in order.\n *\n * @name each\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEach\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to\n * each item in `coll`. Invoked with (item, callback).\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOf`.\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n * // dir4 does not exist\n *\n * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt'];\n * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt'];\n *\n * // asynchronous function that deletes a file\n * const deleteFile = function(file, callback) {\n * fs.unlink(file, callback);\n * };\n *\n * // Using callbacks\n * async.each(fileList, deleteFile, function(err) {\n * if( err ) {\n * console.log(err);\n * } else {\n * console.log('All files have been deleted successfully');\n * }\n * });\n *\n * // Error Handling\n * async.each(withMissingFileList, deleteFile, function(err){\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4/file2.txt does not exist\n * // dir1/file1.txt could have been deleted\n * });\n *\n * // Using Promises\n * async.each(fileList, deleteFile)\n * .then( () => {\n * console.log('All files have been deleted successfully');\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Error Handling\n * async.each(fileList, deleteFile)\n * .then( () => {\n * console.log('All files have been deleted successfully');\n * }).catch( err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4/file2.txt does not exist\n * // dir1/file1.txt could have been deleted\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * await async.each(files, deleteFile);\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // Error Handling\n * async () => {\n * try {\n * await async.each(withMissingFileList, deleteFile);\n * }\n * catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4/file2.txt does not exist\n * // dir1/file1.txt could have been deleted\n * }\n * }\n *\n */\nfunction eachLimit$2(coll, iteratee, callback) {\n return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback);\n}\n\nvar each = awaitify(eachLimit$2, 3);\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.\n *\n * @name eachLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfLimit`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachLimit(coll, limit, iteratee, callback) {\n return eachOfLimit$2(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback);\n}\nvar eachLimit$1 = awaitify(eachLimit, 4);\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.\n *\n * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item\n * in series and therefore the iteratee functions will complete in order.\n\n * @name eachSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfSeries`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachSeries(coll, iteratee, callback) {\n return eachLimit$1(coll, 1, iteratee, callback)\n}\nvar eachSeries$1 = awaitify(eachSeries, 3);\n\n/**\n * Wrap an async function and ensure it calls its callback on a later tick of\n * the event loop. If the function already calls its callback on a next tick,\n * no extra deferral is added. This is useful for preventing stack overflows\n * (`RangeError: Maximum call stack size exceeded`) and generally keeping\n * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)\n * contained. ES2017 `async` functions are returned as-is -- they are immune\n * to Zalgo's corrupting influences, as they always resolve on a later tick.\n *\n * @name ensureAsync\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - an async function, one that expects a node-style\n * callback as its last argument.\n * @returns {AsyncFunction} Returns a wrapped function with the exact same call\n * signature as the function passed in.\n * @example\n *\n * function sometimesAsync(arg, callback) {\n * if (cache[arg]) {\n * return callback(null, cache[arg]); // this would be synchronous!!\n * } else {\n * doSomeIO(arg, callback); // this IO would be asynchronous\n * }\n * }\n *\n * // this has a risk of stack overflows if many results are cached in a row\n * async.mapSeries(args, sometimesAsync, done);\n *\n * // this will defer sometimesAsync's callback if necessary,\n * // preventing stack overflows\n * async.mapSeries(args, async.ensureAsync(sometimesAsync), done);\n */\nfunction ensureAsync(fn) {\n if (isAsync(fn)) return fn;\n return function (...args/*, callback*/) {\n var callback = args.pop();\n var sync = true;\n args.push((...innerArgs) => {\n if (sync) {\n setImmediate$1(() => callback(...innerArgs));\n } else {\n callback(...innerArgs);\n }\n });\n fn.apply(this, args);\n sync = false;\n };\n}\n\n/**\n * Returns `true` if every element in `coll` satisfies an async test. If any\n * iteratee call returns `false`, the main `callback` is immediately called.\n *\n * @name every\n * @static\n * @memberOf module:Collections\n * @method\n * @alias all\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in parallel.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n * // dir4 does not exist\n *\n * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt'];\n * const withMissingFileList = ['file1.txt','file2.txt','file4.txt'];\n *\n * // asynchronous function that checks if a file exists\n * function fileExists(file, callback) {\n * fs.access(file, fs.constants.F_OK, (err) => {\n * callback(null, !err);\n * });\n * }\n *\n * // Using callbacks\n * async.every(fileList, fileExists, function(err, result) {\n * console.log(result);\n * // true\n * // result is true since every file exists\n * });\n *\n * async.every(withMissingFileList, fileExists, function(err, result) {\n * console.log(result);\n * // false\n * // result is false since NOT every file exists\n * });\n *\n * // Using Promises\n * async.every(fileList, fileExists)\n * .then( result => {\n * console.log(result);\n * // true\n * // result is true since every file exists\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * async.every(withMissingFileList, fileExists)\n * .then( result => {\n * console.log(result);\n * // false\n * // result is false since NOT every file exists\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.every(fileList, fileExists);\n * console.log(result);\n * // true\n * // result is true since every file exists\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * async () => {\n * try {\n * let result = await async.every(withMissingFileList, fileExists);\n * console.log(result);\n * // false\n * // result is false since NOT every file exists\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction every(coll, iteratee, callback) {\n return _createTester(bool => !bool, res => !res)(eachOf$1, coll, iteratee, callback)\n}\nvar every$1 = awaitify(every, 3);\n\n/**\n * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.\n *\n * @name everyLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.every]{@link module:Collections.every}\n * @alias allLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in parallel.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction everyLimit(coll, limit, iteratee, callback) {\n return _createTester(bool => !bool, res => !res)(eachOfLimit$2(limit), coll, iteratee, callback)\n}\nvar everyLimit$1 = awaitify(everyLimit, 4);\n\n/**\n * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.\n *\n * @name everySeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.every]{@link module:Collections.every}\n * @alias allSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in series.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction everySeries(coll, iteratee, callback) {\n return _createTester(bool => !bool, res => !res)(eachOfSeries$1, coll, iteratee, callback)\n}\nvar everySeries$1 = awaitify(everySeries, 3);\n\nfunction filterArray(eachfn, arr, iteratee, callback) {\n var truthValues = new Array(arr.length);\n eachfn(arr, (x, index, iterCb) => {\n iteratee(x, (err, v) => {\n truthValues[index] = !!v;\n iterCb(err);\n });\n }, err => {\n if (err) return callback(err);\n var results = [];\n for (var i = 0; i < arr.length; i++) {\n if (truthValues[i]) results.push(arr[i]);\n }\n callback(null, results);\n });\n}\n\nfunction filterGeneric(eachfn, coll, iteratee, callback) {\n var results = [];\n eachfn(coll, (x, index, iterCb) => {\n iteratee(x, (err, v) => {\n if (err) return iterCb(err);\n if (v) {\n results.push({index, value: x});\n }\n iterCb(err);\n });\n }, err => {\n if (err) return callback(err);\n callback(null, results\n .sort((a, b) => a.index - b.index)\n .map(v => v.value));\n });\n}\n\nfunction _filter(eachfn, coll, iteratee, callback) {\n var filter = isArrayLike(coll) ? filterArray : filterGeneric;\n return filter(eachfn, coll, wrapAsync(iteratee), callback);\n}\n\n/**\n * Returns a new array of all the values in `coll` which pass an async truth\n * test. This operation is performed in parallel, but the results array will be\n * in the same order as the original.\n *\n * @name filter\n * @static\n * @memberOf module:Collections\n * @method\n * @alias select\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n *\n * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt'];\n *\n * // asynchronous function that checks if a file exists\n * function fileExists(file, callback) {\n * fs.access(file, fs.constants.F_OK, (err) => {\n * callback(null, !err);\n * });\n * }\n *\n * // Using callbacks\n * async.filter(files, fileExists, function(err, results) {\n * if(err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // [ 'dir1/file1.txt', 'dir2/file3.txt' ]\n * // results is now an array of the existing files\n * }\n * });\n *\n * // Using Promises\n * async.filter(files, fileExists)\n * .then(results => {\n * console.log(results);\n * // [ 'dir1/file1.txt', 'dir2/file3.txt' ]\n * // results is now an array of the existing files\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let results = await async.filter(files, fileExists);\n * console.log(results);\n * // [ 'dir1/file1.txt', 'dir2/file3.txt' ]\n * // results is now an array of the existing files\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction filter (coll, iteratee, callback) {\n return _filter(eachOf$1, coll, iteratee, callback)\n}\nvar filter$1 = awaitify(filter, 3);\n\n/**\n * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name filterLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @alias selectLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction filterLimit (coll, limit, iteratee, callback) {\n return _filter(eachOfLimit$2(limit), coll, iteratee, callback)\n}\nvar filterLimit$1 = awaitify(filterLimit, 4);\n\n/**\n * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time.\n *\n * @name filterSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @alias selectSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results)\n * @returns {Promise} a promise, if no callback provided\n */\nfunction filterSeries (coll, iteratee, callback) {\n return _filter(eachOfSeries$1, coll, iteratee, callback)\n}\nvar filterSeries$1 = awaitify(filterSeries, 3);\n\n/**\n * Calls the asynchronous function `fn` with a callback parameter that allows it\n * to call itself again, in series, indefinitely.\n\n * If an error is passed to the callback then `errback` is called with the\n * error, and execution stops, otherwise it will never be called.\n *\n * @name forever\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} fn - an async function to call repeatedly.\n * Invoked with (next).\n * @param {Function} [errback] - when `fn` passes an error to it's callback,\n * this function will be called, and execution stops. Invoked with (err).\n * @returns {Promise} a promise that rejects if an error occurs and an errback\n * is not passed\n * @example\n *\n * async.forever(\n * function(next) {\n * // next is suitable for passing to things that need a callback(err [, whatever]);\n * // it will result in this function being called again.\n * },\n * function(err) {\n * // if next is called with a value in its first parameter, it will appear\n * // in here as 'err', and execution will stop.\n * }\n * );\n */\nfunction forever(fn, errback) {\n var done = onlyOnce(errback);\n var task = wrapAsync(ensureAsync(fn));\n\n function next(err) {\n if (err) return done(err);\n if (err === false) return;\n task(next);\n }\n return next();\n}\nvar forever$1 = awaitify(forever, 2);\n\n/**\n * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time.\n *\n * @name groupByLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.groupBy]{@link module:Collections.groupBy}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whoses\n * properties are arrays of values which returned the corresponding key.\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction groupByLimit(coll, limit, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n return mapLimit$1(coll, limit, (val, iterCb) => {\n _iteratee(val, (err, key) => {\n if (err) return iterCb(err);\n return iterCb(err, {key, val});\n });\n }, (err, mapResults) => {\n var result = {};\n // from MDN, handle object having an `hasOwnProperty` prop\n var {hasOwnProperty} = Object.prototype;\n\n for (var i = 0; i < mapResults.length; i++) {\n if (mapResults[i]) {\n var {key} = mapResults[i];\n var {val} = mapResults[i];\n\n if (hasOwnProperty.call(result, key)) {\n result[key].push(val);\n } else {\n result[key] = [val];\n }\n }\n }\n\n return callback(err, result);\n });\n}\n\nvar groupByLimit$1 = awaitify(groupByLimit, 4);\n\n/**\n * Returns a new object, where each value corresponds to an array of items, from\n * `coll`, that returned the corresponding key. That is, the keys of the object\n * correspond to the values passed to the `iteratee` callback.\n *\n * Note: Since this function applies the `iteratee` to each item in parallel,\n * there is no guarantee that the `iteratee` functions will complete in order.\n * However, the values for each key in the `result` will be in the same order as\n * the original `coll`. For Objects, the values will roughly be in the order of\n * the original Objects' keys (but this can vary across JavaScript engines).\n *\n * @name groupBy\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whoses\n * properties are arrays of values which returned the corresponding key.\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n * // dir4 does not exist\n *\n * const files = ['dir1/file1.txt','dir2','dir4']\n *\n * // asynchronous function that detects file type as none, file, or directory\n * function detectFile(file, callback) {\n * fs.stat(file, function(err, stat) {\n * if (err) {\n * return callback(null, 'none');\n * }\n * callback(null, stat.isDirectory() ? 'directory' : 'file');\n * });\n * }\n *\n * //Using callbacks\n * async.groupBy(files, detectFile, function(err, result) {\n * if(err) {\n * console.log(err);\n * } else {\n *\t console.log(result);\n * // {\n * // file: [ 'dir1/file1.txt' ],\n * // none: [ 'dir4' ],\n * // directory: [ 'dir2']\n * // }\n * // result is object containing the files grouped by type\n * }\n * });\n *\n * // Using Promises\n * async.groupBy(files, detectFile)\n * .then( result => {\n * console.log(result);\n * // {\n * // file: [ 'dir1/file1.txt' ],\n * // none: [ 'dir4' ],\n * // directory: [ 'dir2']\n * // }\n * // result is object containing the files grouped by type\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.groupBy(files, detectFile);\n * console.log(result);\n * // {\n * // file: [ 'dir1/file1.txt' ],\n * // none: [ 'dir4' ],\n * // directory: [ 'dir2']\n * // }\n * // result is object containing the files grouped by type\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction groupBy (coll, iteratee, callback) {\n return groupByLimit$1(coll, Infinity, iteratee, callback)\n}\n\n/**\n * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time.\n *\n * @name groupBySeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.groupBy]{@link module:Collections.groupBy}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whose\n * properties are arrays of values which returned the corresponding key.\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction groupBySeries (coll, iteratee, callback) {\n return groupByLimit$1(coll, 1, iteratee, callback)\n}\n\n/**\n * Logs the result of an `async` function to the `console`. Only works in\n * Node.js or in browsers that support `console.log` and `console.error` (such\n * as FF and Chrome). If multiple arguments are returned from the async\n * function, `console.log` is called on each argument in order.\n *\n * @name log\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} function - The function you want to eventually apply\n * all arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n * setTimeout(function() {\n * callback(null, 'hello ' + name);\n * }, 1000);\n * };\n *\n * // in the node repl\n * node> async.log(hello, 'world');\n * 'hello world'\n */\nvar log = consoleFunc('log');\n\n/**\n * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name mapValuesLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.mapValues]{@link module:Collections.mapValues}\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapValuesLimit(obj, limit, iteratee, callback) {\n callback = once(callback);\n var newObj = {};\n var _iteratee = wrapAsync(iteratee);\n return eachOfLimit$2(limit)(obj, (val, key, next) => {\n _iteratee(val, key, (err, result) => {\n if (err) return next(err);\n newObj[key] = result;\n next(err);\n });\n }, err => callback(err, newObj));\n}\n\nvar mapValuesLimit$1 = awaitify(mapValuesLimit, 4);\n\n/**\n * A relative of [`map`]{@link module:Collections.map}, designed for use with objects.\n *\n * Produces a new Object by mapping each value of `obj` through the `iteratee`\n * function. The `iteratee` is called each `value` and `key` from `obj` and a\n * callback for when it has finished processing. Each of these callbacks takes\n * two arguments: an `error`, and the transformed item from `obj`. If `iteratee`\n * passes an error to its callback, the main `callback` (for the `mapValues`\n * function) is immediately called with the error.\n *\n * Note, the order of the keys in the result is not guaranteed. The keys will\n * be roughly in the order they complete, (but this is very engine-specific)\n *\n * @name mapValues\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // file1.txt is a file that is 1000 bytes in size\n * // file2.txt is a file that is 2000 bytes in size\n * // file3.txt is a file that is 3000 bytes in size\n * // file4.txt does not exist\n *\n * const fileMap = {\n * f1: 'file1.txt',\n * f2: 'file2.txt',\n * f3: 'file3.txt'\n * };\n *\n * const withMissingFileMap = {\n * f1: 'file1.txt',\n * f2: 'file2.txt',\n * f3: 'file4.txt'\n * };\n *\n * // asynchronous function that returns the file size in bytes\n * function getFileSizeInBytes(file, key, callback) {\n * fs.stat(file, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * callback(null, stat.size);\n * });\n * }\n *\n * // Using callbacks\n * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(result);\n * // result is now a map of file size in bytes for each file, e.g.\n * // {\n * // f1: 1000,\n * // f2: 2000,\n * // f3: 3000\n * // }\n * }\n * });\n *\n * // Error handling\n * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) {\n * if (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * } else {\n * console.log(result);\n * }\n * });\n *\n * // Using Promises\n * async.mapValues(fileMap, getFileSizeInBytes)\n * .then( result => {\n * console.log(result);\n * // result is now a map of file size in bytes for each file, e.g.\n * // {\n * // f1: 1000,\n * // f2: 2000,\n * // f3: 3000\n * // }\n * }).catch (err => {\n * console.log(err);\n * });\n *\n * // Error Handling\n * async.mapValues(withMissingFileMap, getFileSizeInBytes)\n * .then( result => {\n * console.log(result);\n * }).catch (err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.mapValues(fileMap, getFileSizeInBytes);\n * console.log(result);\n * // result is now a map of file size in bytes for each file, e.g.\n * // {\n * // f1: 1000,\n * // f2: 2000,\n * // f3: 3000\n * // }\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // Error Handling\n * async () => {\n * try {\n * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes);\n * console.log(result);\n * }\n * catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * }\n * }\n *\n */\nfunction mapValues(obj, iteratee, callback) {\n return mapValuesLimit$1(obj, Infinity, iteratee, callback)\n}\n\n/**\n * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time.\n *\n * @name mapValuesSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.mapValues]{@link module:Collections.mapValues}\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapValuesSeries(obj, iteratee, callback) {\n return mapValuesLimit$1(obj, 1, iteratee, callback)\n}\n\n/**\n * Caches the results of an async function. When creating a hash to store\n * function results against, the callback is omitted from the hash and an\n * optional hash function can be used.\n *\n * **Note: if the async function errs, the result will not be cached and\n * subsequent calls will call the wrapped function.**\n *\n * If no hash function is specified, the first argument is used as a hash key,\n * which may work reasonably if it is a string or a data type that converts to a\n * distinct string. Note that objects and arrays will not behave reasonably.\n * Neither will cases where the other arguments are significant. In such cases,\n * specify your own hash function.\n *\n * The cache of results is exposed as the `memo` property of the function\n * returned by `memoize`.\n *\n * @name memoize\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - The async function to proxy and cache results from.\n * @param {Function} hasher - An optional function for generating a custom hash\n * for storing results. It has all the arguments applied to it apart from the\n * callback, and must be synchronous.\n * @returns {AsyncFunction} a memoized version of `fn`\n * @example\n *\n * var slow_fn = function(name, callback) {\n * // do something\n * callback(null, result);\n * };\n * var fn = async.memoize(slow_fn);\n *\n * // fn can now be used as if it were slow_fn\n * fn('some name', function() {\n * // callback\n * });\n */\nfunction memoize(fn, hasher = v => v) {\n var memo = Object.create(null);\n var queues = Object.create(null);\n var _fn = wrapAsync(fn);\n var memoized = initialParams((args, callback) => {\n var key = hasher(...args);\n if (key in memo) {\n setImmediate$1(() => callback(null, ...memo[key]));\n } else if (key in queues) {\n queues[key].push(callback);\n } else {\n queues[key] = [callback];\n _fn(...args, (err, ...resultArgs) => {\n // #1465 don't memoize if an error occurred\n if (!err) {\n memo[key] = resultArgs;\n }\n var q = queues[key];\n delete queues[key];\n for (var i = 0, l = q.length; i < l; i++) {\n q[i](err, ...resultArgs);\n }\n });\n }\n });\n memoized.memo = memo;\n memoized.unmemoized = fn;\n return memoized;\n}\n\n/* istanbul ignore file */\n\n/**\n * Calls `callback` on a later loop around the event loop. In Node.js this just\n * calls `process.nextTick`. In the browser it will use `setImmediate` if\n * available, otherwise `setTimeout(callback, 0)`, which means other higher\n * priority events may precede the execution of `callback`.\n *\n * This is used internally for browser-compatibility purposes.\n *\n * @name nextTick\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.setImmediate]{@link module:Utils.setImmediate}\n * @category Util\n * @param {Function} callback - The function to call on a later loop around\n * the event loop. Invoked with (args...).\n * @param {...*} args... - any number of additional arguments to pass to the\n * callback on the next tick.\n * @example\n *\n * var call_order = [];\n * async.nextTick(function() {\n * call_order.push('two');\n * // call_order now equals ['one','two']\n * });\n * call_order.push('one');\n *\n * async.setImmediate(function (a, b, c) {\n * // a, b, and c equal 1, 2, and 3\n * }, 1, 2, 3);\n */\nvar _defer;\n\nif (hasNextTick) {\n _defer = process.nextTick;\n} else if (hasSetImmediate) {\n _defer = setImmediate;\n} else {\n _defer = fallback;\n}\n\nvar nextTick = wrap(_defer);\n\nvar _parallel = awaitify((eachfn, tasks, callback) => {\n var results = isArrayLike(tasks) ? [] : {};\n\n eachfn(tasks, (task, key, taskCb) => {\n wrapAsync(task)((err, ...result) => {\n if (result.length < 2) {\n [result] = result;\n }\n results[key] = result;\n taskCb(err);\n });\n }, err => callback(err, results));\n}, 3);\n\n/**\n * Run the `tasks` collection of functions in parallel, without waiting until\n * the previous function has completed. If any of the functions pass an error to\n * its callback, the main `callback` is immediately called with the value of the\n * error. Once the `tasks` have completed, the results are passed to the final\n * `callback` as an array.\n *\n * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about\n * parallel execution of code. If your tasks do not use any timers or perform\n * any I/O, they will actually be executed in series. Any synchronous setup\n * sections for each task will happen one after the other. JavaScript remains\n * single-threaded.\n *\n * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the\n * execution of other tasks when a task fails.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function and the results will be passed to the final `callback`\n * as an object instead of an array. This can be a more readable way of handling\n * results from {@link async.parallel}.\n *\n * @name parallel\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of\n * [async functions]{@link AsyncFunction} to run.\n * Each async function can complete with any number of optional `result` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed successfully. This function gets a results array\n * (or object) containing all the result arguments passed to the task callbacks.\n * Invoked with (err, results).\n * @returns {Promise} a promise, if a callback is not passed\n *\n * @example\n *\n * //Using Callbacks\n * async.parallel([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ], function(err, results) {\n * console.log(results);\n * // results is equal to ['one','two'] even though\n * // the second function had a shorter timeout.\n * });\n *\n * // an example using an object instead of an array\n * async.parallel({\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * callback(null, 2);\n * }, 100);\n * }\n * }, function(err, results) {\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * });\n *\n * //Using Promises\n * async.parallel([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ]).then(results => {\n * console.log(results);\n * // results is equal to ['one','two'] even though\n * // the second function had a shorter timeout.\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // an example using an object instead of an array\n * async.parallel({\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * callback(null, 2);\n * }, 100);\n * }\n * }).then(results => {\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * //Using async/await\n * async () => {\n * try {\n * let results = await async.parallel([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ]);\n * console.log(results);\n * // results is equal to ['one','two'] even though\n * // the second function had a shorter timeout.\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // an example using an object instead of an array\n * async () => {\n * try {\n * let results = await async.parallel({\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * callback(null, 2);\n * }, 100);\n * }\n * });\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction parallel(tasks, callback) {\n return _parallel(eachOf$1, tasks, callback);\n}\n\n/**\n * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name parallelLimit\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.parallel]{@link module:ControlFlow.parallel}\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of\n * [async functions]{@link AsyncFunction} to run.\n * Each async function can complete with any number of optional `result` values.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed successfully. This function gets a results array\n * (or object) containing all the result arguments passed to the task callbacks.\n * Invoked with (err, results).\n * @returns {Promise} a promise, if a callback is not passed\n */\nfunction parallelLimit(tasks, limit, callback) {\n return _parallel(eachOfLimit$2(limit), tasks, callback);\n}\n\n/**\n * A queue of tasks for the worker function to complete.\n * @typedef {Iterable} QueueObject\n * @memberOf module:ControlFlow\n * @property {Function} length - a function returning the number of items\n * waiting to be processed. Invoke with `queue.length()`.\n * @property {boolean} started - a boolean indicating whether or not any\n * items have been pushed and processed by the queue.\n * @property {Function} running - a function returning the number of items\n * currently being processed. Invoke with `queue.running()`.\n * @property {Function} workersList - a function returning the array of items\n * currently being processed. Invoke with `queue.workersList()`.\n * @property {Function} idle - a function returning false if there are items\n * waiting or being processed, or true if not. Invoke with `queue.idle()`.\n * @property {number} concurrency - an integer for determining how many `worker`\n * functions should be run in parallel. This property can be changed after a\n * `queue` is created to alter the concurrency on-the-fly.\n * @property {number} payload - an integer that specifies how many items are\n * passed to the worker function at a time. only applies if this is a\n * [cargo]{@link module:ControlFlow.cargo} object\n * @property {AsyncFunction} push - add a new task to the `queue`. Calls `callback`\n * once the `worker` has finished processing the task. Instead of a single task,\n * a `tasks` array can be submitted. The respective callback is used for every\n * task in the list. Invoke with `queue.push(task, [callback])`,\n * @property {AsyncFunction} unshift - add a new task to the front of the `queue`.\n * Invoke with `queue.unshift(task, [callback])`.\n * @property {AsyncFunction} pushAsync - the same as `q.push`, except this returns\n * a promise that rejects if an error occurs.\n * @property {AsyncFunction} unshiftAsync - the same as `q.unshift`, except this returns\n * a promise that rejects if an error occurs.\n * @property {Function} remove - remove items from the queue that match a test\n * function. The test function will be passed an object with a `data` property,\n * and a `priority` property, if this is a\n * [priorityQueue]{@link module:ControlFlow.priorityQueue} object.\n * Invoked with `queue.remove(testFn)`, where `testFn` is of the form\n * `function ({data, priority}) {}` and returns a Boolean.\n * @property {Function} saturated - a function that sets a callback that is\n * called when the number of running workers hits the `concurrency` limit, and\n * further tasks will be queued. If the callback is omitted, `q.saturated()`\n * returns a promise for the next occurrence.\n * @property {Function} unsaturated - a function that sets a callback that is\n * called when the number of running workers is less than the `concurrency` &\n * `buffer` limits, and further tasks will not be queued. If the callback is\n * omitted, `q.unsaturated()` returns a promise for the next occurrence.\n * @property {number} buffer - A minimum threshold buffer in order to say that\n * the `queue` is `unsaturated`.\n * @property {Function} empty - a function that sets a callback that is called\n * when the last item from the `queue` is given to a `worker`. If the callback\n * is omitted, `q.empty()` returns a promise for the next occurrence.\n * @property {Function} drain - a function that sets a callback that is called\n * when the last item from the `queue` has returned from the `worker`. If the\n * callback is omitted, `q.drain()` returns a promise for the next occurrence.\n * @property {Function} error - a function that sets a callback that is called\n * when a task errors. Has the signature `function(error, task)`. If the\n * callback is omitted, `error()` returns a promise that rejects on the next\n * error.\n * @property {boolean} paused - a boolean for determining whether the queue is\n * in a paused state.\n * @property {Function} pause - a function that pauses the processing of tasks\n * until `resume()` is called. Invoke with `queue.pause()`.\n * @property {Function} resume - a function that resumes the processing of\n * queued tasks when the queue is paused. Invoke with `queue.resume()`.\n * @property {Function} kill - a function that removes the `drain` callback and\n * empties remaining tasks from the queue forcing it to go idle. No more tasks\n * should be pushed to the queue after calling this function. Invoke with `queue.kill()`.\n *\n * @example\n * const q = async.queue(worker, 2)\n * q.push(item1)\n * q.push(item2)\n * q.push(item3)\n * // queues are iterable, spread into an array to inspect\n * const items = [...q] // [item1, item2, item3]\n * // or use for of\n * for (let item of q) {\n * console.log(item)\n * }\n *\n * q.drain(() => {\n * console.log('all done')\n * })\n * // or\n * await q.drain()\n */\n\n/**\n * Creates a `queue` object with the specified `concurrency`. Tasks added to the\n * `queue` are processed in parallel (up to the `concurrency` limit). If all\n * `worker`s are in progress, the task is queued until one becomes available.\n * Once a `worker` completes a `task`, that `task`'s callback is called.\n *\n * @name queue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * `q.push()`. Invoked with (task, callback).\n * @param {number} [concurrency=1] - An `integer` for determining how many\n * `worker` functions should be run in parallel. If omitted, the concurrency\n * defaults to `1`. If the concurrency is `0`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be\n * attached as certain properties to listen for specific events during the\n * lifecycle of the queue.\n * @example\n *\n * // create a queue object with concurrency 2\n * var q = async.queue(function(task, callback) {\n * console.log('hello ' + task.name);\n * callback();\n * }, 2);\n *\n * // assign a callback\n * q.drain(function() {\n * console.log('all items have been processed');\n * });\n * // or await the end\n * await q.drain()\n *\n * // assign an error callback\n * q.error(function(err, task) {\n * console.error('task experienced an error');\n * });\n *\n * // add some items to the queue\n * q.push({name: 'foo'}, function(err) {\n * console.log('finished processing foo');\n * });\n * // callback is optional\n * q.push({name: 'bar'});\n *\n * // add some items to the queue (batch-wise)\n * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) {\n * console.log('finished processing item');\n * });\n *\n * // add some items to the front of the queue\n * q.unshift({name: 'bar'}, function (err) {\n * console.log('finished processing bar');\n * });\n */\nfunction queue (worker, concurrency) {\n var _worker = wrapAsync(worker);\n return queue$1((items, cb) => {\n _worker(items[0], cb);\n }, concurrency, 1);\n}\n\n// Binary min-heap implementation used for priority queue.\n// Implementation is stable, i.e. push time is considered for equal priorities\nclass Heap {\n constructor() {\n this.heap = [];\n this.pushCount = Number.MIN_SAFE_INTEGER;\n }\n\n get length() {\n return this.heap.length;\n }\n\n empty () {\n this.heap = [];\n return this;\n }\n\n percUp(index) {\n let p;\n\n while (index > 0 && smaller(this.heap[index], this.heap[p=parent(index)])) {\n let t = this.heap[index];\n this.heap[index] = this.heap[p];\n this.heap[p] = t;\n\n index = p;\n }\n }\n\n percDown(index) {\n let l;\n\n while ((l=leftChi(index)) < this.heap.length) {\n if (l+1 < this.heap.length && smaller(this.heap[l+1], this.heap[l])) {\n l = l+1;\n }\n\n if (smaller(this.heap[index], this.heap[l])) {\n break;\n }\n\n let t = this.heap[index];\n this.heap[index] = this.heap[l];\n this.heap[l] = t;\n\n index = l;\n }\n }\n\n push(node) {\n node.pushCount = ++this.pushCount;\n this.heap.push(node);\n this.percUp(this.heap.length-1);\n }\n\n unshift(node) {\n return this.heap.push(node);\n }\n\n shift() {\n let [top] = this.heap;\n\n this.heap[0] = this.heap[this.heap.length-1];\n this.heap.pop();\n this.percDown(0);\n\n return top;\n }\n\n toArray() {\n return [...this];\n }\n\n *[Symbol.iterator] () {\n for (let i = 0; i < this.heap.length; i++) {\n yield this.heap[i].data;\n }\n }\n\n remove (testFn) {\n let j = 0;\n for (let i = 0; i < this.heap.length; i++) {\n if (!testFn(this.heap[i])) {\n this.heap[j] = this.heap[i];\n j++;\n }\n }\n\n this.heap.splice(j);\n\n for (let i = parent(this.heap.length-1); i >= 0; i--) {\n this.percDown(i);\n }\n\n return this;\n }\n}\n\nfunction leftChi(i) {\n return (i<<1)+1;\n}\n\nfunction parent(i) {\n return ((i+1)>>1)-1;\n}\n\nfunction smaller(x, y) {\n if (x.priority !== y.priority) {\n return x.priority < y.priority;\n }\n else {\n return x.pushCount < y.pushCount;\n }\n}\n\n/**\n * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and\n * completed in ascending priority order.\n *\n * @name priorityQueue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * `q.push()`.\n * Invoked with (task, callback).\n * @param {number} concurrency - An `integer` for determining how many `worker`\n * functions should be run in parallel. If omitted, the concurrency defaults to\n * `1`. If the concurrency is `0`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are three\n * differences between `queue` and `priorityQueue` objects:\n * * `push(task, priority, [callback])` - `priority` should be a number. If an\n * array of `tasks` is given, all tasks will be assigned the same priority.\n * * `pushAsync(task, priority, [callback])` - the same as `priorityQueue.push`,\n * except this returns a promise that rejects if an error occurs.\n * * The `unshift` and `unshiftAsync` methods were removed.\n */\nfunction priorityQueue(worker, concurrency) {\n // Start with a normal queue\n var q = queue(worker, concurrency);\n\n var {\n push,\n pushAsync\n } = q;\n\n q._tasks = new Heap();\n q._createTaskItem = ({data, priority}, callback) => {\n return {\n data,\n priority,\n callback\n };\n };\n\n function createDataItems(tasks, priority) {\n if (!Array.isArray(tasks)) {\n return {data: tasks, priority};\n }\n return tasks.map(data => { return {data, priority}; });\n }\n\n // Override push to accept second parameter representing priority\n q.push = function(data, priority = 0, callback) {\n return push(createDataItems(data, priority), callback);\n };\n\n q.pushAsync = function(data, priority = 0, callback) {\n return pushAsync(createDataItems(data, priority), callback);\n };\n\n // Remove unshift functions\n delete q.unshift;\n delete q.unshiftAsync;\n\n return q;\n}\n\n/**\n * Runs the `tasks` array of functions in parallel, without waiting until the\n * previous function has completed. Once any of the `tasks` complete or pass an\n * error to its callback, the main `callback` is immediately called. It's\n * equivalent to `Promise.race()`.\n *\n * @name race\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction}\n * to run. Each function can complete with an optional `result` value.\n * @param {Function} callback - A callback to run once any of the functions have\n * completed. This function gets an error or result from the first function that\n * completed. Invoked with (err, result).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * async.race([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ],\n * // main callback\n * function(err, result) {\n * // the result will be equal to 'two' as it finishes earlier\n * });\n */\nfunction race(tasks, callback) {\n callback = once(callback);\n if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions'));\n if (!tasks.length) return callback();\n for (var i = 0, l = tasks.length; i < l; i++) {\n wrapAsync(tasks[i])(callback);\n }\n}\n\nvar race$1 = awaitify(race, 2);\n\n/**\n * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order.\n *\n * @name reduceRight\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reduce]{@link module:Collections.reduce}\n * @alias foldr\n * @category Collection\n * @param {Array} array - A collection to iterate over.\n * @param {*} memo - The initial state of the reduction.\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * array to produce the next step in the reduction.\n * The `iteratee` should complete with the next state of the reduction.\n * If the iteratee completes with an error, the reduction is stopped and the\n * main `callback` is immediately called with the error.\n * Invoked with (memo, item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result is the reduced value. Invoked with\n * (err, result).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction reduceRight (array, memo, iteratee, callback) {\n var reversed = [...array].reverse();\n return reduce$1(reversed, memo, iteratee, callback);\n}\n\n/**\n * Wraps the async function in another function that always completes with a\n * result object, even when it errors.\n *\n * The result object has either the property `error` or `value`.\n *\n * @name reflect\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - The async function you want to wrap\n * @returns {Function} - A function that always passes null to it's callback as\n * the error. The second argument to the callback will be an `object` with\n * either an `error` or a `value` property.\n * @example\n *\n * async.parallel([\n * async.reflect(function(callback) {\n * // do some stuff ...\n * callback(null, 'one');\n * }),\n * async.reflect(function(callback) {\n * // do some more stuff but error ...\n * callback('bad stuff happened');\n * }),\n * async.reflect(function(callback) {\n * // do some more stuff ...\n * callback(null, 'two');\n * })\n * ],\n * // optional callback\n * function(err, results) {\n * // values\n * // results[0].value = 'one'\n * // results[1].error = 'bad stuff happened'\n * // results[2].value = 'two'\n * });\n */\nfunction reflect(fn) {\n var _fn = wrapAsync(fn);\n return initialParams(function reflectOn(args, reflectCallback) {\n args.push((error, ...cbArgs) => {\n let retVal = {};\n if (error) {\n retVal.error = error;\n }\n if (cbArgs.length > 0){\n var value = cbArgs;\n if (cbArgs.length <= 1) {\n [value] = cbArgs;\n }\n retVal.value = value;\n }\n reflectCallback(null, retVal);\n });\n\n return _fn.apply(this, args);\n });\n}\n\n/**\n * A helper function that wraps an array or an object of functions with `reflect`.\n *\n * @name reflectAll\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.reflect]{@link module:Utils.reflect}\n * @category Util\n * @param {Array|Object|Iterable} tasks - The collection of\n * [async functions]{@link AsyncFunction} to wrap in `async.reflect`.\n * @returns {Array} Returns an array of async functions, each wrapped in\n * `async.reflect`\n * @example\n *\n * let tasks = [\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * // do some more stuff but error ...\n * callback(new Error('bad stuff happened'));\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ];\n *\n * async.parallel(async.reflectAll(tasks),\n * // optional callback\n * function(err, results) {\n * // values\n * // results[0].value = 'one'\n * // results[1].error = Error('bad stuff happened')\n * // results[2].value = 'two'\n * });\n *\n * // an example using an object instead of an array\n * let tasks = {\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * two: function(callback) {\n * callback('two');\n * },\n * three: function(callback) {\n * setTimeout(function() {\n * callback(null, 'three');\n * }, 100);\n * }\n * };\n *\n * async.parallel(async.reflectAll(tasks),\n * // optional callback\n * function(err, results) {\n * // values\n * // results.one.value = 'one'\n * // results.two.error = 'two'\n * // results.three.value = 'three'\n * });\n */\nfunction reflectAll(tasks) {\n var results;\n if (Array.isArray(tasks)) {\n results = tasks.map(reflect);\n } else {\n results = {};\n Object.keys(tasks).forEach(key => {\n results[key] = reflect.call(this, tasks[key]);\n });\n }\n return results;\n}\n\nfunction reject$2(eachfn, arr, _iteratee, callback) {\n const iteratee = wrapAsync(_iteratee);\n return _filter(eachfn, arr, (value, cb) => {\n iteratee(value, (err, v) => {\n cb(err, !v);\n });\n }, callback);\n}\n\n/**\n * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test.\n *\n * @name reject\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n *\n * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt'];\n *\n * // asynchronous function that checks if a file exists\n * function fileExists(file, callback) {\n * fs.access(file, fs.constants.F_OK, (err) => {\n * callback(null, !err);\n * });\n * }\n *\n * // Using callbacks\n * async.reject(fileList, fileExists, function(err, results) {\n * // [ 'dir3/file6.txt' ]\n * // results now equals an array of the non-existing files\n * });\n *\n * // Using Promises\n * async.reject(fileList, fileExists)\n * .then( results => {\n * console.log(results);\n * // [ 'dir3/file6.txt' ]\n * // results now equals an array of the non-existing files\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let results = await async.reject(fileList, fileExists);\n * console.log(results);\n * // [ 'dir3/file6.txt' ]\n * // results now equals an array of the non-existing files\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction reject (coll, iteratee, callback) {\n return reject$2(eachOf$1, coll, iteratee, callback)\n}\nvar reject$1 = awaitify(reject, 3);\n\n/**\n * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name rejectLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reject]{@link module:Collections.reject}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction rejectLimit (coll, limit, iteratee, callback) {\n return reject$2(eachOfLimit$2(limit), coll, iteratee, callback)\n}\nvar rejectLimit$1 = awaitify(rejectLimit, 4);\n\n/**\n * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time.\n *\n * @name rejectSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reject]{@link module:Collections.reject}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction rejectSeries (coll, iteratee, callback) {\n return reject$2(eachOfSeries$1, coll, iteratee, callback)\n}\nvar rejectSeries$1 = awaitify(rejectSeries, 3);\n\nfunction constant(value) {\n return function () {\n return value;\n }\n}\n\n/**\n * Attempts to get a successful response from `task` no more than `times` times\n * before returning an error. If the task is successful, the `callback` will be\n * passed the result of the successful task. If all attempts fail, the callback\n * will be passed the error and result (if any) of the final attempt.\n *\n * @name retry\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @see [async.retryable]{@link module:ControlFlow.retryable}\n * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an\n * object with `times` and `interval` or a number.\n * * `times` - The number of attempts to make before giving up. The default\n * is `5`.\n * * `interval` - The time to wait between retries, in milliseconds. The\n * default is `0`. The interval may also be specified as a function of the\n * retry count (see example).\n * * `errorFilter` - An optional synchronous function that is invoked on\n * erroneous result. If it returns `true` the retry attempts will continue;\n * if the function returns `false` the retry flow is aborted with the current\n * attempt's error and result being returned to the final callback.\n * Invoked with (err).\n * * If `opts` is a number, the number specifies the number of times to retry,\n * with the default interval of `0`.\n * @param {AsyncFunction} task - An async function to retry.\n * Invoked with (callback).\n * @param {Function} [callback] - An optional callback which is called when the\n * task has succeeded, or after the final failed attempt. It receives the `err`\n * and `result` arguments of the last attempt at completing the `task`. Invoked\n * with (err, results).\n * @returns {Promise} a promise if no callback provided\n *\n * @example\n *\n * // The `retry` function can be used as a stand-alone control flow by passing\n * // a callback, as shown below:\n *\n * // try calling apiMethod 3 times\n * async.retry(3, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod 3 times, waiting 200 ms between each retry\n * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod 10 times with exponential backoff\n * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds)\n * async.retry({\n * times: 10,\n * interval: function(retryCount) {\n * return 50 * Math.pow(2, retryCount);\n * }\n * }, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod the default 5 times no delay between each retry\n * async.retry(apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod only when error condition satisfies, all other\n * // errors will abort the retry control flow and return to final callback\n * async.retry({\n * errorFilter: function(err) {\n * return err.message === 'Temporary error'; // only retry on a specific error\n * }\n * }, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // to retry individual methods that are not as reliable within other\n * // control flow functions, use the `retryable` wrapper:\n * async.auto({\n * users: api.getUsers.bind(api),\n * payments: async.retryable(3, api.getPayments.bind(api))\n * }, function(err, results) {\n * // do something with the results\n * });\n *\n */\nconst DEFAULT_TIMES = 5;\nconst DEFAULT_INTERVAL = 0;\n\nfunction retry(opts, task, callback) {\n var options = {\n times: DEFAULT_TIMES,\n intervalFunc: constant(DEFAULT_INTERVAL)\n };\n\n if (arguments.length < 3 && typeof opts === 'function') {\n callback = task || promiseCallback();\n task = opts;\n } else {\n parseTimes(options, opts);\n callback = callback || promiseCallback();\n }\n\n if (typeof task !== 'function') {\n throw new Error(\"Invalid arguments for async.retry\");\n }\n\n var _task = wrapAsync(task);\n\n var attempt = 1;\n function retryAttempt() {\n _task((err, ...args) => {\n if (err === false) return\n if (err && attempt++ < options.times &&\n (typeof options.errorFilter != 'function' ||\n options.errorFilter(err))) {\n setTimeout(retryAttempt, options.intervalFunc(attempt - 1));\n } else {\n callback(err, ...args);\n }\n });\n }\n\n retryAttempt();\n return callback[PROMISE_SYMBOL]\n}\n\nfunction parseTimes(acc, t) {\n if (typeof t === 'object') {\n acc.times = +t.times || DEFAULT_TIMES;\n\n acc.intervalFunc = typeof t.interval === 'function' ?\n t.interval :\n constant(+t.interval || DEFAULT_INTERVAL);\n\n acc.errorFilter = t.errorFilter;\n } else if (typeof t === 'number' || typeof t === 'string') {\n acc.times = +t || DEFAULT_TIMES;\n } else {\n throw new Error(\"Invalid arguments for async.retry\");\n }\n}\n\n/**\n * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method\n * wraps a task and makes it retryable, rather than immediately calling it\n * with retries.\n *\n * @name retryable\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.retry]{@link module:ControlFlow.retry}\n * @category Control Flow\n * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional\n * options, exactly the same as from `retry`, except for a `opts.arity` that\n * is the arity of the `task` function, defaulting to `task.length`\n * @param {AsyncFunction} task - the asynchronous function to wrap.\n * This function will be passed any arguments passed to the returned wrapper.\n * Invoked with (...args, callback).\n * @returns {AsyncFunction} The wrapped function, which when invoked, will\n * retry on an error, based on the parameters specified in `opts`.\n * This function will accept the same parameters as `task`.\n * @example\n *\n * async.auto({\n * dep1: async.retryable(3, getFromFlakyService),\n * process: [\"dep1\", async.retryable(3, function (results, cb) {\n * maybeProcessData(results.dep1, cb);\n * })]\n * }, callback);\n */\nfunction retryable (opts, task) {\n if (!task) {\n task = opts;\n opts = null;\n }\n let arity = (opts && opts.arity) || task.length;\n if (isAsync(task)) {\n arity += 1;\n }\n var _task = wrapAsync(task);\n return initialParams((args, callback) => {\n if (args.length < arity - 1 || callback == null) {\n args.push(callback);\n callback = promiseCallback();\n }\n function taskFn(cb) {\n _task(...args, cb);\n }\n\n if (opts) retry(opts, taskFn, callback);\n else retry(taskFn, callback);\n\n return callback[PROMISE_SYMBOL]\n });\n}\n\n/**\n * Run the functions in the `tasks` collection in series, each one running once\n * the previous function has completed. If any functions in the series pass an\n * error to its callback, no more functions are run, and `callback` is\n * immediately called with the value of the error. Otherwise, `callback`\n * receives an array of results when `tasks` have completed.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function, and the results will be passed to the final `callback`\n * as an object instead of an array. This can be a more readable way of handling\n * results from {@link async.series}.\n *\n * **Note** that while many implementations preserve the order of object\n * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)\n * explicitly states that\n *\n * > The mechanics and order of enumerating the properties is not specified.\n *\n * So if you rely on the order in which your series of functions are executed,\n * and want this to work on all platforms, consider using an array.\n *\n * @name series\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing\n * [async functions]{@link AsyncFunction} to run in series.\n * Each function can complete with any number of optional `result` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This function gets a results array (or object)\n * containing all the result arguments passed to the `task` callbacks. Invoked\n * with (err, result).\n * @return {Promise} a promise, if no callback is passed\n * @example\n *\n * //Using Callbacks\n * async.series([\n * function(callback) {\n * setTimeout(function() {\n * // do some async task\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * // then do another async task\n * callback(null, 'two');\n * }, 100);\n * }\n * ], function(err, results) {\n * console.log(results);\n * // results is equal to ['one','two']\n * });\n *\n * // an example using objects instead of arrays\n * async.series({\n * one: function(callback) {\n * setTimeout(function() {\n * // do some async task\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * // then do another async task\n * callback(null, 2);\n * }, 100);\n * }\n * }, function(err, results) {\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * });\n *\n * //Using Promises\n * async.series([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ]).then(results => {\n * console.log(results);\n * // results is equal to ['one','two']\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // an example using an object instead of an array\n * async.series({\n * one: function(callback) {\n * setTimeout(function() {\n * // do some async task\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * // then do another async task\n * callback(null, 2);\n * }, 100);\n * }\n * }).then(results => {\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * //Using async/await\n * async () => {\n * try {\n * let results = await async.series([\n * function(callback) {\n * setTimeout(function() {\n * // do some async task\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * // then do another async task\n * callback(null, 'two');\n * }, 100);\n * }\n * ]);\n * console.log(results);\n * // results is equal to ['one','two']\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // an example using an object instead of an array\n * async () => {\n * try {\n * let results = await async.parallel({\n * one: function(callback) {\n * setTimeout(function() {\n * // do some async task\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * // then do another async task\n * callback(null, 2);\n * }, 100);\n * }\n * });\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction series(tasks, callback) {\n return _parallel(eachOfSeries$1, tasks, callback);\n}\n\n/**\n * Returns `true` if at least one element in the `coll` satisfies an async test.\n * If any iteratee call returns `true`, the main `callback` is immediately\n * called.\n *\n * @name some\n * @static\n * @memberOf module:Collections\n * @method\n * @alias any\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in parallel.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n * // dir4 does not exist\n *\n * // asynchronous function that checks if a file exists\n * function fileExists(file, callback) {\n * fs.access(file, fs.constants.F_OK, (err) => {\n * callback(null, !err);\n * });\n * }\n *\n * // Using callbacks\n * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists,\n * function(err, result) {\n * console.log(result);\n * // true\n * // result is true since some file in the list exists\n * }\n *);\n *\n * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists,\n * function(err, result) {\n * console.log(result);\n * // false\n * // result is false since none of the files exists\n * }\n *);\n *\n * // Using Promises\n * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists)\n * .then( result => {\n * console.log(result);\n * // true\n * // result is true since some file in the list exists\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists)\n * .then( result => {\n * console.log(result);\n * // false\n * // result is false since none of the files exists\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists);\n * console.log(result);\n * // true\n * // result is true since some file in the list exists\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * async () => {\n * try {\n * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists);\n * console.log(result);\n * // false\n * // result is false since none of the files exists\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction some(coll, iteratee, callback) {\n return _createTester(Boolean, res => res)(eachOf$1, coll, iteratee, callback)\n}\nvar some$1 = awaitify(some, 3);\n\n/**\n * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.\n *\n * @name someLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.some]{@link module:Collections.some}\n * @alias anyLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in parallel.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction someLimit(coll, limit, iteratee, callback) {\n return _createTester(Boolean, res => res)(eachOfLimit$2(limit), coll, iteratee, callback)\n}\nvar someLimit$1 = awaitify(someLimit, 4);\n\n/**\n * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.\n *\n * @name someSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.some]{@link module:Collections.some}\n * @alias anySeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in series.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction someSeries(coll, iteratee, callback) {\n return _createTester(Boolean, res => res)(eachOfSeries$1, coll, iteratee, callback)\n}\nvar someSeries$1 = awaitify(someSeries, 3);\n\n/**\n * Sorts a list by the results of running each `coll` value through an async\n * `iteratee`.\n *\n * @name sortBy\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a value to use as the sort criteria as\n * its `result`.\n * Invoked with (item, callback).\n * @param {Function} callback - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is the items\n * from the original `coll` sorted by the values returned by the `iteratee`\n * calls. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback passed\n * @example\n *\n * // bigfile.txt is a file that is 251100 bytes in size\n * // mediumfile.txt is a file that is 11000 bytes in size\n * // smallfile.txt is a file that is 121 bytes in size\n *\n * // asynchronous function that returns the file size in bytes\n * function getFileSizeInBytes(file, callback) {\n * fs.stat(file, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * callback(null, stat.size);\n * });\n * }\n *\n * // Using callbacks\n * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes,\n * function(err, results) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // results is now the original array of files sorted by\n * // file size (ascending by default), e.g.\n * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt']\n * }\n * }\n * );\n *\n * // By modifying the callback parameter the\n * // sorting order can be influenced:\n *\n * // ascending order\n * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) {\n * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) {\n * if (getFileSizeErr) return callback(getFileSizeErr);\n * callback(null, fileSize);\n * });\n * }, function(err, results) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // results is now the original array of files sorted by\n * // file size (ascending by default), e.g.\n * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt']\n * }\n * }\n * );\n *\n * // descending order\n * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) {\n * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) {\n * if (getFileSizeErr) {\n * return callback(getFileSizeErr);\n * }\n * callback(null, fileSize * -1);\n * });\n * }, function(err, results) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // results is now the original array of files sorted by\n * // file size (ascending by default), e.g.\n * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt']\n * }\n * }\n * );\n *\n * // Error handling\n * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes,\n * function(err, results) {\n * if (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * } else {\n * console.log(results);\n * }\n * }\n * );\n *\n * // Using Promises\n * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes)\n * .then( results => {\n * console.log(results);\n * // results is now the original array of files sorted by\n * // file size (ascending by default), e.g.\n * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt']\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Error handling\n * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes)\n * .then( results => {\n * console.log(results);\n * }).catch( err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * });\n *\n * // Using async/await\n * (async () => {\n * try {\n * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes);\n * console.log(results);\n * // results is now the original array of files sorted by\n * // file size (ascending by default), e.g.\n * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt']\n * }\n * catch (err) {\n * console.log(err);\n * }\n * })();\n *\n * // Error handling\n * async () => {\n * try {\n * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes);\n * console.log(results);\n * }\n * catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * }\n * }\n *\n */\nfunction sortBy (coll, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n return map$1(coll, (x, iterCb) => {\n _iteratee(x, (err, criteria) => {\n if (err) return iterCb(err);\n iterCb(err, {value: x, criteria});\n });\n }, (err, results) => {\n if (err) return callback(err);\n callback(null, results.sort(comparator).map(v => v.value));\n });\n\n function comparator(left, right) {\n var a = left.criteria, b = right.criteria;\n return a < b ? -1 : a > b ? 1 : 0;\n }\n}\nvar sortBy$1 = awaitify(sortBy, 3);\n\n/**\n * Sets a time limit on an asynchronous function. If the function does not call\n * its callback within the specified milliseconds, it will be called with a\n * timeout error. The code property for the error object will be `'ETIMEDOUT'`.\n *\n * @name timeout\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} asyncFn - The async function to limit in time.\n * @param {number} milliseconds - The specified time limit.\n * @param {*} [info] - Any variable you want attached (`string`, `object`, etc)\n * to timeout Error for more information..\n * @returns {AsyncFunction} Returns a wrapped function that can be used with any\n * of the control flow functions.\n * Invoke this function with the same parameters as you would `asyncFunc`.\n * @example\n *\n * function myFunction(foo, callback) {\n * doAsyncTask(foo, function(err, data) {\n * // handle errors\n * if (err) return callback(err);\n *\n * // do some stuff ...\n *\n * // return processed data\n * return callback(null, data);\n * });\n * }\n *\n * var wrapped = async.timeout(myFunction, 1000);\n *\n * // call `wrapped` as you would `myFunction`\n * wrapped({ bar: 'bar' }, function(err, data) {\n * // if `myFunction` takes < 1000 ms to execute, `err`\n * // and `data` will have their expected values\n *\n * // else `err` will be an Error with the code 'ETIMEDOUT'\n * });\n */\nfunction timeout(asyncFn, milliseconds, info) {\n var fn = wrapAsync(asyncFn);\n\n return initialParams((args, callback) => {\n var timedOut = false;\n var timer;\n\n function timeoutCallback() {\n var name = asyncFn.name || 'anonymous';\n var error = new Error('Callback function \"' + name + '\" timed out.');\n error.code = 'ETIMEDOUT';\n if (info) {\n error.info = info;\n }\n timedOut = true;\n callback(error);\n }\n\n args.push((...cbArgs) => {\n if (!timedOut) {\n callback(...cbArgs);\n clearTimeout(timer);\n }\n });\n\n // setup timer and call original function\n timer = setTimeout(timeoutCallback, milliseconds);\n fn(...args);\n });\n}\n\nfunction range(size) {\n var result = Array(size);\n while (size--) {\n result[size] = size;\n }\n return result;\n}\n\n/**\n * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name timesLimit\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.times]{@link module:ControlFlow.times}\n * @category Control Flow\n * @param {number} count - The number of times to run the function.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see [async.map]{@link module:Collections.map}.\n * @returns {Promise} a promise, if no callback is provided\n */\nfunction timesLimit(count, limit, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n return mapLimit$1(range(count), limit, _iteratee, callback);\n}\n\n/**\n * Calls the `iteratee` function `n` times, and accumulates results in the same\n * manner you would use with [map]{@link module:Collections.map}.\n *\n * @name times\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Control Flow\n * @param {number} n - The number of times to run the function.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see {@link module:Collections.map}.\n * @returns {Promise} a promise, if no callback is provided\n * @example\n *\n * // Pretend this is some complicated async factory\n * var createUser = function(id, callback) {\n * callback(null, {\n * id: 'user' + id\n * });\n * };\n *\n * // generate 5 users\n * async.times(5, function(n, next) {\n * createUser(n, function(err, user) {\n * next(err, user);\n * });\n * }, function(err, users) {\n * // we should now have 5 users\n * });\n */\nfunction times (n, iteratee, callback) {\n return timesLimit(n, Infinity, iteratee, callback)\n}\n\n/**\n * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time.\n *\n * @name timesSeries\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.times]{@link module:ControlFlow.times}\n * @category Control Flow\n * @param {number} n - The number of times to run the function.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see {@link module:Collections.map}.\n * @returns {Promise} a promise, if no callback is provided\n */\nfunction timesSeries (n, iteratee, callback) {\n return timesLimit(n, 1, iteratee, callback)\n}\n\n/**\n * A relative of `reduce`. Takes an Object or Array, and iterates over each\n * element in parallel, each step potentially mutating an `accumulator` value.\n * The type of the accumulator defaults to the type of collection passed in.\n *\n * @name transform\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {*} [accumulator] - The initial state of the transform. If omitted,\n * it will default to an empty Object or Array, depending on the type of `coll`\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * collection that potentially modifies the accumulator.\n * Invoked with (accumulator, item, key, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result is the transformed accumulator.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * // file1.txt is a file that is 1000 bytes in size\n * // file2.txt is a file that is 2000 bytes in size\n * // file3.txt is a file that is 3000 bytes in size\n *\n * // helper function that returns human-readable size format from bytes\n * function formatBytes(bytes, decimals = 2) {\n * // implementation not included for brevity\n * return humanReadbleFilesize;\n * }\n *\n * const fileList = ['file1.txt','file2.txt','file3.txt'];\n *\n * // asynchronous function that returns the file size, transformed to human-readable format\n * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc.\n * function transformFileSize(acc, value, key, callback) {\n * fs.stat(value, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * acc[key] = formatBytes(stat.size);\n * callback(null);\n * });\n * }\n *\n * // Using callbacks\n * async.transform(fileList, transformFileSize, function(err, result) {\n * if(err) {\n * console.log(err);\n * } else {\n * console.log(result);\n * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ]\n * }\n * });\n *\n * // Using Promises\n * async.transform(fileList, transformFileSize)\n * .then(result => {\n * console.log(result);\n * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ]\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * (async () => {\n * try {\n * let result = await async.transform(fileList, transformFileSize);\n * console.log(result);\n * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ]\n * }\n * catch (err) {\n * console.log(err);\n * }\n * })();\n *\n * @example\n *\n * // file1.txt is a file that is 1000 bytes in size\n * // file2.txt is a file that is 2000 bytes in size\n * // file3.txt is a file that is 3000 bytes in size\n *\n * // helper function that returns human-readable size format from bytes\n * function formatBytes(bytes, decimals = 2) {\n * // implementation not included for brevity\n * return humanReadbleFilesize;\n * }\n *\n * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' };\n *\n * // asynchronous function that returns the file size, transformed to human-readable format\n * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc.\n * function transformFileSize(acc, value, key, callback) {\n * fs.stat(value, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * acc[key] = formatBytes(stat.size);\n * callback(null);\n * });\n * }\n *\n * // Using callbacks\n * async.transform(fileMap, transformFileSize, function(err, result) {\n * if(err) {\n * console.log(err);\n * } else {\n * console.log(result);\n * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' }\n * }\n * });\n *\n * // Using Promises\n * async.transform(fileMap, transformFileSize)\n * .then(result => {\n * console.log(result);\n * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' }\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.transform(fileMap, transformFileSize);\n * console.log(result);\n * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' }\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction transform (coll, accumulator, iteratee, callback) {\n if (arguments.length <= 3 && typeof accumulator === 'function') {\n callback = iteratee;\n iteratee = accumulator;\n accumulator = Array.isArray(coll) ? [] : {};\n }\n callback = once(callback || promiseCallback());\n var _iteratee = wrapAsync(iteratee);\n\n eachOf$1(coll, (v, k, cb) => {\n _iteratee(accumulator, v, k, cb);\n }, err => callback(err, accumulator));\n return callback[PROMISE_SYMBOL]\n}\n\n/**\n * It runs each task in series but stops whenever any of the functions were\n * successful. If one of the tasks were successful, the `callback` will be\n * passed the result of the successful task. If all tasks fail, the callback\n * will be passed the error and result (if any) of the final attempt.\n *\n * @name tryEach\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to\n * run, each function is passed a `callback(err, result)` it must call on\n * completion with an error `err` (which can be `null`) and an optional `result`\n * value.\n * @param {Function} [callback] - An optional callback which is called when one\n * of the tasks has succeeded, or all have failed. It receives the `err` and\n * `result` arguments of the last attempt at completing the `task`. Invoked with\n * (err, results).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n * async.tryEach([\n * function getDataFromFirstWebsite(callback) {\n * // Try getting the data from the first website\n * callback(err, data);\n * },\n * function getDataFromSecondWebsite(callback) {\n * // First website failed,\n * // Try getting the data from the backup website\n * callback(err, data);\n * }\n * ],\n * // optional callback\n * function(err, results) {\n * Now do something with the data.\n * });\n *\n */\nfunction tryEach(tasks, callback) {\n var error = null;\n var result;\n return eachSeries$1(tasks, (task, taskCb) => {\n wrapAsync(task)((err, ...args) => {\n if (err === false) return taskCb(err);\n\n if (args.length < 2) {\n [result] = args;\n } else {\n result = args;\n }\n error = err;\n taskCb(err ? null : {});\n });\n }, () => callback(error, result));\n}\n\nvar tryEach$1 = awaitify(tryEach);\n\n/**\n * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original,\n * unmemoized form. Handy for testing.\n *\n * @name unmemoize\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.memoize]{@link module:Utils.memoize}\n * @category Util\n * @param {AsyncFunction} fn - the memoized function\n * @returns {AsyncFunction} a function that calls the original unmemoized function\n */\nfunction unmemoize(fn) {\n return (...args) => {\n return (fn.unmemoized || fn)(...args);\n };\n}\n\n/**\n * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when\n * stopped, or an error occurs.\n *\n * @name whilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} test - asynchronous truth test to perform before each\n * execution of `iteratee`. Invoked with (callback).\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` passes. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * var count = 0;\n * async.whilst(\n * function test(cb) { cb(null, count < 5); },\n * function iter(callback) {\n * count++;\n * setTimeout(function() {\n * callback(null, count);\n * }, 1000);\n * },\n * function (err, n) {\n * // 5 seconds have passed, n = 5\n * }\n * );\n */\nfunction whilst(test, iteratee, callback) {\n callback = onlyOnce(callback);\n var _fn = wrapAsync(iteratee);\n var _test = wrapAsync(test);\n var results = [];\n\n function next(err, ...rest) {\n if (err) return callback(err);\n results = rest;\n if (err === false) return;\n _test(check);\n }\n\n function check(err, truth) {\n if (err) return callback(err);\n if (err === false) return;\n if (!truth) return callback(null, ...results);\n _fn(next);\n }\n\n return _test(check);\n}\nvar whilst$1 = awaitify(whilst, 3);\n\n/**\n * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when\n * stopped, or an error occurs. `callback` will be passed an error and any\n * arguments passed to the final `iteratee`'s callback.\n *\n * The inverse of [whilst]{@link module:ControlFlow.whilst}.\n *\n * @name until\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {AsyncFunction} test - asynchronous truth test to perform before each\n * execution of `iteratee`. Invoked with (callback).\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` fails. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has passed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if a callback is not passed\n *\n * @example\n * const results = []\n * let finished = false\n * async.until(function test(cb) {\n * cb(null, finished)\n * }, function iter(next) {\n * fetchPage(url, (err, body) => {\n * if (err) return next(err)\n * results = results.concat(body.objects)\n * finished = !!body.next\n * next(err)\n * })\n * }, function done (err) {\n * // all pages have been fetched\n * })\n */\nfunction until(test, iteratee, callback) {\n const _test = wrapAsync(test);\n return whilst$1((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback);\n}\n\n/**\n * Runs the `tasks` array of functions in series, each passing their results to\n * the next in the array. However, if any of the `tasks` pass an error to their\n * own callback, the next function is not executed, and the main `callback` is\n * immediately called with the error.\n *\n * @name waterfall\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array of [async functions]{@link AsyncFunction}\n * to run.\n * Each function should complete with any number of `result` values.\n * The `result` values will be passed as arguments, in order, to the next task.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This will be passed the results of the last task's\n * callback. Invoked with (err, [results]).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * async.waterfall([\n * function(callback) {\n * callback(null, 'one', 'two');\n * },\n * function(arg1, arg2, callback) {\n * // arg1 now equals 'one' and arg2 now equals 'two'\n * callback(null, 'three');\n * },\n * function(arg1, callback) {\n * // arg1 now equals 'three'\n * callback(null, 'done');\n * }\n * ], function (err, result) {\n * // result now equals 'done'\n * });\n *\n * // Or, with named functions:\n * async.waterfall([\n * myFirstFunction,\n * mySecondFunction,\n * myLastFunction,\n * ], function (err, result) {\n * // result now equals 'done'\n * });\n * function myFirstFunction(callback) {\n * callback(null, 'one', 'two');\n * }\n * function mySecondFunction(arg1, arg2, callback) {\n * // arg1 now equals 'one' and arg2 now equals 'two'\n * callback(null, 'three');\n * }\n * function myLastFunction(arg1, callback) {\n * // arg1 now equals 'three'\n * callback(null, 'done');\n * }\n */\nfunction waterfall (tasks, callback) {\n callback = once(callback);\n if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));\n if (!tasks.length) return callback();\n var taskIndex = 0;\n\n function nextTask(args) {\n var task = wrapAsync(tasks[taskIndex++]);\n task(...args, onlyOnce(next));\n }\n\n function next(err, ...args) {\n if (err === false) return\n if (err || taskIndex === tasks.length) {\n return callback(err, ...args);\n }\n nextTask(args);\n }\n\n nextTask([]);\n}\n\nvar waterfall$1 = awaitify(waterfall);\n\n/**\n * An \"async function\" in the context of Async is an asynchronous function with\n * a variable number of parameters, with the final parameter being a callback.\n * (`function (arg1, arg2, ..., callback) {}`)\n * The final callback is of the form `callback(err, results...)`, which must be\n * called once the function is completed. The callback should be called with a\n * Error as its first argument to signal that an error occurred.\n * Otherwise, if no error occurred, it should be called with `null` as the first\n * argument, and any additional `result` arguments that may apply, to signal\n * successful completion.\n * The callback must be called exactly once, ideally on a later tick of the\n * JavaScript event loop.\n *\n * This type of function is also referred to as a \"Node-style async function\",\n * or a \"continuation passing-style function\" (CPS). Most of the methods of this\n * library are themselves CPS/Node-style async functions, or functions that\n * return CPS/Node-style async functions.\n *\n * Wherever we accept a Node-style async function, we also directly accept an\n * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}.\n * In this case, the `async` function will not be passed a final callback\n * argument, and any thrown error will be used as the `err` argument of the\n * implicit callback, and the return value will be used as the `result` value.\n * (i.e. a `rejected` of the returned Promise becomes the `err` callback\n * argument, and a `resolved` value becomes the `result`.)\n *\n * Note, due to JavaScript limitations, we can only detect native `async`\n * functions and not transpilied implementations.\n * Your environment must have `async`/`await` support for this to work.\n * (e.g. Node > v7.6, or a recent version of a modern browser).\n * If you are using `async` functions through a transpiler (e.g. Babel), you\n * must still wrap the function with [asyncify]{@link module:Utils.asyncify},\n * because the `async function` will be compiled to an ordinary function that\n * returns a promise.\n *\n * @typedef {Function} AsyncFunction\n * @static\n */\n\n\nvar index = {\n apply,\n applyEach,\n applyEachSeries,\n asyncify,\n auto,\n autoInject,\n cargo: cargo$1,\n cargoQueue: cargo,\n compose,\n concat: concat$1,\n concatLimit: concatLimit$1,\n concatSeries: concatSeries$1,\n constant: constant$1,\n detect: detect$1,\n detectLimit: detectLimit$1,\n detectSeries: detectSeries$1,\n dir,\n doUntil,\n doWhilst: doWhilst$1,\n each,\n eachLimit: eachLimit$1,\n eachOf: eachOf$1,\n eachOfLimit: eachOfLimit$1,\n eachOfSeries: eachOfSeries$1,\n eachSeries: eachSeries$1,\n ensureAsync,\n every: every$1,\n everyLimit: everyLimit$1,\n everySeries: everySeries$1,\n filter: filter$1,\n filterLimit: filterLimit$1,\n filterSeries: filterSeries$1,\n forever: forever$1,\n groupBy,\n groupByLimit: groupByLimit$1,\n groupBySeries,\n log,\n map: map$1,\n mapLimit: mapLimit$1,\n mapSeries: mapSeries$1,\n mapValues,\n mapValuesLimit: mapValuesLimit$1,\n mapValuesSeries,\n memoize,\n nextTick,\n parallel,\n parallelLimit,\n priorityQueue,\n queue,\n race: race$1,\n reduce: reduce$1,\n reduceRight,\n reflect,\n reflectAll,\n reject: reject$1,\n rejectLimit: rejectLimit$1,\n rejectSeries: rejectSeries$1,\n retry,\n retryable,\n seq,\n series,\n setImmediate: setImmediate$1,\n some: some$1,\n someLimit: someLimit$1,\n someSeries: someSeries$1,\n sortBy: sortBy$1,\n timeout,\n times,\n timesLimit,\n timesSeries,\n transform,\n tryEach: tryEach$1,\n unmemoize,\n until,\n waterfall: waterfall$1,\n whilst: whilst$1,\n\n // aliases\n all: every$1,\n allLimit: everyLimit$1,\n allSeries: everySeries$1,\n any: some$1,\n anyLimit: someLimit$1,\n anySeries: someSeries$1,\n find: detect$1,\n findLimit: detectLimit$1,\n findSeries: detectSeries$1,\n flatMap: concat$1,\n flatMapLimit: concatLimit$1,\n flatMapSeries: concatSeries$1,\n forEach: each,\n forEachSeries: eachSeries$1,\n forEachLimit: eachLimit$1,\n forEachOf: eachOf$1,\n forEachOfSeries: eachOfSeries$1,\n forEachOfLimit: eachOfLimit$1,\n inject: reduce$1,\n foldl: reduce$1,\n foldr: reduceRight,\n select: filter$1,\n selectLimit: filterLimit$1,\n selectSeries: filterSeries$1,\n wrapSync: asyncify,\n during: whilst$1,\n doDuring: doWhilst$1\n};\n\nexport { every$1 as all, everyLimit$1 as allLimit, everySeries$1 as allSeries, some$1 as any, someLimit$1 as anyLimit, someSeries$1 as anySeries, apply, applyEach, applyEachSeries, asyncify, auto, autoInject, cargo$1 as cargo, cargo as cargoQueue, compose, concat$1 as concat, concatLimit$1 as concatLimit, concatSeries$1 as concatSeries, constant$1 as constant, index as default, detect$1 as detect, detectLimit$1 as detectLimit, detectSeries$1 as detectSeries, dir, doWhilst$1 as doDuring, doUntil, doWhilst$1 as doWhilst, whilst$1 as during, each, eachLimit$1 as eachLimit, eachOf$1 as eachOf, eachOfLimit$1 as eachOfLimit, eachOfSeries$1 as eachOfSeries, eachSeries$1 as eachSeries, ensureAsync, every$1 as every, everyLimit$1 as everyLimit, everySeries$1 as everySeries, filter$1 as filter, filterLimit$1 as filterLimit, filterSeries$1 as filterSeries, detect$1 as find, detectLimit$1 as findLimit, detectSeries$1 as findSeries, concat$1 as flatMap, concatLimit$1 as flatMapLimit, concatSeries$1 as flatMapSeries, reduce$1 as foldl, reduceRight as foldr, each as forEach, eachLimit$1 as forEachLimit, eachOf$1 as forEachOf, eachOfLimit$1 as forEachOfLimit, eachOfSeries$1 as forEachOfSeries, eachSeries$1 as forEachSeries, forever$1 as forever, groupBy, groupByLimit$1 as groupByLimit, groupBySeries, reduce$1 as inject, log, map$1 as map, mapLimit$1 as mapLimit, mapSeries$1 as mapSeries, mapValues, mapValuesLimit$1 as mapValuesLimit, mapValuesSeries, memoize, nextTick, parallel, parallelLimit, priorityQueue, queue, race$1 as race, reduce$1 as reduce, reduceRight, reflect, reflectAll, reject$1 as reject, rejectLimit$1 as rejectLimit, rejectSeries$1 as rejectSeries, retry, retryable, filter$1 as select, filterLimit$1 as selectLimit, filterSeries$1 as selectSeries, seq, series, setImmediate$1 as setImmediate, some$1 as some, someLimit$1 as someLimit, someSeries$1 as someSeries, sortBy$1 as sortBy, timeout, times, timesLimit, timesSeries, transform, tryEach$1 as tryEach, unmemoize, until, waterfall$1 as waterfall, whilst$1 as whilst, asyncify as wrapSync };\n","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH = exports.DEFAULT_MAX_SEND_MESSAGE_LENGTH = exports.Propagate = exports.LogVerbosity = exports.Status = void 0;\nvar Status;\n(function (Status) {\n Status[Status[\"OK\"] = 0] = \"OK\";\n Status[Status[\"CANCELLED\"] = 1] = \"CANCELLED\";\n Status[Status[\"UNKNOWN\"] = 2] = \"UNKNOWN\";\n Status[Status[\"INVALID_ARGUMENT\"] = 3] = \"INVALID_ARGUMENT\";\n Status[Status[\"DEADLINE_EXCEEDED\"] = 4] = \"DEADLINE_EXCEEDED\";\n Status[Status[\"NOT_FOUND\"] = 5] = \"NOT_FOUND\";\n Status[Status[\"ALREADY_EXISTS\"] = 6] = \"ALREADY_EXISTS\";\n Status[Status[\"PERMISSION_DENIED\"] = 7] = \"PERMISSION_DENIED\";\n Status[Status[\"RESOURCE_EXHAUSTED\"] = 8] = \"RESOURCE_EXHAUSTED\";\n Status[Status[\"FAILED_PRECONDITION\"] = 9] = \"FAILED_PRECONDITION\";\n Status[Status[\"ABORTED\"] = 10] = \"ABORTED\";\n Status[Status[\"OUT_OF_RANGE\"] = 11] = \"OUT_OF_RANGE\";\n Status[Status[\"UNIMPLEMENTED\"] = 12] = \"UNIMPLEMENTED\";\n Status[Status[\"INTERNAL\"] = 13] = \"INTERNAL\";\n Status[Status[\"UNAVAILABLE\"] = 14] = \"UNAVAILABLE\";\n Status[Status[\"DATA_LOSS\"] = 15] = \"DATA_LOSS\";\n Status[Status[\"UNAUTHENTICATED\"] = 16] = \"UNAUTHENTICATED\";\n})(Status || (exports.Status = Status = {}));\nvar LogVerbosity;\n(function (LogVerbosity) {\n LogVerbosity[LogVerbosity[\"DEBUG\"] = 0] = \"DEBUG\";\n LogVerbosity[LogVerbosity[\"INFO\"] = 1] = \"INFO\";\n LogVerbosity[LogVerbosity[\"ERROR\"] = 2] = \"ERROR\";\n LogVerbosity[LogVerbosity[\"NONE\"] = 3] = \"NONE\";\n})(LogVerbosity || (exports.LogVerbosity = LogVerbosity = {}));\n/**\n * NOTE: This enum is not currently used in any implemented API in this\n * library. It is included only for type parity with the other implementation.\n */\nvar Propagate;\n(function (Propagate) {\n Propagate[Propagate[\"DEADLINE\"] = 1] = \"DEADLINE\";\n Propagate[Propagate[\"CENSUS_STATS_CONTEXT\"] = 2] = \"CENSUS_STATS_CONTEXT\";\n Propagate[Propagate[\"CENSUS_TRACING_CONTEXT\"] = 4] = \"CENSUS_TRACING_CONTEXT\";\n Propagate[Propagate[\"CANCELLATION\"] = 8] = \"CANCELLATION\";\n // https://github.com/grpc/grpc/blob/master/include/grpc/impl/codegen/propagation_bits.h#L43\n Propagate[Propagate[\"DEFAULTS\"] = 65535] = \"DEFAULTS\";\n})(Propagate || (exports.Propagate = Propagate = {}));\n// -1 means unlimited\nexports.DEFAULT_MAX_SEND_MESSAGE_LENGTH = -1;\n// 4 MB default\nexports.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH = 4 * 1024 * 1024;\n//# sourceMappingURL=constants.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar _a, _b, _c, _d;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.log = exports.setLoggerVerbosity = exports.setLogger = exports.getLogger = void 0;\nexports.trace = trace;\nexports.isTracerEnabled = isTracerEnabled;\nconst constants_1 = require(\"./constants\");\nconst process_1 = require(\"process\");\nconst clientVersion = require('../../package.json').version;\nconst DEFAULT_LOGGER = {\n error: (message, ...optionalParams) => {\n console.error('E ' + message, ...optionalParams);\n },\n info: (message, ...optionalParams) => {\n console.error('I ' + message, ...optionalParams);\n },\n debug: (message, ...optionalParams) => {\n console.error('D ' + message, ...optionalParams);\n },\n};\nlet _logger = DEFAULT_LOGGER;\nlet _logVerbosity = constants_1.LogVerbosity.ERROR;\nconst verbosityString = (_b = (_a = process.env.GRPC_NODE_VERBOSITY) !== null && _a !== void 0 ? _a : process.env.GRPC_VERBOSITY) !== null && _b !== void 0 ? _b : '';\nswitch (verbosityString.toUpperCase()) {\n case 'DEBUG':\n _logVerbosity = constants_1.LogVerbosity.DEBUG;\n break;\n case 'INFO':\n _logVerbosity = constants_1.LogVerbosity.INFO;\n break;\n case 'ERROR':\n _logVerbosity = constants_1.LogVerbosity.ERROR;\n break;\n case 'NONE':\n _logVerbosity = constants_1.LogVerbosity.NONE;\n break;\n default:\n // Ignore any other values\n}\nconst getLogger = () => {\n return _logger;\n};\nexports.getLogger = getLogger;\nconst setLogger = (logger) => {\n _logger = logger;\n};\nexports.setLogger = setLogger;\nconst setLoggerVerbosity = (verbosity) => {\n _logVerbosity = verbosity;\n};\nexports.setLoggerVerbosity = setLoggerVerbosity;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst log = (severity, ...args) => {\n let logFunction;\n if (severity >= _logVerbosity) {\n switch (severity) {\n case constants_1.LogVerbosity.DEBUG:\n logFunction = _logger.debug;\n break;\n case constants_1.LogVerbosity.INFO:\n logFunction = _logger.info;\n break;\n case constants_1.LogVerbosity.ERROR:\n logFunction = _logger.error;\n break;\n }\n /* Fall back to _logger.error when other methods are not available for\n * compatiblity with older behavior that always logged to _logger.error */\n if (!logFunction) {\n logFunction = _logger.error;\n }\n if (logFunction) {\n logFunction.bind(_logger)(...args);\n }\n }\n};\nexports.log = log;\nconst tracersString = (_d = (_c = process.env.GRPC_NODE_TRACE) !== null && _c !== void 0 ? _c : process.env.GRPC_TRACE) !== null && _d !== void 0 ? _d : '';\nconst enabledTracers = new Set();\nconst disabledTracers = new Set();\nfor (const tracerName of tracersString.split(',')) {\n if (tracerName.startsWith('-')) {\n disabledTracers.add(tracerName.substring(1));\n }\n else {\n enabledTracers.add(tracerName);\n }\n}\nconst allEnabled = enabledTracers.has('all');\nfunction trace(severity, tracer, text) {\n if (isTracerEnabled(tracer)) {\n (0, exports.log)(severity, new Date().toISOString() +\n ' | v' +\n clientVersion +\n ' ' +\n process_1.pid +\n ' | ' +\n tracer +\n ' | ' +\n text);\n }\n}\nfunction isTracerEnabled(tracer) {\n return (!disabledTracers.has(tracer) && (allEnabled || enabledTracers.has(tracer)));\n}\n//# sourceMappingURL=logging.js.map","\"use strict\";\n/*\n * Copyright 2022 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getErrorMessage = getErrorMessage;\nexports.getErrorCode = getErrorCode;\nfunction getErrorMessage(error) {\n if (error instanceof Error) {\n return error.message;\n }\n else {\n return String(error);\n }\n}\nfunction getErrorCode(error) {\n if (typeof error === 'object' &&\n error !== null &&\n 'code' in error &&\n typeof error.code === 'number') {\n return error.code;\n }\n else {\n return null;\n }\n}\n//# sourceMappingURL=error.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Metadata = void 0;\nconst logging_1 = require(\"./logging\");\nconst constants_1 = require(\"./constants\");\nconst error_1 = require(\"./error\");\nconst LEGAL_KEY_REGEX = /^[0-9a-z_.-]+$/;\nconst LEGAL_NON_BINARY_VALUE_REGEX = /^[ -~]*$/;\nfunction isLegalKey(key) {\n return LEGAL_KEY_REGEX.test(key);\n}\nfunction isLegalNonBinaryValue(value) {\n return LEGAL_NON_BINARY_VALUE_REGEX.test(value);\n}\nfunction isBinaryKey(key) {\n return key.endsWith('-bin');\n}\nfunction isCustomMetadata(key) {\n return !key.startsWith('grpc-');\n}\nfunction normalizeKey(key) {\n return key.toLowerCase();\n}\nfunction validate(key, value) {\n if (!isLegalKey(key)) {\n throw new Error('Metadata key \"' + key + '\" contains illegal characters');\n }\n if (value !== null && value !== undefined) {\n if (isBinaryKey(key)) {\n if (!Buffer.isBuffer(value)) {\n throw new Error(\"keys that end with '-bin' must have Buffer values\");\n }\n }\n else {\n if (Buffer.isBuffer(value)) {\n throw new Error(\"keys that don't end with '-bin' must have String values\");\n }\n if (!isLegalNonBinaryValue(value)) {\n throw new Error('Metadata string value \"' + value + '\" contains illegal characters');\n }\n }\n }\n}\n/**\n * A class for storing metadata. Keys are normalized to lowercase ASCII.\n */\nclass Metadata {\n constructor(options = {}) {\n this.internalRepr = new Map();\n this.options = options;\n }\n /**\n * Sets the given value for the given key by replacing any other values\n * associated with that key. Normalizes the key.\n * @param key The key to whose value should be set.\n * @param value The value to set. Must be a buffer if and only\n * if the normalized key ends with '-bin'.\n */\n set(key, value) {\n key = normalizeKey(key);\n validate(key, value);\n this.internalRepr.set(key, [value]);\n }\n /**\n * Adds the given value for the given key by appending to a list of previous\n * values associated with that key. Normalizes the key.\n * @param key The key for which a new value should be appended.\n * @param value The value to add. Must be a buffer if and only\n * if the normalized key ends with '-bin'.\n */\n add(key, value) {\n key = normalizeKey(key);\n validate(key, value);\n const existingValue = this.internalRepr.get(key);\n if (existingValue === undefined) {\n this.internalRepr.set(key, [value]);\n }\n else {\n existingValue.push(value);\n }\n }\n /**\n * Removes the given key and any associated values. Normalizes the key.\n * @param key The key whose values should be removed.\n */\n remove(key) {\n key = normalizeKey(key);\n // validate(key);\n this.internalRepr.delete(key);\n }\n /**\n * Gets a list of all values associated with the key. Normalizes the key.\n * @param key The key whose value should be retrieved.\n * @return A list of values associated with the given key.\n */\n get(key) {\n key = normalizeKey(key);\n // validate(key);\n return this.internalRepr.get(key) || [];\n }\n /**\n * Gets a plain object mapping each key to the first value associated with it.\n * This reflects the most common way that people will want to see metadata.\n * @return A key/value mapping of the metadata.\n */\n getMap() {\n const result = {};\n for (const [key, values] of this.internalRepr) {\n if (values.length > 0) {\n const v = values[0];\n result[key] = Buffer.isBuffer(v) ? Buffer.from(v) : v;\n }\n }\n return result;\n }\n /**\n * Clones the metadata object.\n * @return The newly cloned object.\n */\n clone() {\n const newMetadata = new Metadata(this.options);\n const newInternalRepr = newMetadata.internalRepr;\n for (const [key, value] of this.internalRepr) {\n const clonedValue = value.map(v => {\n if (Buffer.isBuffer(v)) {\n return Buffer.from(v);\n }\n else {\n return v;\n }\n });\n newInternalRepr.set(key, clonedValue);\n }\n return newMetadata;\n }\n /**\n * Merges all key-value pairs from a given Metadata object into this one.\n * If both this object and the given object have values in the same key,\n * values from the other Metadata object will be appended to this object's\n * values.\n * @param other A Metadata object.\n */\n merge(other) {\n for (const [key, values] of other.internalRepr) {\n const mergedValue = (this.internalRepr.get(key) || []).concat(values);\n this.internalRepr.set(key, mergedValue);\n }\n }\n setOptions(options) {\n this.options = options;\n }\n getOptions() {\n return this.options;\n }\n /**\n * Creates an OutgoingHttpHeaders object that can be used with the http2 API.\n */\n toHttp2Headers() {\n // NOTE: Node <8.9 formats http2 headers incorrectly.\n const result = {};\n for (const [key, values] of this.internalRepr) {\n // We assume that the user's interaction with this object is limited to\n // through its public API (i.e. keys and values are already validated).\n result[key] = values.map(bufToString);\n }\n return result;\n }\n /**\n * This modifies the behavior of JSON.stringify to show an object\n * representation of the metadata map.\n */\n toJSON() {\n const result = {};\n for (const [key, values] of this.internalRepr) {\n result[key] = values;\n }\n return result;\n }\n /**\n * Returns a new Metadata object based fields in a given IncomingHttpHeaders\n * object.\n * @param headers An IncomingHttpHeaders object.\n */\n static fromHttp2Headers(headers) {\n const result = new Metadata();\n for (const key of Object.keys(headers)) {\n // Reserved headers (beginning with `:`) are not valid keys.\n if (key.charAt(0) === ':') {\n continue;\n }\n const values = headers[key];\n try {\n if (isBinaryKey(key)) {\n if (Array.isArray(values)) {\n values.forEach(value => {\n result.add(key, Buffer.from(value, 'base64'));\n });\n }\n else if (values !== undefined) {\n if (isCustomMetadata(key)) {\n values.split(',').forEach(v => {\n result.add(key, Buffer.from(v.trim(), 'base64'));\n });\n }\n else {\n result.add(key, Buffer.from(values, 'base64'));\n }\n }\n }\n else {\n if (Array.isArray(values)) {\n values.forEach(value => {\n result.add(key, value);\n });\n }\n else if (values !== undefined) {\n result.add(key, values);\n }\n }\n }\n catch (error) {\n const message = `Failed to add metadata entry ${key}: ${values}. ${(0, error_1.getErrorMessage)(error)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;\n (0, logging_1.log)(constants_1.LogVerbosity.ERROR, message);\n }\n }\n return result;\n }\n}\nexports.Metadata = Metadata;\nconst bufToString = (val) => {\n return Buffer.isBuffer(val) ? val.toString('base64') : val;\n};\n//# sourceMappingURL=metadata.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CallCredentials = void 0;\nconst metadata_1 = require(\"./metadata\");\nfunction isCurrentOauth2Client(client) {\n return ('getRequestHeaders' in client &&\n typeof client.getRequestHeaders === 'function');\n}\n/**\n * A class that represents a generic method of adding authentication-related\n * metadata on a per-request basis.\n */\nclass CallCredentials {\n /**\n * Creates a new CallCredentials object from a given function that generates\n * Metadata objects.\n * @param metadataGenerator A function that accepts a set of options, and\n * generates a Metadata object based on these options, which is passed back\n * to the caller via a supplied (err, metadata) callback.\n */\n static createFromMetadataGenerator(metadataGenerator) {\n return new SingleCallCredentials(metadataGenerator);\n }\n /**\n * Create a gRPC credential from a Google credential object.\n * @param googleCredentials The authentication client to use.\n * @return The resulting CallCredentials object.\n */\n static createFromGoogleCredential(googleCredentials) {\n return CallCredentials.createFromMetadataGenerator((options, callback) => {\n let getHeaders;\n if (isCurrentOauth2Client(googleCredentials)) {\n getHeaders = googleCredentials.getRequestHeaders(options.service_url);\n }\n else {\n getHeaders = new Promise((resolve, reject) => {\n googleCredentials.getRequestMetadata(options.service_url, (err, headers) => {\n if (err) {\n reject(err);\n return;\n }\n if (!headers) {\n reject(new Error('Headers not set by metadata plugin'));\n return;\n }\n resolve(headers);\n });\n });\n }\n getHeaders.then(headers => {\n const metadata = new metadata_1.Metadata();\n for (const key of Object.keys(headers)) {\n metadata.add(key, headers[key]);\n }\n callback(null, metadata);\n }, err => {\n callback(err);\n });\n });\n }\n static createEmpty() {\n return new EmptyCallCredentials();\n }\n}\nexports.CallCredentials = CallCredentials;\nclass ComposedCallCredentials extends CallCredentials {\n constructor(creds) {\n super();\n this.creds = creds;\n }\n async generateMetadata(options) {\n const base = new metadata_1.Metadata();\n const generated = await Promise.all(this.creds.map(cred => cred.generateMetadata(options)));\n for (const gen of generated) {\n base.merge(gen);\n }\n return base;\n }\n compose(other) {\n return new ComposedCallCredentials(this.creds.concat([other]));\n }\n _equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof ComposedCallCredentials) {\n return this.creds.every((value, index) => value._equals(other.creds[index]));\n }\n else {\n return false;\n }\n }\n}\nclass SingleCallCredentials extends CallCredentials {\n constructor(metadataGenerator) {\n super();\n this.metadataGenerator = metadataGenerator;\n }\n generateMetadata(options) {\n return new Promise((resolve, reject) => {\n this.metadataGenerator(options, (err, metadata) => {\n if (metadata !== undefined) {\n resolve(metadata);\n }\n else {\n reject(err);\n }\n });\n });\n }\n compose(other) {\n return new ComposedCallCredentials([this, other]);\n }\n _equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof SingleCallCredentials) {\n return this.metadataGenerator === other.metadataGenerator;\n }\n else {\n return false;\n }\n }\n}\nclass EmptyCallCredentials extends CallCredentials {\n generateMetadata(options) {\n return Promise.resolve(new metadata_1.Metadata());\n }\n compose(other) {\n return other;\n }\n _equals(other) {\n return other instanceof EmptyCallCredentials;\n }\n}\n//# sourceMappingURL=call-credentials.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CIPHER_SUITES = void 0;\nexports.getDefaultRootsData = getDefaultRootsData;\nconst fs = require(\"fs\");\nexports.CIPHER_SUITES = process.env.GRPC_SSL_CIPHER_SUITES;\nconst DEFAULT_ROOTS_FILE_PATH = process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH;\nlet defaultRootsData = null;\nfunction getDefaultRootsData() {\n if (DEFAULT_ROOTS_FILE_PATH) {\n if (defaultRootsData === null) {\n defaultRootsData = fs.readFileSync(DEFAULT_ROOTS_FILE_PATH);\n }\n return defaultRootsData;\n }\n return null;\n}\n//# sourceMappingURL=tls-helpers.js.map","\"use strict\";\n/*\n * Copyright 2020 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseUri = parseUri;\nexports.splitHostPort = splitHostPort;\nexports.combineHostPort = combineHostPort;\nexports.uriToString = uriToString;\n/*\n * The groups correspond to URI parts as follows:\n * 1. scheme\n * 2. authority\n * 3. path\n */\nconst URI_REGEX = /^(?:([A-Za-z0-9+.-]+):)?(?:\\/\\/([^/]*)\\/)?(.+)$/;\nfunction parseUri(uriString) {\n const parsedUri = URI_REGEX.exec(uriString);\n if (parsedUri === null) {\n return null;\n }\n return {\n scheme: parsedUri[1],\n authority: parsedUri[2],\n path: parsedUri[3],\n };\n}\nconst NUMBER_REGEX = /^\\d+$/;\nfunction splitHostPort(path) {\n if (path.startsWith('[')) {\n const hostEnd = path.indexOf(']');\n if (hostEnd === -1) {\n return null;\n }\n const host = path.substring(1, hostEnd);\n /* Only an IPv6 address should be in bracketed notation, and an IPv6\n * address should have at least one colon */\n if (host.indexOf(':') === -1) {\n return null;\n }\n if (path.length > hostEnd + 1) {\n if (path[hostEnd + 1] === ':') {\n const portString = path.substring(hostEnd + 2);\n if (NUMBER_REGEX.test(portString)) {\n return {\n host: host,\n port: +portString,\n };\n }\n else {\n return null;\n }\n }\n else {\n return null;\n }\n }\n else {\n return {\n host,\n };\n }\n }\n else {\n const splitPath = path.split(':');\n /* Exactly one colon means that this is host:port. Zero colons means that\n * there is no port. And multiple colons means that this is a bare IPv6\n * address with no port */\n if (splitPath.length === 2) {\n if (NUMBER_REGEX.test(splitPath[1])) {\n return {\n host: splitPath[0],\n port: +splitPath[1],\n };\n }\n else {\n return null;\n }\n }\n else {\n return {\n host: path,\n };\n }\n }\n}\nfunction combineHostPort(hostPort) {\n if (hostPort.port === undefined) {\n return hostPort.host;\n }\n else {\n // Only an IPv6 host should include a colon\n if (hostPort.host.includes(':')) {\n return `[${hostPort.host}]:${hostPort.port}`;\n }\n else {\n return `${hostPort.host}:${hostPort.port}`;\n }\n }\n}\nfunction uriToString(uri) {\n let result = '';\n if (uri.scheme !== undefined) {\n result += uri.scheme + ':';\n }\n if (uri.authority !== undefined) {\n result += '//' + uri.authority + '/';\n }\n result += uri.path;\n return result;\n}\n//# sourceMappingURL=uri-parser.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.registerResolver = registerResolver;\nexports.registerDefaultScheme = registerDefaultScheme;\nexports.createResolver = createResolver;\nexports.getDefaultAuthority = getDefaultAuthority;\nexports.mapUriDefaultScheme = mapUriDefaultScheme;\nconst uri_parser_1 = require(\"./uri-parser\");\nconst registeredResolvers = {};\nlet defaultScheme = null;\n/**\n * Register a resolver class to handle target names prefixed with the `prefix`\n * string. This prefix should correspond to a URI scheme name listed in the\n * [gRPC Name Resolution document](https://github.com/grpc/grpc/blob/master/doc/naming.md)\n * @param prefix\n * @param resolverClass\n */\nfunction registerResolver(scheme, resolverClass) {\n registeredResolvers[scheme] = resolverClass;\n}\n/**\n * Register a default resolver to handle target names that do not start with\n * any registered prefix.\n * @param resolverClass\n */\nfunction registerDefaultScheme(scheme) {\n defaultScheme = scheme;\n}\n/**\n * Create a name resolver for the specified target, if possible. Throws an\n * error if no such name resolver can be created.\n * @param target\n * @param listener\n */\nfunction createResolver(target, listener, options) {\n if (target.scheme !== undefined && target.scheme in registeredResolvers) {\n return new registeredResolvers[target.scheme](target, listener, options);\n }\n else {\n throw new Error(`No resolver could be created for target ${(0, uri_parser_1.uriToString)(target)}`);\n }\n}\n/**\n * Get the default authority for the specified target, if possible. Throws an\n * error if no registered name resolver can parse that target string.\n * @param target\n */\nfunction getDefaultAuthority(target) {\n if (target.scheme !== undefined && target.scheme in registeredResolvers) {\n return registeredResolvers[target.scheme].getDefaultAuthority(target);\n }\n else {\n throw new Error(`Invalid target ${(0, uri_parser_1.uriToString)(target)}`);\n }\n}\nfunction mapUriDefaultScheme(target) {\n if (target.scheme === undefined || !(target.scheme in registeredResolvers)) {\n if (defaultScheme !== null) {\n return {\n scheme: defaultScheme,\n authority: undefined,\n path: (0, uri_parser_1.uriToString)(target),\n };\n }\n else {\n return null;\n }\n }\n return target;\n}\n//# sourceMappingURL=resolver.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ChannelCredentials = void 0;\nexports.createCertificateProviderChannelCredentials = createCertificateProviderChannelCredentials;\nconst tls_1 = require(\"tls\");\nconst call_credentials_1 = require(\"./call-credentials\");\nconst tls_helpers_1 = require(\"./tls-helpers\");\nconst uri_parser_1 = require(\"./uri-parser\");\nconst resolver_1 = require(\"./resolver\");\nconst logging_1 = require(\"./logging\");\nconst constants_1 = require(\"./constants\");\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction verifyIsBufferOrNull(obj, friendlyName) {\n if (obj && !(obj instanceof Buffer)) {\n throw new TypeError(`${friendlyName}, if provided, must be a Buffer.`);\n }\n}\n/**\n * A class that contains credentials for communicating over a channel, as well\n * as a set of per-call credentials, which are applied to every method call made\n * over a channel initialized with an instance of this class.\n */\nclass ChannelCredentials {\n /**\n * Returns a copy of this object with the included set of per-call credentials\n * expanded to include callCredentials.\n * @param callCredentials A CallCredentials object to associate with this\n * instance.\n */\n compose(callCredentials) {\n return new ComposedChannelCredentialsImpl(this, callCredentials);\n }\n /**\n * Return a new ChannelCredentials instance with a given set of credentials.\n * The resulting instance can be used to construct a Channel that communicates\n * over TLS.\n * @param rootCerts The root certificate data.\n * @param privateKey The client certificate private key, if available.\n * @param certChain The client certificate key chain, if available.\n * @param verifyOptions Additional options to modify certificate verification\n */\n static createSsl(rootCerts, privateKey, certChain, verifyOptions) {\n var _a;\n verifyIsBufferOrNull(rootCerts, 'Root certificate');\n verifyIsBufferOrNull(privateKey, 'Private key');\n verifyIsBufferOrNull(certChain, 'Certificate chain');\n if (privateKey && !certChain) {\n throw new Error('Private key must be given with accompanying certificate chain');\n }\n if (!privateKey && certChain) {\n throw new Error('Certificate chain must be given with accompanying private key');\n }\n const secureContext = (0, tls_1.createSecureContext)({\n ca: (_a = rootCerts !== null && rootCerts !== void 0 ? rootCerts : (0, tls_helpers_1.getDefaultRootsData)()) !== null && _a !== void 0 ? _a : undefined,\n key: privateKey !== null && privateKey !== void 0 ? privateKey : undefined,\n cert: certChain !== null && certChain !== void 0 ? certChain : undefined,\n ciphers: tls_helpers_1.CIPHER_SUITES,\n });\n return new SecureChannelCredentialsImpl(secureContext, verifyOptions !== null && verifyOptions !== void 0 ? verifyOptions : {});\n }\n /**\n * Return a new ChannelCredentials instance with credentials created using\n * the provided secureContext. The resulting instances can be used to\n * construct a Channel that communicates over TLS. gRPC will not override\n * anything in the provided secureContext, so the environment variables\n * GRPC_SSL_CIPHER_SUITES and GRPC_DEFAULT_SSL_ROOTS_FILE_PATH will\n * not be applied.\n * @param secureContext The return value of tls.createSecureContext()\n * @param verifyOptions Additional options to modify certificate verification\n */\n static createFromSecureContext(secureContext, verifyOptions) {\n return new SecureChannelCredentialsImpl(secureContext, verifyOptions !== null && verifyOptions !== void 0 ? verifyOptions : {});\n }\n /**\n * Return a new ChannelCredentials instance with no credentials.\n */\n static createInsecure() {\n return new InsecureChannelCredentialsImpl();\n }\n}\nexports.ChannelCredentials = ChannelCredentials;\nclass InsecureChannelCredentialsImpl extends ChannelCredentials {\n constructor() {\n super();\n }\n compose(callCredentials) {\n throw new Error('Cannot compose insecure credentials');\n }\n _isSecure() {\n return false;\n }\n _equals(other) {\n return other instanceof InsecureChannelCredentialsImpl;\n }\n _createSecureConnector(channelTarget, options, callCredentials) {\n return {\n connect(socket) {\n return Promise.resolve({\n socket,\n secure: false\n });\n },\n waitForReady: () => {\n return Promise.resolve();\n },\n getCallCredentials: () => {\n return callCredentials !== null && callCredentials !== void 0 ? callCredentials : call_credentials_1.CallCredentials.createEmpty();\n },\n destroy() { }\n };\n }\n}\nfunction getConnectionOptions(secureContext, verifyOptions, channelTarget, options) {\n var _a, _b, _c, _d;\n const connectionOptions = {\n secureContext: secureContext\n };\n if (verifyOptions.checkServerIdentity) {\n connectionOptions.checkServerIdentity = verifyOptions.checkServerIdentity;\n }\n if (verifyOptions.rejectUnauthorized !== undefined) {\n connectionOptions.rejectUnauthorized = verifyOptions.rejectUnauthorized;\n }\n connectionOptions.ALPNProtocols = ['h2'];\n if (options['grpc.ssl_target_name_override']) {\n const sslTargetNameOverride = options['grpc.ssl_target_name_override'];\n const originalCheckServerIdentity = (_a = connectionOptions.checkServerIdentity) !== null && _a !== void 0 ? _a : tls_1.checkServerIdentity;\n connectionOptions.checkServerIdentity = (host, cert) => {\n return originalCheckServerIdentity(sslTargetNameOverride, cert);\n };\n connectionOptions.servername = sslTargetNameOverride;\n }\n else {\n if ('grpc.http_connect_target' in options) {\n /* This is more or less how servername will be set in createSession\n * if a connection is successfully established through the proxy.\n * If the proxy is not used, these connectionOptions are discarded\n * anyway */\n const targetPath = (0, resolver_1.getDefaultAuthority)((_b = (0, uri_parser_1.parseUri)(options['grpc.http_connect_target'])) !== null && _b !== void 0 ? _b : {\n path: 'localhost',\n });\n const hostPort = (0, uri_parser_1.splitHostPort)(targetPath);\n connectionOptions.servername = (_c = hostPort === null || hostPort === void 0 ? void 0 : hostPort.host) !== null && _c !== void 0 ? _c : targetPath;\n }\n }\n if (options['grpc-node.tls_enable_trace']) {\n connectionOptions.enableTrace = true;\n }\n let realTarget = channelTarget;\n if ('grpc.http_connect_target' in options) {\n const parsedTarget = (0, uri_parser_1.parseUri)(options['grpc.http_connect_target']);\n if (parsedTarget) {\n realTarget = parsedTarget;\n }\n }\n const targetPath = (0, resolver_1.getDefaultAuthority)(realTarget);\n const hostPort = (0, uri_parser_1.splitHostPort)(targetPath);\n const remoteHost = (_d = hostPort === null || hostPort === void 0 ? void 0 : hostPort.host) !== null && _d !== void 0 ? _d : targetPath;\n connectionOptions.host = remoteHost;\n connectionOptions.servername = remoteHost;\n return connectionOptions;\n}\nclass SecureConnectorImpl {\n constructor(connectionOptions, callCredentials) {\n this.connectionOptions = connectionOptions;\n this.callCredentials = callCredentials;\n }\n connect(socket) {\n const tlsConnectOptions = Object.assign({ socket: socket }, this.connectionOptions);\n return new Promise((resolve, reject) => {\n const tlsSocket = (0, tls_1.connect)(tlsConnectOptions, () => {\n var _a;\n if (((_a = this.connectionOptions.rejectUnauthorized) !== null && _a !== void 0 ? _a : true) && !tlsSocket.authorized) {\n reject(tlsSocket.authorizationError);\n return;\n }\n resolve({\n socket: tlsSocket,\n secure: true\n });\n });\n tlsSocket.on('error', (error) => {\n reject(error);\n });\n });\n }\n waitForReady() {\n return Promise.resolve();\n }\n getCallCredentials() {\n return this.callCredentials;\n }\n destroy() { }\n}\nclass SecureChannelCredentialsImpl extends ChannelCredentials {\n constructor(secureContext, verifyOptions) {\n super();\n this.secureContext = secureContext;\n this.verifyOptions = verifyOptions;\n }\n _isSecure() {\n return true;\n }\n _equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof SecureChannelCredentialsImpl) {\n return (this.secureContext === other.secureContext &&\n this.verifyOptions.checkServerIdentity ===\n other.verifyOptions.checkServerIdentity);\n }\n else {\n return false;\n }\n }\n _createSecureConnector(channelTarget, options, callCredentials) {\n const connectionOptions = getConnectionOptions(this.secureContext, this.verifyOptions, channelTarget, options);\n return new SecureConnectorImpl(connectionOptions, callCredentials !== null && callCredentials !== void 0 ? callCredentials : call_credentials_1.CallCredentials.createEmpty());\n }\n}\nclass CertificateProviderChannelCredentialsImpl extends ChannelCredentials {\n constructor(caCertificateProvider, identityCertificateProvider, verifyOptions) {\n super();\n this.caCertificateProvider = caCertificateProvider;\n this.identityCertificateProvider = identityCertificateProvider;\n this.verifyOptions = verifyOptions;\n this.refcount = 0;\n /**\n * `undefined` means that the certificates have not yet been loaded. `null`\n * means that an attempt to load them has completed, and has failed.\n */\n this.latestCaUpdate = undefined;\n /**\n * `undefined` means that the certificates have not yet been loaded. `null`\n * means that an attempt to load them has completed, and has failed.\n */\n this.latestIdentityUpdate = undefined;\n this.caCertificateUpdateListener = this.handleCaCertificateUpdate.bind(this);\n this.identityCertificateUpdateListener = this.handleIdentityCertitificateUpdate.bind(this);\n this.secureContextWatchers = [];\n }\n _isSecure() {\n return true;\n }\n _equals(other) {\n var _a, _b;\n if (this === other) {\n return true;\n }\n if (other instanceof CertificateProviderChannelCredentialsImpl) {\n return this.caCertificateProvider === other.caCertificateProvider &&\n this.identityCertificateProvider === other.identityCertificateProvider &&\n ((_a = this.verifyOptions) === null || _a === void 0 ? void 0 : _a.checkServerIdentity) === ((_b = other.verifyOptions) === null || _b === void 0 ? void 0 : _b.checkServerIdentity);\n }\n else {\n return false;\n }\n }\n ref() {\n var _a;\n if (this.refcount === 0) {\n this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener);\n (_a = this.identityCertificateProvider) === null || _a === void 0 ? void 0 : _a.addIdentityCertificateListener(this.identityCertificateUpdateListener);\n }\n this.refcount += 1;\n }\n unref() {\n var _a;\n this.refcount -= 1;\n if (this.refcount === 0) {\n this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener);\n (_a = this.identityCertificateProvider) === null || _a === void 0 ? void 0 : _a.removeIdentityCertificateListener(this.identityCertificateUpdateListener);\n }\n }\n _createSecureConnector(channelTarget, options, callCredentials) {\n this.ref();\n return new CertificateProviderChannelCredentialsImpl.SecureConnectorImpl(this, channelTarget, options, callCredentials !== null && callCredentials !== void 0 ? callCredentials : call_credentials_1.CallCredentials.createEmpty());\n }\n maybeUpdateWatchers() {\n if (this.hasReceivedUpdates()) {\n for (const watcher of this.secureContextWatchers) {\n watcher(this.getLatestSecureContext());\n }\n this.secureContextWatchers = [];\n }\n }\n handleCaCertificateUpdate(update) {\n this.latestCaUpdate = update;\n this.maybeUpdateWatchers();\n }\n handleIdentityCertitificateUpdate(update) {\n this.latestIdentityUpdate = update;\n this.maybeUpdateWatchers();\n }\n hasReceivedUpdates() {\n if (this.latestCaUpdate === undefined) {\n return false;\n }\n if (this.identityCertificateProvider && this.latestIdentityUpdate === undefined) {\n return false;\n }\n return true;\n }\n getSecureContext() {\n if (this.hasReceivedUpdates()) {\n return Promise.resolve(this.getLatestSecureContext());\n }\n else {\n return new Promise(resolve => {\n this.secureContextWatchers.push(resolve);\n });\n }\n }\n getLatestSecureContext() {\n var _a, _b;\n if (!this.latestCaUpdate) {\n return null;\n }\n if (this.identityCertificateProvider !== null && !this.latestIdentityUpdate) {\n return null;\n }\n try {\n return (0, tls_1.createSecureContext)({\n ca: this.latestCaUpdate.caCertificate,\n key: (_a = this.latestIdentityUpdate) === null || _a === void 0 ? void 0 : _a.privateKey,\n cert: (_b = this.latestIdentityUpdate) === null || _b === void 0 ? void 0 : _b.certificate,\n ciphers: tls_helpers_1.CIPHER_SUITES\n });\n }\n catch (e) {\n (0, logging_1.log)(constants_1.LogVerbosity.ERROR, 'Failed to createSecureContext with error ' + e.message);\n return null;\n }\n }\n}\nCertificateProviderChannelCredentialsImpl.SecureConnectorImpl = class {\n constructor(parent, channelTarget, options, callCredentials) {\n this.parent = parent;\n this.channelTarget = channelTarget;\n this.options = options;\n this.callCredentials = callCredentials;\n }\n connect(socket) {\n return new Promise((resolve, reject) => {\n const secureContext = this.parent.getLatestSecureContext();\n if (!secureContext) {\n reject(new Error('Failed to load credentials'));\n return;\n }\n if (socket.closed) {\n reject(new Error('Socket closed while loading credentials'));\n }\n const connnectionOptions = getConnectionOptions(secureContext, this.parent.verifyOptions, this.channelTarget, this.options);\n const tlsConnectOptions = Object.assign({ socket: socket }, connnectionOptions);\n const closeCallback = () => {\n reject(new Error('Socket closed'));\n };\n const errorCallback = (error) => {\n reject(error);\n };\n const tlsSocket = (0, tls_1.connect)(tlsConnectOptions, () => {\n var _a;\n tlsSocket.removeListener('close', closeCallback);\n tlsSocket.removeListener('error', errorCallback);\n if (((_a = this.parent.verifyOptions.rejectUnauthorized) !== null && _a !== void 0 ? _a : true) && !tlsSocket.authorized) {\n reject(tlsSocket.authorizationError);\n return;\n }\n resolve({\n socket: tlsSocket,\n secure: true\n });\n });\n tlsSocket.once('close', closeCallback);\n tlsSocket.once('error', errorCallback);\n });\n }\n async waitForReady() {\n await this.parent.getSecureContext();\n }\n getCallCredentials() {\n return this.callCredentials;\n }\n destroy() {\n this.parent.unref();\n }\n};\nfunction createCertificateProviderChannelCredentials(caCertificateProvider, identityCertificateProvider, verifyOptions) {\n return new CertificateProviderChannelCredentialsImpl(caCertificateProvider, identityCertificateProvider, verifyOptions !== null && verifyOptions !== void 0 ? verifyOptions : {});\n}\nclass ComposedChannelCredentialsImpl extends ChannelCredentials {\n constructor(channelCredentials, callCredentials) {\n super();\n this.channelCredentials = channelCredentials;\n this.callCredentials = callCredentials;\n if (!channelCredentials._isSecure()) {\n throw new Error('Cannot compose insecure credentials');\n }\n }\n compose(callCredentials) {\n const combinedCallCredentials = this.callCredentials.compose(callCredentials);\n return new ComposedChannelCredentialsImpl(this.channelCredentials, combinedCallCredentials);\n }\n _isSecure() {\n return true;\n }\n _equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof ComposedChannelCredentialsImpl) {\n return (this.channelCredentials._equals(other.channelCredentials) &&\n this.callCredentials._equals(other.callCredentials));\n }\n else {\n return false;\n }\n }\n _createSecureConnector(channelTarget, options, callCredentials) {\n const combinedCallCredentials = this.callCredentials.compose(callCredentials !== null && callCredentials !== void 0 ? callCredentials : call_credentials_1.CallCredentials.createEmpty());\n return this.channelCredentials._createSecureConnector(channelTarget, options, combinedCallCredentials);\n }\n}\n//# sourceMappingURL=channel-credentials.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createChildChannelControlHelper = createChildChannelControlHelper;\nexports.registerLoadBalancerType = registerLoadBalancerType;\nexports.registerDefaultLoadBalancerType = registerDefaultLoadBalancerType;\nexports.createLoadBalancer = createLoadBalancer;\nexports.isLoadBalancerNameRegistered = isLoadBalancerNameRegistered;\nexports.parseLoadBalancingConfig = parseLoadBalancingConfig;\nexports.getDefaultConfig = getDefaultConfig;\nexports.selectLbConfigFromList = selectLbConfigFromList;\nconst logging_1 = require(\"./logging\");\nconst constants_1 = require(\"./constants\");\n/**\n * Create a child ChannelControlHelper that overrides some methods of the\n * parent while letting others pass through to the parent unmodified. This\n * allows other code to create these children without needing to know about\n * all of the methods to be passed through.\n * @param parent\n * @param overrides\n */\nfunction createChildChannelControlHelper(parent, overrides) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n return {\n createSubchannel: (_b = (_a = overrides.createSubchannel) === null || _a === void 0 ? void 0 : _a.bind(overrides)) !== null && _b !== void 0 ? _b : parent.createSubchannel.bind(parent),\n updateState: (_d = (_c = overrides.updateState) === null || _c === void 0 ? void 0 : _c.bind(overrides)) !== null && _d !== void 0 ? _d : parent.updateState.bind(parent),\n requestReresolution: (_f = (_e = overrides.requestReresolution) === null || _e === void 0 ? void 0 : _e.bind(overrides)) !== null && _f !== void 0 ? _f : parent.requestReresolution.bind(parent),\n addChannelzChild: (_h = (_g = overrides.addChannelzChild) === null || _g === void 0 ? void 0 : _g.bind(overrides)) !== null && _h !== void 0 ? _h : parent.addChannelzChild.bind(parent),\n removeChannelzChild: (_k = (_j = overrides.removeChannelzChild) === null || _j === void 0 ? void 0 : _j.bind(overrides)) !== null && _k !== void 0 ? _k : parent.removeChannelzChild.bind(parent),\n };\n}\nconst registeredLoadBalancerTypes = {};\nlet defaultLoadBalancerType = null;\nfunction registerLoadBalancerType(typeName, loadBalancerType, loadBalancingConfigType) {\n registeredLoadBalancerTypes[typeName] = {\n LoadBalancer: loadBalancerType,\n LoadBalancingConfig: loadBalancingConfigType,\n };\n}\nfunction registerDefaultLoadBalancerType(typeName) {\n defaultLoadBalancerType = typeName;\n}\nfunction createLoadBalancer(config, channelControlHelper) {\n const typeName = config.getLoadBalancerName();\n if (typeName in registeredLoadBalancerTypes) {\n return new registeredLoadBalancerTypes[typeName].LoadBalancer(channelControlHelper);\n }\n else {\n return null;\n }\n}\nfunction isLoadBalancerNameRegistered(typeName) {\n return typeName in registeredLoadBalancerTypes;\n}\nfunction parseLoadBalancingConfig(rawConfig) {\n const keys = Object.keys(rawConfig);\n if (keys.length !== 1) {\n throw new Error('Provided load balancing config has multiple conflicting entries');\n }\n const typeName = keys[0];\n if (typeName in registeredLoadBalancerTypes) {\n try {\n return registeredLoadBalancerTypes[typeName].LoadBalancingConfig.createFromJson(rawConfig[typeName]);\n }\n catch (e) {\n throw new Error(`${typeName}: ${e.message}`);\n }\n }\n else {\n throw new Error(`Unrecognized load balancing config name ${typeName}`);\n }\n}\nfunction getDefaultConfig() {\n if (!defaultLoadBalancerType) {\n throw new Error('No default load balancer type registered');\n }\n return new registeredLoadBalancerTypes[defaultLoadBalancerType].LoadBalancingConfig();\n}\nfunction selectLbConfigFromList(configs, fallbackTodefault = false) {\n for (const config of configs) {\n try {\n return parseLoadBalancingConfig(config);\n }\n catch (e) {\n (0, logging_1.log)(constants_1.LogVerbosity.DEBUG, 'Config parsing failed with error', e.message);\n continue;\n }\n }\n if (fallbackTodefault) {\n if (defaultLoadBalancerType) {\n return new registeredLoadBalancerTypes[defaultLoadBalancerType].LoadBalancingConfig();\n }\n else {\n return null;\n }\n }\n else {\n return null;\n }\n}\n//# sourceMappingURL=load-balancer.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateRetryThrottling = validateRetryThrottling;\nexports.validateServiceConfig = validateServiceConfig;\nexports.extractAndSelectServiceConfig = extractAndSelectServiceConfig;\n/* This file implements gRFC A2 and the service config spec:\n * https://github.com/grpc/proposal/blob/master/A2-service-configs-in-dns.md\n * https://github.com/grpc/grpc/blob/master/doc/service_config.md. Each\n * function here takes an object with unknown structure and returns its\n * specific object type if the input has the right structure, and throws an\n * error otherwise. */\n/* The any type is purposely used here. All functions validate their input at\n * runtime */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst os = require(\"os\");\nconst constants_1 = require(\"./constants\");\n/**\n * Recognizes a number with up to 9 digits after the decimal point, followed by\n * an \"s\", representing a number of seconds.\n */\nconst DURATION_REGEX = /^\\d+(\\.\\d{1,9})?s$/;\n/**\n * Client language name used for determining whether this client matches a\n * `ServiceConfigCanaryConfig`'s `clientLanguage` list.\n */\nconst CLIENT_LANGUAGE_STRING = 'node';\nfunction validateName(obj) {\n // In this context, and unset field and '' are considered the same\n if ('service' in obj && obj.service !== '') {\n if (typeof obj.service !== 'string') {\n throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof obj.service}`);\n }\n if ('method' in obj && obj.method !== '') {\n if (typeof obj.method !== 'string') {\n throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof obj.service}`);\n }\n return {\n service: obj.service,\n method: obj.method,\n };\n }\n else {\n return {\n service: obj.service,\n };\n }\n }\n else {\n if ('method' in obj && obj.method !== undefined) {\n throw new Error(`Invalid method config name: method set with empty or unset service`);\n }\n return {};\n }\n}\nfunction validateRetryPolicy(obj) {\n if (!('maxAttempts' in obj) ||\n !Number.isInteger(obj.maxAttempts) ||\n obj.maxAttempts < 2) {\n throw new Error('Invalid method config retry policy: maxAttempts must be an integer at least 2');\n }\n if (!('initialBackoff' in obj) ||\n typeof obj.initialBackoff !== 'string' ||\n !DURATION_REGEX.test(obj.initialBackoff)) {\n throw new Error('Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s');\n }\n if (!('maxBackoff' in obj) ||\n typeof obj.maxBackoff !== 'string' ||\n !DURATION_REGEX.test(obj.maxBackoff)) {\n throw new Error('Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s');\n }\n if (!('backoffMultiplier' in obj) ||\n typeof obj.backoffMultiplier !== 'number' ||\n obj.backoffMultiplier <= 0) {\n throw new Error('Invalid method config retry policy: backoffMultiplier must be a number greater than 0');\n }\n if (!('retryableStatusCodes' in obj && Array.isArray(obj.retryableStatusCodes))) {\n throw new Error('Invalid method config retry policy: retryableStatusCodes is required');\n }\n if (obj.retryableStatusCodes.length === 0) {\n throw new Error('Invalid method config retry policy: retryableStatusCodes must be non-empty');\n }\n for (const value of obj.retryableStatusCodes) {\n if (typeof value === 'number') {\n if (!Object.values(constants_1.Status).includes(value)) {\n throw new Error('Invalid method config retry policy: retryableStatusCodes value not in status code range');\n }\n }\n else if (typeof value === 'string') {\n if (!Object.values(constants_1.Status).includes(value.toUpperCase())) {\n throw new Error('Invalid method config retry policy: retryableStatusCodes value not a status code name');\n }\n }\n else {\n throw new Error('Invalid method config retry policy: retryableStatusCodes value must be a string or number');\n }\n }\n return {\n maxAttempts: obj.maxAttempts,\n initialBackoff: obj.initialBackoff,\n maxBackoff: obj.maxBackoff,\n backoffMultiplier: obj.backoffMultiplier,\n retryableStatusCodes: obj.retryableStatusCodes,\n };\n}\nfunction validateHedgingPolicy(obj) {\n if (!('maxAttempts' in obj) ||\n !Number.isInteger(obj.maxAttempts) ||\n obj.maxAttempts < 2) {\n throw new Error('Invalid method config hedging policy: maxAttempts must be an integer at least 2');\n }\n if ('hedgingDelay' in obj &&\n (typeof obj.hedgingDelay !== 'string' ||\n !DURATION_REGEX.test(obj.hedgingDelay))) {\n throw new Error('Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s');\n }\n if ('nonFatalStatusCodes' in obj && Array.isArray(obj.nonFatalStatusCodes)) {\n for (const value of obj.nonFatalStatusCodes) {\n if (typeof value === 'number') {\n if (!Object.values(constants_1.Status).includes(value)) {\n throw new Error('Invalid method config hedging policy: nonFatalStatusCodes value not in status code range');\n }\n }\n else if (typeof value === 'string') {\n if (!Object.values(constants_1.Status).includes(value.toUpperCase())) {\n throw new Error('Invalid method config hedging policy: nonFatalStatusCodes value not a status code name');\n }\n }\n else {\n throw new Error('Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number');\n }\n }\n }\n const result = {\n maxAttempts: obj.maxAttempts,\n };\n if (obj.hedgingDelay) {\n result.hedgingDelay = obj.hedgingDelay;\n }\n if (obj.nonFatalStatusCodes) {\n result.nonFatalStatusCodes = obj.nonFatalStatusCodes;\n }\n return result;\n}\nfunction validateMethodConfig(obj) {\n var _a;\n const result = {\n name: [],\n };\n if (!('name' in obj) || !Array.isArray(obj.name)) {\n throw new Error('Invalid method config: invalid name array');\n }\n for (const name of obj.name) {\n result.name.push(validateName(name));\n }\n if ('waitForReady' in obj) {\n if (typeof obj.waitForReady !== 'boolean') {\n throw new Error('Invalid method config: invalid waitForReady');\n }\n result.waitForReady = obj.waitForReady;\n }\n if ('timeout' in obj) {\n if (typeof obj.timeout === 'object') {\n if (!('seconds' in obj.timeout) ||\n !(typeof obj.timeout.seconds === 'number')) {\n throw new Error('Invalid method config: invalid timeout.seconds');\n }\n if (!('nanos' in obj.timeout) ||\n !(typeof obj.timeout.nanos === 'number')) {\n throw new Error('Invalid method config: invalid timeout.nanos');\n }\n result.timeout = obj.timeout;\n }\n else if (typeof obj.timeout === 'string' &&\n DURATION_REGEX.test(obj.timeout)) {\n const timeoutParts = obj.timeout\n .substring(0, obj.timeout.length - 1)\n .split('.');\n result.timeout = {\n seconds: timeoutParts[0] | 0,\n nanos: ((_a = timeoutParts[1]) !== null && _a !== void 0 ? _a : 0) | 0,\n };\n }\n else {\n throw new Error('Invalid method config: invalid timeout');\n }\n }\n if ('maxRequestBytes' in obj) {\n if (typeof obj.maxRequestBytes !== 'number') {\n throw new Error('Invalid method config: invalid maxRequestBytes');\n }\n result.maxRequestBytes = obj.maxRequestBytes;\n }\n if ('maxResponseBytes' in obj) {\n if (typeof obj.maxResponseBytes !== 'number') {\n throw new Error('Invalid method config: invalid maxRequestBytes');\n }\n result.maxResponseBytes = obj.maxResponseBytes;\n }\n if ('retryPolicy' in obj) {\n if ('hedgingPolicy' in obj) {\n throw new Error('Invalid method config: retryPolicy and hedgingPolicy cannot both be specified');\n }\n else {\n result.retryPolicy = validateRetryPolicy(obj.retryPolicy);\n }\n }\n else if ('hedgingPolicy' in obj) {\n result.hedgingPolicy = validateHedgingPolicy(obj.hedgingPolicy);\n }\n return result;\n}\nfunction validateRetryThrottling(obj) {\n if (!('maxTokens' in obj) ||\n typeof obj.maxTokens !== 'number' ||\n obj.maxTokens <= 0 ||\n obj.maxTokens > 1000) {\n throw new Error('Invalid retryThrottling: maxTokens must be a number in (0, 1000]');\n }\n if (!('tokenRatio' in obj) ||\n typeof obj.tokenRatio !== 'number' ||\n obj.tokenRatio <= 0) {\n throw new Error('Invalid retryThrottling: tokenRatio must be a number greater than 0');\n }\n return {\n maxTokens: +obj.maxTokens.toFixed(3),\n tokenRatio: +obj.tokenRatio.toFixed(3),\n };\n}\nfunction validateLoadBalancingConfig(obj) {\n if (!(typeof obj === 'object' && obj !== null)) {\n throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof obj}`);\n }\n const keys = Object.keys(obj);\n if (keys.length > 1) {\n throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${keys}`);\n }\n if (keys.length === 0) {\n throw new Error('Invalid loadBalancingConfig: load balancing policy name required');\n }\n return {\n [keys[0]]: obj[keys[0]],\n };\n}\nfunction validateServiceConfig(obj) {\n const result = {\n loadBalancingConfig: [],\n methodConfig: [],\n };\n if ('loadBalancingPolicy' in obj) {\n if (typeof obj.loadBalancingPolicy === 'string') {\n result.loadBalancingPolicy = obj.loadBalancingPolicy;\n }\n else {\n throw new Error('Invalid service config: invalid loadBalancingPolicy');\n }\n }\n if ('loadBalancingConfig' in obj) {\n if (Array.isArray(obj.loadBalancingConfig)) {\n for (const config of obj.loadBalancingConfig) {\n result.loadBalancingConfig.push(validateLoadBalancingConfig(config));\n }\n }\n else {\n throw new Error('Invalid service config: invalid loadBalancingConfig');\n }\n }\n if ('methodConfig' in obj) {\n if (Array.isArray(obj.methodConfig)) {\n for (const methodConfig of obj.methodConfig) {\n result.methodConfig.push(validateMethodConfig(methodConfig));\n }\n }\n }\n if ('retryThrottling' in obj) {\n result.retryThrottling = validateRetryThrottling(obj.retryThrottling);\n }\n // Validate method name uniqueness\n const seenMethodNames = [];\n for (const methodConfig of result.methodConfig) {\n for (const name of methodConfig.name) {\n for (const seenName of seenMethodNames) {\n if (name.service === seenName.service &&\n name.method === seenName.method) {\n throw new Error(`Invalid service config: duplicate name ${name.service}/${name.method}`);\n }\n }\n seenMethodNames.push(name);\n }\n }\n return result;\n}\nfunction validateCanaryConfig(obj) {\n if (!('serviceConfig' in obj)) {\n throw new Error('Invalid service config choice: missing service config');\n }\n const result = {\n serviceConfig: validateServiceConfig(obj.serviceConfig),\n };\n if ('clientLanguage' in obj) {\n if (Array.isArray(obj.clientLanguage)) {\n result.clientLanguage = [];\n for (const lang of obj.clientLanguage) {\n if (typeof lang === 'string') {\n result.clientLanguage.push(lang);\n }\n else {\n throw new Error('Invalid service config choice: invalid clientLanguage');\n }\n }\n }\n else {\n throw new Error('Invalid service config choice: invalid clientLanguage');\n }\n }\n if ('clientHostname' in obj) {\n if (Array.isArray(obj.clientHostname)) {\n result.clientHostname = [];\n for (const lang of obj.clientHostname) {\n if (typeof lang === 'string') {\n result.clientHostname.push(lang);\n }\n else {\n throw new Error('Invalid service config choice: invalid clientHostname');\n }\n }\n }\n else {\n throw new Error('Invalid service config choice: invalid clientHostname');\n }\n }\n if ('percentage' in obj) {\n if (typeof obj.percentage === 'number' &&\n 0 <= obj.percentage &&\n obj.percentage <= 100) {\n result.percentage = obj.percentage;\n }\n else {\n throw new Error('Invalid service config choice: invalid percentage');\n }\n }\n // Validate that no unexpected fields are present\n const allowedFields = [\n 'clientLanguage',\n 'percentage',\n 'clientHostname',\n 'serviceConfig',\n ];\n for (const field in obj) {\n if (!allowedFields.includes(field)) {\n throw new Error(`Invalid service config choice: unexpected field ${field}`);\n }\n }\n return result;\n}\nfunction validateAndSelectCanaryConfig(obj, percentage) {\n if (!Array.isArray(obj)) {\n throw new Error('Invalid service config list');\n }\n for (const config of obj) {\n const validatedConfig = validateCanaryConfig(config);\n /* For each field, we check if it is present, then only discard the\n * config if the field value does not match the current client */\n if (typeof validatedConfig.percentage === 'number' &&\n percentage > validatedConfig.percentage) {\n continue;\n }\n if (Array.isArray(validatedConfig.clientHostname)) {\n let hostnameMatched = false;\n for (const hostname of validatedConfig.clientHostname) {\n if (hostname === os.hostname()) {\n hostnameMatched = true;\n }\n }\n if (!hostnameMatched) {\n continue;\n }\n }\n if (Array.isArray(validatedConfig.clientLanguage)) {\n let languageMatched = false;\n for (const language of validatedConfig.clientLanguage) {\n if (language === CLIENT_LANGUAGE_STRING) {\n languageMatched = true;\n }\n }\n if (!languageMatched) {\n continue;\n }\n }\n return validatedConfig.serviceConfig;\n }\n throw new Error('No matching service config found');\n}\n/**\n * Find the \"grpc_config\" record among the TXT records, parse its value as JSON, validate its contents,\n * and select a service config with selection fields that all match this client. Most of these steps\n * can fail with an error; the caller must handle any errors thrown this way.\n * @param txtRecord The TXT record array that is output from a successful call to dns.resolveTxt\n * @param percentage A number chosen from the range [0, 100) that is used to select which config to use\n * @return The service configuration to use, given the percentage value, or null if the service config\n * data has a valid format but none of the options match the current client.\n */\nfunction extractAndSelectServiceConfig(txtRecord, percentage) {\n for (const record of txtRecord) {\n if (record.length > 0 && record[0].startsWith('grpc_config=')) {\n /* Treat the list of strings in this record as a single string and remove\n * \"grpc_config=\" from the beginning. The rest should be a JSON string */\n const recordString = record.join('').substring('grpc_config='.length);\n const recordJson = JSON.parse(recordString);\n return validateAndSelectCanaryConfig(recordJson, percentage);\n }\n }\n return null;\n}\n//# sourceMappingURL=service-config.js.map","\"use strict\";\n/*\n * Copyright 2021 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConnectivityState = void 0;\nvar ConnectivityState;\n(function (ConnectivityState) {\n ConnectivityState[ConnectivityState[\"IDLE\"] = 0] = \"IDLE\";\n ConnectivityState[ConnectivityState[\"CONNECTING\"] = 1] = \"CONNECTING\";\n ConnectivityState[ConnectivityState[\"READY\"] = 2] = \"READY\";\n ConnectivityState[ConnectivityState[\"TRANSIENT_FAILURE\"] = 3] = \"TRANSIENT_FAILURE\";\n ConnectivityState[ConnectivityState[\"SHUTDOWN\"] = 4] = \"SHUTDOWN\";\n})(ConnectivityState || (exports.ConnectivityState = ConnectivityState = {}));\n//# sourceMappingURL=connectivity-state.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.QueuePicker = exports.UnavailablePicker = exports.PickResultType = void 0;\nconst metadata_1 = require(\"./metadata\");\nconst constants_1 = require(\"./constants\");\nvar PickResultType;\n(function (PickResultType) {\n PickResultType[PickResultType[\"COMPLETE\"] = 0] = \"COMPLETE\";\n PickResultType[PickResultType[\"QUEUE\"] = 1] = \"QUEUE\";\n PickResultType[PickResultType[\"TRANSIENT_FAILURE\"] = 2] = \"TRANSIENT_FAILURE\";\n PickResultType[PickResultType[\"DROP\"] = 3] = \"DROP\";\n})(PickResultType || (exports.PickResultType = PickResultType = {}));\n/**\n * A standard picker representing a load balancer in the TRANSIENT_FAILURE\n * state. Always responds to every pick request with an UNAVAILABLE status.\n */\nclass UnavailablePicker {\n constructor(status) {\n this.status = Object.assign({ code: constants_1.Status.UNAVAILABLE, details: 'No connection established', metadata: new metadata_1.Metadata() }, status);\n }\n pick(pickArgs) {\n return {\n pickResultType: PickResultType.TRANSIENT_FAILURE,\n subchannel: null,\n status: this.status,\n onCallStarted: null,\n onCallEnded: null,\n };\n }\n}\nexports.UnavailablePicker = UnavailablePicker;\n/**\n * A standard picker representing a load balancer in the IDLE or CONNECTING\n * state. Always responds to every pick request with a QUEUE pick result\n * indicating that the pick should be tried again with the next `Picker`. Also\n * reports back to the load balancer that a connection should be established\n * once any pick is attempted.\n * If the childPicker is provided, delegate to it instead of returning the\n * hardcoded QUEUE pick result, but still calls exitIdle.\n */\nclass QueuePicker {\n // Constructed with a load balancer. Calls exitIdle on it the first time pick is called\n constructor(loadBalancer, childPicker) {\n this.loadBalancer = loadBalancer;\n this.childPicker = childPicker;\n this.calledExitIdle = false;\n }\n pick(pickArgs) {\n if (!this.calledExitIdle) {\n process.nextTick(() => {\n this.loadBalancer.exitIdle();\n });\n this.calledExitIdle = true;\n }\n if (this.childPicker) {\n return this.childPicker.pick(pickArgs);\n }\n else {\n return {\n pickResultType: PickResultType.QUEUE,\n subchannel: null,\n status: null,\n onCallStarted: null,\n onCallEnded: null,\n };\n }\n }\n}\nexports.QueuePicker = QueuePicker;\n//# sourceMappingURL=picker.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BackoffTimeout = void 0;\nconst constants_1 = require(\"./constants\");\nconst logging = require(\"./logging\");\nconst TRACER_NAME = 'backoff';\nconst INITIAL_BACKOFF_MS = 1000;\nconst BACKOFF_MULTIPLIER = 1.6;\nconst MAX_BACKOFF_MS = 120000;\nconst BACKOFF_JITTER = 0.2;\n/**\n * Get a number uniformly at random in the range [min, max)\n * @param min\n * @param max\n */\nfunction uniformRandom(min, max) {\n return Math.random() * (max - min) + min;\n}\nclass BackoffTimeout {\n constructor(callback, options) {\n this.callback = callback;\n /**\n * The delay time at the start, and after each reset.\n */\n this.initialDelay = INITIAL_BACKOFF_MS;\n /**\n * The exponential backoff multiplier.\n */\n this.multiplier = BACKOFF_MULTIPLIER;\n /**\n * The maximum delay time\n */\n this.maxDelay = MAX_BACKOFF_MS;\n /**\n * The maximum fraction by which the delay time can randomly vary after\n * applying the multiplier.\n */\n this.jitter = BACKOFF_JITTER;\n /**\n * Indicates whether the timer is currently running.\n */\n this.running = false;\n /**\n * Indicates whether the timer should keep the Node process running if no\n * other async operation is doing so.\n */\n this.hasRef = true;\n /**\n * The time that the currently running timer was started. Only valid if\n * running is true.\n */\n this.startTime = new Date();\n /**\n * The approximate time that the currently running timer will end. Only valid\n * if running is true.\n */\n this.endTime = new Date();\n this.id = BackoffTimeout.getNextId();\n if (options) {\n if (options.initialDelay) {\n this.initialDelay = options.initialDelay;\n }\n if (options.multiplier) {\n this.multiplier = options.multiplier;\n }\n if (options.jitter) {\n this.jitter = options.jitter;\n }\n if (options.maxDelay) {\n this.maxDelay = options.maxDelay;\n }\n }\n this.trace('constructed initialDelay=' + this.initialDelay + ' multiplier=' + this.multiplier + ' jitter=' + this.jitter + ' maxDelay=' + this.maxDelay);\n this.nextDelay = this.initialDelay;\n this.timerId = setTimeout(() => { }, 0);\n clearTimeout(this.timerId);\n }\n static getNextId() {\n return this.nextId++;\n }\n trace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, '{' + this.id + '} ' + text);\n }\n runTimer(delay) {\n var _a, _b;\n this.trace('runTimer(delay=' + delay + ')');\n this.endTime = this.startTime;\n this.endTime.setMilliseconds(this.endTime.getMilliseconds() + delay);\n clearTimeout(this.timerId);\n this.timerId = setTimeout(() => {\n this.trace('timer fired');\n this.running = false;\n this.callback();\n }, delay);\n if (!this.hasRef) {\n (_b = (_a = this.timerId).unref) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n }\n /**\n * Call the callback after the current amount of delay time\n */\n runOnce() {\n this.trace('runOnce()');\n this.running = true;\n this.startTime = new Date();\n this.runTimer(this.nextDelay);\n const nextBackoff = Math.min(this.nextDelay * this.multiplier, this.maxDelay);\n const jitterMagnitude = nextBackoff * this.jitter;\n this.nextDelay =\n nextBackoff + uniformRandom(-jitterMagnitude, jitterMagnitude);\n }\n /**\n * Stop the timer. The callback will not be called until `runOnce` is called\n * again.\n */\n stop() {\n this.trace('stop()');\n clearTimeout(this.timerId);\n this.running = false;\n }\n /**\n * Reset the delay time to its initial value. If the timer is still running,\n * retroactively apply that reset to the current timer.\n */\n reset() {\n this.trace('reset() running=' + this.running);\n this.nextDelay = this.initialDelay;\n if (this.running) {\n const now = new Date();\n const newEndTime = this.startTime;\n newEndTime.setMilliseconds(newEndTime.getMilliseconds() + this.nextDelay);\n clearTimeout(this.timerId);\n if (now < newEndTime) {\n this.runTimer(newEndTime.getTime() - now.getTime());\n }\n else {\n this.running = false;\n }\n }\n }\n /**\n * Check whether the timer is currently running.\n */\n isRunning() {\n return this.running;\n }\n /**\n * Set that while the timer is running, it should keep the Node process\n * running.\n */\n ref() {\n var _a, _b;\n this.hasRef = true;\n (_b = (_a = this.timerId).ref) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n /**\n * Set that while the timer is running, it should not keep the Node process\n * running.\n */\n unref() {\n var _a, _b;\n this.hasRef = false;\n (_b = (_a = this.timerId).unref) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n /**\n * Get the approximate timestamp of when the timer will fire. Only valid if\n * this.isRunning() is true.\n */\n getEndTime() {\n return this.endTime;\n }\n}\nexports.BackoffTimeout = BackoffTimeout;\nBackoffTimeout.nextId = 0;\n//# sourceMappingURL=backoff-timeout.js.map","\"use strict\";\n/*\n * Copyright 2020 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ChildLoadBalancerHandler = void 0;\nconst load_balancer_1 = require(\"./load-balancer\");\nconst connectivity_state_1 = require(\"./connectivity-state\");\nconst TYPE_NAME = 'child_load_balancer_helper';\nclass ChildLoadBalancerHandler {\n constructor(channelControlHelper) {\n this.channelControlHelper = channelControlHelper;\n this.currentChild = null;\n this.pendingChild = null;\n this.latestConfig = null;\n this.ChildPolicyHelper = class {\n constructor(parent) {\n this.parent = parent;\n this.child = null;\n }\n createSubchannel(subchannelAddress, subchannelArgs) {\n return this.parent.channelControlHelper.createSubchannel(subchannelAddress, subchannelArgs);\n }\n updateState(connectivityState, picker, errorMessage) {\n var _a;\n if (this.calledByPendingChild()) {\n if (connectivityState === connectivity_state_1.ConnectivityState.CONNECTING) {\n return;\n }\n (_a = this.parent.currentChild) === null || _a === void 0 ? void 0 : _a.destroy();\n this.parent.currentChild = this.parent.pendingChild;\n this.parent.pendingChild = null;\n }\n else if (!this.calledByCurrentChild()) {\n return;\n }\n this.parent.channelControlHelper.updateState(connectivityState, picker, errorMessage);\n }\n requestReresolution() {\n var _a;\n const latestChild = (_a = this.parent.pendingChild) !== null && _a !== void 0 ? _a : this.parent.currentChild;\n if (this.child === latestChild) {\n this.parent.channelControlHelper.requestReresolution();\n }\n }\n setChild(newChild) {\n this.child = newChild;\n }\n addChannelzChild(child) {\n this.parent.channelControlHelper.addChannelzChild(child);\n }\n removeChannelzChild(child) {\n this.parent.channelControlHelper.removeChannelzChild(child);\n }\n calledByPendingChild() {\n return this.child === this.parent.pendingChild;\n }\n calledByCurrentChild() {\n return this.child === this.parent.currentChild;\n }\n };\n }\n configUpdateRequiresNewPolicyInstance(oldConfig, newConfig) {\n return oldConfig.getLoadBalancerName() !== newConfig.getLoadBalancerName();\n }\n /**\n * Prerequisites: lbConfig !== null and lbConfig.name is registered\n * @param endpointList\n * @param lbConfig\n * @param attributes\n */\n updateAddressList(endpointList, lbConfig, options) {\n let childToUpdate;\n if (this.currentChild === null ||\n this.latestConfig === null ||\n this.configUpdateRequiresNewPolicyInstance(this.latestConfig, lbConfig)) {\n const newHelper = new this.ChildPolicyHelper(this);\n const newChild = (0, load_balancer_1.createLoadBalancer)(lbConfig, newHelper);\n newHelper.setChild(newChild);\n if (this.currentChild === null) {\n this.currentChild = newChild;\n childToUpdate = this.currentChild;\n }\n else {\n if (this.pendingChild) {\n this.pendingChild.destroy();\n }\n this.pendingChild = newChild;\n childToUpdate = this.pendingChild;\n }\n }\n else {\n if (this.pendingChild === null) {\n childToUpdate = this.currentChild;\n }\n else {\n childToUpdate = this.pendingChild;\n }\n }\n this.latestConfig = lbConfig;\n childToUpdate.updateAddressList(endpointList, lbConfig, options);\n }\n exitIdle() {\n if (this.currentChild) {\n this.currentChild.exitIdle();\n if (this.pendingChild) {\n this.pendingChild.exitIdle();\n }\n }\n }\n resetBackoff() {\n if (this.currentChild) {\n this.currentChild.resetBackoff();\n if (this.pendingChild) {\n this.pendingChild.resetBackoff();\n }\n }\n }\n destroy() {\n /* Note: state updates are only propagated from the child balancer if that\n * object is equal to this.currentChild or this.pendingChild. Since this\n * function sets both of those to null, no further state updates will\n * occur after this function returns. */\n if (this.currentChild) {\n this.currentChild.destroy();\n this.currentChild = null;\n }\n if (this.pendingChild) {\n this.pendingChild.destroy();\n this.pendingChild = null;\n }\n }\n getTypeName() {\n return TYPE_NAME;\n }\n}\nexports.ChildLoadBalancerHandler = ChildLoadBalancerHandler;\n//# sourceMappingURL=load-balancer-child-handler.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ResolvingLoadBalancer = void 0;\nconst load_balancer_1 = require(\"./load-balancer\");\nconst service_config_1 = require(\"./service-config\");\nconst connectivity_state_1 = require(\"./connectivity-state\");\nconst resolver_1 = require(\"./resolver\");\nconst picker_1 = require(\"./picker\");\nconst backoff_timeout_1 = require(\"./backoff-timeout\");\nconst constants_1 = require(\"./constants\");\nconst metadata_1 = require(\"./metadata\");\nconst logging = require(\"./logging\");\nconst constants_2 = require(\"./constants\");\nconst uri_parser_1 = require(\"./uri-parser\");\nconst load_balancer_child_handler_1 = require(\"./load-balancer-child-handler\");\nconst TRACER_NAME = 'resolving_load_balancer';\nfunction trace(text) {\n logging.trace(constants_2.LogVerbosity.DEBUG, TRACER_NAME, text);\n}\n/**\n * Name match levels in order from most to least specific. This is the order in\n * which searches will be performed.\n */\nconst NAME_MATCH_LEVEL_ORDER = [\n 'SERVICE_AND_METHOD',\n 'SERVICE',\n 'EMPTY',\n];\nfunction hasMatchingName(service, method, methodConfig, matchLevel) {\n for (const name of methodConfig.name) {\n switch (matchLevel) {\n case 'EMPTY':\n if (!name.service && !name.method) {\n return true;\n }\n break;\n case 'SERVICE':\n if (name.service === service && !name.method) {\n return true;\n }\n break;\n case 'SERVICE_AND_METHOD':\n if (name.service === service && name.method === method) {\n return true;\n }\n }\n }\n return false;\n}\nfunction findMatchingConfig(service, method, methodConfigs, matchLevel) {\n for (const config of methodConfigs) {\n if (hasMatchingName(service, method, config, matchLevel)) {\n return config;\n }\n }\n return null;\n}\nfunction getDefaultConfigSelector(serviceConfig) {\n return {\n invoke(methodName, metadata) {\n var _a, _b;\n const splitName = methodName.split('/').filter(x => x.length > 0);\n const service = (_a = splitName[0]) !== null && _a !== void 0 ? _a : '';\n const method = (_b = splitName[1]) !== null && _b !== void 0 ? _b : '';\n if (serviceConfig && serviceConfig.methodConfig) {\n /* Check for the following in order, and return the first method\n * config that matches:\n * 1. A name that exactly matches the service and method\n * 2. A name with no method set that matches the service\n * 3. An empty name\n */\n for (const matchLevel of NAME_MATCH_LEVEL_ORDER) {\n const matchingConfig = findMatchingConfig(service, method, serviceConfig.methodConfig, matchLevel);\n if (matchingConfig) {\n return {\n methodConfig: matchingConfig,\n pickInformation: {},\n status: constants_1.Status.OK,\n dynamicFilterFactories: [],\n };\n }\n }\n }\n return {\n methodConfig: { name: [] },\n pickInformation: {},\n status: constants_1.Status.OK,\n dynamicFilterFactories: [],\n };\n },\n unref() { }\n };\n}\nclass ResolvingLoadBalancer {\n /**\n * Wrapper class that behaves like a `LoadBalancer` and also handles name\n * resolution internally.\n * @param target The address of the backend to connect to.\n * @param channelControlHelper `ChannelControlHelper` instance provided by\n * this load balancer's owner.\n * @param defaultServiceConfig The default service configuration to be used\n * if none is provided by the name resolver. A `null` value indicates\n * that the default behavior should be the default unconfigured behavior.\n * In practice, that means using the \"pick first\" load balancer\n * implmentation\n */\n constructor(target, channelControlHelper, channelOptions, onSuccessfulResolution, onFailedResolution) {\n this.target = target;\n this.channelControlHelper = channelControlHelper;\n this.channelOptions = channelOptions;\n this.onSuccessfulResolution = onSuccessfulResolution;\n this.onFailedResolution = onFailedResolution;\n this.latestChildState = connectivity_state_1.ConnectivityState.IDLE;\n this.latestChildPicker = new picker_1.QueuePicker(this);\n this.latestChildErrorMessage = null;\n /**\n * This resolving load balancer's current connectivity state.\n */\n this.currentState = connectivity_state_1.ConnectivityState.IDLE;\n /**\n * The service config object from the last successful resolution, if\n * available. A value of null indicates that we have not yet received a valid\n * service config from the resolver.\n */\n this.previousServiceConfig = null;\n /**\n * Indicates whether we should attempt to resolve again after the backoff\n * timer runs out.\n */\n this.continueResolving = false;\n if (channelOptions['grpc.service_config']) {\n this.defaultServiceConfig = (0, service_config_1.validateServiceConfig)(JSON.parse(channelOptions['grpc.service_config']));\n }\n else {\n this.defaultServiceConfig = {\n loadBalancingConfig: [],\n methodConfig: [],\n };\n }\n this.updateState(connectivity_state_1.ConnectivityState.IDLE, new picker_1.QueuePicker(this), null);\n this.childLoadBalancer = new load_balancer_child_handler_1.ChildLoadBalancerHandler({\n createSubchannel: channelControlHelper.createSubchannel.bind(channelControlHelper),\n requestReresolution: () => {\n /* If the backoffTimeout is running, we're still backing off from\n * making resolve requests, so we shouldn't make another one here.\n * In that case, the backoff timer callback will call\n * updateResolution */\n if (this.backoffTimeout.isRunning()) {\n trace('requestReresolution delayed by backoff timer until ' +\n this.backoffTimeout.getEndTime().toISOString());\n this.continueResolving = true;\n }\n else {\n this.updateResolution();\n }\n },\n updateState: (newState, picker, errorMessage) => {\n this.latestChildState = newState;\n this.latestChildPicker = picker;\n this.latestChildErrorMessage = errorMessage;\n this.updateState(newState, picker, errorMessage);\n },\n addChannelzChild: channelControlHelper.addChannelzChild.bind(channelControlHelper),\n removeChannelzChild: channelControlHelper.removeChannelzChild.bind(channelControlHelper),\n });\n this.innerResolver = (0, resolver_1.createResolver)(target, {\n onSuccessfulResolution: (endpointList, serviceConfig, serviceConfigError, configSelector, attributes) => {\n var _a;\n this.backoffTimeout.stop();\n this.backoffTimeout.reset();\n let workingServiceConfig = null;\n /* This first group of conditionals implements the algorithm described\n * in https://github.com/grpc/proposal/blob/master/A21-service-config-error-handling.md\n * in the section called \"Behavior on receiving a new gRPC Config\".\n */\n if (serviceConfig === null) {\n // Step 4 and 5\n if (serviceConfigError === null) {\n // Step 5\n this.previousServiceConfig = null;\n workingServiceConfig = this.defaultServiceConfig;\n }\n else {\n // Step 4\n if (this.previousServiceConfig === null) {\n // Step 4.ii\n this.handleResolutionFailure(serviceConfigError);\n }\n else {\n // Step 4.i\n workingServiceConfig = this.previousServiceConfig;\n }\n }\n }\n else {\n // Step 3\n workingServiceConfig = serviceConfig;\n this.previousServiceConfig = serviceConfig;\n }\n const workingConfigList = (_a = workingServiceConfig === null || workingServiceConfig === void 0 ? void 0 : workingServiceConfig.loadBalancingConfig) !== null && _a !== void 0 ? _a : [];\n const loadBalancingConfig = (0, load_balancer_1.selectLbConfigFromList)(workingConfigList, true);\n if (loadBalancingConfig === null) {\n // There were load balancing configs but none are supported. This counts as a resolution failure\n this.handleResolutionFailure({\n code: constants_1.Status.UNAVAILABLE,\n details: 'All load balancer options in service config are not compatible',\n metadata: new metadata_1.Metadata(),\n });\n configSelector === null || configSelector === void 0 ? void 0 : configSelector.unref();\n return;\n }\n this.childLoadBalancer.updateAddressList(endpointList, loadBalancingConfig, Object.assign(Object.assign({}, this.channelOptions), attributes));\n const finalServiceConfig = workingServiceConfig !== null && workingServiceConfig !== void 0 ? workingServiceConfig : this.defaultServiceConfig;\n this.onSuccessfulResolution(finalServiceConfig, configSelector !== null && configSelector !== void 0 ? configSelector : getDefaultConfigSelector(finalServiceConfig));\n },\n onError: (error) => {\n this.handleResolutionFailure(error);\n },\n }, channelOptions);\n const backoffOptions = {\n initialDelay: channelOptions['grpc.initial_reconnect_backoff_ms'],\n maxDelay: channelOptions['grpc.max_reconnect_backoff_ms'],\n };\n this.backoffTimeout = new backoff_timeout_1.BackoffTimeout(() => {\n if (this.continueResolving) {\n this.updateResolution();\n this.continueResolving = false;\n }\n else {\n this.updateState(this.latestChildState, this.latestChildPicker, this.latestChildErrorMessage);\n }\n }, backoffOptions);\n this.backoffTimeout.unref();\n }\n updateResolution() {\n this.innerResolver.updateResolution();\n if (this.currentState === connectivity_state_1.ConnectivityState.IDLE) {\n /* this.latestChildPicker is initialized as new QueuePicker(this), which\n * is an appropriate value here if the child LB policy is unset.\n * Otherwise, we want to delegate to the child here, in case that\n * triggers something. */\n this.updateState(connectivity_state_1.ConnectivityState.CONNECTING, this.latestChildPicker, this.latestChildErrorMessage);\n }\n this.backoffTimeout.runOnce();\n }\n updateState(connectivityState, picker, errorMessage) {\n trace((0, uri_parser_1.uriToString)(this.target) +\n ' ' +\n connectivity_state_1.ConnectivityState[this.currentState] +\n ' -> ' +\n connectivity_state_1.ConnectivityState[connectivityState]);\n // Ensure that this.exitIdle() is called by the picker\n if (connectivityState === connectivity_state_1.ConnectivityState.IDLE) {\n picker = new picker_1.QueuePicker(this, picker);\n }\n this.currentState = connectivityState;\n this.channelControlHelper.updateState(connectivityState, picker, errorMessage);\n }\n handleResolutionFailure(error) {\n if (this.latestChildState === connectivity_state_1.ConnectivityState.IDLE) {\n this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker(error), error.details);\n this.onFailedResolution(error);\n }\n }\n exitIdle() {\n if (this.currentState === connectivity_state_1.ConnectivityState.IDLE ||\n this.currentState === connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) {\n if (this.backoffTimeout.isRunning()) {\n this.continueResolving = true;\n }\n else {\n this.updateResolution();\n }\n }\n this.childLoadBalancer.exitIdle();\n }\n updateAddressList(endpointList, lbConfig) {\n throw new Error('updateAddressList not supported on ResolvingLoadBalancer');\n }\n resetBackoff() {\n this.backoffTimeout.reset();\n this.childLoadBalancer.resetBackoff();\n }\n destroy() {\n this.childLoadBalancer.destroy();\n this.innerResolver.destroy();\n this.backoffTimeout.reset();\n this.backoffTimeout.stop();\n this.latestChildState = connectivity_state_1.ConnectivityState.IDLE;\n this.latestChildPicker = new picker_1.QueuePicker(this);\n this.currentState = connectivity_state_1.ConnectivityState.IDLE;\n this.previousServiceConfig = null;\n this.continueResolving = false;\n }\n getTypeName() {\n return 'resolving_load_balancer';\n }\n}\nexports.ResolvingLoadBalancer = ResolvingLoadBalancer;\n//# sourceMappingURL=resolving-load-balancer.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.recognizedOptions = void 0;\nexports.channelOptionsEqual = channelOptionsEqual;\n/**\n * This is for checking provided options at runtime. This is an object for\n * easier membership checking.\n */\nexports.recognizedOptions = {\n 'grpc.ssl_target_name_override': true,\n 'grpc.primary_user_agent': true,\n 'grpc.secondary_user_agent': true,\n 'grpc.default_authority': true,\n 'grpc.keepalive_time_ms': true,\n 'grpc.keepalive_timeout_ms': true,\n 'grpc.keepalive_permit_without_calls': true,\n 'grpc.service_config': true,\n 'grpc.max_concurrent_streams': true,\n 'grpc.initial_reconnect_backoff_ms': true,\n 'grpc.max_reconnect_backoff_ms': true,\n 'grpc.use_local_subchannel_pool': true,\n 'grpc.max_send_message_length': true,\n 'grpc.max_receive_message_length': true,\n 'grpc.enable_http_proxy': true,\n 'grpc.enable_channelz': true,\n 'grpc.dns_min_time_between_resolutions_ms': true,\n 'grpc.enable_retries': true,\n 'grpc.per_rpc_retry_buffer_size': true,\n 'grpc.retry_buffer_size': true,\n 'grpc.max_connection_age_ms': true,\n 'grpc.max_connection_age_grace_ms': true,\n 'grpc-node.max_session_memory': true,\n 'grpc.service_config_disable_resolution': true,\n 'grpc.client_idle_timeout_ms': true,\n 'grpc-node.tls_enable_trace': true,\n 'grpc.lb.ring_hash.ring_size_cap': true,\n 'grpc-node.retry_max_attempts_limit': true,\n 'grpc-node.flow_control_window': true,\n};\nfunction channelOptionsEqual(options1, options2) {\n const keys1 = Object.keys(options1).sort();\n const keys2 = Object.keys(options2).sort();\n if (keys1.length !== keys2.length) {\n return false;\n }\n for (let i = 0; i < keys1.length; i += 1) {\n if (keys1[i] !== keys2[i]) {\n return false;\n }\n if (options1[keys1[i]] !== options2[keys2[i]]) {\n return false;\n }\n }\n return true;\n}\n//# sourceMappingURL=channel-options.js.map","\"use strict\";\n/*\n * Copyright 2021 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EndpointMap = void 0;\nexports.isTcpSubchannelAddress = isTcpSubchannelAddress;\nexports.subchannelAddressEqual = subchannelAddressEqual;\nexports.subchannelAddressToString = subchannelAddressToString;\nexports.stringToSubchannelAddress = stringToSubchannelAddress;\nexports.endpointEqual = endpointEqual;\nexports.endpointToString = endpointToString;\nexports.endpointHasAddress = endpointHasAddress;\nconst net_1 = require(\"net\");\nfunction isTcpSubchannelAddress(address) {\n return 'port' in address;\n}\nfunction subchannelAddressEqual(address1, address2) {\n if (!address1 && !address2) {\n return true;\n }\n if (!address1 || !address2) {\n return false;\n }\n if (isTcpSubchannelAddress(address1)) {\n return (isTcpSubchannelAddress(address2) &&\n address1.host === address2.host &&\n address1.port === address2.port);\n }\n else {\n return !isTcpSubchannelAddress(address2) && address1.path === address2.path;\n }\n}\nfunction subchannelAddressToString(address) {\n if (isTcpSubchannelAddress(address)) {\n if ((0, net_1.isIPv6)(address.host)) {\n return '[' + address.host + ']:' + address.port;\n }\n else {\n return address.host + ':' + address.port;\n }\n }\n else {\n return address.path;\n }\n}\nconst DEFAULT_PORT = 443;\nfunction stringToSubchannelAddress(addressString, port) {\n if ((0, net_1.isIP)(addressString)) {\n return {\n host: addressString,\n port: port !== null && port !== void 0 ? port : DEFAULT_PORT,\n };\n }\n else {\n return {\n path: addressString,\n };\n }\n}\nfunction endpointEqual(endpoint1, endpoint2) {\n if (endpoint1.addresses.length !== endpoint2.addresses.length) {\n return false;\n }\n for (let i = 0; i < endpoint1.addresses.length; i++) {\n if (!subchannelAddressEqual(endpoint1.addresses[i], endpoint2.addresses[i])) {\n return false;\n }\n }\n return true;\n}\nfunction endpointToString(endpoint) {\n return ('[' + endpoint.addresses.map(subchannelAddressToString).join(', ') + ']');\n}\nfunction endpointHasAddress(endpoint, expectedAddress) {\n for (const address of endpoint.addresses) {\n if (subchannelAddressEqual(address, expectedAddress)) {\n return true;\n }\n }\n return false;\n}\nfunction endpointEqualUnordered(endpoint1, endpoint2) {\n if (endpoint1.addresses.length !== endpoint2.addresses.length) {\n return false;\n }\n for (const address1 of endpoint1.addresses) {\n let matchFound = false;\n for (const address2 of endpoint2.addresses) {\n if (subchannelAddressEqual(address1, address2)) {\n matchFound = true;\n break;\n }\n }\n if (!matchFound) {\n return false;\n }\n }\n return true;\n}\nclass EndpointMap {\n constructor() {\n this.map = new Set();\n }\n get size() {\n return this.map.size;\n }\n getForSubchannelAddress(address) {\n for (const entry of this.map) {\n if (endpointHasAddress(entry.key, address)) {\n return entry.value;\n }\n }\n return undefined;\n }\n /**\n * Delete any entries in this map with keys that are not in endpoints\n * @param endpoints\n */\n deleteMissing(endpoints) {\n const removedValues = [];\n for (const entry of this.map) {\n let foundEntry = false;\n for (const endpoint of endpoints) {\n if (endpointEqualUnordered(endpoint, entry.key)) {\n foundEntry = true;\n }\n }\n if (!foundEntry) {\n removedValues.push(entry.value);\n this.map.delete(entry);\n }\n }\n return removedValues;\n }\n get(endpoint) {\n for (const entry of this.map) {\n if (endpointEqualUnordered(endpoint, entry.key)) {\n return entry.value;\n }\n }\n return undefined;\n }\n set(endpoint, mapEntry) {\n for (const entry of this.map) {\n if (endpointEqualUnordered(endpoint, entry.key)) {\n entry.value = mapEntry;\n return;\n }\n }\n this.map.add({ key: endpoint, value: mapEntry });\n }\n delete(endpoint) {\n for (const entry of this.map) {\n if (endpointEqualUnordered(endpoint, entry.key)) {\n this.map.delete(entry);\n return;\n }\n }\n }\n has(endpoint) {\n for (const entry of this.map) {\n if (endpointEqualUnordered(endpoint, entry.key)) {\n return true;\n }\n }\n return false;\n }\n clear() {\n this.map.clear();\n }\n *keys() {\n for (const entry of this.map) {\n yield entry.key;\n }\n }\n *values() {\n for (const entry of this.map) {\n yield entry.value;\n }\n }\n *entries() {\n for (const entry of this.map) {\n yield [entry.key, entry.value];\n }\n }\n}\nexports.EndpointMap = EndpointMap;\n//# sourceMappingURL=subchannel-address.js.map","var extendStatics = function(e, r) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function(e, r) {\n e.__proto__ = r;\n } || function(e, r) {\n for (var t in r) if (Object.prototype.hasOwnProperty.call(r, t)) e[t] = r[t];\n };\n return extendStatics(e, r);\n};\n\nfunction __extends(e, r) {\n if (typeof r !== \"function\" && r !== null) throw new TypeError(\"Class extends value \" + String(r) + \" is not a constructor or null\");\n extendStatics(e, r);\n function __() {\n this.constructor = e;\n }\n e.prototype = r === null ? Object.create(r) : (__.prototype = r.prototype, new __);\n}\n\nfunction __generator(e, r) {\n var t = {\n label: 0,\n sent: function() {\n if (s[0] & 1) throw s[1];\n return s[1];\n },\n trys: [],\n ops: []\n }, i, n, s, h;\n return h = {\n next: verb(0),\n throw: verb(1),\n return: verb(2)\n }, typeof Symbol === \"function\" && (h[Symbol.iterator] = function() {\n return this;\n }), h;\n function verb(e) {\n return function(r) {\n return step([ e, r ]);\n };\n }\n function step(a) {\n if (i) throw new TypeError(\"Generator is already executing.\");\n while (h && (h = 0, a[0] && (t = 0)), t) try {\n if (i = 1, n && (s = a[0] & 2 ? n[\"return\"] : a[0] ? n[\"throw\"] || ((s = n[\"return\"]) && s.call(n), \n 0) : n.next) && !(s = s.call(n, a[1])).done) return s;\n if (n = 0, s) a = [ a[0] & 2, s.value ];\n switch (a[0]) {\n case 0:\n case 1:\n s = a;\n break;\n\n case 4:\n t.label++;\n return {\n value: a[1],\n done: false\n };\n\n case 5:\n t.label++;\n n = a[1];\n a = [ 0 ];\n continue;\n\n case 7:\n a = t.ops.pop();\n t.trys.pop();\n continue;\n\n default:\n if (!(s = t.trys, s = s.length > 0 && s[s.length - 1]) && (a[0] === 6 || a[0] === 2)) {\n t = 0;\n continue;\n }\n if (a[0] === 3 && (!s || a[1] > s[0] && a[1] < s[3])) {\n t.label = a[1];\n break;\n }\n if (a[0] === 6 && t.label < s[1]) {\n t.label = s[1];\n s = a;\n break;\n }\n if (s && t.label < s[2]) {\n t.label = s[2];\n t.ops.push(a);\n break;\n }\n if (s[2]) t.ops.pop();\n t.trys.pop();\n continue;\n }\n a = r.call(e, t);\n } catch (e) {\n a = [ 6, e ];\n n = 0;\n } finally {\n i = s = 0;\n }\n if (a[0] & 5) throw a[1];\n return {\n value: a[0] ? a[1] : void 0,\n done: true\n };\n }\n}\n\ntypeof SuppressedError === \"function\" ? SuppressedError : function(e, r, t) {\n var i = new Error(t);\n return i.name = \"SuppressedError\", i.error = e, i.suppressed = r, i;\n};\n\nvar TreeNode = function() {\n function TreeNode(e, r, t) {\n if (t === void 0) {\n t = 1;\n }\n this.t = undefined;\n this.i = undefined;\n this.h = undefined;\n this.u = e;\n this.o = r;\n this.l = t;\n }\n TreeNode.prototype.v = function() {\n var e = this;\n var r = e.h.h === e;\n if (r && e.l === 1) {\n e = e.i;\n } else if (e.t) {\n e = e.t;\n while (e.i) {\n e = e.i;\n }\n } else {\n if (r) {\n return e.h;\n }\n var t = e.h;\n while (t.t === e) {\n e = t;\n t = e.h;\n }\n e = t;\n }\n return e;\n };\n TreeNode.prototype.p = function() {\n var e = this;\n if (e.i) {\n e = e.i;\n while (e.t) {\n e = e.t;\n }\n return e;\n } else {\n var r = e.h;\n while (r.i === e) {\n e = r;\n r = e.h;\n }\n if (e.i !== r) {\n return r;\n } else return e;\n }\n };\n TreeNode.prototype.T = function() {\n var e = this.h;\n var r = this.i;\n var t = r.t;\n if (e.h === this) e.h = r; else if (e.t === this) e.t = r; else e.i = r;\n r.h = e;\n r.t = this;\n this.h = r;\n this.i = t;\n if (t) t.h = this;\n return r;\n };\n TreeNode.prototype.I = function() {\n var e = this.h;\n var r = this.t;\n var t = r.i;\n if (e.h === this) e.h = r; else if (e.t === this) e.t = r; else e.i = r;\n r.h = e;\n r.i = this;\n this.h = r;\n this.t = t;\n if (t) t.h = this;\n return r;\n };\n return TreeNode;\n}();\n\nvar TreeNodeEnableIndex = function(e) {\n __extends(TreeNodeEnableIndex, e);\n function TreeNodeEnableIndex() {\n var r = e !== null && e.apply(this, arguments) || this;\n r.O = 1;\n return r;\n }\n TreeNodeEnableIndex.prototype.T = function() {\n var r = e.prototype.T.call(this);\n this.M();\n r.M();\n return r;\n };\n TreeNodeEnableIndex.prototype.I = function() {\n var r = e.prototype.I.call(this);\n this.M();\n r.M();\n return r;\n };\n TreeNodeEnableIndex.prototype.M = function() {\n this.O = 1;\n if (this.t) {\n this.O += this.t.O;\n }\n if (this.i) {\n this.O += this.i.O;\n }\n };\n return TreeNodeEnableIndex;\n}(TreeNode);\n\nvar ContainerIterator = function() {\n function ContainerIterator(e) {\n if (e === void 0) {\n e = 0;\n }\n this.iteratorType = e;\n }\n ContainerIterator.prototype.equals = function(e) {\n return this.C === e.C;\n };\n return ContainerIterator;\n}();\n\nvar Base = function() {\n function Base() {\n this._ = 0;\n }\n Object.defineProperty(Base.prototype, \"length\", {\n get: function() {\n return this._;\n },\n enumerable: false,\n configurable: true\n });\n Base.prototype.size = function() {\n return this._;\n };\n Base.prototype.empty = function() {\n return this._ === 0;\n };\n return Base;\n}();\n\nvar Container = function(e) {\n __extends(Container, e);\n function Container() {\n return e !== null && e.apply(this, arguments) || this;\n }\n return Container;\n}(Base);\n\nfunction throwIteratorAccessError() {\n throw new RangeError(\"Iterator access denied!\");\n}\n\nvar TreeContainer = function(e) {\n __extends(TreeContainer, e);\n function TreeContainer(r, t) {\n if (r === void 0) {\n r = function(e, r) {\n if (e < r) return -1;\n if (e > r) return 1;\n return 0;\n };\n }\n if (t === void 0) {\n t = false;\n }\n var i = e.call(this) || this;\n i.N = undefined;\n i.g = r;\n i.enableIndex = t;\n i.S = t ? TreeNodeEnableIndex : TreeNode;\n i.A = new i.S;\n return i;\n }\n TreeContainer.prototype.m = function(e, r) {\n var t = this.A;\n while (e) {\n var i = this.g(e.u, r);\n if (i < 0) {\n e = e.i;\n } else if (i > 0) {\n t = e;\n e = e.t;\n } else return e;\n }\n return t;\n };\n TreeContainer.prototype.B = function(e, r) {\n var t = this.A;\n while (e) {\n var i = this.g(e.u, r);\n if (i <= 0) {\n e = e.i;\n } else {\n t = e;\n e = e.t;\n }\n }\n return t;\n };\n TreeContainer.prototype.j = function(e, r) {\n var t = this.A;\n while (e) {\n var i = this.g(e.u, r);\n if (i < 0) {\n t = e;\n e = e.i;\n } else if (i > 0) {\n e = e.t;\n } else return e;\n }\n return t;\n };\n TreeContainer.prototype.k = function(e, r) {\n var t = this.A;\n while (e) {\n var i = this.g(e.u, r);\n if (i < 0) {\n t = e;\n e = e.i;\n } else {\n e = e.t;\n }\n }\n return t;\n };\n TreeContainer.prototype.R = function(e) {\n while (true) {\n var r = e.h;\n if (r === this.A) return;\n if (e.l === 1) {\n e.l = 0;\n return;\n }\n if (e === r.t) {\n var t = r.i;\n if (t.l === 1) {\n t.l = 0;\n r.l = 1;\n if (r === this.N) {\n this.N = r.T();\n } else r.T();\n } else {\n if (t.i && t.i.l === 1) {\n t.l = r.l;\n r.l = 0;\n t.i.l = 0;\n if (r === this.N) {\n this.N = r.T();\n } else r.T();\n return;\n } else if (t.t && t.t.l === 1) {\n t.l = 1;\n t.t.l = 0;\n t.I();\n } else {\n t.l = 1;\n e = r;\n }\n }\n } else {\n var t = r.t;\n if (t.l === 1) {\n t.l = 0;\n r.l = 1;\n if (r === this.N) {\n this.N = r.I();\n } else r.I();\n } else {\n if (t.t && t.t.l === 1) {\n t.l = r.l;\n r.l = 0;\n t.t.l = 0;\n if (r === this.N) {\n this.N = r.I();\n } else r.I();\n return;\n } else if (t.i && t.i.l === 1) {\n t.l = 1;\n t.i.l = 0;\n t.T();\n } else {\n t.l = 1;\n e = r;\n }\n }\n }\n }\n };\n TreeContainer.prototype.G = function(e) {\n if (this._ === 1) {\n this.clear();\n return;\n }\n var r = e;\n while (r.t || r.i) {\n if (r.i) {\n r = r.i;\n while (r.t) r = r.t;\n } else {\n r = r.t;\n }\n var t = e.u;\n e.u = r.u;\n r.u = t;\n var i = e.o;\n e.o = r.o;\n r.o = i;\n e = r;\n }\n if (this.A.t === r) {\n this.A.t = r.h;\n } else if (this.A.i === r) {\n this.A.i = r.h;\n }\n this.R(r);\n var n = r.h;\n if (r === n.t) {\n n.t = undefined;\n } else n.i = undefined;\n this._ -= 1;\n this.N.l = 0;\n if (this.enableIndex) {\n while (n !== this.A) {\n n.O -= 1;\n n = n.h;\n }\n }\n };\n TreeContainer.prototype.P = function(e) {\n var r = typeof e === \"number\" ? e : undefined;\n var t = typeof e === \"function\" ? e : undefined;\n var i = typeof e === \"undefined\" ? [] : undefined;\n var n = 0;\n var s = this.N;\n var h = [];\n while (h.length || s) {\n if (s) {\n h.push(s);\n s = s.t;\n } else {\n s = h.pop();\n if (n === r) return s;\n i && i.push(s);\n t && t(s, n, this);\n n += 1;\n s = s.i;\n }\n }\n return i;\n };\n TreeContainer.prototype.q = function(e) {\n while (true) {\n var r = e.h;\n if (r.l === 0) return;\n var t = r.h;\n if (r === t.t) {\n var i = t.i;\n if (i && i.l === 1) {\n i.l = r.l = 0;\n if (t === this.N) return;\n t.l = 1;\n e = t;\n continue;\n } else if (e === r.i) {\n e.l = 0;\n if (e.t) {\n e.t.h = r;\n }\n if (e.i) {\n e.i.h = t;\n }\n r.i = e.t;\n t.t = e.i;\n e.t = r;\n e.i = t;\n if (t === this.N) {\n this.N = e;\n this.A.h = e;\n } else {\n var n = t.h;\n if (n.t === t) {\n n.t = e;\n } else n.i = e;\n }\n e.h = t.h;\n r.h = e;\n t.h = e;\n t.l = 1;\n } else {\n r.l = 0;\n if (t === this.N) {\n this.N = t.I();\n } else t.I();\n t.l = 1;\n return;\n }\n } else {\n var i = t.t;\n if (i && i.l === 1) {\n i.l = r.l = 0;\n if (t === this.N) return;\n t.l = 1;\n e = t;\n continue;\n } else if (e === r.t) {\n e.l = 0;\n if (e.t) {\n e.t.h = t;\n }\n if (e.i) {\n e.i.h = r;\n }\n t.i = e.t;\n r.t = e.i;\n e.t = t;\n e.i = r;\n if (t === this.N) {\n this.N = e;\n this.A.h = e;\n } else {\n var n = t.h;\n if (n.t === t) {\n n.t = e;\n } else n.i = e;\n }\n e.h = t.h;\n r.h = e;\n t.h = e;\n t.l = 1;\n } else {\n r.l = 0;\n if (t === this.N) {\n this.N = t.T();\n } else t.T();\n t.l = 1;\n return;\n }\n }\n if (this.enableIndex) {\n r.M();\n t.M();\n e.M();\n }\n return;\n }\n };\n TreeContainer.prototype.D = function(e, r, t) {\n if (this.N === undefined) {\n this._ += 1;\n this.N = new this.S(e, r, 0);\n this.N.h = this.A;\n this.A.h = this.A.t = this.A.i = this.N;\n return this._;\n }\n var i;\n var n = this.A.t;\n var s = this.g(n.u, e);\n if (s === 0) {\n n.o = r;\n return this._;\n } else if (s > 0) {\n n.t = new this.S(e, r);\n n.t.h = n;\n i = n.t;\n this.A.t = i;\n } else {\n var h = this.A.i;\n var a = this.g(h.u, e);\n if (a === 0) {\n h.o = r;\n return this._;\n } else if (a < 0) {\n h.i = new this.S(e, r);\n h.i.h = h;\n i = h.i;\n this.A.i = i;\n } else {\n if (t !== undefined) {\n var u = t.C;\n if (u !== this.A) {\n var f = this.g(u.u, e);\n if (f === 0) {\n u.o = r;\n return this._;\n } else if (f > 0) {\n var o = u.v();\n var d = this.g(o.u, e);\n if (d === 0) {\n o.o = r;\n return this._;\n } else if (d < 0) {\n i = new this.S(e, r);\n if (o.i === undefined) {\n o.i = i;\n i.h = o;\n } else {\n u.t = i;\n i.h = u;\n }\n }\n }\n }\n }\n if (i === undefined) {\n i = this.N;\n while (true) {\n var c = this.g(i.u, e);\n if (c > 0) {\n if (i.t === undefined) {\n i.t = new this.S(e, r);\n i.t.h = i;\n i = i.t;\n break;\n }\n i = i.t;\n } else if (c < 0) {\n if (i.i === undefined) {\n i.i = new this.S(e, r);\n i.i.h = i;\n i = i.i;\n break;\n }\n i = i.i;\n } else {\n i.o = r;\n return this._;\n }\n }\n }\n }\n }\n if (this.enableIndex) {\n var l = i.h;\n while (l !== this.A) {\n l.O += 1;\n l = l.h;\n }\n }\n this.q(i);\n this._ += 1;\n return this._;\n };\n TreeContainer.prototype.F = function(e, r) {\n while (e) {\n var t = this.g(e.u, r);\n if (t < 0) {\n e = e.i;\n } else if (t > 0) {\n e = e.t;\n } else return e;\n }\n return e || this.A;\n };\n TreeContainer.prototype.clear = function() {\n this._ = 0;\n this.N = undefined;\n this.A.h = undefined;\n this.A.t = this.A.i = undefined;\n };\n TreeContainer.prototype.updateKeyByIterator = function(e, r) {\n var t = e.C;\n if (t === this.A) {\n throwIteratorAccessError();\n }\n if (this._ === 1) {\n t.u = r;\n return true;\n }\n var i = t.p().u;\n if (t === this.A.t) {\n if (this.g(i, r) > 0) {\n t.u = r;\n return true;\n }\n return false;\n }\n var n = t.v().u;\n if (t === this.A.i) {\n if (this.g(n, r) < 0) {\n t.u = r;\n return true;\n }\n return false;\n }\n if (this.g(n, r) >= 0 || this.g(i, r) <= 0) return false;\n t.u = r;\n return true;\n };\n TreeContainer.prototype.eraseElementByPos = function(e) {\n if (e < 0 || e > this._ - 1) {\n throw new RangeError;\n }\n var r = this.P(e);\n this.G(r);\n return this._;\n };\n TreeContainer.prototype.eraseElementByKey = function(e) {\n if (this._ === 0) return false;\n var r = this.F(this.N, e);\n if (r === this.A) return false;\n this.G(r);\n return true;\n };\n TreeContainer.prototype.eraseElementByIterator = function(e) {\n var r = e.C;\n if (r === this.A) {\n throwIteratorAccessError();\n }\n var t = r.i === undefined;\n var i = e.iteratorType === 0;\n if (i) {\n if (t) e.next();\n } else {\n if (!t || r.t === undefined) e.next();\n }\n this.G(r);\n return e;\n };\n TreeContainer.prototype.getHeight = function() {\n if (this._ === 0) return 0;\n function traversal(e) {\n if (!e) return 0;\n return Math.max(traversal(e.t), traversal(e.i)) + 1;\n }\n return traversal(this.N);\n };\n return TreeContainer;\n}(Container);\n\nvar TreeIterator = function(e) {\n __extends(TreeIterator, e);\n function TreeIterator(r, t, i) {\n var n = e.call(this, i) || this;\n n.C = r;\n n.A = t;\n if (n.iteratorType === 0) {\n n.pre = function() {\n if (this.C === this.A.t) {\n throwIteratorAccessError();\n }\n this.C = this.C.v();\n return this;\n };\n n.next = function() {\n if (this.C === this.A) {\n throwIteratorAccessError();\n }\n this.C = this.C.p();\n return this;\n };\n } else {\n n.pre = function() {\n if (this.C === this.A.i) {\n throwIteratorAccessError();\n }\n this.C = this.C.p();\n return this;\n };\n n.next = function() {\n if (this.C === this.A) {\n throwIteratorAccessError();\n }\n this.C = this.C.v();\n return this;\n };\n }\n return n;\n }\n Object.defineProperty(TreeIterator.prototype, \"index\", {\n get: function() {\n var e = this.C;\n var r = this.A.h;\n if (e === this.A) {\n if (r) {\n return r.O - 1;\n }\n return 0;\n }\n var t = 0;\n if (e.t) {\n t += e.t.O;\n }\n while (e !== r) {\n var i = e.h;\n if (e === i.i) {\n t += 1;\n if (i.t) {\n t += i.t.O;\n }\n }\n e = i;\n }\n return t;\n },\n enumerable: false,\n configurable: true\n });\n TreeIterator.prototype.isAccessible = function() {\n return this.C !== this.A;\n };\n return TreeIterator;\n}(ContainerIterator);\n\nvar OrderedMapIterator = function(e) {\n __extends(OrderedMapIterator, e);\n function OrderedMapIterator(r, t, i, n) {\n var s = e.call(this, r, t, n) || this;\n s.container = i;\n return s;\n }\n Object.defineProperty(OrderedMapIterator.prototype, \"pointer\", {\n get: function() {\n if (this.C === this.A) {\n throwIteratorAccessError();\n }\n var e = this;\n return new Proxy([], {\n get: function(r, t) {\n if (t === \"0\") return e.C.u; else if (t === \"1\") return e.C.o;\n r[0] = e.C.u;\n r[1] = e.C.o;\n return r[t];\n },\n set: function(r, t, i) {\n if (t !== \"1\") {\n throw new TypeError(\"prop must be 1\");\n }\n e.C.o = i;\n return true;\n }\n });\n },\n enumerable: false,\n configurable: true\n });\n OrderedMapIterator.prototype.copy = function() {\n return new OrderedMapIterator(this.C, this.A, this.container, this.iteratorType);\n };\n return OrderedMapIterator;\n}(TreeIterator);\n\nvar OrderedMap = function(e) {\n __extends(OrderedMap, e);\n function OrderedMap(r, t, i) {\n if (r === void 0) {\n r = [];\n }\n var n = e.call(this, t, i) || this;\n var s = n;\n r.forEach((function(e) {\n s.setElement(e[0], e[1]);\n }));\n return n;\n }\n OrderedMap.prototype.begin = function() {\n return new OrderedMapIterator(this.A.t || this.A, this.A, this);\n };\n OrderedMap.prototype.end = function() {\n return new OrderedMapIterator(this.A, this.A, this);\n };\n OrderedMap.prototype.rBegin = function() {\n return new OrderedMapIterator(this.A.i || this.A, this.A, this, 1);\n };\n OrderedMap.prototype.rEnd = function() {\n return new OrderedMapIterator(this.A, this.A, this, 1);\n };\n OrderedMap.prototype.front = function() {\n if (this._ === 0) return;\n var e = this.A.t;\n return [ e.u, e.o ];\n };\n OrderedMap.prototype.back = function() {\n if (this._ === 0) return;\n var e = this.A.i;\n return [ e.u, e.o ];\n };\n OrderedMap.prototype.lowerBound = function(e) {\n var r = this.m(this.N, e);\n return new OrderedMapIterator(r, this.A, this);\n };\n OrderedMap.prototype.upperBound = function(e) {\n var r = this.B(this.N, e);\n return new OrderedMapIterator(r, this.A, this);\n };\n OrderedMap.prototype.reverseLowerBound = function(e) {\n var r = this.j(this.N, e);\n return new OrderedMapIterator(r, this.A, this);\n };\n OrderedMap.prototype.reverseUpperBound = function(e) {\n var r = this.k(this.N, e);\n return new OrderedMapIterator(r, this.A, this);\n };\n OrderedMap.prototype.forEach = function(e) {\n this.P((function(r, t, i) {\n e([ r.u, r.o ], t, i);\n }));\n };\n OrderedMap.prototype.setElement = function(e, r, t) {\n return this.D(e, r, t);\n };\n OrderedMap.prototype.getElementByPos = function(e) {\n if (e < 0 || e > this._ - 1) {\n throw new RangeError;\n }\n var r = this.P(e);\n return [ r.u, r.o ];\n };\n OrderedMap.prototype.find = function(e) {\n var r = this.F(this.N, e);\n return new OrderedMapIterator(r, this.A, this);\n };\n OrderedMap.prototype.getElementByKey = function(e) {\n var r = this.F(this.N, e);\n return r.o;\n };\n OrderedMap.prototype.union = function(e) {\n var r = this;\n e.forEach((function(e) {\n r.setElement(e[0], e[1]);\n }));\n return this._;\n };\n OrderedMap.prototype[Symbol.iterator] = function() {\n var e, r, t, i;\n return __generator(this, (function(n) {\n switch (n.label) {\n case 0:\n e = this._;\n r = this.P();\n t = 0;\n n.label = 1;\n\n case 1:\n if (!(t < e)) return [ 3, 4 ];\n i = r[t];\n return [ 4, [ i.u, i.o ] ];\n\n case 2:\n n.sent();\n n.label = 3;\n\n case 3:\n ++t;\n return [ 3, 1 ];\n\n case 4:\n return [ 2 ];\n }\n }));\n };\n return OrderedMap;\n}(TreeContainer);\n\nexport { OrderedMap };\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n/*\n * Copyright 2021 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.registerAdminService = registerAdminService;\nexports.addAdminServicesToServer = addAdminServicesToServer;\nconst registeredAdminServices = [];\nfunction registerAdminService(getServiceDefinition, getHandlers) {\n registeredAdminServices.push({ getServiceDefinition, getHandlers });\n}\nfunction addAdminServicesToServer(server) {\n for (const { getServiceDefinition, getHandlers } of registeredAdminServices) {\n server.addService(getServiceDefinition(), getHandlers());\n }\n}\n//# sourceMappingURL=admin.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ClientDuplexStreamImpl = exports.ClientWritableStreamImpl = exports.ClientReadableStreamImpl = exports.ClientUnaryCallImpl = void 0;\nexports.callErrorFromStatus = callErrorFromStatus;\nconst events_1 = require(\"events\");\nconst stream_1 = require(\"stream\");\nconst constants_1 = require(\"./constants\");\n/**\n * Construct a ServiceError from a StatusObject. This function exists primarily\n * as an attempt to make the error stack trace clearly communicate that the\n * error is not necessarily a problem in gRPC itself.\n * @param status\n */\nfunction callErrorFromStatus(status, callerStack) {\n const message = `${status.code} ${constants_1.Status[status.code]}: ${status.details}`;\n const error = new Error(message);\n const stack = `${error.stack}\\nfor call at\\n${callerStack}`;\n return Object.assign(new Error(message), status, { stack });\n}\nclass ClientUnaryCallImpl extends events_1.EventEmitter {\n constructor() {\n super();\n }\n cancel() {\n var _a;\n (_a = this.call) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client');\n }\n getPeer() {\n var _a, _b;\n return (_b = (_a = this.call) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : 'unknown';\n }\n}\nexports.ClientUnaryCallImpl = ClientUnaryCallImpl;\nclass ClientReadableStreamImpl extends stream_1.Readable {\n constructor(deserialize) {\n super({ objectMode: true });\n this.deserialize = deserialize;\n }\n cancel() {\n var _a;\n (_a = this.call) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client');\n }\n getPeer() {\n var _a, _b;\n return (_b = (_a = this.call) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : 'unknown';\n }\n _read(_size) {\n var _a;\n (_a = this.call) === null || _a === void 0 ? void 0 : _a.startRead();\n }\n}\nexports.ClientReadableStreamImpl = ClientReadableStreamImpl;\nclass ClientWritableStreamImpl extends stream_1.Writable {\n constructor(serialize) {\n super({ objectMode: true });\n this.serialize = serialize;\n }\n cancel() {\n var _a;\n (_a = this.call) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client');\n }\n getPeer() {\n var _a, _b;\n return (_b = (_a = this.call) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : 'unknown';\n }\n _write(chunk, encoding, cb) {\n var _a;\n const context = {\n callback: cb,\n };\n const flags = Number(encoding);\n if (!Number.isNaN(flags)) {\n context.flags = flags;\n }\n (_a = this.call) === null || _a === void 0 ? void 0 : _a.sendMessageWithContext(context, chunk);\n }\n _final(cb) {\n var _a;\n (_a = this.call) === null || _a === void 0 ? void 0 : _a.halfClose();\n cb();\n }\n}\nexports.ClientWritableStreamImpl = ClientWritableStreamImpl;\nclass ClientDuplexStreamImpl extends stream_1.Duplex {\n constructor(serialize, deserialize) {\n super({ objectMode: true });\n this.serialize = serialize;\n this.deserialize = deserialize;\n }\n cancel() {\n var _a;\n (_a = this.call) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client');\n }\n getPeer() {\n var _a, _b;\n return (_b = (_a = this.call) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : 'unknown';\n }\n _read(_size) {\n var _a;\n (_a = this.call) === null || _a === void 0 ? void 0 : _a.startRead();\n }\n _write(chunk, encoding, cb) {\n var _a;\n const context = {\n callback: cb,\n };\n const flags = Number(encoding);\n if (!Number.isNaN(flags)) {\n context.flags = flags;\n }\n (_a = this.call) === null || _a === void 0 ? void 0 : _a.sendMessageWithContext(context, chunk);\n }\n _final(cb) {\n var _a;\n (_a = this.call) === null || _a === void 0 ? void 0 : _a.halfClose();\n cb();\n }\n}\nexports.ClientDuplexStreamImpl = ClientDuplexStreamImpl;\n//# sourceMappingURL=call.js.map","\"use strict\";\n/*\n * Copyright 2022 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InterceptingListenerImpl = void 0;\nexports.isInterceptingListener = isInterceptingListener;\nfunction isInterceptingListener(listener) {\n return (listener.onReceiveMetadata !== undefined &&\n listener.onReceiveMetadata.length === 1);\n}\nclass InterceptingListenerImpl {\n constructor(listener, nextListener) {\n this.listener = listener;\n this.nextListener = nextListener;\n this.processingMetadata = false;\n this.hasPendingMessage = false;\n this.processingMessage = false;\n this.pendingStatus = null;\n }\n processPendingMessage() {\n if (this.hasPendingMessage) {\n this.nextListener.onReceiveMessage(this.pendingMessage);\n this.pendingMessage = null;\n this.hasPendingMessage = false;\n }\n }\n processPendingStatus() {\n if (this.pendingStatus) {\n this.nextListener.onReceiveStatus(this.pendingStatus);\n }\n }\n onReceiveMetadata(metadata) {\n this.processingMetadata = true;\n this.listener.onReceiveMetadata(metadata, metadata => {\n this.processingMetadata = false;\n this.nextListener.onReceiveMetadata(metadata);\n this.processPendingMessage();\n this.processPendingStatus();\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onReceiveMessage(message) {\n /* If this listener processes messages asynchronously, the last message may\n * be reordered with respect to the status */\n this.processingMessage = true;\n this.listener.onReceiveMessage(message, msg => {\n this.processingMessage = false;\n if (this.processingMetadata) {\n this.pendingMessage = msg;\n this.hasPendingMessage = true;\n }\n else {\n this.nextListener.onReceiveMessage(msg);\n this.processPendingStatus();\n }\n });\n }\n onReceiveStatus(status) {\n this.listener.onReceiveStatus(status, processedStatus => {\n if (this.processingMetadata || this.processingMessage) {\n this.pendingStatus = processedStatus;\n }\n else {\n this.nextListener.onReceiveStatus(processedStatus);\n }\n });\n }\n}\nexports.InterceptingListenerImpl = InterceptingListenerImpl;\n//# sourceMappingURL=call-interface.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InterceptingCall = exports.RequesterBuilder = exports.ListenerBuilder = exports.InterceptorConfigurationError = void 0;\nexports.getInterceptingCall = getInterceptingCall;\nconst metadata_1 = require(\"./metadata\");\nconst call_interface_1 = require(\"./call-interface\");\nconst constants_1 = require(\"./constants\");\nconst error_1 = require(\"./error\");\n/**\n * Error class associated with passing both interceptors and interceptor\n * providers to a client constructor or as call options.\n */\nclass InterceptorConfigurationError extends Error {\n constructor(message) {\n super(message);\n this.name = 'InterceptorConfigurationError';\n Error.captureStackTrace(this, InterceptorConfigurationError);\n }\n}\nexports.InterceptorConfigurationError = InterceptorConfigurationError;\nclass ListenerBuilder {\n constructor() {\n this.metadata = undefined;\n this.message = undefined;\n this.status = undefined;\n }\n withOnReceiveMetadata(onReceiveMetadata) {\n this.metadata = onReceiveMetadata;\n return this;\n }\n withOnReceiveMessage(onReceiveMessage) {\n this.message = onReceiveMessage;\n return this;\n }\n withOnReceiveStatus(onReceiveStatus) {\n this.status = onReceiveStatus;\n return this;\n }\n build() {\n return {\n onReceiveMetadata: this.metadata,\n onReceiveMessage: this.message,\n onReceiveStatus: this.status,\n };\n }\n}\nexports.ListenerBuilder = ListenerBuilder;\nclass RequesterBuilder {\n constructor() {\n this.start = undefined;\n this.message = undefined;\n this.halfClose = undefined;\n this.cancel = undefined;\n }\n withStart(start) {\n this.start = start;\n return this;\n }\n withSendMessage(sendMessage) {\n this.message = sendMessage;\n return this;\n }\n withHalfClose(halfClose) {\n this.halfClose = halfClose;\n return this;\n }\n withCancel(cancel) {\n this.cancel = cancel;\n return this;\n }\n build() {\n return {\n start: this.start,\n sendMessage: this.message,\n halfClose: this.halfClose,\n cancel: this.cancel,\n };\n }\n}\nexports.RequesterBuilder = RequesterBuilder;\n/**\n * A Listener with a default pass-through implementation of each method. Used\n * for filling out Listeners with some methods omitted.\n */\nconst defaultListener = {\n onReceiveMetadata: (metadata, next) => {\n next(metadata);\n },\n onReceiveMessage: (message, next) => {\n next(message);\n },\n onReceiveStatus: (status, next) => {\n next(status);\n },\n};\n/**\n * A Requester with a default pass-through implementation of each method. Used\n * for filling out Requesters with some methods omitted.\n */\nconst defaultRequester = {\n start: (metadata, listener, next) => {\n next(metadata, listener);\n },\n sendMessage: (message, next) => {\n next(message);\n },\n halfClose: next => {\n next();\n },\n cancel: next => {\n next();\n },\n};\nclass InterceptingCall {\n constructor(nextCall, requester) {\n var _a, _b, _c, _d;\n this.nextCall = nextCall;\n /**\n * Indicates that metadata has been passed to the requester's start\n * method but it has not been passed to the corresponding next callback\n */\n this.processingMetadata = false;\n /**\n * Message context for a pending message that is waiting for\n */\n this.pendingMessageContext = null;\n /**\n * Indicates that a message has been passed to the requester's sendMessage\n * method but it has not been passed to the corresponding next callback\n */\n this.processingMessage = false;\n /**\n * Indicates that a status was received but could not be propagated because\n * a message was still being processed.\n */\n this.pendingHalfClose = false;\n if (requester) {\n this.requester = {\n start: (_a = requester.start) !== null && _a !== void 0 ? _a : defaultRequester.start,\n sendMessage: (_b = requester.sendMessage) !== null && _b !== void 0 ? _b : defaultRequester.sendMessage,\n halfClose: (_c = requester.halfClose) !== null && _c !== void 0 ? _c : defaultRequester.halfClose,\n cancel: (_d = requester.cancel) !== null && _d !== void 0 ? _d : defaultRequester.cancel,\n };\n }\n else {\n this.requester = defaultRequester;\n }\n }\n cancelWithStatus(status, details) {\n this.requester.cancel(() => {\n this.nextCall.cancelWithStatus(status, details);\n });\n }\n getPeer() {\n return this.nextCall.getPeer();\n }\n processPendingMessage() {\n if (this.pendingMessageContext) {\n this.nextCall.sendMessageWithContext(this.pendingMessageContext, this.pendingMessage);\n this.pendingMessageContext = null;\n this.pendingMessage = null;\n }\n }\n processPendingHalfClose() {\n if (this.pendingHalfClose) {\n this.nextCall.halfClose();\n }\n }\n start(metadata, interceptingListener) {\n var _a, _b, _c, _d, _e, _f;\n const fullInterceptingListener = {\n onReceiveMetadata: (_b = (_a = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveMetadata) === null || _a === void 0 ? void 0 : _a.bind(interceptingListener)) !== null && _b !== void 0 ? _b : (metadata => { }),\n onReceiveMessage: (_d = (_c = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveMessage) === null || _c === void 0 ? void 0 : _c.bind(interceptingListener)) !== null && _d !== void 0 ? _d : (message => { }),\n onReceiveStatus: (_f = (_e = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveStatus) === null || _e === void 0 ? void 0 : _e.bind(interceptingListener)) !== null && _f !== void 0 ? _f : (status => { }),\n };\n this.processingMetadata = true;\n this.requester.start(metadata, fullInterceptingListener, (md, listener) => {\n var _a, _b, _c;\n this.processingMetadata = false;\n let finalInterceptingListener;\n if ((0, call_interface_1.isInterceptingListener)(listener)) {\n finalInterceptingListener = listener;\n }\n else {\n const fullListener = {\n onReceiveMetadata: (_a = listener.onReceiveMetadata) !== null && _a !== void 0 ? _a : defaultListener.onReceiveMetadata,\n onReceiveMessage: (_b = listener.onReceiveMessage) !== null && _b !== void 0 ? _b : defaultListener.onReceiveMessage,\n onReceiveStatus: (_c = listener.onReceiveStatus) !== null && _c !== void 0 ? _c : defaultListener.onReceiveStatus,\n };\n finalInterceptingListener = new call_interface_1.InterceptingListenerImpl(fullListener, fullInterceptingListener);\n }\n this.nextCall.start(md, finalInterceptingListener);\n this.processPendingMessage();\n this.processPendingHalfClose();\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n sendMessageWithContext(context, message) {\n this.processingMessage = true;\n this.requester.sendMessage(message, finalMessage => {\n this.processingMessage = false;\n if (this.processingMetadata) {\n this.pendingMessageContext = context;\n this.pendingMessage = message;\n }\n else {\n this.nextCall.sendMessageWithContext(context, finalMessage);\n this.processPendingHalfClose();\n }\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n sendMessage(message) {\n this.sendMessageWithContext({}, message);\n }\n startRead() {\n this.nextCall.startRead();\n }\n halfClose() {\n this.requester.halfClose(() => {\n if (this.processingMetadata || this.processingMessage) {\n this.pendingHalfClose = true;\n }\n else {\n this.nextCall.halfClose();\n }\n });\n }\n}\nexports.InterceptingCall = InterceptingCall;\nfunction getCall(channel, path, options) {\n var _a, _b;\n const deadline = (_a = options.deadline) !== null && _a !== void 0 ? _a : Infinity;\n const host = options.host;\n const parent = (_b = options.parent) !== null && _b !== void 0 ? _b : null;\n const propagateFlags = options.propagate_flags;\n const credentials = options.credentials;\n const call = channel.createCall(path, deadline, host, parent, propagateFlags);\n if (credentials) {\n call.setCredentials(credentials);\n }\n return call;\n}\n/**\n * InterceptingCall implementation that directly owns the underlying Call\n * object and handles serialization and deseraizliation.\n */\nclass BaseInterceptingCall {\n constructor(call, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n methodDefinition) {\n this.call = call;\n this.methodDefinition = methodDefinition;\n }\n cancelWithStatus(status, details) {\n this.call.cancelWithStatus(status, details);\n }\n getPeer() {\n return this.call.getPeer();\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n sendMessageWithContext(context, message) {\n let serialized;\n try {\n serialized = this.methodDefinition.requestSerialize(message);\n }\n catch (e) {\n this.call.cancelWithStatus(constants_1.Status.INTERNAL, `Request message serialization failure: ${(0, error_1.getErrorMessage)(e)}`);\n return;\n }\n this.call.sendMessageWithContext(context, serialized);\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n sendMessage(message) {\n this.sendMessageWithContext({}, message);\n }\n start(metadata, interceptingListener) {\n let readError = null;\n this.call.start(metadata, {\n onReceiveMetadata: metadata => {\n var _a;\n (_a = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveMetadata) === null || _a === void 0 ? void 0 : _a.call(interceptingListener, metadata);\n },\n onReceiveMessage: message => {\n var _a;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let deserialized;\n try {\n deserialized = this.methodDefinition.responseDeserialize(message);\n }\n catch (e) {\n readError = {\n code: constants_1.Status.INTERNAL,\n details: `Response message parsing error: ${(0, error_1.getErrorMessage)(e)}`,\n metadata: new metadata_1.Metadata(),\n };\n this.call.cancelWithStatus(readError.code, readError.details);\n return;\n }\n (_a = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveMessage) === null || _a === void 0 ? void 0 : _a.call(interceptingListener, deserialized);\n },\n onReceiveStatus: status => {\n var _a, _b;\n if (readError) {\n (_a = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveStatus) === null || _a === void 0 ? void 0 : _a.call(interceptingListener, readError);\n }\n else {\n (_b = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveStatus) === null || _b === void 0 ? void 0 : _b.call(interceptingListener, status);\n }\n },\n });\n }\n startRead() {\n this.call.startRead();\n }\n halfClose() {\n this.call.halfClose();\n }\n}\n/**\n * BaseInterceptingCall with special-cased behavior for methods with unary\n * responses.\n */\nclass BaseUnaryInterceptingCall extends BaseInterceptingCall {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(call, methodDefinition) {\n super(call, methodDefinition);\n }\n start(metadata, listener) {\n var _a, _b;\n let receivedMessage = false;\n const wrapperListener = {\n onReceiveMetadata: (_b = (_a = listener === null || listener === void 0 ? void 0 : listener.onReceiveMetadata) === null || _a === void 0 ? void 0 : _a.bind(listener)) !== null && _b !== void 0 ? _b : (metadata => { }),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onReceiveMessage: (message) => {\n var _a;\n receivedMessage = true;\n (_a = listener === null || listener === void 0 ? void 0 : listener.onReceiveMessage) === null || _a === void 0 ? void 0 : _a.call(listener, message);\n },\n onReceiveStatus: (status) => {\n var _a, _b;\n if (!receivedMessage) {\n (_a = listener === null || listener === void 0 ? void 0 : listener.onReceiveMessage) === null || _a === void 0 ? void 0 : _a.call(listener, null);\n }\n (_b = listener === null || listener === void 0 ? void 0 : listener.onReceiveStatus) === null || _b === void 0 ? void 0 : _b.call(listener, status);\n },\n };\n super.start(metadata, wrapperListener);\n this.call.startRead();\n }\n}\n/**\n * BaseInterceptingCall with special-cased behavior for methods with streaming\n * responses.\n */\nclass BaseStreamingInterceptingCall extends BaseInterceptingCall {\n}\nfunction getBottomInterceptingCall(channel, options, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nmethodDefinition) {\n const call = getCall(channel, methodDefinition.path, options);\n if (methodDefinition.responseStream) {\n return new BaseStreamingInterceptingCall(call, methodDefinition);\n }\n else {\n return new BaseUnaryInterceptingCall(call, methodDefinition);\n }\n}\nfunction getInterceptingCall(interceptorArgs, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nmethodDefinition, options, channel) {\n if (interceptorArgs.clientInterceptors.length > 0 &&\n interceptorArgs.clientInterceptorProviders.length > 0) {\n throw new InterceptorConfigurationError('Both interceptors and interceptor_providers were passed as options ' +\n 'to the client constructor. Only one of these is allowed.');\n }\n if (interceptorArgs.callInterceptors.length > 0 &&\n interceptorArgs.callInterceptorProviders.length > 0) {\n throw new InterceptorConfigurationError('Both interceptors and interceptor_providers were passed as call ' +\n 'options. Only one of these is allowed.');\n }\n let interceptors = [];\n // Interceptors passed to the call override interceptors passed to the client constructor\n if (interceptorArgs.callInterceptors.length > 0 ||\n interceptorArgs.callInterceptorProviders.length > 0) {\n interceptors = []\n .concat(interceptorArgs.callInterceptors, interceptorArgs.callInterceptorProviders.map(provider => provider(methodDefinition)))\n .filter(interceptor => interceptor);\n // Filter out falsy values when providers return nothing\n }\n else {\n interceptors = []\n .concat(interceptorArgs.clientInterceptors, interceptorArgs.clientInterceptorProviders.map(provider => provider(methodDefinition)))\n .filter(interceptor => interceptor);\n // Filter out falsy values when providers return nothing\n }\n const interceptorOptions = Object.assign({}, options, {\n method_definition: methodDefinition,\n });\n /* For each interceptor in the list, the nextCall function passed to it is\n * based on the next interceptor in the list, using a nextCall function\n * constructed with the following interceptor in the list, and so on. The\n * initialValue, which is effectively at the end of the list, is a nextCall\n * function that invokes getBottomInterceptingCall, the result of which\n * handles (de)serialization and also gets the underlying call from the\n * channel. */\n const getCall = interceptors.reduceRight((nextCall, nextInterceptor) => {\n return currentOptions => nextInterceptor(currentOptions, nextCall);\n }, (finalOptions) => getBottomInterceptingCall(channel, finalOptions, methodDefinition));\n return getCall(interceptorOptions);\n}\n//# sourceMappingURL=client-interceptors.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Client = void 0;\nconst call_1 = require(\"./call\");\nconst channel_1 = require(\"./channel\");\nconst connectivity_state_1 = require(\"./connectivity-state\");\nconst constants_1 = require(\"./constants\");\nconst metadata_1 = require(\"./metadata\");\nconst client_interceptors_1 = require(\"./client-interceptors\");\nconst CHANNEL_SYMBOL = Symbol();\nconst INTERCEPTOR_SYMBOL = Symbol();\nconst INTERCEPTOR_PROVIDER_SYMBOL = Symbol();\nconst CALL_INVOCATION_TRANSFORMER_SYMBOL = Symbol();\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nfunction getErrorStackString(error) {\n var _a;\n return ((_a = error.stack) === null || _a === void 0 ? void 0 : _a.split('\\n').slice(1).join('\\n')) || 'no stack trace available';\n}\n/**\n * A generic gRPC client. Primarily useful as a base class for all generated\n * clients.\n */\nclass Client {\n constructor(address, credentials, options = {}) {\n var _a, _b;\n options = Object.assign({}, options);\n this[INTERCEPTOR_SYMBOL] = (_a = options.interceptors) !== null && _a !== void 0 ? _a : [];\n delete options.interceptors;\n this[INTERCEPTOR_PROVIDER_SYMBOL] = (_b = options.interceptor_providers) !== null && _b !== void 0 ? _b : [];\n delete options.interceptor_providers;\n if (this[INTERCEPTOR_SYMBOL].length > 0 &&\n this[INTERCEPTOR_PROVIDER_SYMBOL].length > 0) {\n throw new Error('Both interceptors and interceptor_providers were passed as options ' +\n 'to the client constructor. Only one of these is allowed.');\n }\n this[CALL_INVOCATION_TRANSFORMER_SYMBOL] =\n options.callInvocationTransformer;\n delete options.callInvocationTransformer;\n if (options.channelOverride) {\n this[CHANNEL_SYMBOL] = options.channelOverride;\n }\n else if (options.channelFactoryOverride) {\n const channelFactoryOverride = options.channelFactoryOverride;\n delete options.channelFactoryOverride;\n this[CHANNEL_SYMBOL] = channelFactoryOverride(address, credentials, options);\n }\n else {\n this[CHANNEL_SYMBOL] = new channel_1.ChannelImplementation(address, credentials, options);\n }\n }\n close() {\n this[CHANNEL_SYMBOL].close();\n }\n getChannel() {\n return this[CHANNEL_SYMBOL];\n }\n waitForReady(deadline, callback) {\n const checkState = (err) => {\n if (err) {\n callback(new Error('Failed to connect before the deadline'));\n return;\n }\n let newState;\n try {\n newState = this[CHANNEL_SYMBOL].getConnectivityState(true);\n }\n catch (e) {\n callback(new Error('The channel has been closed'));\n return;\n }\n if (newState === connectivity_state_1.ConnectivityState.READY) {\n callback();\n }\n else {\n try {\n this[CHANNEL_SYMBOL].watchConnectivityState(newState, deadline, checkState);\n }\n catch (e) {\n callback(new Error('The channel has been closed'));\n }\n }\n };\n setImmediate(checkState);\n }\n checkOptionalUnaryResponseArguments(arg1, arg2, arg3) {\n if (isFunction(arg1)) {\n return { metadata: new metadata_1.Metadata(), options: {}, callback: arg1 };\n }\n else if (isFunction(arg2)) {\n if (arg1 instanceof metadata_1.Metadata) {\n return { metadata: arg1, options: {}, callback: arg2 };\n }\n else {\n return { metadata: new metadata_1.Metadata(), options: arg1, callback: arg2 };\n }\n }\n else {\n if (!(arg1 instanceof metadata_1.Metadata &&\n arg2 instanceof Object &&\n isFunction(arg3))) {\n throw new Error('Incorrect arguments passed');\n }\n return { metadata: arg1, options: arg2, callback: arg3 };\n }\n }\n makeUnaryRequest(method, serialize, deserialize, argument, metadata, options, callback) {\n var _a, _b;\n const checkedArguments = this.checkOptionalUnaryResponseArguments(metadata, options, callback);\n const methodDefinition = {\n path: method,\n requestStream: false,\n responseStream: false,\n requestSerialize: serialize,\n responseDeserialize: deserialize,\n };\n let callProperties = {\n argument: argument,\n metadata: checkedArguments.metadata,\n call: new call_1.ClientUnaryCallImpl(),\n channel: this[CHANNEL_SYMBOL],\n methodDefinition: methodDefinition,\n callOptions: checkedArguments.options,\n callback: checkedArguments.callback,\n };\n if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) {\n callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL](callProperties);\n }\n const emitter = callProperties.call;\n const interceptorArgs = {\n clientInterceptors: this[INTERCEPTOR_SYMBOL],\n clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL],\n callInterceptors: (_a = callProperties.callOptions.interceptors) !== null && _a !== void 0 ? _a : [],\n callInterceptorProviders: (_b = callProperties.callOptions.interceptor_providers) !== null && _b !== void 0 ? _b : [],\n };\n const call = (0, client_interceptors_1.getInterceptingCall)(interceptorArgs, callProperties.methodDefinition, callProperties.callOptions, callProperties.channel);\n /* This needs to happen before the emitter is used. Unfortunately we can't\n * enforce this with the type system. We need to construct this emitter\n * before calling the CallInvocationTransformer, and we need to create the\n * call after that. */\n emitter.call = call;\n let responseMessage = null;\n let receivedStatus = false;\n let callerStackError = new Error();\n call.start(callProperties.metadata, {\n onReceiveMetadata: metadata => {\n emitter.emit('metadata', metadata);\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onReceiveMessage(message) {\n if (responseMessage !== null) {\n call.cancelWithStatus(constants_1.Status.UNIMPLEMENTED, 'Too many responses received');\n }\n responseMessage = message;\n },\n onReceiveStatus(status) {\n if (receivedStatus) {\n return;\n }\n receivedStatus = true;\n if (status.code === constants_1.Status.OK) {\n if (responseMessage === null) {\n const callerStack = getErrorStackString(callerStackError);\n callProperties.callback((0, call_1.callErrorFromStatus)({\n code: constants_1.Status.UNIMPLEMENTED,\n details: 'No message received',\n metadata: status.metadata,\n }, callerStack));\n }\n else {\n callProperties.callback(null, responseMessage);\n }\n }\n else {\n const callerStack = getErrorStackString(callerStackError);\n callProperties.callback((0, call_1.callErrorFromStatus)(status, callerStack));\n }\n /* Avoid retaining the callerStackError object in the call context of\n * the status event handler. */\n callerStackError = null;\n emitter.emit('status', status);\n },\n });\n call.sendMessage(argument);\n call.halfClose();\n return emitter;\n }\n makeClientStreamRequest(method, serialize, deserialize, metadata, options, callback) {\n var _a, _b;\n const checkedArguments = this.checkOptionalUnaryResponseArguments(metadata, options, callback);\n const methodDefinition = {\n path: method,\n requestStream: true,\n responseStream: false,\n requestSerialize: serialize,\n responseDeserialize: deserialize,\n };\n let callProperties = {\n metadata: checkedArguments.metadata,\n call: new call_1.ClientWritableStreamImpl(serialize),\n channel: this[CHANNEL_SYMBOL],\n methodDefinition: methodDefinition,\n callOptions: checkedArguments.options,\n callback: checkedArguments.callback,\n };\n if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) {\n callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL](callProperties);\n }\n const emitter = callProperties.call;\n const interceptorArgs = {\n clientInterceptors: this[INTERCEPTOR_SYMBOL],\n clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL],\n callInterceptors: (_a = callProperties.callOptions.interceptors) !== null && _a !== void 0 ? _a : [],\n callInterceptorProviders: (_b = callProperties.callOptions.interceptor_providers) !== null && _b !== void 0 ? _b : [],\n };\n const call = (0, client_interceptors_1.getInterceptingCall)(interceptorArgs, callProperties.methodDefinition, callProperties.callOptions, callProperties.channel);\n /* This needs to happen before the emitter is used. Unfortunately we can't\n * enforce this with the type system. We need to construct this emitter\n * before calling the CallInvocationTransformer, and we need to create the\n * call after that. */\n emitter.call = call;\n let responseMessage = null;\n let receivedStatus = false;\n let callerStackError = new Error();\n call.start(callProperties.metadata, {\n onReceiveMetadata: metadata => {\n emitter.emit('metadata', metadata);\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onReceiveMessage(message) {\n if (responseMessage !== null) {\n call.cancelWithStatus(constants_1.Status.UNIMPLEMENTED, 'Too many responses received');\n }\n responseMessage = message;\n call.startRead();\n },\n onReceiveStatus(status) {\n if (receivedStatus) {\n return;\n }\n receivedStatus = true;\n if (status.code === constants_1.Status.OK) {\n if (responseMessage === null) {\n const callerStack = getErrorStackString(callerStackError);\n callProperties.callback((0, call_1.callErrorFromStatus)({\n code: constants_1.Status.UNIMPLEMENTED,\n details: 'No message received',\n metadata: status.metadata,\n }, callerStack));\n }\n else {\n callProperties.callback(null, responseMessage);\n }\n }\n else {\n const callerStack = getErrorStackString(callerStackError);\n callProperties.callback((0, call_1.callErrorFromStatus)(status, callerStack));\n }\n /* Avoid retaining the callerStackError object in the call context of\n * the status event handler. */\n callerStackError = null;\n emitter.emit('status', status);\n },\n });\n return emitter;\n }\n checkMetadataAndOptions(arg1, arg2) {\n let metadata;\n let options;\n if (arg1 instanceof metadata_1.Metadata) {\n metadata = arg1;\n if (arg2) {\n options = arg2;\n }\n else {\n options = {};\n }\n }\n else {\n if (arg1) {\n options = arg1;\n }\n else {\n options = {};\n }\n metadata = new metadata_1.Metadata();\n }\n return { metadata, options };\n }\n makeServerStreamRequest(method, serialize, deserialize, argument, metadata, options) {\n var _a, _b;\n const checkedArguments = this.checkMetadataAndOptions(metadata, options);\n const methodDefinition = {\n path: method,\n requestStream: false,\n responseStream: true,\n requestSerialize: serialize,\n responseDeserialize: deserialize,\n };\n let callProperties = {\n argument: argument,\n metadata: checkedArguments.metadata,\n call: new call_1.ClientReadableStreamImpl(deserialize),\n channel: this[CHANNEL_SYMBOL],\n methodDefinition: methodDefinition,\n callOptions: checkedArguments.options,\n };\n if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) {\n callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL](callProperties);\n }\n const stream = callProperties.call;\n const interceptorArgs = {\n clientInterceptors: this[INTERCEPTOR_SYMBOL],\n clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL],\n callInterceptors: (_a = callProperties.callOptions.interceptors) !== null && _a !== void 0 ? _a : [],\n callInterceptorProviders: (_b = callProperties.callOptions.interceptor_providers) !== null && _b !== void 0 ? _b : [],\n };\n const call = (0, client_interceptors_1.getInterceptingCall)(interceptorArgs, callProperties.methodDefinition, callProperties.callOptions, callProperties.channel);\n /* This needs to happen before the emitter is used. Unfortunately we can't\n * enforce this with the type system. We need to construct this emitter\n * before calling the CallInvocationTransformer, and we need to create the\n * call after that. */\n stream.call = call;\n let receivedStatus = false;\n let callerStackError = new Error();\n call.start(callProperties.metadata, {\n onReceiveMetadata(metadata) {\n stream.emit('metadata', metadata);\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onReceiveMessage(message) {\n stream.push(message);\n },\n onReceiveStatus(status) {\n if (receivedStatus) {\n return;\n }\n receivedStatus = true;\n stream.push(null);\n if (status.code !== constants_1.Status.OK) {\n const callerStack = getErrorStackString(callerStackError);\n stream.emit('error', (0, call_1.callErrorFromStatus)(status, callerStack));\n }\n /* Avoid retaining the callerStackError object in the call context of\n * the status event handler. */\n callerStackError = null;\n stream.emit('status', status);\n },\n });\n call.sendMessage(argument);\n call.halfClose();\n return stream;\n }\n makeBidiStreamRequest(method, serialize, deserialize, metadata, options) {\n var _a, _b;\n const checkedArguments = this.checkMetadataAndOptions(metadata, options);\n const methodDefinition = {\n path: method,\n requestStream: true,\n responseStream: true,\n requestSerialize: serialize,\n responseDeserialize: deserialize,\n };\n let callProperties = {\n metadata: checkedArguments.metadata,\n call: new call_1.ClientDuplexStreamImpl(serialize, deserialize),\n channel: this[CHANNEL_SYMBOL],\n methodDefinition: methodDefinition,\n callOptions: checkedArguments.options,\n };\n if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) {\n callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL](callProperties);\n }\n const stream = callProperties.call;\n const interceptorArgs = {\n clientInterceptors: this[INTERCEPTOR_SYMBOL],\n clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL],\n callInterceptors: (_a = callProperties.callOptions.interceptors) !== null && _a !== void 0 ? _a : [],\n callInterceptorProviders: (_b = callProperties.callOptions.interceptor_providers) !== null && _b !== void 0 ? _b : [],\n };\n const call = (0, client_interceptors_1.getInterceptingCall)(interceptorArgs, callProperties.methodDefinition, callProperties.callOptions, callProperties.channel);\n /* This needs to happen before the emitter is used. Unfortunately we can't\n * enforce this with the type system. We need to construct this emitter\n * before calling the CallInvocationTransformer, and we need to create the\n * call after that. */\n stream.call = call;\n let receivedStatus = false;\n let callerStackError = new Error();\n call.start(callProperties.metadata, {\n onReceiveMetadata(metadata) {\n stream.emit('metadata', metadata);\n },\n onReceiveMessage(message) {\n stream.push(message);\n },\n onReceiveStatus(status) {\n if (receivedStatus) {\n return;\n }\n receivedStatus = true;\n stream.push(null);\n if (status.code !== constants_1.Status.OK) {\n const callerStack = getErrorStackString(callerStackError);\n stream.emit('error', (0, call_1.callErrorFromStatus)(status, callerStack));\n }\n /* Avoid retaining the callerStackError object in the call context of\n * the status event handler. */\n callerStackError = null;\n stream.emit('status', status);\n },\n });\n return stream;\n }\n}\nexports.Client = Client;\n//# sourceMappingURL=client.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.makeClientConstructor = makeClientConstructor;\nexports.loadPackageDefinition = loadPackageDefinition;\nconst client_1 = require(\"./client\");\n/**\n * Map with short names for each of the requester maker functions. Used in\n * makeClientConstructor\n * @private\n */\nconst requesterFuncs = {\n unary: client_1.Client.prototype.makeUnaryRequest,\n server_stream: client_1.Client.prototype.makeServerStreamRequest,\n client_stream: client_1.Client.prototype.makeClientStreamRequest,\n bidi: client_1.Client.prototype.makeBidiStreamRequest,\n};\n/**\n * Returns true, if given key is included in the blacklisted\n * keys.\n * @param key key for check, string.\n */\nfunction isPrototypePolluted(key) {\n return ['__proto__', 'prototype', 'constructor'].includes(key);\n}\n/**\n * Creates a constructor for a client with the given methods, as specified in\n * the methods argument. The resulting class will have an instance method for\n * each method in the service, which is a partial application of one of the\n * [Client]{@link grpc.Client} request methods, depending on `requestSerialize`\n * and `responseSerialize`, with the `method`, `serialize`, and `deserialize`\n * arguments predefined.\n * @param methods An object mapping method names to\n * method attributes\n * @param serviceName The fully qualified name of the service\n * @param classOptions An options object.\n * @return New client constructor, which is a subclass of\n * {@link grpc.Client}, and has the same arguments as that constructor.\n */\nfunction makeClientConstructor(methods, serviceName, classOptions) {\n if (!classOptions) {\n classOptions = {};\n }\n class ServiceClientImpl extends client_1.Client {\n }\n Object.keys(methods).forEach(name => {\n if (isPrototypePolluted(name)) {\n return;\n }\n const attrs = methods[name];\n let methodType;\n // TODO(murgatroid99): Verify that we don't need this anymore\n if (typeof name === 'string' && name.charAt(0) === '$') {\n throw new Error('Method names cannot start with $');\n }\n if (attrs.requestStream) {\n if (attrs.responseStream) {\n methodType = 'bidi';\n }\n else {\n methodType = 'client_stream';\n }\n }\n else {\n if (attrs.responseStream) {\n methodType = 'server_stream';\n }\n else {\n methodType = 'unary';\n }\n }\n const serialize = attrs.requestSerialize;\n const deserialize = attrs.responseDeserialize;\n const methodFunc = partial(requesterFuncs[methodType], attrs.path, serialize, deserialize);\n ServiceClientImpl.prototype[name] = methodFunc;\n // Associate all provided attributes with the method\n Object.assign(ServiceClientImpl.prototype[name], attrs);\n if (attrs.originalName && !isPrototypePolluted(attrs.originalName)) {\n ServiceClientImpl.prototype[attrs.originalName] =\n ServiceClientImpl.prototype[name];\n }\n });\n ServiceClientImpl.service = methods;\n ServiceClientImpl.serviceName = serviceName;\n return ServiceClientImpl;\n}\nfunction partial(fn, path, serialize, deserialize) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (...args) {\n return fn.call(this, path, serialize, deserialize, ...args);\n };\n}\nfunction isProtobufTypeDefinition(obj) {\n return 'format' in obj;\n}\n/**\n * Load a gRPC package definition as a gRPC object hierarchy.\n * @param packageDef The package definition object.\n * @return The resulting gRPC object.\n */\nfunction loadPackageDefinition(packageDef) {\n const result = {};\n for (const serviceFqn in packageDef) {\n if (Object.prototype.hasOwnProperty.call(packageDef, serviceFqn)) {\n const service = packageDef[serviceFqn];\n const nameComponents = serviceFqn.split('.');\n if (nameComponents.some((comp) => isPrototypePolluted(comp))) {\n continue;\n }\n const serviceName = nameComponents[nameComponents.length - 1];\n let current = result;\n for (const packageName of nameComponents.slice(0, -1)) {\n if (!current[packageName]) {\n current[packageName] = {};\n }\n current = current[packageName];\n }\n if (isProtobufTypeDefinition(service)) {\n current[serviceName] = service;\n }\n else {\n current[serviceName] = makeClientConstructor(service, serviceName, {});\n }\n }\n }\n return result;\n}\n//# sourceMappingURL=make-client.js.map","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match words composed of alphanumeric characters. */\nvar reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n/** Used to match Latin Unicode letters (excluding mathematical operators). */\nvar reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe23',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20f0',\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n 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',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')',\n rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match apostrophes. */\nvar reApos = RegExp(rsApos, 'g');\n\n/**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\nvar reComboMark = RegExp(rsCombo, 'g');\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/** Used to match complex or compound words. */\nvar reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')',\n rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr,\n rsUpper + '+' + rsOptUpperContr,\n rsDigits,\n rsEmoji\n].join('|'), 'g');\n\n/** 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/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');\n\n/** Used to detect strings that need a more robust regexp to match words. */\nvar reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n/** Used to map Latin Unicode letters to basic Latin letters. */\nvar deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 'ss'\n};\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\n/**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction asciiWords(string) {\n return string.match(reAsciiWord) || [];\n}\n\n/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n\n/**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\nvar deburrLetter = basePropertyOf(deburredLetters);\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\n/**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\nfunction hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n}\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\n/**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\n/**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\nfunction createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n}\n\n/**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\nfunction createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\n/**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\nvar camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n});\n\n/**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\nfunction capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n}\n\n/**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\nfunction deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n}\n\n/**\n * Converts the first character of `string` to upper case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.upperFirst('fred');\n * // => 'Fred'\n *\n * _.upperFirst('FRED');\n * // => 'FRED'\n */\nvar upperFirst = createCaseFirst('toUpperCase');\n\n/**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */\nfunction words(string, pattern, guard) {\n string = toString(string);\n pattern = guard ? undefined : pattern;\n\n if (pattern === undefined) {\n return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);\n }\n return string.match(pattern) || [];\n}\n\nmodule.exports = camelCase;\n","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(\"../util/minimal\");\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(\"@protobufjs/aspromise\");\n\n// converts to / from base64 encoded strings\nutil.base64 = require(\"@protobufjs/base64\");\n\n// base class of rpc.Service\nutil.EventEmitter = require(\"@protobufjs/eventemitter\");\n\n// float handling accross browsers\nutil.float = require(\"@protobufjs/float\");\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(\"@protobufjs/inquire\");\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(\"@protobufjs/utf8\");\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(\"@protobufjs/pool\");\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(\"./longbits\");\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n && global\n && global.process\n && global.process.versions\n && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n CustomError.prototype = Object.create(Error.prototype, {\n constructor: {\n value: CustomError,\n writable: true,\n enumerable: false,\n configurable: true,\n },\n name: {\n get: function get() { return name; },\n set: undefined,\n enumerable: false,\n // configurable: false would accurately preserve the behavior of\n // the original, but I'm guessing that was not intentional.\n // For an actual error subclass, this property would\n // be configurable.\n configurable: true,\n },\n toString: {\n value: function value() { return this.name + \": \" + this.message; },\n writable: true,\n enumerable: false,\n configurable: true,\n },\n });\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(\"./util/minimal\");\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(\"./writer\");\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(\"./util/minimal\");\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n\n if (start === end) { // fix for IE 10/Win8 and others' subarray returning array of size 1\n var nativeBuffer = util.Buffer;\n return nativeBuffer\n ? nativeBuffer.alloc(0)\n : new this.buf.constructor(0);\n }\n return this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(\"./reader\");\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(\"../util/minimal\");\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(\"./rpc/service\");\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available across modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(\"./writer\");\nprotobuf.BufferWriter = require(\"./writer_buffer\");\nprotobuf.Reader = require(\"./reader\");\nprotobuf.BufferReader = require(\"./reader_buffer\");\n\n// Utility\nprotobuf.util = require(\"./util/minimal\");\nprotobuf.rpc = require(\"./rpc\");\nprotobuf.roots = require(\"./roots\");\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.util._configure();\n protobuf.Writer._configure(protobuf.BufferWriter);\n protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @param {string[]} functionParams Function parameter names\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n */\r\nfunction codegen(functionParams, functionName) {\r\n\r\n /* istanbul ignore if */\r\n if (typeof functionParams === \"string\") {\r\n functionName = functionParams;\r\n functionParams = undefined;\r\n }\r\n\r\n var body = [];\r\n\r\n /**\r\n * Appends code to the function's body or finishes generation.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\r\n * @param {...*} [formatParams] Format parameters\r\n * @returns {Codegen|Function} Itself or the generated function if finished\r\n * @throws {Error} If format parameter counts do not match\r\n */\r\n\r\n function Codegen(formatStringOrScope) {\r\n // note that explicit array handling below makes this ~50% faster\r\n\r\n // finish the function\r\n if (typeof formatStringOrScope !== \"string\") {\r\n var source = toString();\r\n if (codegen.verbose)\r\n console.log(\"codegen: \" + source); // eslint-disable-line no-console\r\n source = \"return \" + source;\r\n if (formatStringOrScope) {\r\n var scopeKeys = Object.keys(formatStringOrScope),\r\n scopeParams = new Array(scopeKeys.length + 1),\r\n scopeValues = new Array(scopeKeys.length),\r\n scopeOffset = 0;\r\n while (scopeOffset < scopeKeys.length) {\r\n scopeParams[scopeOffset] = scopeKeys[scopeOffset];\r\n scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\r\n }\r\n scopeParams[scopeOffset] = source;\r\n return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\r\n }\r\n return Function(source)(); // eslint-disable-line no-new-func\r\n }\r\n\r\n // otherwise append to body\r\n var formatParams = new Array(arguments.length - 1),\r\n formatOffset = 0;\r\n while (formatOffset < formatParams.length)\r\n formatParams[formatOffset] = arguments[++formatOffset];\r\n formatOffset = 0;\r\n formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\r\n var value = formatParams[formatOffset++];\r\n switch ($1) {\r\n case \"d\": case \"f\": return String(Number(value));\r\n case \"i\": return String(Math.floor(value));\r\n case \"j\": return JSON.stringify(value);\r\n case \"s\": return String(value);\r\n }\r\n return \"%\";\r\n });\r\n if (formatOffset !== formatParams.length)\r\n throw Error(\"parameter count mismatch\");\r\n body.push(formatStringOrScope);\r\n return Codegen;\r\n }\r\n\r\n function toString(functionNameOverride) {\r\n return \"function \" + (functionNameOverride || functionName || \"\") + \"(\" + (functionParams && functionParams.join(\",\") || \"\") + \"){\\n \" + body.join(\"\\n \") + \"\\n}\";\r\n }\r\n\r\n Codegen.toString = toString;\r\n return Codegen;\r\n}\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @function codegen\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * When set to `true`, codegen will log generated code to console. Useful for debugging.\r\n * @name util.codegen.verbose\r\n * @type {boolean}\r\n */\r\ncodegen.verbose = false;\r\n","\"use strict\";\r\nmodule.exports = fetch;\r\n\r\nvar asPromise = require(\"@protobufjs/aspromise\"),\r\n inquire = require(\"@protobufjs/inquire\");\r\n\r\nvar fs = inquire(\"fs\");\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Options as used by {@link util.fetch}.\r\n * @typedef FetchOptions\r\n * @type {Object}\r\n * @property {boolean} [binary=false] Whether expecting a binary response\r\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} filename File path or url\r\n * @param {FetchOptions} options Fetch options\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction fetch(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = {};\r\n } else if (!options)\r\n options = {};\r\n\r\n if (!callback)\r\n return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\r\n\r\n // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\r\n if (!options.xhr && fs && fs.readFile)\r\n return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\r\n return err && typeof XMLHttpRequest !== \"undefined\"\r\n ? fetch.xhr(filename, options, callback)\r\n : err\r\n ? callback(err)\r\n : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\r\n });\r\n\r\n // use the XHR version otherwise.\r\n return fetch.xhr(filename, options, callback);\r\n}\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchOptions} [options] Fetch options\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n\r\n/**/\r\nfetch.xhr = function fetch_xhr(filename, options, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\r\n\r\n if (xhr.readyState !== 4)\r\n return undefined;\r\n\r\n // local cors security errors return status 0 / empty string, too. afaik this cannot be\r\n // reliably distinguished from an actually empty file for security reasons. feel free\r\n // to send a pull request if you are aware of a solution.\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n\r\n // if binary data is expected, make sure that some sort of array is returned, even if\r\n // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\r\n if (options.binary) {\r\n var buffer = xhr.response;\r\n if (!buffer) {\r\n buffer = [];\r\n for (var i = 0; i < xhr.responseText.length; ++i)\r\n buffer.push(xhr.responseText.charCodeAt(i) & 255);\r\n }\r\n return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\r\n }\r\n return callback(null, xhr.responseText);\r\n };\r\n\r\n if (options.binary) {\r\n // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\r\n if (\"overrideMimeType\" in xhr)\r\n xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\r\n xhr.responseType = \"arraybuffer\";\r\n }\r\n\r\n xhr.open(\"GET\", filename);\r\n xhr.send();\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal path module to resolve Unix, Windows and URL paths alike.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar path = exports;\r\n\r\nvar isAbsolute =\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\npath.isAbsolute = function isAbsolute(path) {\r\n return /^(?:\\/|\\w+:)/.test(path);\r\n};\r\n\r\nvar normalize =\r\n/**\r\n * Normalizes the specified path.\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\npath.normalize = function normalize(path) {\r\n path = path.replace(/\\\\/g, \"/\")\r\n .replace(/\\/{2,}/g, \"/\");\r\n var parts = path.split(\"/\"),\r\n absolute = isAbsolute(path),\r\n prefix = \"\";\r\n if (absolute)\r\n prefix = parts.shift() + \"/\";\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === \"..\") {\r\n if (i > 0 && parts[i - 1] !== \"..\")\r\n parts.splice(--i, 2);\r\n else if (absolute)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === \".\")\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join(\"/\");\r\n};\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path to the origin file\r\n * @param {string} includePath Include path relative to origin path\r\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the include file\r\n */\r\npath.resolve = function resolve(originPath, includePath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n includePath = normalize(includePath);\r\n if (isAbsolute(includePath))\r\n return includePath;\r\n if (!alreadyNormalized)\r\n originPath = normalize(originPath);\r\n return (originPath = originPath.replace(/(?:\\/|^)[^/]+$/, \"\")).length ? normalize(originPath + \"/\" + includePath) : includePath;\r\n};\r\n","\"use strict\";\nmodule.exports = Namespace;\n\n// extends ReflectionObject\nvar ReflectionObject = require(\"./object\");\n((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = \"Namespace\";\n\nvar Field = require(\"./field\"),\n util = require(\"./util\"),\n OneOf = require(\"./oneof\");\n\nvar Type, // cyclic\n Service,\n Enum;\n\n/**\n * Constructs a new namespace instance.\n * @name Namespace\n * @classdesc Reflected namespace.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a namespace from JSON.\n * @memberof Namespace\n * @function\n * @param {string} name Namespace name\n * @param {Object.} json JSON object\n * @returns {Namespace} Created namespace\n * @throws {TypeError} If arguments are invalid\n */\nNamespace.fromJSON = function fromJSON(name, json) {\n return new Namespace(name, json.options).addJSON(json.nested);\n};\n\n/**\n * Converts an array of reflection objects to JSON.\n * @memberof Namespace\n * @param {ReflectionObject[]} array Object array\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\n */\nfunction arrayToJSON(array, toJSONOptions) {\n if (!(array && array.length))\n return undefined;\n var obj = {};\n for (var i = 0; i < array.length; ++i)\n obj[array[i].name] = array[i].toJSON(toJSONOptions);\n return obj;\n}\n\nNamespace.arrayToJSON = arrayToJSON;\n\n/**\n * Tests if the specified id is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedId = function isReservedId(reserved, id) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (typeof reserved[i] !== \"string\" && reserved[i][0] <= id && reserved[i][1] > id)\n return true;\n return false;\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedName = function isReservedName(reserved, name) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (reserved[i] === name)\n return true;\n return false;\n};\n\n/**\n * Not an actual constructor. Use {@link Namespace} instead.\n * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports NamespaceBase\n * @extends ReflectionObject\n * @abstract\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n * @see {@link Namespace}\n */\nfunction Namespace(name, options) {\n ReflectionObject.call(this, name, options);\n\n /**\n * Nested objects by name.\n * @type {Object.|undefined}\n */\n this.nested = undefined; // toJSON\n\n /**\n * Cached nested objects as an array.\n * @type {ReflectionObject[]|null}\n * @private\n */\n this._nestedArray = null;\n}\n\nfunction clearCache(namespace) {\n namespace._nestedArray = null;\n return namespace;\n}\n\n/**\n * Nested objects of this namespace as an array for iteration.\n * @name NamespaceBase#nestedArray\n * @type {ReflectionObject[]}\n * @readonly\n */\nObject.defineProperty(Namespace.prototype, \"nestedArray\", {\n get: function() {\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\n }\n});\n\n/**\n * Namespace descriptor.\n * @interface INamespace\n * @property {Object.} [options] Namespace options\n * @property {Object.} [nested] Nested object descriptors\n */\n\n/**\n * Any extension field descriptor.\n * @typedef AnyExtensionField\n * @type {IExtensionField|IExtensionMapField}\n */\n\n/**\n * Any nested object descriptor.\n * @typedef AnyNestedObject\n * @type {IEnum|IType|IService|AnyExtensionField|INamespace|IOneOf}\n */\n\n/**\n * Converts this namespace to a namespace descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {INamespace} Namespace descriptor\n */\nNamespace.prototype.toJSON = function toJSON(toJSONOptions) {\n return util.toObject([\n \"options\" , this.options,\n \"nested\" , arrayToJSON(this.nestedArray, toJSONOptions)\n ]);\n};\n\n/**\n * Adds nested objects to this namespace from nested object descriptors.\n * @param {Object.} nestedJson Any nested object descriptors\n * @returns {Namespace} `this`\n */\nNamespace.prototype.addJSON = function addJSON(nestedJson) {\n var ns = this;\n /* istanbul ignore else */\n if (nestedJson) {\n for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) {\n nested = nestedJson[names[i]];\n ns.add( // most to least likely\n ( nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : nested.id !== undefined\n ? Field.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n }\n return this;\n};\n\n/**\n * Gets the nested object of the specified name.\n * @param {string} name Nested object name\n * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist\n */\nNamespace.prototype.get = function get(name) {\n return this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Gets the values of the nested {@link Enum|enum} of the specified name.\n * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.\n * @param {string} name Nested enum name\n * @returns {Object.} Enum values\n * @throws {Error} If there is no such enum\n */\nNamespace.prototype.getEnum = function getEnum(name) {\n if (this.nested && this.nested[name] instanceof Enum)\n return this.nested[name].values;\n throw Error(\"no such enum: \" + name);\n};\n\n/**\n * Adds a nested object to this namespace.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name\n */\nNamespace.prototype.add = function add(object) {\n\n if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof OneOf || object instanceof Enum || object instanceof Service || object instanceof Namespace))\n throw TypeError(\"object must be a valid nested object\");\n\n if (!this.nested)\n this.nested = {};\n else {\n var prev = this.get(object.name);\n if (prev) {\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\n // replace plain namespace but keep existing nested elements and options\n var nested = prev.nestedArray;\n for (var i = 0; i < nested.length; ++i)\n object.add(nested[i]);\n this.remove(prev);\n if (!this.nested)\n this.nested = {};\n object.setOptions(prev.options, true);\n\n } else\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n }\n }\n this.nested[object.name] = object;\n\n if (!(this instanceof Type || this instanceof Service || this instanceof Enum || this instanceof Field)) {\n // This is a package or a root namespace.\n if (!object._edition) {\n // Make sure that some edition is set if it hasn't already been specified.\n object._edition = object._defaultEdition;\n }\n }\n\n object.onAdd(this);\n return clearCache(this);\n};\n\n/**\n * Removes a nested object from this namespace.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this namespace\n */\nNamespace.prototype.remove = function remove(object) {\n\n if (!(object instanceof ReflectionObject))\n throw TypeError(\"object must be a ReflectionObject\");\n if (object.parent !== this)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.nested[object.name];\n if (!Object.keys(this.nested).length)\n this.nested = undefined;\n\n object.onRemove(this);\n return clearCache(this);\n};\n\n/**\n * Defines additial namespaces within this one if not yet existing.\n * @param {string|string[]} path Path to create\n * @param {*} [json] Nested types to create from JSON\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\n */\nNamespace.prototype.define = function define(path, json) {\n\n if (util.isString(path))\n path = path.split(\".\");\n else if (!Array.isArray(path))\n throw TypeError(\"illegal path\");\n if (path && path.length && path[0] === \"\")\n throw Error(\"path must be relative\");\n\n var ptr = this;\n while (path.length > 0) {\n var part = path.shift();\n if (ptr.nested && ptr.nested[part]) {\n ptr = ptr.nested[part];\n if (!(ptr instanceof Namespace))\n throw Error(\"path conflicts with non-namespace objects\");\n } else\n ptr.add(ptr = new Namespace(part));\n }\n if (json)\n ptr.addJSON(json);\n return ptr;\n};\n\n/**\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.\n * @returns {Namespace} `this`\n */\nNamespace.prototype.resolveAll = function resolveAll() {\n var nested = this.nestedArray, i = 0;\n this.resolve();\n while (i < nested.length)\n if (nested[i] instanceof Namespace)\n nested[i++].resolveAll();\n else\n nested[i++].resolve();\n return this;\n};\n\n/**\n * @override\n */\nNamespace.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {\n edition = this._edition || edition;\n\n ReflectionObject.prototype._resolveFeaturesRecursive.call(this, edition);\n this.nestedArray.forEach(nested => {\n nested._resolveFeaturesRecursive(edition);\n });\n return this;\n};\n\n/**\n * Recursively looks up the reflection object matching the specified path in the scope of this namespace.\n * @param {string|string[]} path Path to look up\n * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.\n * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n */\nNamespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {\n\n /* istanbul ignore next */\n if (typeof filterTypes === \"boolean\") {\n parentAlreadyChecked = filterTypes;\n filterTypes = undefined;\n } else if (filterTypes && !Array.isArray(filterTypes))\n filterTypes = [ filterTypes ];\n\n if (util.isString(path) && path.length) {\n if (path === \".\")\n return this.root;\n path = path.split(\".\");\n } else if (!path.length)\n return this;\n\n // Start at root if path is absolute\n if (path[0] === \"\")\n return this.root.lookup(path.slice(1), filterTypes);\n\n // Test if the first part matches any nested object, and if so, traverse if path contains more\n var found = this.get(path[0]);\n if (found) {\n if (path.length === 1) {\n if (!filterTypes || filterTypes.indexOf(found.constructor) > -1)\n return found;\n } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true)))\n return found;\n\n // Otherwise try each nested namespace\n } else\n for (var i = 0; i < this.nestedArray.length; ++i)\n if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true)))\n return found;\n\n // If there hasn't been a match, try again at the parent\n if (this.parent === null || parentAlreadyChecked)\n return null;\n return this.parent.lookup(path, filterTypes);\n};\n\n/**\n * Looks up the reflection object at the specified path, relative to this namespace.\n * @name NamespaceBase#lookup\n * @function\n * @param {string|string[]} path Path to look up\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n * @variation 2\n */\n// lookup(path: string, [parentAlreadyChecked: boolean])\n\n/**\n * Looks up the {@link Type|type} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type\n * @throws {Error} If `path` does not point to a type\n */\nNamespace.prototype.lookupType = function lookupType(path) {\n var found = this.lookup(path, [ Type ]);\n if (!found)\n throw Error(\"no such type: \" + path);\n return found;\n};\n\n/**\n * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Enum} Looked up enum\n * @throws {Error} If `path` does not point to an enum\n */\nNamespace.prototype.lookupEnum = function lookupEnum(path) {\n var found = this.lookup(path, [ Enum ]);\n if (!found)\n throw Error(\"no such Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type or enum\n * @throws {Error} If `path` does not point to a type or enum\n */\nNamespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) {\n var found = this.lookup(path, [ Type, Enum ]);\n if (!found)\n throw Error(\"no such Type or Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Service|service} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Service} Looked up service\n * @throws {Error} If `path` does not point to a service\n */\nNamespace.prototype.lookupService = function lookupService(path) {\n var found = this.lookup(path, [ Service ]);\n if (!found)\n throw Error(\"no such Service '\" + path + \"' in \" + this);\n return found;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nNamespace._configure = function(Type_, Service_, Enum_) {\n Type = Type_;\n Service = Service_;\n Enum = Enum_;\n};\n","\"use strict\";\nmodule.exports = MapField;\n\n// extends Field\nvar Field = require(\"./field\");\n((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = \"MapField\";\n\nvar types = require(\"./types\"),\n util = require(\"./util\");\n\n/**\n * Constructs a new map field instance.\n * @classdesc Reflected map field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} keyType Key type\n * @param {string} type Value type\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction MapField(name, id, keyType, type, options, comment) {\n Field.call(this, name, id, type, undefined, undefined, options, comment);\n\n /* istanbul ignore if */\n if (!util.isString(keyType))\n throw TypeError(\"keyType must be a string\");\n\n /**\n * Key type.\n * @type {string}\n */\n this.keyType = keyType; // toJSON, marker\n\n /**\n * Resolved key type if not a basic type.\n * @type {ReflectionObject|null}\n */\n this.resolvedKeyType = null;\n\n // Overrides Field#map\n this.map = true;\n}\n\n/**\n * Map field descriptor.\n * @interface IMapField\n * @extends {IField}\n * @property {string} keyType Key type\n */\n\n/**\n * Extension map field descriptor.\n * @interface IExtensionMapField\n * @extends IMapField\n * @property {string} extend Extended type\n */\n\n/**\n * Constructs a map field from a map field descriptor.\n * @param {string} name Field name\n * @param {IMapField} json Map field descriptor\n * @returns {MapField} Created map field\n * @throws {TypeError} If arguments are invalid\n */\nMapField.fromJSON = function fromJSON(name, json) {\n return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment);\n};\n\n/**\n * Converts this map field to a map field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMapField} Map field descriptor\n */\nMapField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"keyType\" , this.keyType,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMapField.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n\n // Besides a value type, map fields have a key type that may be \"any scalar type except for floating point types and bytes\"\n if (types.mapKey[this.keyType] === undefined)\n throw Error(\"invalid key type: \" + this.keyType);\n\n return Field.prototype.resolve.call(this);\n};\n\n/**\n * Map field decorator (TypeScript).\n * @name MapField.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"} fieldKeyType Field key type\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"|\"bytes\"|Object|Constructor<{}>} fieldValueType Field value type\n * @returns {FieldDecorator} Decorator function\n * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }\n */\nMapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {\n\n // submessage value: decorate the submessage and use its name as the type\n if (typeof fieldValueType === \"function\")\n fieldValueType = util.decorateType(fieldValueType).name;\n\n // enum reference value: create a reflected copy of the enum and keep reuseing it\n else if (fieldValueType && typeof fieldValueType === \"object\")\n fieldValueType = util.decorateEnum(fieldValueType).name;\n\n return function mapFieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));\n };\n};\n","\"use strict\";\nmodule.exports = Method;\n\n// extends ReflectionObject\nvar ReflectionObject = require(\"./object\");\n((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = \"Method\";\n\nvar util = require(\"./util\");\n\n/**\n * Constructs a new service method instance.\n * @classdesc Reflected service method.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Method name\n * @param {string|undefined} type Method type, usually `\"rpc\"`\n * @param {string} requestType Request message type\n * @param {string} responseType Response message type\n * @param {boolean|Object.} [requestStream] Whether the request is streamed\n * @param {boolean|Object.} [responseStream] Whether the response is streamed\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this method\n * @param {Object.} [parsedOptions] Declared options, properly parsed into an object\n */\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options, comment, parsedOptions) {\n\n /* istanbul ignore next */\n if (util.isObject(requestStream)) {\n options = requestStream;\n requestStream = responseStream = undefined;\n } else if (util.isObject(responseStream)) {\n options = responseStream;\n responseStream = undefined;\n }\n\n /* istanbul ignore if */\n if (!(type === undefined || util.isString(type)))\n throw TypeError(\"type must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(requestType))\n throw TypeError(\"requestType must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(responseType))\n throw TypeError(\"responseType must be a string\");\n\n ReflectionObject.call(this, name, options);\n\n /**\n * Method type.\n * @type {string}\n */\n this.type = type || \"rpc\"; // toJSON\n\n /**\n * Request type.\n * @type {string}\n */\n this.requestType = requestType; // toJSON, marker\n\n /**\n * Whether requests are streamed or not.\n * @type {boolean|undefined}\n */\n this.requestStream = requestStream ? true : undefined; // toJSON\n\n /**\n * Response type.\n * @type {string}\n */\n this.responseType = responseType; // toJSON\n\n /**\n * Whether responses are streamed or not.\n * @type {boolean|undefined}\n */\n this.responseStream = responseStream ? true : undefined; // toJSON\n\n /**\n * Resolved request type.\n * @type {Type|null}\n */\n this.resolvedRequestType = null;\n\n /**\n * Resolved response type.\n * @type {Type|null}\n */\n this.resolvedResponseType = null;\n\n /**\n * Comment for this method\n * @type {string|null}\n */\n this.comment = comment;\n\n /**\n * Options properly parsed into an object\n */\n this.parsedOptions = parsedOptions;\n}\n\n/**\n * Method descriptor.\n * @interface IMethod\n * @property {string} [type=\"rpc\"] Method type\n * @property {string} requestType Request type\n * @property {string} responseType Response type\n * @property {boolean} [requestStream=false] Whether requests are streamed\n * @property {boolean} [responseStream=false] Whether responses are streamed\n * @property {Object.} [options] Method options\n * @property {string} comment Method comments\n * @property {Object.} [parsedOptions] Method options properly parsed into an object\n */\n\n/**\n * Constructs a method from a method descriptor.\n * @param {string} name Method name\n * @param {IMethod} json Method descriptor\n * @returns {Method} Created method\n * @throws {TypeError} If arguments are invalid\n */\nMethod.fromJSON = function fromJSON(name, json) {\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment, json.parsedOptions);\n};\n\n/**\n * Converts this method to a method descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMethod} Method descriptor\n */\nMethod.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"type\" , this.type !== \"rpc\" && /* istanbul ignore next */ this.type || undefined,\n \"requestType\" , this.requestType,\n \"requestStream\" , this.requestStream,\n \"responseType\" , this.responseType,\n \"responseStream\" , this.responseStream,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined,\n \"parsedOptions\" , this.parsedOptions,\n ]);\n};\n\n/**\n * @override\n */\nMethod.prototype.resolve = function resolve() {\n\n /* istanbul ignore if */\n if (this.resolved)\n return this;\n\n this.resolvedRequestType = this.parent.lookupType(this.requestType);\n this.resolvedResponseType = this.parent.lookupType(this.responseType);\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n","\"use strict\";\nmodule.exports = Service;\n\n// extends Namespace\nvar Namespace = require(\"./namespace\");\n((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = \"Service\";\n\nvar Method = require(\"./method\"),\n util = require(\"./util\"),\n rpc = require(\"./rpc\");\n\n/**\n * Constructs a new service instance.\n * @classdesc Reflected service.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Service name\n * @param {Object.} [options] Service options\n * @throws {TypeError} If arguments are invalid\n */\nfunction Service(name, options) {\n Namespace.call(this, name, options);\n\n /**\n * Service methods.\n * @type {Object.}\n */\n this.methods = {}; // toJSON, marker\n\n /**\n * Cached methods as an array.\n * @type {Method[]|null}\n * @private\n */\n this._methodsArray = null;\n}\n\n/**\n * Service descriptor.\n * @interface IService\n * @extends INamespace\n * @property {Object.} methods Method descriptors\n */\n\n/**\n * Constructs a service from a service descriptor.\n * @param {string} name Service name\n * @param {IService} json Service descriptor\n * @returns {Service} Created service\n * @throws {TypeError} If arguments are invalid\n */\nService.fromJSON = function fromJSON(name, json) {\n var service = new Service(name, json.options);\n /* istanbul ignore else */\n if (json.methods)\n for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)\n service.add(Method.fromJSON(names[i], json.methods[names[i]]));\n if (json.nested)\n service.addJSON(json.nested);\n if (json.edition)\n service._edition = json.edition;\n service.comment = json.comment;\n service._defaultEdition = \"proto3\"; // For backwards-compatibility.\n return service;\n};\n\n/**\n * Converts this service to a service descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IService} Service descriptor\n */\nService.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"edition\" , this._editionToJSON(),\n \"options\" , inherited && inherited.options || undefined,\n \"methods\" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Methods of this service as an array for iteration.\n * @name Service#methodsArray\n * @type {Method[]}\n * @readonly\n */\nObject.defineProperty(Service.prototype, \"methodsArray\", {\n get: function() {\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\n }\n});\n\nfunction clearCache(service) {\n service._methodsArray = null;\n return service;\n}\n\n/**\n * @override\n */\nService.prototype.get = function get(name) {\n return this.methods[name]\n || Namespace.prototype.get.call(this, name);\n};\n\n/**\n * @override\n */\nService.prototype.resolveAll = function resolveAll() {\n Namespace.prototype.resolve.call(this);\n var methods = this.methodsArray;\n for (var i = 0; i < methods.length; ++i)\n methods[i].resolve();\n return this;\n};\n\n/**\n * @override\n */\nService.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {\n edition = this._edition || edition;\n\n Namespace.prototype._resolveFeaturesRecursive.call(this, edition);\n this.methodsArray.forEach(method => {\n method._resolveFeaturesRecursive(edition);\n });\n return this;\n};\n\n/**\n * @override\n */\nService.prototype.add = function add(object) {\n\n /* istanbul ignore if */\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Method) {\n this.methods[object.name] = object;\n object.parent = this;\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * @override\n */\nService.prototype.remove = function remove(object) {\n if (object instanceof Method) {\n\n /* istanbul ignore if */\n if (this.methods[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.methods[object.name];\n object.parent = null;\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Creates a runtime service using the specified rpc implementation.\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed.\n */\nService.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);\n for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {\n var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\\w_]/g, \"\");\n rpcService[methodName] = util.codegen([\"r\",\"c\"], util.isReserved(methodName) ? methodName + \"_\" : methodName)(\"return this.rpcCall(m,q,s,r,c)\")({\n m: method,\n q: method.resolvedRequestType.ctor,\n s: method.resolvedResponseType.ctor\n });\n }\n return rpcService;\n};\n","\"use strict\";\nmodule.exports = Message;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new message instance.\n * @classdesc Abstract runtime message.\n * @constructor\n * @param {Properties} [properties] Properties to set\n * @template T extends object = object\n */\nfunction Message(properties) {\n // not used internally\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n this[keys[i]] = properties[keys[i]];\n}\n\n/**\n * Reference to the reflected type.\n * @name Message.$type\n * @type {Type}\n * @readonly\n */\n\n/**\n * Reference to the reflected type.\n * @name Message#$type\n * @type {Type}\n * @readonly\n */\n\n/*eslint-disable valid-jsdoc*/\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.create = function create(properties) {\n return this.$type.create(properties);\n};\n\n/**\n * Encodes a message of this type.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encode = function encode(message, writer) {\n return this.$type.encode(message, writer);\n};\n\n/**\n * Encodes a message of this type preceeded by its length as a varint.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\n return this.$type.encodeDelimited(message, writer);\n};\n\n/**\n * Decodes a message of this type.\n * @name Message.decode\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decode = function decode(reader) {\n return this.$type.decode(reader);\n};\n\n/**\n * Decodes a message of this type preceeded by its length as a varint.\n * @name Message.decodeDelimited\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decodeDelimited = function decodeDelimited(reader) {\n return this.$type.decodeDelimited(reader);\n};\n\n/**\n * Verifies a message of this type.\n * @name Message.verify\n * @function\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\nMessage.verify = function verify(message) {\n return this.$type.verify(message);\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object\n * @returns {T} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.fromObject = function fromObject(object) {\n return this.$type.fromObject(object);\n};\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {T} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @template T extends Message\n * @this Constructor\n */\nMessage.toObject = function toObject(message, options) {\n return this.$type.toObject(message, options);\n};\n\n/**\n * Converts this message to JSON.\n * @returns {Object.} JSON object\n */\nMessage.prototype.toJSON = function toJSON() {\n return this.$type.toObject(this, util.toJSONOptions);\n};\n\n/*eslint-enable valid-jsdoc*/","\"use strict\";\nmodule.exports = decoder;\n\nvar Enum = require(\"./enum\"),\n types = require(\"./types\"),\n util = require(\"./util\");\n\nfunction missing(field) {\n return \"missing required '\" + field.name + \"'\";\n}\n\n/**\n * Generates a decoder specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction decoder(mtype) {\n /* eslint-disable no-unexpected-multiline */\n var gen = util.codegen([\"r\", \"l\", \"e\"], mtype.name + \"$decode\")\n (\"if(!(r instanceof Reader))\")\n (\"r=Reader.create(r)\")\n (\"var c=l===undefined?r.len:r.pos+l,m=new this.ctor\" + (mtype.fieldsArray.filter(function(field) { return field.map; }).length ? \",k,value\" : \"\"))\n (\"while(r.pos>>3){\");\n\n var i = 0;\n for (; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n ref = \"m\" + util.safeProp(field.name); gen\n (\"case %i: {\", field.id);\n\n // Map fields\n if (field.map) { gen\n (\"if(%s===util.emptyObject)\", ref)\n (\"%s={}\", ref)\n (\"var c2 = r.uint32()+r.pos\");\n\n if (types.defaults[field.keyType] !== undefined) gen\n (\"k=%j\", types.defaults[field.keyType]);\n else gen\n (\"k=null\");\n\n if (types.defaults[type] !== undefined) gen\n (\"value=%j\", types.defaults[type]);\n else gen\n (\"value=null\");\n\n gen\n (\"while(r.pos>>3){\")\n (\"case 1: k=r.%s(); break\", field.keyType)\n (\"case 2:\");\n\n if (types.basic[type] === undefined) gen\n (\"value=types[%i].decode(r,r.uint32())\", i); // can't be groups\n else gen\n (\"value=r.%s()\", type);\n\n gen\n (\"break\")\n (\"default:\")\n (\"r.skipType(tag2&7)\")\n (\"break\")\n (\"}\")\n (\"}\");\n\n if (types.long[field.keyType] !== undefined) gen\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=value\", ref);\n else gen\n (\"%s[k]=value\", ref);\n\n // Repeated fields\n } else if (field.repeated) { gen\n\n (\"if(!(%s&&%s.length))\", ref, ref)\n (\"%s=[]\", ref);\n\n // Packable (always check for forward and backward compatiblity)\n if (types.packed[type] !== undefined) gen\n (\"if((t&7)===2){\")\n (\"var c2=r.uint32()+r.pos\")\n (\"while(r.pos>>0\", prop, prop);\n break;\n case \"int32\":\n case \"sint32\":\n case \"sfixed32\": gen\n (\"m%s=d%s|0\", prop, prop);\n break;\n case \"uint64\":\n isUnsigned = true;\n // eslint-disable-next-line no-fallthrough\n case \"int64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(util.Long)\")\n (\"(m%s=util.Long.fromValue(d%s)).unsigned=%j\", prop, prop, isUnsigned)\n (\"else if(typeof d%s===\\\"string\\\")\", prop)\n (\"m%s=parseInt(d%s,10)\", prop, prop)\n (\"else if(typeof d%s===\\\"number\\\")\", prop)\n (\"m%s=d%s\", prop, prop)\n (\"else if(typeof d%s===\\\"object\\\")\", prop)\n (\"m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)\", prop, prop, prop, isUnsigned ? \"true\" : \"\");\n break;\n case \"bytes\": gen\n (\"if(typeof d%s===\\\"string\\\")\", prop)\n (\"util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)\", prop, prop, prop)\n (\"else if(d%s.length >= 0)\", prop)\n (\"m%s=d%s\", prop, prop);\n break;\n case \"string\": gen\n (\"m%s=String(d%s)\", prop, prop);\n break;\n case \"bool\": gen\n (\"m%s=Boolean(d%s)\", prop, prop);\n break;\n /* default: gen\n (\"m%s=d%s\", prop, prop);\n break; */\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a plain object to runtime message converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.fromObject = function fromObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray;\n var gen = util.codegen([\"d\"], mtype.name + \"$fromObject\")\n (\"if(d instanceof this.ctor)\")\n (\"return d\");\n if (!fields.length) return gen\n (\"return new this.ctor\");\n gen\n (\"var m=new this.ctor\");\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n prop = util.safeProp(field.name);\n\n // Map fields\n if (field.map) { gen\n (\"if(d%s){\", prop)\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s={}\", prop)\n (\"for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s\", prop, prop, prop, prop, isUnsigned ? \"true\": \"\", prop);\n break;\n case \"bytes\": gen\n (\"d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s\", prop, prop, prop, prop, prop);\n break;\n default: gen\n (\"d%s=m%s\", prop, prop);\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a runtime message to plain object converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.toObject = function toObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);\n if (!fields.length)\n return util.codegen()(\"return {}\");\n var gen = util.codegen([\"m\", \"o\"], mtype.name + \"$toObject\")\n (\"if(!o)\")\n (\"o={}\")\n (\"var d={}\");\n\n var repeatedFields = [],\n mapFields = [],\n normalFields = [],\n i = 0;\n for (; i < fields.length; ++i)\n if (!fields[i].partOf)\n ( fields[i].resolve().repeated ? repeatedFields\n : fields[i].map ? mapFields\n : normalFields).push(fields[i]);\n\n if (repeatedFields.length) { gen\n (\"if(o.arrays||o.defaults){\");\n for (i = 0; i < repeatedFields.length; ++i) gen\n (\"d%s=[]\", util.safeProp(repeatedFields[i].name));\n gen\n (\"}\");\n }\n\n if (mapFields.length) { gen\n (\"if(o.objects||o.defaults){\");\n for (i = 0; i < mapFields.length; ++i) gen\n (\"d%s={}\", util.safeProp(mapFields[i].name));\n gen\n (\"}\");\n }\n\n if (normalFields.length) { gen\n (\"if(o.defaults){\");\n for (i = 0; i < normalFields.length; ++i) {\n var field = normalFields[i],\n prop = util.safeProp(field.name);\n if (field.resolvedType instanceof Enum) gen\n (\"d%s=o.enums===String?%j:%j\", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault);\n else if (field.long) gen\n (\"if(util.Long){\")\n (\"var n=new util.Long(%i,%i,%j)\", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)\n (\"d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n\", prop)\n (\"}else\")\n (\"d%s=o.longs===String?%j:%i\", prop, field.typeDefault.toString(), field.typeDefault.toNumber());\n else if (field.bytes) {\n var arrayDefault = \"[\" + Array.prototype.slice.call(field.typeDefault).join(\",\") + \"]\";\n gen\n (\"if(o.bytes===String)d%s=%j\", prop, String.fromCharCode.apply(String, field.typeDefault))\n (\"else{\")\n (\"d%s=%s\", prop, arrayDefault)\n (\"if(o.bytes!==Array)d%s=util.newBuffer(d%s)\", prop, prop)\n (\"}\");\n } else gen\n (\"d%s=%j\", prop, field.typeDefault); // also messages (=null)\n } gen\n (\"}\");\n }\n var hasKs2 = false;\n for (i = 0; i < fields.length; ++i) {\n var field = fields[i],\n index = mtype._fieldsArray.indexOf(field),\n prop = util.safeProp(field.name);\n if (field.map) {\n if (!hasKs2) { hasKs2 = true; gen\n (\"var ks2\");\n } gen\n (\"if(m%s&&(ks2=Object.keys(m%s)).length){\", prop, prop)\n (\"d%s={}\", prop)\n (\"for(var j=0;j}\n * @const\n */\nvar wrappers = exports;\n\nvar Message = require(\"./message\");\n\n/**\n * From object converter part of an {@link IWrapper}.\n * @typedef WrapperFromObjectConverter\n * @type {function}\n * @param {Object.} object Plain object\n * @returns {Message<{}>} Message instance\n * @this Type\n */\n\n/**\n * To object converter part of an {@link IWrapper}.\n * @typedef WrapperToObjectConverter\n * @type {function}\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @this Type\n */\n\n/**\n * Common type wrapper part of {@link wrappers}.\n * @interface IWrapper\n * @property {WrapperFromObjectConverter} [fromObject] From object converter\n * @property {WrapperToObjectConverter} [toObject] To object converter\n */\n\n// Custom wrapper for Any\nwrappers[\".google.protobuf.Any\"] = {\n\n fromObject: function(object) {\n\n // unwrap value type if mapped\n if (object && object[\"@type\"]) {\n // Only use fully qualified type name after the last '/'\n var name = object[\"@type\"].substring(object[\"@type\"].lastIndexOf(\"/\") + 1);\n var type = this.lookup(name);\n /* istanbul ignore else */\n if (type) {\n // type_url does not accept leading \".\"\n var type_url = object[\"@type\"].charAt(0) === \".\" ?\n object[\"@type\"].slice(1) : object[\"@type\"];\n // type_url prefix is optional, but path seperator is required\n if (type_url.indexOf(\"/\") === -1) {\n type_url = \"/\" + type_url;\n }\n return this.create({\n type_url: type_url,\n value: type.encode(type.fromObject(object)).finish()\n });\n }\n }\n\n return this.fromObject(object);\n },\n\n toObject: function(message, options) {\n\n // Default prefix\n var googleApi = \"type.googleapis.com/\";\n var prefix = \"\";\n var name = \"\";\n\n // decode value if requested and unmapped\n if (options && options.json && message.type_url && message.value) {\n // Only use fully qualified type name after the last '/'\n name = message.type_url.substring(message.type_url.lastIndexOf(\"/\") + 1);\n // Separate the prefix used\n prefix = message.type_url.substring(0, message.type_url.lastIndexOf(\"/\") + 1);\n var type = this.lookup(name);\n /* istanbul ignore else */\n if (type)\n message = type.decode(message.value);\n }\n\n // wrap value if unmapped\n if (!(message instanceof this.ctor) && message instanceof Message) {\n var object = message.$type.toObject(message, options);\n var messageName = message.$type.fullName[0] === \".\" ?\n message.$type.fullName.slice(1) : message.$type.fullName;\n // Default to type.googleapis.com prefix if no prefix is used\n if (prefix === \"\") {\n prefix = googleApi;\n }\n name = prefix + messageName;\n object[\"@type\"] = name;\n return object;\n }\n\n return this.toObject(message, options);\n }\n};\n","\"use strict\";\nmodule.exports = Type;\n\n// extends Namespace\nvar Namespace = require(\"./namespace\");\n((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = \"Type\";\n\nvar Enum = require(\"./enum\"),\n OneOf = require(\"./oneof\"),\n Field = require(\"./field\"),\n MapField = require(\"./mapfield\"),\n Service = require(\"./service\"),\n Message = require(\"./message\"),\n Reader = require(\"./reader\"),\n Writer = require(\"./writer\"),\n util = require(\"./util\"),\n encoder = require(\"./encoder\"),\n decoder = require(\"./decoder\"),\n verifier = require(\"./verifier\"),\n converter = require(\"./converter\"),\n wrappers = require(\"./wrappers\");\n\n/**\n * Constructs a new reflected message type instance.\n * @classdesc Reflected message type.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Message name\n * @param {Object.} [options] Declared options\n */\nfunction Type(name, options) {\n Namespace.call(this, name, options);\n\n /**\n * Message fields.\n * @type {Object.}\n */\n this.fields = {}; // toJSON, marker\n\n /**\n * Oneofs declared within this namespace, if any.\n * @type {Object.}\n */\n this.oneofs = undefined; // toJSON\n\n /**\n * Extension ranges, if any.\n * @type {number[][]}\n */\n this.extensions = undefined; // toJSON\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n /*?\n * Whether this type is a legacy group.\n * @type {boolean|undefined}\n */\n this.group = undefined; // toJSON\n\n /**\n * Cached fields by id.\n * @type {Object.|null}\n * @private\n */\n this._fieldsById = null;\n\n /**\n * Cached fields as an array.\n * @type {Field[]|null}\n * @private\n */\n this._fieldsArray = null;\n\n /**\n * Cached oneofs as an array.\n * @type {OneOf[]|null}\n * @private\n */\n this._oneofsArray = null;\n\n /**\n * Cached constructor.\n * @type {Constructor<{}>}\n * @private\n */\n this._ctor = null;\n}\n\nObject.defineProperties(Type.prototype, {\n\n /**\n * Message fields by id.\n * @name Type#fieldsById\n * @type {Object.}\n * @readonly\n */\n fieldsById: {\n get: function() {\n\n /* istanbul ignore if */\n if (this._fieldsById)\n return this._fieldsById;\n\n this._fieldsById = {};\n for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) {\n var field = this.fields[names[i]],\n id = field.id;\n\n /* istanbul ignore if */\n if (this._fieldsById[id])\n throw Error(\"duplicate id \" + id + \" in \" + this);\n\n this._fieldsById[id] = field;\n }\n return this._fieldsById;\n }\n },\n\n /**\n * Fields of this message as an array for iteration.\n * @name Type#fieldsArray\n * @type {Field[]}\n * @readonly\n */\n fieldsArray: {\n get: function() {\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\n }\n },\n\n /**\n * Oneofs of this message as an array for iteration.\n * @name Type#oneofsArray\n * @type {OneOf[]}\n * @readonly\n */\n oneofsArray: {\n get: function() {\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\n }\n },\n\n /**\n * The registered constructor, if any registered, otherwise a generic constructor.\n * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.\n * @name Type#ctor\n * @type {Constructor<{}>}\n */\n ctor: {\n get: function() {\n return this._ctor || (this.ctor = Type.generateConstructor(this)());\n },\n set: function(ctor) {\n\n // Ensure proper prototype\n var prototype = ctor.prototype;\n if (!(prototype instanceof Message)) {\n (ctor.prototype = new Message()).constructor = ctor;\n util.merge(ctor.prototype, prototype);\n }\n\n // Classes and messages reference their reflected type\n ctor.$type = ctor.prototype.$type = this;\n\n // Mix in static methods\n util.merge(ctor, Message, true);\n\n this._ctor = ctor;\n\n // Messages have non-enumerable default values on their prototype\n var i = 0;\n for (; i < /* initializes */ this.fieldsArray.length; ++i)\n this._fieldsArray[i].resolve(); // ensures a proper value\n\n // Messages have non-enumerable getters and setters for each virtual oneof field\n var ctorProperties = {};\n for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i)\n ctorProperties[this._oneofsArray[i].resolve().name] = {\n get: util.oneOfGetter(this._oneofsArray[i].oneof),\n set: util.oneOfSetter(this._oneofsArray[i].oneof)\n };\n if (i)\n Object.defineProperties(ctor.prototype, ctorProperties);\n }\n }\n});\n\n/**\n * Generates a constructor function for the specified type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nType.generateConstructor = function generateConstructor(mtype) {\n /* eslint-disable no-unexpected-multiline */\n var gen = util.codegen([\"p\"], mtype.name);\n // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype\n for (var i = 0, field; i < mtype.fieldsArray.length; ++i)\n if ((field = mtype._fieldsArray[i]).map) gen\n (\"this%s={}\", util.safeProp(field.name));\n else if (field.repeated) gen\n (\"this%s=[]\", util.safeProp(field.name));\n return gen\n (\"if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors\n * @property {Object.} fields Field descriptors\n * @property {number[][]} [extensions] Extension ranges\n * @property {Array.} [reserved] Reserved ranges\n * @property {boolean} [group=false] Whether a legacy group or not\n */\n\n/**\n * Creates a message type from a message type descriptor.\n * @param {string} name Message name\n * @param {IType} json Message type descriptor\n * @returns {Type} Created message type\n */\nType.fromJSON = function fromJSON(name, json) {\n var type = new Type(name, json.options);\n type.extensions = json.extensions;\n type.reserved = json.reserved;\n var names = Object.keys(json.fields),\n i = 0;\n for (; i < names.length; ++i)\n type.add(\n ( typeof json.fields[names[i]].keyType !== \"undefined\"\n ? MapField.fromJSON\n : Field.fromJSON )(names[i], json.fields[names[i]])\n );\n if (json.oneofs)\n for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i)\n type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]]));\n if (json.nested)\n for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) {\n var nested = json.nested[names[i]];\n type.add( // most to least likely\n ( nested.id !== undefined\n ? Field.fromJSON\n : nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n if (json.extensions && json.extensions.length)\n type.extensions = json.extensions;\n if (json.reserved && json.reserved.length)\n type.reserved = json.reserved;\n if (json.group)\n type.group = true;\n if (json.comment)\n type.comment = json.comment;\n if (json.edition)\n type._edition = json.edition;\n type._defaultEdition = \"proto3\"; // For backwards-compatibility.\n return type;\n};\n\n/**\n * Converts this message type to a message type descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IType} Message type descriptor\n */\nType.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"edition\" , this._editionToJSON(),\n \"options\" , inherited && inherited.options || undefined,\n \"oneofs\" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),\n \"fields\" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},\n \"extensions\" , this.extensions && this.extensions.length ? this.extensions : undefined,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"group\" , this.group || undefined,\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nType.prototype.resolveAll = function resolveAll() {\n Namespace.prototype.resolveAll.call(this);\n var oneofs = this.oneofsArray; i = 0;\n while (i < oneofs.length)\n oneofs[i++].resolve();\n var fields = this.fieldsArray, i = 0;\n while (i < fields.length)\n fields[i++].resolve();\n return this;\n};\n\n/**\n * @override\n */\nType.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {\n edition = this._edition || edition;\n\n Namespace.prototype._resolveFeaturesRecursive.call(this, edition);\n this.oneofsArray.forEach(oneof => {\n oneof._resolveFeatures(edition);\n });\n this.fieldsArray.forEach(field => {\n field._resolveFeatures(edition);\n });\n return this;\n};\n\n/**\n * @override\n */\nType.prototype.get = function get(name) {\n return this.fields[name]\n || this.oneofs && this.oneofs[name]\n || this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Adds a nested object to this type.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\n */\nType.prototype.add = function add(object) {\n\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Field && object.extend === undefined) {\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\n // The root object takes care of adding distinct sister-fields to the respective extended\n // type instead.\n\n // avoids calling the getter if not absolutely necessary because it's called quite frequently\n if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id])\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\n if (this.isReservedId(object.id))\n throw Error(\"id \" + object.id + \" is reserved in \" + this);\n if (this.isReservedName(object.name))\n throw Error(\"name '\" + object.name + \"' is reserved in \" + this);\n\n if (object.parent)\n object.parent.remove(object);\n this.fields[object.name] = object;\n object.message = this;\n object.onAdd(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n if (!this.oneofs)\n this.oneofs = {};\n this.oneofs[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * Removes a nested object from this type.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this type\n */\nType.prototype.remove = function remove(object) {\n if (object instanceof Field && object.extend === undefined) {\n // See Type#add for the reason why extension fields are excluded here.\n\n /* istanbul ignore if */\n if (!this.fields || this.fields[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.fields[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n\n /* istanbul ignore if */\n if (!this.oneofs || this.oneofs[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.oneofs[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message<{}>} Message instance\n */\nType.prototype.create = function create(properties) {\n return new this.ctor(properties);\n};\n\n/**\n * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}.\n * @returns {Type} `this`\n */\nType.prototype.setup = function setup() {\n // Sets up everything at once so that the prototype chain does not have to be re-evaluated\n // multiple times (V8, soft-deopt prototype-check).\n\n var fullName = this.fullName,\n types = [];\n for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i)\n types.push(this._fieldsArray[i].resolve().resolvedType);\n\n // Replace setup methods with type-specific generated functions\n this.encode = encoder(this)({\n Writer : Writer,\n types : types,\n util : util\n });\n this.decode = decoder(this)({\n Reader : Reader,\n types : types,\n util : util\n });\n this.verify = verifier(this)({\n types : types,\n util : util\n });\n this.fromObject = converter.fromObject(this)({\n types : types,\n util : util\n });\n this.toObject = converter.toObject(this)({\n types : types,\n util : util\n });\n\n // Inject custom wrappers for common types\n var wrapper = wrappers[fullName];\n if (wrapper) {\n var originalThis = Object.create(this);\n // if (wrapper.fromObject) {\n originalThis.fromObject = this.fromObject;\n this.fromObject = wrapper.fromObject.bind(originalThis);\n // }\n // if (wrapper.toObject) {\n originalThis.toObject = this.toObject;\n this.toObject = wrapper.toObject.bind(originalThis);\n // }\n }\n\n return this;\n};\n\n/**\n * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encode = function encode_setup(message, writer) {\n return this.setup().encode(message, writer); // overrides this method\n};\n\n/**\n * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\n};\n\n/**\n * Decodes a message of this type.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Length of the message, if known beforehand\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError<{}>} If required fields are missing\n */\nType.prototype.decode = function decode_setup(reader, length) {\n return this.setup().decode(reader, length); // overrides this method\n};\n\n/**\n * Decodes a message of this type preceeded by its byte length as a varint.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError} If required fields are missing\n */\nType.prototype.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof Reader))\n reader = Reader.create(reader);\n return this.decode(reader, reader.uint32());\n};\n\n/**\n * Verifies that field values are valid and that required fields are present.\n * @param {Object.} message Plain object to verify\n * @returns {null|string} `null` if valid, otherwise the reason why it is not\n */\nType.prototype.verify = function verify_setup(message) {\n return this.setup().verify(message); // overrides this method\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object to convert\n * @returns {Message<{}>} Message instance\n */\nType.prototype.fromObject = function fromObject(object) {\n return this.setup().fromObject(object);\n};\n\n/**\n * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.\n * @interface IConversionOptions\n * @property {Function} [longs] Long conversion type.\n * Valid values are `String` and `Number` (the global types).\n * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.\n * @property {Function} [enums] Enum value conversion type.\n * Only valid value is `String` (the global type).\n * Defaults to copy the present value, which is the numeric id.\n * @property {Function} [bytes] Bytes value conversion type.\n * Valid values are `Array` and (a base64 encoded) `String` (the global types).\n * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.\n * @property {boolean} [defaults=false] Also sets default values on the resulting object\n * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false`\n * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false`\n * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any\n * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings\n */\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\nType.prototype.toObject = function toObject(message, options) {\n return this.setup().toObject(message, options);\n};\n\n/**\n * Decorator function as returned by {@link Type.d} (TypeScript).\n * @typedef TypeDecorator\n * @type {function}\n * @param {Constructor} target Target constructor\n * @returns {undefined}\n * @template T extends Message\n */\n\n/**\n * Type decorator (TypeScript).\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {TypeDecorator} Decorator function\n * @template T extends Message\n */\nType.d = function decorateType(typeName) {\n return function typeDecorator(target) {\n util.decorateType(target, typeName);\n };\n};\n","\"use strict\";\nmodule.exports = Root;\n\n// extends Namespace\nvar Namespace = require(\"./namespace\");\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\n\nvar Field = require(\"./field\"),\n Enum = require(\"./enum\"),\n OneOf = require(\"./oneof\"),\n util = require(\"./util\");\n\nvar Type, // cyclic\n parse, // might be excluded\n common; // \"\n\n/**\n * Constructs a new root namespace instance.\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\n * @extends NamespaceBase\n * @constructor\n * @param {Object.} [options] Top level options\n */\nfunction Root(options) {\n Namespace.call(this, \"\", options);\n\n /**\n * Deferred extension fields.\n * @type {Field[]}\n */\n this.deferred = [];\n\n /**\n * Resolved file names of loaded files.\n * @type {string[]}\n */\n this.files = [];\n\n // Default to proto2 if unspecified.\n this._edition = \"proto2\";\n}\n\n/**\n * Loads a namespace descriptor into a root namespace.\n * @param {INamespace} json Namespace descriptor\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\n * @returns {Root} Root namespace\n */\nRoot.fromJSON = function fromJSON(json, root) {\n if (!root)\n root = new Root();\n if (json.options)\n root.setOptions(json.options);\n return root.addJSON(json.nested).resolveAll();\n};\n\n/**\n * Resolves the path of an imported file, relative to the importing origin.\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\n * @function\n * @param {string} origin The file name of the importing file\n * @param {string} target The file name being imported\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\n */\nRoot.prototype.resolvePath = util.path.resolve;\n\n/**\n * Fetch content from file path or url\n * This method exists so you can override it with your own logic.\n * @function\n * @param {string} path File path or url\n * @param {FetchCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.fetch = util.fetch;\n\n// A symbol-like function to safely signal synchronous loading\n/* istanbul ignore next */\nfunction SYNC() {} // eslint-disable-line no-empty-function\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} options Parse options\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.load = function load(filename, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = undefined;\n }\n var self = this;\n if (!callback) {\n return util.asPromise(load, self, filename, options);\n }\n\n var sync = callback === SYNC; // undocumented\n\n // Finishes loading by calling the callback (exactly once)\n function finish(err, root) {\n /* istanbul ignore if */\n if (!callback) {\n return;\n }\n if (sync) {\n throw err;\n }\n var cb = callback;\n callback = null;\n if (root) {\n root.resolveAll();\n }\n cb(err, root);\n }\n\n // Bundled definition existence checking\n function getBundledFileName(filename) {\n var idx = filename.lastIndexOf(\"google/protobuf/\");\n if (idx > -1) {\n var altname = filename.substring(idx);\n if (altname in common) return altname;\n }\n return null;\n }\n\n // Processes a single file\n function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued) {\n finish(null, self); // only once anyway\n }\n }\n\n // Fetches a single file\n function fetch(filename, weak) {\n filename = getBundledFileName(filename) || filename;\n\n // Skip if already loaded / attempted\n if (self.files.indexOf(filename) > -1) {\n return;\n }\n self.files.push(filename);\n\n // Shortcut bundled definitions\n if (filename in common) {\n if (sync) {\n process(filename, common[filename]);\n } else {\n ++queued;\n setTimeout(function() {\n --queued;\n process(filename, common[filename]);\n });\n }\n return;\n }\n\n // Otherwise fetch from disk or network\n if (sync) {\n var source;\n try {\n source = util.fs.readFileSync(filename).toString(\"utf8\");\n } catch (err) {\n if (!weak)\n finish(err);\n return;\n }\n process(filename, source);\n } else {\n ++queued;\n self.fetch(filename, function(err, source) {\n --queued;\n /* istanbul ignore if */\n if (!callback) {\n return; // terminated meanwhile\n }\n if (err) {\n /* istanbul ignore else */\n if (!weak)\n finish(err);\n else if (!queued) // can't be covered reliably\n finish(null, self);\n return;\n }\n process(filename, source);\n });\n }\n }\n var queued = 0;\n\n // Assembling the root namespace doesn't require working type\n // references anymore, so we can load everything in parallel\n if (util.isString(filename)) {\n filename = [ filename ];\n }\n for (var i = 0, resolved; i < filename.length; ++i)\n if (resolved = self.resolvePath(\"\", filename[i]))\n fetch(resolved);\n self.resolveAll();\n if (sync) {\n return self;\n }\n if (!queued) {\n finish(null, self);\n }\n\n return self;\n};\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Promise} Promise\n * @variation 3\n */\n// function load(filename:string, [options:IParseOptions]):Promise\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\n * @function Root#loadSync\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n */\nRoot.prototype.loadSync = function loadSync(filename, options) {\n if (!util.isNode)\n throw Error(\"not supported\");\n return this.load(filename, options, SYNC);\n};\n\n/**\n * @override\n */\nRoot.prototype.resolveAll = function resolveAll() {\n if (this.deferred.length)\n throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\n return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\n }).join(\", \"));\n return Namespace.prototype.resolveAll.call(this);\n};\n\n// only uppercased (and thus conflict-free) children are exposed, see below\nvar exposeRe = /^[A-Z]/;\n\n/**\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\n * @param {Root} root Root instance\n * @param {Field} field Declaring extension field witin the declaring type\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\n * @inner\n * @ignore\n */\nfunction tryHandleExtension(root, field) {\n var extendedType = field.parent.lookup(field.extend);\n if (extendedType) {\n var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\n //do not allow to extend same field twice to prevent the error\n if (extendedType.get(sisterField.name)) {\n return true;\n }\n sisterField.declaringField = field;\n field.extensionField = sisterField;\n extendedType.add(sisterField);\n return true;\n }\n return false;\n}\n\n/**\n * Called when any object is added to this root or its sub-namespaces.\n * @param {ReflectionObject} object Object added\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleAdd = function _handleAdd(object) {\n if (object instanceof Field) {\n\n if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\n if (!tryHandleExtension(this, object))\n this.deferred.push(object);\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n object.parent[object.name] = object.values; // expose enum values as property of its parent\n\n } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\n\n if (object instanceof Type) // Try to handle any deferred extensions\n for (var i = 0; i < this.deferred.length;)\n if (tryHandleExtension(this, this.deferred[i]))\n this.deferred.splice(i, 1);\n else\n ++i;\n for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\n this._handleAdd(object._nestedArray[j]);\n if (exposeRe.test(object.name))\n object.parent[object.name] = object; // expose namespace as property of its parent\n }\n\n // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\n // properties of namespaces just like static code does. This allows using a .d.ts generated for\n // a static module with reflection-based solutions where the condition is met.\n};\n\n/**\n * Called when any object is removed from this root or its sub-namespaces.\n * @param {ReflectionObject} object Object removed\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleRemove = function _handleRemove(object) {\n if (object instanceof Field) {\n\n if (/* an extension field */ object.extend !== undefined) {\n if (/* already handled */ object.extensionField) { // remove its sister field\n object.extensionField.parent.remove(object.extensionField);\n object.extensionField = null;\n } else { // cancel the extension\n var index = this.deferred.indexOf(object);\n /* istanbul ignore else */\n if (index > -1)\n this.deferred.splice(index, 1);\n }\n }\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose enum values\n\n } else if (object instanceof Namespace) {\n\n for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\n this._handleRemove(object._nestedArray[i]);\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose namespaces\n\n }\n};\n\n// Sets up cyclic dependencies (called in index-light)\nRoot._configure = function(Type_, parse_, common_) {\n Type = Type_;\n parse = parse_;\n common = common_;\n};\n","\"use strict\";\n\n/**\n * Various utility functions.\n * @namespace\n */\nvar util = module.exports = require(\"./util/minimal\");\n\nvar roots = require(\"./roots\");\n\nvar Type, // cyclic\n Enum;\n\nutil.codegen = require(\"@protobufjs/codegen\");\nutil.fetch = require(\"@protobufjs/fetch\");\nutil.path = require(\"@protobufjs/path\");\n\n/**\n * Node's fs module if available.\n * @type {Object.}\n */\nutil.fs = util.inquire(\"fs\");\n\n/**\n * Converts an object's values to an array.\n * @param {Object.} object Object to convert\n * @returns {Array.<*>} Converted array\n */\nutil.toArray = function toArray(object) {\n if (object) {\n var keys = Object.keys(object),\n array = new Array(keys.length),\n index = 0;\n while (index < keys.length)\n array[index] = object[keys[index++]];\n return array;\n }\n return [];\n};\n\n/**\n * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values.\n * @param {Array.<*>} array Array to convert\n * @returns {Object.} Converted object\n */\nutil.toObject = function toObject(array) {\n var object = {},\n index = 0;\n while (index < array.length) {\n var key = array[index++],\n val = array[index++];\n if (val !== undefined)\n object[key] = val;\n }\n return object;\n};\n\nvar safePropBackslashRe = /\\\\/g,\n safePropQuoteRe = /\"/g;\n\n/**\n * Tests whether the specified name is a reserved word in JS.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nutil.isReserved = function isReserved(name) {\n return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name);\n};\n\n/**\n * Returns a safe property accessor for the specified property name.\n * @param {string} prop Property name\n * @returns {string} Safe accessor\n */\nutil.safeProp = function safeProp(prop) {\n if (!/^[$\\w_]+$/.test(prop) || util.isReserved(prop))\n return \"[\\\"\" + prop.replace(safePropBackslashRe, \"\\\\\\\\\").replace(safePropQuoteRe, \"\\\\\\\"\") + \"\\\"]\";\n return \".\" + prop;\n};\n\n/**\n * Converts the first character of a string to upper case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.ucFirst = function ucFirst(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\n\nvar camelCaseRe = /_([a-z])/g;\n\n/**\n * Converts a string to camel case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.camelCase = function camelCase(str) {\n return str.substring(0, 1)\n + str.substring(1)\n .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); });\n};\n\n/**\n * Compares reflected fields by id.\n * @param {Field} a First field\n * @param {Field} b Second field\n * @returns {number} Comparison value\n */\nutil.compareFieldsById = function compareFieldsById(a, b) {\n return a.id - b.id;\n};\n\n/**\n * Decorator helper for types (TypeScript).\n * @param {Constructor} ctor Constructor function\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {Type} Reflected type\n * @template T extends Message\n * @property {Root} root Decorators root\n */\nutil.decorateType = function decorateType(ctor, typeName) {\n\n /* istanbul ignore if */\n if (ctor.$type) {\n if (typeName && ctor.$type.name !== typeName) {\n util.decorateRoot.remove(ctor.$type);\n ctor.$type.name = typeName;\n util.decorateRoot.add(ctor.$type);\n }\n return ctor.$type;\n }\n\n /* istanbul ignore next */\n if (!Type)\n Type = require(\"./type\");\n\n var type = new Type(typeName || ctor.name);\n util.decorateRoot.add(type);\n type.ctor = ctor; // sets up .encode, .decode etc.\n Object.defineProperty(ctor, \"$type\", { value: type, enumerable: false });\n Object.defineProperty(ctor.prototype, \"$type\", { value: type, enumerable: false });\n return type;\n};\n\nvar decorateEnumIndex = 0;\n\n/**\n * Decorator helper for enums (TypeScript).\n * @param {Object} object Enum object\n * @returns {Enum} Reflected enum\n */\nutil.decorateEnum = function decorateEnum(object) {\n\n /* istanbul ignore if */\n if (object.$type)\n return object.$type;\n\n /* istanbul ignore next */\n if (!Enum)\n Enum = require(\"./enum\");\n\n var enm = new Enum(\"Enum\" + decorateEnumIndex++, object);\n util.decorateRoot.add(enm);\n Object.defineProperty(object, \"$type\", { value: enm, enumerable: false });\n return enm;\n};\n\n\n/**\n * Sets the value of a property by property path. If a value already exists, it is turned to an array\n * @param {Object.} dst Destination object\n * @param {string} path dot '.' delimited path of the property to set\n * @param {Object} value the value to set\n * @param {boolean|undefined} [ifNotSet] Sets the option only if it isn't currently set\n * @returns {Object.} Destination object\n */\nutil.setProperty = function setProperty(dst, path, value, ifNotSet) {\n function setProp(dst, path, value) {\n var part = path.shift();\n if (part === \"__proto__\" || part === \"prototype\") {\n return dst;\n }\n if (path.length > 0) {\n dst[part] = setProp(dst[part] || {}, path, value);\n } else {\n var prevValue = dst[part];\n if (prevValue && ifNotSet)\n return dst;\n if (prevValue)\n value = [].concat(prevValue).concat(value);\n dst[part] = value;\n }\n return dst;\n }\n\n if (typeof dst !== \"object\")\n throw TypeError(\"dst must be an object\");\n if (!path)\n throw TypeError(\"path must be specified\");\n\n path = path.split(\".\");\n return setProp(dst, path, value);\n};\n\n/**\n * Decorator root (TypeScript).\n * @name util.decorateRoot\n * @type {Root}\n * @readonly\n */\nObject.defineProperty(util, \"decorateRoot\", {\n get: function() {\n return roots[\"decorated\"] || (roots[\"decorated\"] = new (require(\"./root\"))());\n }\n});\n","\"use strict\";\n\n/**\n * Common type constants.\n * @namespace\n */\nvar types = exports;\n\nvar util = require(\"./util\");\n\nvar s = [\n \"double\", // 0\n \"float\", // 1\n \"int32\", // 2\n \"uint32\", // 3\n \"sint32\", // 4\n \"fixed32\", // 5\n \"sfixed32\", // 6\n \"int64\", // 7\n \"uint64\", // 8\n \"sint64\", // 9\n \"fixed64\", // 10\n \"sfixed64\", // 11\n \"bool\", // 12\n \"string\", // 13\n \"bytes\" // 14\n];\n\nfunction bake(values, offset) {\n var i = 0, o = {};\n offset |= 0;\n while (i < values.length) o[s[i + offset]] = values[i++];\n return o;\n}\n\n/**\n * Basic type wire types.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n * @property {number} bytes=2 Ldelim wire type\n */\ntypes.basic = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2,\n /* bytes */ 2\n]);\n\n/**\n * Basic type defaults.\n * @type {Object.}\n * @const\n * @property {number} double=0 Double default\n * @property {number} float=0 Float default\n * @property {number} int32=0 Int32 default\n * @property {number} uint32=0 Uint32 default\n * @property {number} sint32=0 Sint32 default\n * @property {number} fixed32=0 Fixed32 default\n * @property {number} sfixed32=0 Sfixed32 default\n * @property {number} int64=0 Int64 default\n * @property {number} uint64=0 Uint64 default\n * @property {number} sint64=0 Sint32 default\n * @property {number} fixed64=0 Fixed64 default\n * @property {number} sfixed64=0 Sfixed64 default\n * @property {boolean} bool=false Bool default\n * @property {string} string=\"\" String default\n * @property {Array.} bytes=Array(0) Bytes default\n * @property {null} message=null Message default\n */\ntypes.defaults = bake([\n /* double */ 0,\n /* float */ 0,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 0,\n /* sfixed32 */ 0,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 0,\n /* sfixed64 */ 0,\n /* bool */ false,\n /* string */ \"\",\n /* bytes */ util.emptyArray,\n /* message */ null\n]);\n\n/**\n * Basic long type wire types.\n * @type {Object.}\n * @const\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n */\ntypes.long = bake([\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1\n], 7);\n\n/**\n * Allowed types for map keys with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n */\ntypes.mapKey = bake([\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2\n], 2);\n\n/**\n * Allowed types for packed repeated fields with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n */\ntypes.packed = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0\n]);\n","\"use strict\";\nmodule.exports = Field;\n\n// extends ReflectionObject\nvar ReflectionObject = require(\"./object\");\n((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = \"Field\";\n\nvar Enum = require(\"./enum\"),\n types = require(\"./types\"),\n util = require(\"./util\");\n\nvar Type; // cyclic\n\nvar ruleRe = /^required|optional|repeated$/;\n\n/**\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\n * @name Field\n * @classdesc Reflected message field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a field from a field descriptor.\n * @param {string} name Field name\n * @param {IField} json Field descriptor\n * @returns {Field} Created field\n * @throws {TypeError} If arguments are invalid\n */\nField.fromJSON = function fromJSON(name, json) {\n var field = new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);\n if (json.edition)\n field._edition = json.edition;\n field._defaultEdition = \"proto3\"; // For backwards-compatibility.\n return field;\n};\n\n/**\n * Not an actual constructor. Use {@link Field} instead.\n * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports FieldBase\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction Field(name, id, type, rule, extend, options, comment) {\n\n if (util.isObject(rule)) {\n comment = extend;\n options = rule;\n rule = extend = undefined;\n } else if (util.isObject(extend)) {\n comment = options;\n options = extend;\n extend = undefined;\n }\n\n ReflectionObject.call(this, name, options);\n\n if (!util.isInteger(id) || id < 0)\n throw TypeError(\"id must be a non-negative integer\");\n\n if (!util.isString(type))\n throw TypeError(\"type must be a string\");\n\n if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase()))\n throw TypeError(\"rule must be a string rule\");\n\n if (extend !== undefined && !util.isString(extend))\n throw TypeError(\"extend must be a string\");\n\n /**\n * Field rule, if any.\n * @type {string|undefined}\n */\n if (rule === \"proto3_optional\") {\n rule = \"optional\";\n }\n this.rule = rule && rule !== \"optional\" ? rule : undefined; // toJSON\n\n /**\n * Field type.\n * @type {string}\n */\n this.type = type; // toJSON\n\n /**\n * Unique field id.\n * @type {number}\n */\n this.id = id; // toJSON, marker\n\n /**\n * Extended type if different from parent.\n * @type {string|undefined}\n */\n this.extend = extend || undefined; // toJSON\n\n /**\n * Whether this field is repeated.\n * @type {boolean}\n */\n this.repeated = rule === \"repeated\";\n\n /**\n * Whether this field is a map or not.\n * @type {boolean}\n */\n this.map = false;\n\n /**\n * Message this field belongs to.\n * @type {Type|null}\n */\n this.message = null;\n\n /**\n * OneOf this field belongs to, if any,\n * @type {OneOf|null}\n */\n this.partOf = null;\n\n /**\n * The field type's default value.\n * @type {*}\n */\n this.typeDefault = null;\n\n /**\n * The field's default value on prototypes.\n * @type {*}\n */\n this.defaultValue = null;\n\n /**\n * Whether this field's value should be treated as a long.\n * @type {boolean}\n */\n this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false;\n\n /**\n * Whether this field's value is a buffer.\n * @type {boolean}\n */\n this.bytes = type === \"bytes\";\n\n /**\n * Resolved type if not a basic type.\n * @type {Type|Enum|null}\n */\n this.resolvedType = null;\n\n /**\n * Sister-field within the extended type if a declaring extension field.\n * @type {Field|null}\n */\n this.extensionField = null;\n\n /**\n * Sister-field within the declaring namespace if an extended field.\n * @type {Field|null}\n */\n this.declaringField = null;\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Determines whether this field is required.\n * @name Field#required\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"required\", {\n get: function() {\n return this._features.field_presence === \"LEGACY_REQUIRED\";\n }\n});\n\n/**\n * Determines whether this field is not required.\n * @name Field#optional\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"optional\", {\n get: function() {\n return !this.required;\n }\n});\n\n/**\n * Determines whether this field uses tag-delimited encoding. In proto2 this\n * corresponded to group syntax.\n * @name Field#delimited\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"delimited\", {\n get: function() {\n return this.resolvedType instanceof Type &&\n this._features.message_encoding === \"DELIMITED\";\n }\n});\n\n/**\n * Determines whether this field is packed. Only relevant when repeated.\n * @name Field#packed\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"packed\", {\n get: function() {\n return this._features.repeated_field_encoding === \"PACKED\";\n }\n});\n\n/**\n * Determines whether this field tracks presence.\n * @name Field#hasPresence\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"hasPresence\", {\n get: function() {\n if (this.repeated || this.map) {\n return false;\n }\n return this.partOf || // oneofs\n this.declaringField || this.extensionField || // extensions\n this._features.field_presence !== \"IMPLICIT\";\n }\n});\n\n/**\n * @override\n */\nField.prototype.setOption = function setOption(name, value, ifNotSet) {\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\n};\n\n/**\n * Field descriptor.\n * @interface IField\n * @property {string} [rule=\"optional\"] Field rule\n * @property {string} type Field type\n * @property {number} id Field id\n * @property {Object.} [options] Field options\n */\n\n/**\n * Extension field descriptor.\n * @interface IExtensionField\n * @extends IField\n * @property {string} extend Extended type\n */\n\n/**\n * Converts this field to a field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IField} Field descriptor\n */\nField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"edition\" , this._editionToJSON(),\n \"rule\" , this.rule !== \"optional\" && this.rule || undefined,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Resolves this field's type references.\n * @returns {Field} `this`\n * @throws {Error} If any reference cannot be resolved\n */\nField.prototype.resolve = function resolve() {\n\n if (this.resolved)\n return this;\n\n if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it\n this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);\n if (this.resolvedType instanceof Type)\n this.typeDefault = null;\n else // instanceof Enum\n this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined\n } else if (this.options && this.options.proto3_optional) {\n // proto3 scalar value marked optional; should default to null\n this.typeDefault = null;\n }\n\n // use explicitly set default value if present\n if (this.options && this.options[\"default\"] != null) {\n this.typeDefault = this.options[\"default\"];\n if (this.resolvedType instanceof Enum && typeof this.typeDefault === \"string\")\n this.typeDefault = this.resolvedType.values[this.typeDefault];\n }\n\n // remove unnecessary options\n if (this.options) {\n if (this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))\n delete this.options.packed;\n if (!Object.keys(this.options).length)\n this.options = undefined;\n }\n\n // convert to internal data type if necesssary\n if (this.long) {\n this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === \"u\");\n\n /* istanbul ignore else */\n if (Object.freeze)\n Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it)\n\n } else if (this.bytes && typeof this.typeDefault === \"string\") {\n var buf;\n if (util.base64.test(this.typeDefault))\n util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0);\n else\n util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0);\n this.typeDefault = buf;\n }\n\n // take special care of maps and repeated fields\n if (this.map)\n this.defaultValue = util.emptyObject;\n else if (this.repeated)\n this.defaultValue = util.emptyArray;\n else\n this.defaultValue = this.typeDefault;\n\n // ensure proper value on prototype\n if (this.parent instanceof Type)\n this.parent.ctor.prototype[this.name] = this.defaultValue;\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n\n/**\n * Infers field features from legacy syntax that may have been specified differently.\n * in older editions.\n * @param {string|undefined} edition The edition this proto is on, or undefined if pre-editions\n * @returns {object} The feature values to override\n */\nField.prototype._inferLegacyProtoFeatures = function _inferLegacyProtoFeatures(edition) {\n if (edition !== \"proto2\" && edition !== \"proto3\") {\n return {};\n }\n\n var features = {};\n this.resolve();\n if (this.rule === \"required\") {\n features.field_presence = \"LEGACY_REQUIRED\";\n }\n if (this.resolvedType instanceof Type && this.resolvedType.group) {\n features.message_encoding = \"DELIMITED\";\n }\n if (this.getOption(\"packed\") === true) {\n features.repeated_field_encoding = \"PACKED\";\n } else if (this.getOption(\"packed\") === false) {\n features.repeated_field_encoding = \"EXPANDED\";\n }\n return features;\n};\n\n/**\n * @override\n */\nField.prototype._resolveFeatures = function _resolveFeatures(edition) {\n return ReflectionObject.prototype._resolveFeatures.call(this, this._edition || edition);\n};\n\n/**\n * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).\n * @typedef FieldDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} fieldName Field name\n * @returns {undefined}\n */\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"string\"|\"bool\"|\"bytes\"|Object} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @param {T} [defaultValue] Default value\n * @returns {FieldDecorator} Decorator function\n * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]\n */\nField.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {\n\n // submessage: decorate the submessage and use its name as the type\n if (typeof fieldType === \"function\")\n fieldType = util.decorateType(fieldType).name;\n\n // enum reference: create a reflected copy of the enum and keep reuseing it\n else if (fieldType && typeof fieldType === \"object\")\n fieldType = util.decorateEnum(fieldType).name;\n\n return function fieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new Field(fieldName, fieldId, fieldType, fieldRule, { \"default\": defaultValue }));\n };\n};\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {Constructor|string} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @returns {FieldDecorator} Decorator function\n * @template T extends Message\n * @variation 2\n */\n// like Field.d but without a default value\n\n// Sets up cyclic dependencies (called in index-light)\nField._configure = function configure(Type_) {\n Type = Type_;\n};\n","\"use strict\";\nmodule.exports = OneOf;\n\n// extends ReflectionObject\nvar ReflectionObject = require(\"./object\");\n((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = \"OneOf\";\n\nvar Field = require(\"./field\"),\n util = require(\"./util\");\n\n/**\n * Constructs a new oneof instance.\n * @classdesc Reflected oneof.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Oneof name\n * @param {string[]|Object.} [fieldNames] Field names\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction OneOf(name, fieldNames, options, comment) {\n if (!Array.isArray(fieldNames)) {\n options = fieldNames;\n fieldNames = undefined;\n }\n ReflectionObject.call(this, name, options);\n\n /* istanbul ignore if */\n if (!(fieldNames === undefined || Array.isArray(fieldNames)))\n throw TypeError(\"fieldNames must be an Array\");\n\n /**\n * Field names that belong to this oneof.\n * @type {string[]}\n */\n this.oneof = fieldNames || []; // toJSON, marker\n\n /**\n * Fields that belong to this oneof as an array for iteration.\n * @type {Field[]}\n * @readonly\n */\n this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Oneof descriptor.\n * @interface IOneOf\n * @property {Array.} oneof Oneof field names\n * @property {Object.} [options] Oneof options\n */\n\n/**\n * Constructs a oneof from a oneof descriptor.\n * @param {string} name Oneof name\n * @param {IOneOf} json Oneof descriptor\n * @returns {OneOf} Created oneof\n * @throws {TypeError} If arguments are invalid\n */\nOneOf.fromJSON = function fromJSON(name, json) {\n return new OneOf(name, json.oneof, json.options, json.comment);\n};\n\n/**\n * Converts this oneof to a oneof descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IOneOf} Oneof descriptor\n */\nOneOf.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"oneof\" , this.oneof,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Adds the fields of the specified oneof to the parent if not already done so.\n * @param {OneOf} oneof The oneof\n * @returns {undefined}\n * @inner\n * @ignore\n */\nfunction addFieldsToParent(oneof) {\n if (oneof.parent)\n for (var i = 0; i < oneof.fieldsArray.length; ++i)\n if (!oneof.fieldsArray[i].parent)\n oneof.parent.add(oneof.fieldsArray[i]);\n}\n\n/**\n * Adds a field to this oneof and removes it from its current parent, if any.\n * @param {Field} field Field to add\n * @returns {OneOf} `this`\n */\nOneOf.prototype.add = function add(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n if (field.parent && field.parent !== this.parent)\n field.parent.remove(field);\n this.oneof.push(field.name);\n this.fieldsArray.push(field);\n field.partOf = this; // field.parent remains null\n addFieldsToParent(this);\n return this;\n};\n\n/**\n * Removes a field from this oneof and puts it back to the oneof's parent.\n * @param {Field} field Field to remove\n * @returns {OneOf} `this`\n */\nOneOf.prototype.remove = function remove(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n var index = this.fieldsArray.indexOf(field);\n\n /* istanbul ignore if */\n if (index < 0)\n throw Error(field + \" is not a member of \" + this);\n\n this.fieldsArray.splice(index, 1);\n index = this.oneof.indexOf(field.name);\n\n /* istanbul ignore else */\n if (index > -1) // theoretical\n this.oneof.splice(index, 1);\n\n field.partOf = null;\n return this;\n};\n\n/**\n * @override\n */\nOneOf.prototype.onAdd = function onAdd(parent) {\n ReflectionObject.prototype.onAdd.call(this, parent);\n var self = this;\n // Collect present fields\n for (var i = 0; i < this.oneof.length; ++i) {\n var field = parent.get(this.oneof[i]);\n if (field && !field.partOf) {\n field.partOf = self;\n self.fieldsArray.push(field);\n }\n }\n // Add not yet present fields\n addFieldsToParent(this);\n};\n\n/**\n * @override\n */\nOneOf.prototype.onRemove = function onRemove(parent) {\n for (var i = 0, field; i < this.fieldsArray.length; ++i)\n if ((field = this.fieldsArray[i]).parent)\n field.parent.remove(field);\n ReflectionObject.prototype.onRemove.call(this, parent);\n};\n\n/**\n * Determines whether this field corresponds to a synthetic oneof created for\n * a proto3 optional field. No behavioral logic should depend on this, but it\n * can be relevant for reflection.\n * @name OneOf#isProto3Optional\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(OneOf.prototype, \"isProto3Optional\", {\n get: function() {\n if (this.fieldsArray == null || this.fieldsArray.length !== 1) {\n return false;\n }\n\n var field = this.fieldsArray[0];\n return field.options != null && field.options[\"proto3_optional\"] === true;\n }\n});\n\n/**\n * Decorator function as returned by {@link OneOf.d} (TypeScript).\n * @typedef OneOfDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} oneofName OneOf name\n * @returns {undefined}\n */\n\n/**\n * OneOf decorator (TypeScript).\n * @function\n * @param {...string} fieldNames Field names\n * @returns {OneOfDecorator} Decorator function\n * @template T extends string\n */\nOneOf.d = function decorateOneOf() {\n var fieldNames = new Array(arguments.length),\n index = 0;\n while (index < arguments.length)\n fieldNames[index] = arguments[index++];\n return function oneOfDecorator(prototype, oneofName) {\n util.decorateType(prototype.constructor)\n .add(new OneOf(oneofName, fieldNames));\n Object.defineProperty(prototype, oneofName, {\n get: util.oneOfGetter(fieldNames),\n set: util.oneOfSetter(fieldNames)\n });\n };\n};\n","\"use strict\";\nmodule.exports = ReflectionObject;\n\nReflectionObject.className = \"ReflectionObject\";\n\nconst OneOf = require(\"./oneof\");\nvar util = require(\"./util\");\n\nvar Root; // cyclic\n\n/* eslint-disable no-warning-comments */\n// TODO: Replace with embedded proto.\nvar editions2023Defaults = {enum_type: \"OPEN\", field_presence: \"EXPLICIT\", json_format: \"ALLOW\", message_encoding: \"LENGTH_PREFIXED\", repeated_field_encoding: \"PACKED\", utf8_validation: \"VERIFY\"};\nvar proto2Defaults = {enum_type: \"CLOSED\", field_presence: \"EXPLICIT\", json_format: \"LEGACY_BEST_EFFORT\", message_encoding: \"LENGTH_PREFIXED\", repeated_field_encoding: \"EXPANDED\", utf8_validation: \"NONE\"};\nvar proto3Defaults = {enum_type: \"OPEN\", field_presence: \"IMPLICIT\", json_format: \"ALLOW\", message_encoding: \"LENGTH_PREFIXED\", repeated_field_encoding: \"PACKED\", utf8_validation: \"VERIFY\"};\n\n/**\n * Constructs a new reflection object instance.\n * @classdesc Base class of all reflection objects.\n * @constructor\n * @param {string} name Object name\n * @param {Object.} [options] Declared options\n * @abstract\n */\nfunction ReflectionObject(name, options) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (options && !util.isObject(options))\n throw TypeError(\"options must be an object\");\n\n /**\n * Options.\n * @type {Object.|undefined}\n */\n this.options = options; // toJSON\n\n /**\n * Parsed Options.\n * @type {Array.>|undefined}\n */\n this.parsedOptions = null;\n\n /**\n * Unique name within its namespace.\n * @type {string}\n */\n this.name = name;\n\n /**\n * The edition specified for this object. Only relevant for top-level objects.\n * @type {string}\n */\n this._edition = null;\n\n /**\n * The default edition to use for this object if none is specified. For legacy reasons,\n * this is proto2 except in the JSON parsing case where it was proto3.\n * @type {string}\n */\n this._defaultEdition = \"proto2\";\n\n /**\n * Resolved Features.\n * @type {object}\n */\n this._features = {};\n\n /**\n * Parent namespace.\n * @type {Namespace|null}\n */\n this.parent = null;\n\n /**\n * Whether already resolved or not.\n * @type {boolean}\n */\n this.resolved = false;\n\n /**\n * Comment text, if any.\n * @type {string|null}\n */\n this.comment = null;\n\n /**\n * Defining file name.\n * @type {string|null}\n */\n this.filename = null;\n}\n\nObject.defineProperties(ReflectionObject.prototype, {\n\n /**\n * Reference to the root namespace.\n * @name ReflectionObject#root\n * @type {Root}\n * @readonly\n */\n root: {\n get: function() {\n var ptr = this;\n while (ptr.parent !== null)\n ptr = ptr.parent;\n return ptr;\n }\n },\n\n /**\n * Full name including leading dot.\n * @name ReflectionObject#fullName\n * @type {string}\n * @readonly\n */\n fullName: {\n get: function() {\n var path = [ this.name ],\n ptr = this.parent;\n while (ptr) {\n path.unshift(ptr.name);\n ptr = ptr.parent;\n }\n return path.join(\".\");\n }\n }\n});\n\n/**\n * Converts this reflection object to its descriptor representation.\n * @returns {Object.} Descriptor\n * @abstract\n */\nReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {\n throw Error(); // not implemented, shouldn't happen\n};\n\n/**\n * Called when this object is added to a parent.\n * @param {ReflectionObject} parent Parent added to\n * @returns {undefined}\n */\nReflectionObject.prototype.onAdd = function onAdd(parent) {\n if (this.parent && this.parent !== parent)\n this.parent.remove(this);\n this.parent = parent;\n this.resolved = false;\n var root = parent.root;\n if (root instanceof Root)\n root._handleAdd(this);\n};\n\n/**\n * Called when this object is removed from a parent.\n * @param {ReflectionObject} parent Parent removed from\n * @returns {undefined}\n */\nReflectionObject.prototype.onRemove = function onRemove(parent) {\n var root = parent.root;\n if (root instanceof Root)\n root._handleRemove(this);\n this.parent = null;\n this.resolved = false;\n};\n\n/**\n * Resolves this objects type references.\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n if (this instanceof Root) {\n this._resolveFeaturesRecursive(this._edition);\n this.resolved = true;\n }\n return this;\n};\n\n/**\n * Resolves this objects editions features.\n * @param {string} edition The edition we're currently resolving for.\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {\n return this._resolveFeatures(this._edition || edition);\n};\n\n/**\n * Resolves child features from parent features\n * @param {string} edition The edition we're currently resolving for.\n * @returns {undefined}\n */\nReflectionObject.prototype._resolveFeatures = function _resolveFeatures(edition) {\n var defaults = {};\n\n /* istanbul ignore if */\n if (!edition) {\n throw new Error(\"Unknown edition for \" + this.fullName);\n }\n\n var protoFeatures = Object.assign(this.options ? Object.assign({}, this.options.features) : {},\n this._inferLegacyProtoFeatures(edition));\n\n if (this._edition) {\n // For a namespace marked with a specific edition, reset defaults.\n /* istanbul ignore else */\n if (edition === \"proto2\") {\n defaults = Object.assign({}, proto2Defaults);\n } else if (edition === \"proto3\") {\n defaults = Object.assign({}, proto3Defaults);\n } else if (edition === \"2023\") {\n defaults = Object.assign({}, editions2023Defaults);\n } else {\n throw new Error(\"Unknown edition: \" + edition);\n }\n this._features = Object.assign(defaults, protoFeatures || {});\n return;\n }\n\n // fields in Oneofs aren't actually children of them, so we have to\n // special-case it\n /* istanbul ignore else */\n if (this.partOf instanceof OneOf) {\n var lexicalParentFeaturesCopy = Object.assign({}, this.partOf._features);\n this._features = Object.assign(lexicalParentFeaturesCopy, protoFeatures || {});\n } else if (this.declaringField) {\n // Skip feature resolution of sister fields.\n } else if (this.parent) {\n var parentFeaturesCopy = Object.assign({}, this.parent._features);\n this._features = Object.assign(parentFeaturesCopy, protoFeatures || {});\n } else {\n throw new Error(\"Unable to find a parent for \" + this.fullName);\n }\n if (this.extensionField) {\n // Sister fields should have the same features as their extensions.\n this.extensionField._features = this._features;\n }\n};\n\n/**\n * Infers features from legacy syntax that may have been specified differently.\n * in older editions.\n * @param {string|undefined} edition The edition this proto is on, or undefined if pre-editions\n * @returns {object} The feature values to override\n */\nReflectionObject.prototype._inferLegacyProtoFeatures = function _inferLegacyProtoFeatures(/*edition*/) {\n return {};\n};\n\n/**\n * Gets an option value.\n * @param {string} name Option name\n * @returns {*} Option value or `undefined` if not set\n */\nReflectionObject.prototype.getOption = function getOption(name) {\n if (this.options)\n return this.options[name];\n return undefined;\n};\n\n/**\n * Sets an option.\n * @param {string} name Option name\n * @param {*} value Option value\n * @param {boolean|undefined} [ifNotSet] Sets the option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (!this.options)\n this.options = {};\n if (/^features\\./.test(name)) {\n util.setProperty(this.options, name, value, ifNotSet);\n } else if (!ifNotSet || this.options[name] === undefined) {\n if (this.getOption(name) !== value) this.resolved = false;\n this.options[name] = value;\n }\n\n return this;\n};\n\n/**\n * Sets a parsed option.\n * @param {string} name parsed Option name\n * @param {*} value Option value\n * @param {string} propName dot '.' delimited full path of property within the option to set. if undefined\\empty, will add a new option with that value\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) {\n if (!this.parsedOptions) {\n this.parsedOptions = [];\n }\n var parsedOptions = this.parsedOptions;\n if (propName) {\n // If setting a sub property of an option then try to merge it\n // with an existing option\n var opt = parsedOptions.find(function (opt) {\n return Object.prototype.hasOwnProperty.call(opt, name);\n });\n if (opt) {\n // If we found an existing option - just merge the property value\n // (If it's a feature, will just write over)\n var newValue = opt[name];\n util.setProperty(newValue, propName, value);\n } else {\n // otherwise, create a new option, set its property and add it to the list\n opt = {};\n opt[name] = util.setProperty({}, propName, value);\n parsedOptions.push(opt);\n }\n } else {\n // Always create a new option when setting the value of the option itself\n var newOpt = {};\n newOpt[name] = value;\n parsedOptions.push(newOpt);\n }\n\n return this;\n};\n\n/**\n * Sets multiple options.\n * @param {Object.} options Options to set\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) {\n if (options)\n for (var keys = Object.keys(options), i = 0; i < keys.length; ++i)\n this.setOption(keys[i], options[keys[i]], ifNotSet);\n return this;\n};\n\n/**\n * Converts this instance to its string representation.\n * @returns {string} Class name[, space, full name]\n */\nReflectionObject.prototype.toString = function toString() {\n var className = this.constructor.className,\n fullName = this.fullName;\n if (fullName.length)\n return className + \" \" + fullName;\n return className;\n};\n\n/**\n * Converts the edition this object is pinned to for JSON format.\n * @returns {string|undefined} The edition string for JSON representation\n */\nReflectionObject.prototype._editionToJSON = function _editionToJSON() {\n if (!this._edition || this._edition === \"proto3\") {\n // Avoid emitting proto3 since we need to default to it for backwards\n // compatibility anyway.\n return undefined;\n }\n return this._edition;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nReflectionObject._configure = function(Root_) {\n Root = Root_;\n};\n","\"use strict\";\nmodule.exports = Enum;\n\n// extends ReflectionObject\nvar ReflectionObject = require(\"./object\");\n((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = \"Enum\";\n\nvar Namespace = require(\"./namespace\"),\n util = require(\"./util\");\n\n/**\n * Constructs a new enum instance.\n * @classdesc Reflected enum.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {Object.} [values] Enum values as an object, by name\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this enum\n * @param {Object.} [comments] The value comments for this enum\n * @param {Object.>|undefined} [valuesOptions] The value options for this enum\n */\nfunction Enum(name, values, options, comment, comments, valuesOptions) {\n ReflectionObject.call(this, name, options);\n\n if (values && typeof values !== \"object\")\n throw TypeError(\"values must be an object\");\n\n /**\n * Enum values by id.\n * @type {Object.}\n */\n this.valuesById = {};\n\n /**\n * Enum values by name.\n * @type {Object.}\n */\n this.values = Object.create(this.valuesById); // toJSON, marker\n\n /**\n * Enum comment text.\n * @type {string|null}\n */\n this.comment = comment;\n\n /**\n * Value comment texts, if any.\n * @type {Object.}\n */\n this.comments = comments || {};\n\n /**\n * Values options, if any\n * @type {Object>|undefined}\n */\n this.valuesOptions = valuesOptions;\n\n /**\n * Resolved values features, if any\n * @type {Object>|undefined}\n */\n this._valuesFeatures = {};\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n // Note that values inherit valuesById on their prototype which makes them a TypeScript-\n // compatible enum. This is used by pbts to write actual enum definitions that work for\n // static and reflection code alike instead of emitting generic object definitions.\n\n if (values)\n for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)\n if (typeof values[keys[i]] === \"number\") // use forward entries only\n this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];\n}\n\n/**\n * @override\n */\nEnum.prototype._resolveFeatures = function _resolveFeatures(edition) {\n edition = this._edition || edition;\n ReflectionObject.prototype._resolveFeatures.call(this, edition);\n\n Object.keys(this.values).forEach(key => {\n var parentFeaturesCopy = Object.assign({}, this._features);\n this._valuesFeatures[key] = Object.assign(parentFeaturesCopy, this.valuesOptions && this.valuesOptions[key] && this.valuesOptions[key].features);\n });\n\n return this;\n};\n\n/**\n * Enum descriptor.\n * @interface IEnum\n * @property {Object.} values Enum values\n * @property {Object.} [options] Enum options\n */\n\n/**\n * Constructs an enum from an enum descriptor.\n * @param {string} name Enum name\n * @param {IEnum} json Enum descriptor\n * @returns {Enum} Created enum\n * @throws {TypeError} If arguments are invalid\n */\nEnum.fromJSON = function fromJSON(name, json) {\n var enm = new Enum(name, json.values, json.options, json.comment, json.comments);\n enm.reserved = json.reserved;\n if (json.edition)\n enm._edition = json.edition;\n enm._defaultEdition = \"proto3\"; // For backwards-compatibility.\n return enm;\n};\n\n/**\n * Converts this enum to an enum descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IEnum} Enum descriptor\n */\nEnum.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"edition\" , this._editionToJSON(),\n \"options\" , this.options,\n \"valuesOptions\" , this.valuesOptions,\n \"values\" , this.values,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"comment\" , keepComments ? this.comment : undefined,\n \"comments\" , keepComments ? this.comments : undefined\n ]);\n};\n\n/**\n * Adds a value to this enum.\n * @param {string} name Value name\n * @param {number} id Value id\n * @param {string} [comment] Comment, if any\n * @param {Object.|undefined} [options] Options, if any\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a value with this name or id\n */\nEnum.prototype.add = function add(name, id, comment, options) {\n // utilized by the parser but not by .fromJSON\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (!util.isInteger(id))\n throw TypeError(\"id must be an integer\");\n\n if (this.values[name] !== undefined)\n throw Error(\"duplicate name '\" + name + \"' in \" + this);\n\n if (this.isReservedId(id))\n throw Error(\"id \" + id + \" is reserved in \" + this);\n\n if (this.isReservedName(name))\n throw Error(\"name '\" + name + \"' is reserved in \" + this);\n\n if (this.valuesById[id] !== undefined) {\n if (!(this.options && this.options.allow_alias))\n throw Error(\"duplicate id \" + id + \" in \" + this);\n this.values[name] = id;\n } else\n this.valuesById[this.values[name] = id] = name;\n\n if (options) {\n if (this.valuesOptions === undefined)\n this.valuesOptions = {};\n this.valuesOptions[name] = options || null;\n }\n\n this.comments[name] = comment || null;\n return this;\n};\n\n/**\n * Removes a value from this enum\n * @param {string} name Value name\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `name` is not a name of this enum\n */\nEnum.prototype.remove = function remove(name) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n var val = this.values[name];\n if (val == null)\n throw Error(\"name '\" + name + \"' does not exist in \" + this);\n\n delete this.valuesById[val];\n delete this.values[name];\n delete this.comments[name];\n if (this.valuesOptions)\n delete this.valuesOptions[name];\n\n return this;\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n","\"use strict\";\nmodule.exports = encoder;\n\nvar Enum = require(\"./enum\"),\n types = require(\"./types\"),\n util = require(\"./util\");\n\n/**\n * Generates a partial message type encoder.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genTypePartial(gen, field, fieldIndex, ref) {\n return field.delimited\n ? gen(\"types[%i].encode(%s,w.uint32(%i)).uint32(%i)\", fieldIndex, ref, (field.id << 3 | 3) >>> 0, (field.id << 3 | 4) >>> 0)\n : gen(\"types[%i].encode(%s,w.uint32(%i).fork()).ldelim()\", fieldIndex, ref, (field.id << 3 | 2) >>> 0);\n}\n\n/**\n * Generates an encoder specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction encoder(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var gen = util.codegen([\"m\", \"w\"], mtype.name + \"$encode\")\n (\"if(!w)\")\n (\"w=Writer.create()\");\n\n var i, ref;\n\n // \"when a message is serialized its known fields should be written sequentially by field number\"\n var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById);\n\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n index = mtype._fieldsArray.indexOf(field),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n wireType = types.basic[type];\n ref = \"m\" + util.safeProp(field.name);\n\n // Map fields\n if (field.map) {\n gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j)){\", ref, field.name) // !== undefined && !== null\n (\"for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType);\n if (wireType === undefined) gen\n (\"types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()\", index, ref); // can't be groups\n else gen\n (\".uint32(%i).%s(%s[ks[i]]).ldelim()\", 16 | wireType, type, ref);\n gen\n (\"}\")\n (\"}\");\n\n // Repeated fields\n } else if (field.repeated) { gen\n (\"if(%s!=null&&%s.length){\", ref, ref); // !== undefined && !== null\n\n // Packed repeated\n if (field.packed && types.packed[type] !== undefined) { gen\n\n (\"w.uint32(%i).fork()\", (field.id << 3 | 2) >>> 0)\n (\"for(var i=0;i<%s.length;++i)\", ref)\n (\"w.%s(%s[i])\", type, ref)\n (\"w.ldelim()\");\n\n // Non-packed\n } else { gen\n\n (\"for(var i=0;i<%s.length;++i)\", ref);\n if (wireType === undefined)\n genTypePartial(gen, field, index, ref + \"[i]\");\n else gen\n (\"w.uint32(%i).%s(%s[i])\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n } gen\n (\"}\");\n\n // Non-repeated\n } else {\n if (field.optional) gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j))\", ref, field.name); // !== undefined && !== null\n\n if (wireType === undefined)\n genTypePartial(gen, field, index, ref);\n else gen\n (\"w.uint32(%i).%s(%s)\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n }\n }\n\n return gen\n (\"return w\");\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n","\"use strict\";\nvar protobuf = module.exports = require(\"./index-minimal\");\n\nprotobuf.build = \"light\";\n\n/**\n * A node-style callback as used by {@link load} and {@link Root#load}.\n * @typedef LoadCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Root} [root] Root, if there hasn't been an error\n * @returns {undefined}\n */\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n */\nfunction load(filename, root, callback) {\n if (typeof root === \"function\") {\n callback = root;\n root = new protobuf.Root();\n } else if (!root)\n root = new protobuf.Root();\n return root.load(filename, callback);\n}\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Promise} Promise\n * @see {@link Root#load}\n * @variation 3\n */\n// function load(filename:string, [root:Root]):Promise\n\nprotobuf.load = load;\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n * @see {@link Root#loadSync}\n */\nfunction loadSync(filename, root) {\n if (!root)\n root = new protobuf.Root();\n return root.loadSync(filename);\n}\n\nprotobuf.loadSync = loadSync;\n\n// Serialization\nprotobuf.encoder = require(\"./encoder\");\nprotobuf.decoder = require(\"./decoder\");\nprotobuf.verifier = require(\"./verifier\");\nprotobuf.converter = require(\"./converter\");\n\n// Reflection\nprotobuf.ReflectionObject = require(\"./object\");\nprotobuf.Namespace = require(\"./namespace\");\nprotobuf.Root = require(\"./root\");\nprotobuf.Enum = require(\"./enum\");\nprotobuf.Type = require(\"./type\");\nprotobuf.Field = require(\"./field\");\nprotobuf.OneOf = require(\"./oneof\");\nprotobuf.MapField = require(\"./mapfield\");\nprotobuf.Service = require(\"./service\");\nprotobuf.Method = require(\"./method\");\n\n// Runtime\nprotobuf.Message = require(\"./message\");\nprotobuf.wrappers = require(\"./wrappers\");\n\n// Utility\nprotobuf.types = require(\"./types\");\nprotobuf.util = require(\"./util\");\n\n// Set up possibly cyclic reflection dependencies\nprotobuf.ReflectionObject._configure(protobuf.Root);\nprotobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);\nprotobuf.Root._configure(protobuf.Type);\nprotobuf.Field._configure(protobuf.Type);\n","\"use strict\";\nmodule.exports = tokenize;\n\nvar delimRe = /[\\s{}=;:[\\],'\"()<>]/g,\n stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\n stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\n\nvar setCommentRe = /^ *[*/]+ */,\n setCommentAltRe = /^\\s*\\*?\\/*/,\n setCommentSplitRe = /\\n/g,\n whitespaceRe = /\\s/,\n unescapeRe = /\\\\(.?)/g;\n\nvar unescapeMap = {\n \"0\": \"\\0\",\n \"r\": \"\\r\",\n \"n\": \"\\n\",\n \"t\": \"\\t\"\n};\n\n/**\n * Unescapes a string.\n * @param {string} str String to unescape\n * @returns {string} Unescaped string\n * @property {Object.} map Special characters map\n * @memberof tokenize\n */\nfunction unescape(str) {\n return str.replace(unescapeRe, function($0, $1) {\n switch ($1) {\n case \"\\\\\":\n case \"\":\n return $1;\n default:\n return unescapeMap[$1] || \"\";\n }\n });\n}\n\ntokenize.unescape = unescape;\n\n/**\n * Gets the next token and advances.\n * @typedef TokenizerHandleNext\n * @type {function}\n * @returns {string|null} Next token or `null` on eof\n */\n\n/**\n * Peeks for the next token.\n * @typedef TokenizerHandlePeek\n * @type {function}\n * @returns {string|null} Next token or `null` on eof\n */\n\n/**\n * Pushes a token back to the stack.\n * @typedef TokenizerHandlePush\n * @type {function}\n * @param {string} token Token\n * @returns {undefined}\n */\n\n/**\n * Skips the next token.\n * @typedef TokenizerHandleSkip\n * @type {function}\n * @param {string} expected Expected token\n * @param {boolean} [optional=false] If optional\n * @returns {boolean} Whether the token matched\n * @throws {Error} If the token didn't match and is not optional\n */\n\n/**\n * Gets the comment on the previous line or, alternatively, the line comment on the specified line.\n * @typedef TokenizerHandleCmnt\n * @type {function}\n * @param {number} [line] Line number\n * @returns {string|null} Comment text or `null` if none\n */\n\n/**\n * Handle object returned from {@link tokenize}.\n * @interface ITokenizerHandle\n * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof)\n * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof)\n * @property {TokenizerHandlePush} push Pushes a token back to the stack\n * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\n * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any\n * @property {number} line Current line number\n */\n\n/**\n * Tokenizes the given .proto source and returns an object with useful utility functions.\n * @param {string} source Source contents\n * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode.\n * @returns {ITokenizerHandle} Tokenizer handle\n */\nfunction tokenize(source, alternateCommentMode) {\n /* eslint-disable callback-return */\n source = source.toString();\n\n var offset = 0,\n length = source.length,\n line = 1,\n lastCommentLine = 0,\n comments = {};\n\n var stack = [];\n\n var stringDelim = null;\n\n /* istanbul ignore next */\n /**\n * Creates an error for illegal syntax.\n * @param {string} subject Subject\n * @returns {Error} Error created\n * @inner\n */\n function illegal(subject) {\n return Error(\"illegal \" + subject + \" (line \" + line + \")\");\n }\n\n /**\n * Reads a string till its end.\n * @returns {string} String read\n * @inner\n */\n function readString() {\n var re = stringDelim === \"'\" ? stringSingleRe : stringDoubleRe;\n re.lastIndex = offset - 1;\n var match = re.exec(source);\n if (!match)\n throw illegal(\"string\");\n offset = re.lastIndex;\n push(stringDelim);\n stringDelim = null;\n return unescape(match[1]);\n }\n\n /**\n * Gets the character at `pos` within the source.\n * @param {number} pos Position\n * @returns {string} Character\n * @inner\n */\n function charAt(pos) {\n return source.charAt(pos);\n }\n\n /**\n * Sets the current comment text.\n * @param {number} start Start offset\n * @param {number} end End offset\n * @param {boolean} isLeading set if a leading comment\n * @returns {undefined}\n * @inner\n */\n function setComment(start, end, isLeading) {\n var comment = {\n type: source.charAt(start++),\n lineEmpty: false,\n leading: isLeading,\n };\n var lookback;\n if (alternateCommentMode) {\n lookback = 2; // alternate comment parsing: \"//\" or \"/*\"\n } else {\n lookback = 3; // \"///\" or \"/**\"\n }\n var commentOffset = start - lookback,\n c;\n do {\n if (--commentOffset < 0 ||\n (c = source.charAt(commentOffset)) === \"\\n\") {\n comment.lineEmpty = true;\n break;\n }\n } while (c === \" \" || c === \"\\t\");\n var lines = source\n .substring(start, end)\n .split(setCommentSplitRe);\n for (var i = 0; i < lines.length; ++i)\n lines[i] = lines[i]\n .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, \"\")\n .trim();\n comment.text = lines\n .join(\"\\n\")\n .trim();\n\n comments[line] = comment;\n lastCommentLine = line;\n }\n\n function isDoubleSlashCommentLine(startOffset) {\n var endOffset = findEndOfLine(startOffset);\n\n // see if remaining line matches comment pattern\n var lineText = source.substring(startOffset, endOffset);\n var isComment = /^\\s*\\/\\//.test(lineText);\n return isComment;\n }\n\n function findEndOfLine(cursor) {\n // find end of cursor's line\n var endOffset = cursor;\n while (endOffset < length && charAt(endOffset) !== \"\\n\") {\n endOffset++;\n }\n return endOffset;\n }\n\n /**\n * Obtains the next token.\n * @returns {string|null} Next token or `null` on eof\n * @inner\n */\n function next() {\n if (stack.length > 0)\n return stack.shift();\n if (stringDelim)\n return readString();\n var repeat,\n prev,\n curr,\n start,\n isDoc,\n isLeadingComment = offset === 0;\n do {\n if (offset === length)\n return null;\n repeat = false;\n while (whitespaceRe.test(curr = charAt(offset))) {\n if (curr === \"\\n\") {\n isLeadingComment = true;\n ++line;\n }\n if (++offset === length)\n return null;\n }\n\n if (charAt(offset) === \"/\") {\n if (++offset === length) {\n throw illegal(\"comment\");\n }\n if (charAt(offset) === \"/\") { // Line\n if (!alternateCommentMode) {\n // check for triple-slash comment\n isDoc = charAt(start = offset + 1) === \"/\";\n\n while (charAt(++offset) !== \"\\n\") {\n if (offset === length) {\n return null;\n }\n }\n ++offset;\n if (isDoc) {\n setComment(start, offset - 1, isLeadingComment);\n // Trailing comment cannot not be multi-line,\n // so leading comment state should be reset to handle potential next comments\n isLeadingComment = true;\n }\n ++line;\n repeat = true;\n } else {\n // check for double-slash comments, consolidating consecutive lines\n start = offset;\n isDoc = false;\n if (isDoubleSlashCommentLine(offset - 1)) {\n isDoc = true;\n do {\n offset = findEndOfLine(offset);\n if (offset === length) {\n break;\n }\n offset++;\n if (!isLeadingComment) {\n // Trailing comment cannot not be multi-line\n break;\n }\n } while (isDoubleSlashCommentLine(offset));\n } else {\n offset = Math.min(length, findEndOfLine(offset) + 1);\n }\n if (isDoc) {\n setComment(start, offset, isLeadingComment);\n isLeadingComment = true;\n }\n line++;\n repeat = true;\n }\n } else if ((curr = charAt(offset)) === \"*\") { /* Block */\n // check for /** (regular comment mode) or /* (alternate comment mode)\n start = offset + 1;\n isDoc = alternateCommentMode || charAt(start) === \"*\";\n do {\n if (curr === \"\\n\") {\n ++line;\n }\n if (++offset === length) {\n throw illegal(\"comment\");\n }\n prev = curr;\n curr = charAt(offset);\n } while (prev !== \"*\" || curr !== \"/\");\n ++offset;\n if (isDoc) {\n setComment(start, offset - 2, isLeadingComment);\n isLeadingComment = true;\n }\n repeat = true;\n } else {\n return \"/\";\n }\n }\n } while (repeat);\n\n // offset !== length if we got here\n\n var end = offset;\n delimRe.lastIndex = 0;\n var delim = delimRe.test(charAt(end++));\n if (!delim)\n while (end < length && !delimRe.test(charAt(end)))\n ++end;\n var token = source.substring(offset, offset = end);\n if (token === \"\\\"\" || token === \"'\")\n stringDelim = token;\n return token;\n }\n\n /**\n * Pushes a token back to the stack.\n * @param {string} token Token\n * @returns {undefined}\n * @inner\n */\n function push(token) {\n stack.push(token);\n }\n\n /**\n * Peeks for the next token.\n * @returns {string|null} Token or `null` on eof\n * @inner\n */\n function peek() {\n if (!stack.length) {\n var token = next();\n if (token === null)\n return null;\n push(token);\n }\n return stack[0];\n }\n\n /**\n * Skips a token.\n * @param {string} expected Expected token\n * @param {boolean} [optional=false] Whether the token is optional\n * @returns {boolean} `true` when skipped, `false` if not\n * @throws {Error} When a required token is not present\n * @inner\n */\n function skip(expected, optional) {\n var actual = peek(),\n equals = actual === expected;\n if (equals) {\n next();\n return true;\n }\n if (!optional)\n throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\n return false;\n }\n\n /**\n * Gets a comment.\n * @param {number} [trailingLine] Line number if looking for a trailing comment\n * @returns {string|null} Comment text\n * @inner\n */\n function cmnt(trailingLine) {\n var ret = null;\n var comment;\n if (trailingLine === undefined) {\n comment = comments[line - 1];\n delete comments[line - 1];\n if (comment && (alternateCommentMode || comment.type === \"*\" || comment.lineEmpty)) {\n ret = comment.leading ? comment.text : null;\n }\n } else {\n /* istanbul ignore else */\n if (lastCommentLine < trailingLine) {\n peek();\n }\n comment = comments[trailingLine];\n delete comments[trailingLine];\n if (comment && !comment.lineEmpty && (alternateCommentMode || comment.type === \"/\")) {\n ret = comment.leading ? null : comment.text;\n }\n }\n return ret;\n }\n\n return Object.defineProperty({\n next: next,\n peek: peek,\n push: push,\n skip: skip,\n cmnt: cmnt\n }, \"line\", {\n get: function() { return line; }\n });\n /* eslint-enable callback-return */\n}\n","\"use strict\";\nmodule.exports = parse;\n\nparse.filename = null;\nparse.defaults = { keepCase: false };\n\nvar tokenize = require(\"./tokenize\"),\n Root = require(\"./root\"),\n Type = require(\"./type\"),\n Field = require(\"./field\"),\n MapField = require(\"./mapfield\"),\n OneOf = require(\"./oneof\"),\n Enum = require(\"./enum\"),\n Service = require(\"./service\"),\n Method = require(\"./method\"),\n ReflectionObject = require(\"./object\"),\n types = require(\"./types\"),\n util = require(\"./util\");\n\nvar base10Re = /^[1-9][0-9]*$/,\n base10NegRe = /^-?[1-9][0-9]*$/,\n base16Re = /^0[x][0-9a-fA-F]+$/,\n base16NegRe = /^-?0[x][0-9a-fA-F]+$/,\n base8Re = /^0[0-7]+$/,\n base8NegRe = /^-?0[0-7]+$/,\n numberRe = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,\n nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;\n\n/**\n * Result object returned from {@link parse}.\n * @interface IParserResult\n * @property {string|undefined} package Package name, if declared\n * @property {string[]|undefined} imports Imports, if any\n * @property {string[]|undefined} weakImports Weak imports, if any\n * @property {Root} root Populated root instance\n */\n\n/**\n * Options modifying the behavior of {@link parse}.\n * @interface IParseOptions\n * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case\n * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments.\n * @property {boolean} [preferTrailingComment=false] Use trailing comment when both leading comment and trailing comment exist.\n */\n\n/**\n * Options modifying the behavior of JSON serialization.\n * @interface IToJSONOptions\n * @property {boolean} [keepComments=false] Serializes comments.\n */\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @param {string} source Source contents\n * @param {Root} root Root to populate\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n */\nfunction parse(source, root, options) {\n /* eslint-disable callback-return */\n if (!(root instanceof Root)) {\n options = root;\n root = new Root();\n }\n if (!options)\n options = parse.defaults;\n\n var preferTrailingComment = options.preferTrailingComment || false;\n var tn = tokenize(source, options.alternateCommentMode || false),\n next = tn.next,\n push = tn.push,\n peek = tn.peek,\n skip = tn.skip,\n cmnt = tn.cmnt;\n\n var head = true,\n pkg,\n imports,\n weakImports,\n edition = \"proto2\";\n\n var ptr = root;\n\n var topLevelObjects = [];\n var topLevelOptions = {};\n\n var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase;\n\n function resolveFileFeatures() {\n topLevelObjects.forEach(obj => {\n obj._edition = edition;\n Object.keys(topLevelOptions).forEach(opt => {\n if (obj.getOption(opt) !== undefined) return;\n obj.setOption(opt, topLevelOptions[opt], true);\n });\n });\n }\n\n /* istanbul ignore next */\n function illegal(token, name, insideTryCatch) {\n var filename = parse.filename;\n if (!insideTryCatch)\n parse.filename = null;\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (\" + (filename ? filename + \", \" : \"\") + \"line \" + tn.line + \")\");\n }\n\n function readString() {\n var values = [],\n token;\n do {\n /* istanbul ignore if */\n if ((token = next()) !== \"\\\"\" && token !== \"'\")\n throw illegal(token);\n\n values.push(next());\n skip(token);\n token = peek();\n } while (token === \"\\\"\" || token === \"'\");\n return values.join(\"\");\n }\n\n function readValue(acceptTypeRef) {\n var token = next();\n switch (token) {\n case \"'\":\n case \"\\\"\":\n push(token);\n return readString();\n case \"true\": case \"TRUE\":\n return true;\n case \"false\": case \"FALSE\":\n return false;\n }\n try {\n return parseNumber(token, /* insideTryCatch */ true);\n } catch (e) {\n /* istanbul ignore else */\n if (acceptTypeRef && typeRefRe.test(token))\n return token;\n\n /* istanbul ignore next */\n throw illegal(token, \"value\");\n }\n }\n\n function readRanges(target, acceptStrings) {\n var token, start;\n do {\n if (acceptStrings && ((token = peek()) === \"\\\"\" || token === \"'\")) {\n var str = readString();\n target.push(str);\n if (edition >= 2023) {\n throw illegal(str, \"id\");\n }\n } else {\n try {\n target.push([ start = parseId(next()), skip(\"to\", true) ? parseId(next()) : start ]);\n } catch (err) {\n if (acceptStrings && typeRefRe.test(token) && edition >= 2023) {\n target.push(token);\n } else {\n throw err;\n }\n }\n }\n } while (skip(\",\", true));\n var dummy = {options: undefined};\n dummy.setOption = function(name, value) {\n if (this.options === undefined) this.options = {};\n this.options[name] = value;\n };\n ifBlock(\n dummy,\n function parseRange_block(token) {\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(dummy, token); // skip\n skip(\";\");\n } else\n throw illegal(token);\n },\n function parseRange_line() {\n parseInlineOptions(dummy); // skip\n });\n }\n\n function parseNumber(token, insideTryCatch) {\n var sign = 1;\n if (token.charAt(0) === \"-\") {\n sign = -1;\n token = token.substring(1);\n }\n switch (token) {\n case \"inf\": case \"INF\": case \"Inf\":\n return sign * Infinity;\n case \"nan\": case \"NAN\": case \"Nan\": case \"NaN\":\n return NaN;\n case \"0\":\n return 0;\n }\n if (base10Re.test(token))\n return sign * parseInt(token, 10);\n if (base16Re.test(token))\n return sign * parseInt(token, 16);\n if (base8Re.test(token))\n return sign * parseInt(token, 8);\n\n /* istanbul ignore else */\n if (numberRe.test(token))\n return sign * parseFloat(token);\n\n /* istanbul ignore next */\n throw illegal(token, \"number\", insideTryCatch);\n }\n\n function parseId(token, acceptNegative) {\n switch (token) {\n case \"max\": case \"MAX\": case \"Max\":\n return 536870911;\n case \"0\":\n return 0;\n }\n\n /* istanbul ignore if */\n if (!acceptNegative && token.charAt(0) === \"-\")\n throw illegal(token, \"id\");\n\n if (base10NegRe.test(token))\n return parseInt(token, 10);\n if (base16NegRe.test(token))\n return parseInt(token, 16);\n\n /* istanbul ignore else */\n if (base8NegRe.test(token))\n return parseInt(token, 8);\n\n /* istanbul ignore next */\n throw illegal(token, \"id\");\n }\n\n function parsePackage() {\n /* istanbul ignore if */\n if (pkg !== undefined)\n throw illegal(\"package\");\n\n pkg = next();\n\n /* istanbul ignore if */\n if (!typeRefRe.test(pkg))\n throw illegal(pkg, \"name\");\n\n ptr = ptr.define(pkg);\n\n skip(\";\");\n }\n\n function parseImport() {\n var token = peek();\n var whichImports;\n switch (token) {\n case \"weak\":\n whichImports = weakImports || (weakImports = []);\n next();\n break;\n case \"public\":\n next();\n // eslint-disable-next-line no-fallthrough\n default:\n whichImports = imports || (imports = []);\n break;\n }\n token = readString();\n skip(\";\");\n whichImports.push(token);\n }\n\n function parseSyntax() {\n skip(\"=\");\n edition = readString();\n\n /* istanbul ignore if */\n if (edition < 2023)\n throw illegal(edition, \"syntax\");\n\n skip(\";\");\n }\n\n function parseEdition() {\n skip(\"=\");\n edition = readString();\n const supportedEditions = [\"2023\"];\n\n /* istanbul ignore if */\n if (!supportedEditions.includes(edition))\n throw illegal(edition, \"edition\");\n\n skip(\";\");\n }\n\n\n function parseCommon(parent, token) {\n switch (token) {\n\n case \"option\":\n parseOption(parent, token);\n skip(\";\");\n return true;\n\n case \"message\":\n parseType(parent, token);\n return true;\n\n case \"enum\":\n parseEnum(parent, token);\n return true;\n\n case \"service\":\n parseService(parent, token);\n return true;\n\n case \"extend\":\n parseExtension(parent, token);\n return true;\n }\n return false;\n }\n\n function ifBlock(obj, fnIf, fnElse) {\n var trailingLine = tn.line;\n if (obj) {\n if(typeof obj.comment !== \"string\") {\n obj.comment = cmnt(); // try block-type comment\n }\n obj.filename = parse.filename;\n }\n if (skip(\"{\", true)) {\n var token;\n while ((token = next()) !== \"}\")\n fnIf(token);\n skip(\";\", true);\n } else {\n if (fnElse)\n fnElse();\n skip(\";\");\n if (obj && (typeof obj.comment !== \"string\" || preferTrailingComment))\n obj.comment = cmnt(trailingLine) || obj.comment; // try line-type comment\n }\n }\n\n function parseType(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"type name\");\n\n var type = new Type(token);\n ifBlock(type, function parseType_block(token) {\n if (parseCommon(type, token))\n return;\n\n switch (token) {\n\n case \"map\":\n parseMapField(type, token);\n break;\n\n case \"required\":\n if (edition !== \"proto2\")\n throw illegal(token);\n /* eslint-disable no-fallthrough */\n case \"repeated\":\n parseField(type, token);\n break;\n\n case \"optional\":\n /* istanbul ignore if */\n if (edition === \"proto3\") {\n parseField(type, \"proto3_optional\");\n } else if (edition !== \"proto2\") {\n throw illegal(token);\n } else {\n parseField(type, \"optional\");\n }\n break;\n\n case \"oneof\":\n parseOneOf(type, token);\n break;\n\n case \"extensions\":\n readRanges(type.extensions || (type.extensions = []));\n break;\n\n case \"reserved\":\n readRanges(type.reserved || (type.reserved = []), true);\n break;\n\n default:\n /* istanbul ignore if */\n if (edition === \"proto2\" || !typeRefRe.test(token)) {\n throw illegal(token);\n }\n\n push(token);\n parseField(type, \"optional\");\n break;\n }\n });\n parent.add(type);\n if (parent === ptr) {\n topLevelObjects.push(type);\n }\n }\n\n function parseField(parent, rule, extend) {\n var type = next();\n if (type === \"group\") {\n parseGroup(parent, rule);\n return;\n }\n // Type names can consume multiple tokens, in multiple variants:\n // package.subpackage field tokens: \"package.subpackage\" [TYPE NAME ENDS HERE] \"field\"\n // package . subpackage field tokens: \"package\" \".\" \"subpackage\" [TYPE NAME ENDS HERE] \"field\"\n // package. subpackage field tokens: \"package.\" \"subpackage\" [TYPE NAME ENDS HERE] \"field\"\n // package .subpackage field tokens: \"package\" \".subpackage\" [TYPE NAME ENDS HERE] \"field\"\n // Keep reading tokens until we get a type name with no period at the end,\n // and the next token does not start with a period.\n while (type.endsWith(\".\") || peek().startsWith(\".\")) {\n type += next();\n }\n\n /* istanbul ignore if */\n if (!typeRefRe.test(type))\n throw illegal(type, \"type\");\n\n var name = next();\n\n /* istanbul ignore if */\n\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n name = applyCase(name);\n skip(\"=\");\n\n var field = new Field(name, parseId(next()), type, rule, extend);\n\n ifBlock(field, function parseField_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(field, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseField_line() {\n parseInlineOptions(field);\n });\n\n if (rule === \"proto3_optional\") {\n // for proto3 optional fields, we create a single-member Oneof to mimic \"optional\" behavior\n var oneof = new OneOf(\"_\" + name);\n field.setOption(\"proto3_optional\", true);\n oneof.add(field);\n parent.add(oneof);\n } else {\n parent.add(field);\n }\n if (parent === ptr) {\n topLevelObjects.push(field);\n }\n }\n\n function parseGroup(parent, rule) {\n if (edition >= 2023) {\n throw illegal(\"group\");\n }\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n var fieldName = util.lcFirst(name);\n if (name === fieldName)\n name = util.ucFirst(name);\n skip(\"=\");\n var id = parseId(next());\n var type = new Type(name);\n type.group = true;\n var field = new Field(fieldName, id, name, rule);\n field.filename = parse.filename;\n ifBlock(type, function parseGroup_block(token) {\n switch (token) {\n\n case \"option\":\n parseOption(type, token);\n skip(\";\");\n break;\n case \"required\":\n case \"repeated\":\n parseField(type, token);\n break;\n\n case \"optional\":\n /* istanbul ignore if */\n if (edition === \"proto3\") {\n parseField(type, \"proto3_optional\");\n } else {\n parseField(type, \"optional\");\n }\n break;\n\n case \"message\":\n parseType(type, token);\n break;\n\n case \"enum\":\n parseEnum(type, token);\n break;\n\n /* istanbul ignore next */\n default:\n throw illegal(token); // there are no groups with proto3 semantics\n }\n });\n parent.add(type)\n .add(field);\n }\n\n function parseMapField(parent) {\n skip(\"<\");\n var keyType = next();\n\n /* istanbul ignore if */\n if (types.mapKey[keyType] === undefined)\n throw illegal(keyType, \"type\");\n\n skip(\",\");\n var valueType = next();\n\n /* istanbul ignore if */\n if (!typeRefRe.test(valueType))\n throw illegal(valueType, \"type\");\n\n skip(\">\");\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n skip(\"=\");\n var field = new MapField(applyCase(name), parseId(next()), keyType, valueType);\n ifBlock(field, function parseMapField_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(field, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseMapField_line() {\n parseInlineOptions(field);\n });\n parent.add(field);\n }\n\n function parseOneOf(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var oneof = new OneOf(applyCase(token));\n ifBlock(oneof, function parseOneOf_block(token) {\n if (token === \"option\") {\n parseOption(oneof, token);\n skip(\";\");\n } else {\n push(token);\n parseField(oneof, \"optional\");\n }\n });\n parent.add(oneof);\n }\n\n function parseEnum(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var enm = new Enum(token);\n ifBlock(enm, function parseEnum_block(token) {\n switch(token) {\n case \"option\":\n parseOption(enm, token);\n skip(\";\");\n break;\n\n case \"reserved\":\n readRanges(enm.reserved || (enm.reserved = []), true);\n if(enm.reserved === undefined) enm.reserved = [];\n break;\n\n default:\n parseEnumValue(enm, token);\n }\n });\n parent.add(enm);\n if (parent === ptr) {\n topLevelObjects.push(enm);\n }\n }\n\n function parseEnumValue(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token))\n throw illegal(token, \"name\");\n\n skip(\"=\");\n var value = parseId(next(), true),\n dummy = {\n options: undefined\n };\n dummy.getOption = function(name) {\n return this.options[name];\n };\n dummy.setOption = function(name, value) {\n ReflectionObject.prototype.setOption.call(dummy, name, value);\n };\n dummy.setParsedOption = function() {\n return undefined;\n };\n ifBlock(dummy, function parseEnumValue_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(dummy, token); // skip\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseEnumValue_line() {\n parseInlineOptions(dummy); // skip\n });\n parent.add(token, value, dummy.comment, dummy.parsedOptions || dummy.options);\n }\n\n function parseOption(parent, token) {\n var option;\n var propName;\n var isOption = true;\n if (token === \"option\") {\n token = next();\n }\n\n while (token !== \"=\") {\n if (token === \"(\") {\n var parensValue = next();\n skip(\")\");\n token = \"(\" + parensValue + \")\";\n }\n if (isOption) {\n isOption = false;\n if (token.includes(\".\") && !token.includes(\"(\")) {\n var tokens = token.split(\".\");\n option = tokens[0] + \".\";\n token = tokens[1];\n continue;\n }\n option = token;\n } else {\n propName = propName ? propName += token : token;\n }\n token = next();\n }\n var name = propName ? option.concat(propName) : option;\n var optionValue = parseOptionValue(parent, name);\n propName = propName && propName[0] === \".\" ? propName.slice(1) : propName;\n option = option && option[option.length - 1] === \".\" ? option.slice(0, -1) : option;\n setParsedOption(parent, option, optionValue, propName);\n }\n\n function parseOptionValue(parent, name) {\n // { a: \"foo\" b { c: \"bar\" } }\n if (skip(\"{\", true)) {\n var objectResult = {};\n\n while (!skip(\"}\", true)) {\n /* istanbul ignore if */\n if (!nameRe.test(token = next())) {\n throw illegal(token, \"name\");\n }\n if (token === null) {\n throw illegal(token, \"end of input\");\n }\n\n var value;\n var propName = token;\n\n skip(\":\", true);\n\n if (peek() === \"{\") {\n // option (my_option) = {\n // repeated_value: [ \"foo\", \"bar\" ]\n // };\n value = parseOptionValue(parent, name + \".\" + token);\n } else if (peek() === \"[\") {\n value = [];\n var lastValue;\n if (skip(\"[\", true)) {\n do {\n lastValue = readValue(true);\n value.push(lastValue);\n } while (skip(\",\", true));\n skip(\"]\");\n if (typeof lastValue !== \"undefined\") {\n setOption(parent, name + \".\" + token, lastValue);\n }\n }\n } else {\n value = readValue(true);\n setOption(parent, name + \".\" + token, value);\n }\n\n var prevValue = objectResult[propName];\n\n if (prevValue)\n value = [].concat(prevValue).concat(value);\n\n objectResult[propName] = value;\n\n // Semicolons and commas can be optional\n skip(\",\", true);\n skip(\";\", true);\n }\n\n return objectResult;\n }\n\n var simpleValue = readValue(true);\n setOption(parent, name, simpleValue);\n return simpleValue;\n // Does not enforce a delimiter to be universal\n }\n\n function setOption(parent, name, value) {\n if (ptr === parent && /^features\\./.test(name)) {\n topLevelOptions[name] = value;\n return;\n }\n if (parent.setOption)\n parent.setOption(name, value);\n }\n\n function setParsedOption(parent, name, value, propName) {\n if (parent.setParsedOption)\n parent.setParsedOption(name, value, propName);\n }\n\n function parseInlineOptions(parent) {\n if (skip(\"[\", true)) {\n do {\n parseOption(parent, \"option\");\n } while (skip(\",\", true));\n skip(\"]\");\n }\n return parent;\n }\n\n function parseService(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"service name\");\n\n var service = new Service(token);\n ifBlock(service, function parseService_block(token) {\n if (parseCommon(service, token)) {\n return;\n }\n\n /* istanbul ignore else */\n if (token === \"rpc\")\n parseMethod(service, token);\n else\n throw illegal(token);\n });\n parent.add(service);\n if (parent === ptr) {\n topLevelObjects.push(service);\n }\n }\n\n function parseMethod(parent, token) {\n // Get the comment of the preceding line now (if one exists) in case the\n // method is defined across multiple lines.\n var commentText = cmnt();\n\n var type = token;\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var name = token,\n requestType, requestStream,\n responseType, responseStream;\n\n skip(\"(\");\n if (skip(\"stream\", true))\n requestStream = true;\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token);\n\n requestType = token;\n skip(\")\"); skip(\"returns\"); skip(\"(\");\n if (skip(\"stream\", true))\n responseStream = true;\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token);\n\n responseType = token;\n skip(\")\");\n\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\n method.comment = commentText;\n ifBlock(method, function parseMethod_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(method, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n });\n parent.add(method);\n }\n\n function parseExtension(parent, token) {\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token, \"reference\");\n\n var reference = token;\n ifBlock(null, function parseExtension_block(token) {\n switch (token) {\n\n case \"required\":\n case \"repeated\":\n parseField(parent, token, reference);\n break;\n\n case \"optional\":\n /* istanbul ignore if */\n if (edition === \"proto3\") {\n parseField(parent, \"proto3_optional\", reference);\n } else {\n parseField(parent, \"optional\", reference);\n }\n break;\n\n default:\n /* istanbul ignore if */\n if (edition === \"proto2\" || !typeRefRe.test(token))\n throw illegal(token);\n push(token);\n parseField(parent, \"optional\", reference);\n break;\n }\n });\n }\n\n var token;\n while ((token = next()) !== null) {\n switch (token) {\n\n case \"package\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parsePackage();\n break;\n\n case \"import\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parseImport();\n break;\n\n case \"syntax\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parseSyntax();\n break;\n\n case \"edition\":\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n parseEdition();\n break;\n\n case \"option\":\n parseOption(ptr, token);\n skip(\";\", true);\n break;\n\n default:\n\n /* istanbul ignore else */\n if (parseCommon(ptr, token)) {\n head = false;\n continue;\n }\n\n /* istanbul ignore next */\n throw illegal(token);\n }\n }\n\n resolveFileFeatures();\n\n parse.filename = null;\n return {\n \"package\" : pkg,\n \"imports\" : imports,\n weakImports : weakImports,\n root : root\n };\n}\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @name parse\n * @function\n * @param {string} source Source contents\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n * @variation 2\n */\n","\"use strict\";\nmodule.exports = common;\n\nvar commonRe = /\\/|\\./;\n\n/**\n * Provides common type definitions.\n * Can also be used to provide additional google types or your own custom types.\n * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name\n * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition\n * @returns {undefined}\n * @property {INamespace} google/protobuf/any.proto Any\n * @property {INamespace} google/protobuf/duration.proto Duration\n * @property {INamespace} google/protobuf/empty.proto Empty\n * @property {INamespace} google/protobuf/field_mask.proto FieldMask\n * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue\n * @property {INamespace} google/protobuf/timestamp.proto Timestamp\n * @property {INamespace} google/protobuf/wrappers.proto Wrappers\n * @example\n * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension)\n * protobuf.common(\"descriptor\", descriptorJson);\n *\n * // manually provides a custom definition (uses my.foo namespace)\n * protobuf.common(\"my/foo/bar.proto\", myFooBarJson);\n */\nfunction common(name, json) {\n if (!commonRe.test(name)) {\n name = \"google/protobuf/\" + name + \".proto\";\n json = { nested: { google: { nested: { protobuf: { nested: json } } } } };\n }\n common[name] = json;\n}\n\n// Not provided because of limited use (feel free to discuss or to provide yourself):\n//\n// google/protobuf/descriptor.proto\n// google/protobuf/source_context.proto\n// google/protobuf/type.proto\n//\n// Stripped and pre-parsed versions of these non-bundled files are instead available as part of\n// the repository or package within the google/protobuf directory.\n\ncommon(\"any\", {\n\n /**\n * Properties of a google.protobuf.Any message.\n * @interface IAny\n * @type {Object}\n * @property {string} [typeUrl]\n * @property {Uint8Array} [bytes]\n * @memberof common\n */\n Any: {\n fields: {\n type_url: {\n type: \"string\",\n id: 1\n },\n value: {\n type: \"bytes\",\n id: 2\n }\n }\n }\n});\n\nvar timeType;\n\ncommon(\"duration\", {\n\n /**\n * Properties of a google.protobuf.Duration message.\n * @interface IDuration\n * @type {Object}\n * @property {number|Long} [seconds]\n * @property {number} [nanos]\n * @memberof common\n */\n Duration: timeType = {\n fields: {\n seconds: {\n type: \"int64\",\n id: 1\n },\n nanos: {\n type: \"int32\",\n id: 2\n }\n }\n }\n});\n\ncommon(\"timestamp\", {\n\n /**\n * Properties of a google.protobuf.Timestamp message.\n * @interface ITimestamp\n * @type {Object}\n * @property {number|Long} [seconds]\n * @property {number} [nanos]\n * @memberof common\n */\n Timestamp: timeType\n});\n\ncommon(\"empty\", {\n\n /**\n * Properties of a google.protobuf.Empty message.\n * @interface IEmpty\n * @memberof common\n */\n Empty: {\n fields: {}\n }\n});\n\ncommon(\"struct\", {\n\n /**\n * Properties of a google.protobuf.Struct message.\n * @interface IStruct\n * @type {Object}\n * @property {Object.} [fields]\n * @memberof common\n */\n Struct: {\n fields: {\n fields: {\n keyType: \"string\",\n type: \"Value\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Value message.\n * @interface IValue\n * @type {Object}\n * @property {string} [kind]\n * @property {0} [nullValue]\n * @property {number} [numberValue]\n * @property {string} [stringValue]\n * @property {boolean} [boolValue]\n * @property {IStruct} [structValue]\n * @property {IListValue} [listValue]\n * @memberof common\n */\n Value: {\n oneofs: {\n kind: {\n oneof: [\n \"nullValue\",\n \"numberValue\",\n \"stringValue\",\n \"boolValue\",\n \"structValue\",\n \"listValue\"\n ]\n }\n },\n fields: {\n nullValue: {\n type: \"NullValue\",\n id: 1\n },\n numberValue: {\n type: \"double\",\n id: 2\n },\n stringValue: {\n type: \"string\",\n id: 3\n },\n boolValue: {\n type: \"bool\",\n id: 4\n },\n structValue: {\n type: \"Struct\",\n id: 5\n },\n listValue: {\n type: \"ListValue\",\n id: 6\n }\n }\n },\n\n NullValue: {\n values: {\n NULL_VALUE: 0\n }\n },\n\n /**\n * Properties of a google.protobuf.ListValue message.\n * @interface IListValue\n * @type {Object}\n * @property {Array.} [values]\n * @memberof common\n */\n ListValue: {\n fields: {\n values: {\n rule: \"repeated\",\n type: \"Value\",\n id: 1\n }\n }\n }\n});\n\ncommon(\"wrappers\", {\n\n /**\n * Properties of a google.protobuf.DoubleValue message.\n * @interface IDoubleValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n DoubleValue: {\n fields: {\n value: {\n type: \"double\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.FloatValue message.\n * @interface IFloatValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n FloatValue: {\n fields: {\n value: {\n type: \"float\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Int64Value message.\n * @interface IInt64Value\n * @type {Object}\n * @property {number|Long} [value]\n * @memberof common\n */\n Int64Value: {\n fields: {\n value: {\n type: \"int64\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.UInt64Value message.\n * @interface IUInt64Value\n * @type {Object}\n * @property {number|Long} [value]\n * @memberof common\n */\n UInt64Value: {\n fields: {\n value: {\n type: \"uint64\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Int32Value message.\n * @interface IInt32Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n Int32Value: {\n fields: {\n value: {\n type: \"int32\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.UInt32Value message.\n * @interface IUInt32Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n UInt32Value: {\n fields: {\n value: {\n type: \"uint32\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.BoolValue message.\n * @interface IBoolValue\n * @type {Object}\n * @property {boolean} [value]\n * @memberof common\n */\n BoolValue: {\n fields: {\n value: {\n type: \"bool\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.StringValue message.\n * @interface IStringValue\n * @type {Object}\n * @property {string} [value]\n * @memberof common\n */\n StringValue: {\n fields: {\n value: {\n type: \"string\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.BytesValue message.\n * @interface IBytesValue\n * @type {Object}\n * @property {Uint8Array} [value]\n * @memberof common\n */\n BytesValue: {\n fields: {\n value: {\n type: \"bytes\",\n id: 1\n }\n }\n }\n});\n\ncommon(\"field_mask\", {\n\n /**\n * Properties of a google.protobuf.FieldMask message.\n * @interface IDoubleValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n FieldMask: {\n fields: {\n paths: {\n rule: \"repeated\",\n type: \"string\",\n id: 1\n }\n }\n }\n});\n\n/**\n * Gets the root definition of the specified common proto file.\n *\n * Bundled definitions are:\n * - google/protobuf/any.proto\n * - google/protobuf/duration.proto\n * - google/protobuf/empty.proto\n * - google/protobuf/field_mask.proto\n * - google/protobuf/struct.proto\n * - google/protobuf/timestamp.proto\n * - google/protobuf/wrappers.proto\n *\n * @param {string} file Proto file name\n * @returns {INamespace|null} Root definition or `null` if not defined\n */\ncommon.get = function get(file) {\n return common[file] || null;\n};\n","\"use strict\";\nvar protobuf = module.exports = require(\"./index-light\");\n\nprotobuf.build = \"full\";\n\n// Parser\nprotobuf.tokenize = require(\"./tokenize\");\nprotobuf.parse = require(\"./parse\");\nprotobuf.common = require(\"./common\");\n\n// Configure parser\nprotobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common);\n","// full library entry point.\n\n\"use strict\";\nmodule.exports = require(\"./src/index\");\n","\"use strict\";\nvar $protobuf = require(\"../..\");\nmodule.exports = exports = $protobuf.descriptor = $protobuf.Root.fromJSON(require(\"../../google/protobuf/descriptor.json\")).lookup(\".google.protobuf\");\n\nvar Namespace = $protobuf.Namespace,\n Root = $protobuf.Root,\n Enum = $protobuf.Enum,\n Type = $protobuf.Type,\n Field = $protobuf.Field,\n MapField = $protobuf.MapField,\n OneOf = $protobuf.OneOf,\n Service = $protobuf.Service,\n Method = $protobuf.Method;\n\n// --- Root ---\n\n/**\n * Properties of a FileDescriptorSet message.\n * @interface IFileDescriptorSet\n * @property {IFileDescriptorProto[]} file Files\n */\n\n/**\n * Properties of a FileDescriptorProto message.\n * @interface IFileDescriptorProto\n * @property {string} [name] File name\n * @property {string} [package] Package\n * @property {*} [dependency] Not supported\n * @property {*} [publicDependency] Not supported\n * @property {*} [weakDependency] Not supported\n * @property {IDescriptorProto[]} [messageType] Nested message types\n * @property {IEnumDescriptorProto[]} [enumType] Nested enums\n * @property {IServiceDescriptorProto[]} [service] Nested services\n * @property {IFieldDescriptorProto[]} [extension] Nested extension fields\n * @property {IFileOptions} [options] Options\n * @property {*} [sourceCodeInfo] Not supported\n * @property {string} [syntax=\"proto2\"] Syntax\n */\n\n/**\n * Properties of a FileOptions message.\n * @interface IFileOptions\n * @property {string} [javaPackage]\n * @property {string} [javaOuterClassname]\n * @property {boolean} [javaMultipleFiles]\n * @property {boolean} [javaGenerateEqualsAndHash]\n * @property {boolean} [javaStringCheckUtf8]\n * @property {IFileOptionsOptimizeMode} [optimizeFor=1]\n * @property {string} [goPackage]\n * @property {boolean} [ccGenericServices]\n * @property {boolean} [javaGenericServices]\n * @property {boolean} [pyGenericServices]\n * @property {boolean} [deprecated]\n * @property {boolean} [ccEnableArenas]\n * @property {string} [objcClassPrefix]\n * @property {string} [csharpNamespace]\n */\n\n/**\n * Values of he FileOptions.OptimizeMode enum.\n * @typedef IFileOptionsOptimizeMode\n * @type {number}\n * @property {number} SPEED=1\n * @property {number} CODE_SIZE=2\n * @property {number} LITE_RUNTIME=3\n */\n\n/**\n * Creates a root from a descriptor set.\n * @param {IFileDescriptorSet|Reader|Uint8Array} descriptor Descriptor\n * @returns {Root} Root instance\n */\nRoot.fromDescriptor = function fromDescriptor(descriptor) {\n\n // Decode the descriptor message if specified as a buffer:\n if (typeof descriptor.length === \"number\")\n descriptor = exports.FileDescriptorSet.decode(descriptor);\n\n var root = new Root();\n\n if (descriptor.file) {\n var fileDescriptor,\n filePackage;\n for (var j = 0, i; j < descriptor.file.length; ++j) {\n filePackage = root;\n if ((fileDescriptor = descriptor.file[j])[\"package\"] && fileDescriptor[\"package\"].length)\n filePackage = root.define(fileDescriptor[\"package\"]);\n if (fileDescriptor.name && fileDescriptor.name.length)\n root.files.push(filePackage.filename = fileDescriptor.name);\n if (fileDescriptor.messageType)\n for (i = 0; i < fileDescriptor.messageType.length; ++i)\n filePackage.add(Type.fromDescriptor(fileDescriptor.messageType[i], fileDescriptor.syntax));\n if (fileDescriptor.enumType)\n for (i = 0; i < fileDescriptor.enumType.length; ++i)\n filePackage.add(Enum.fromDescriptor(fileDescriptor.enumType[i]));\n if (fileDescriptor.extension)\n for (i = 0; i < fileDescriptor.extension.length; ++i)\n filePackage.add(Field.fromDescriptor(fileDescriptor.extension[i]));\n if (fileDescriptor.service)\n for (i = 0; i < fileDescriptor.service.length; ++i)\n filePackage.add(Service.fromDescriptor(fileDescriptor.service[i]));\n var opts = fromDescriptorOptions(fileDescriptor.options, exports.FileOptions);\n if (opts) {\n var ks = Object.keys(opts);\n for (i = 0; i < ks.length; ++i)\n filePackage.setOption(ks[i], opts[ks[i]]);\n }\n }\n }\n\n return root;\n};\n\n/**\n * Converts a root to a descriptor set.\n * @returns {Message} Descriptor\n * @param {string} [syntax=\"proto2\"] Syntax\n */\nRoot.prototype.toDescriptor = function toDescriptor(syntax) {\n var set = exports.FileDescriptorSet.create();\n Root_toDescriptorRecursive(this, set.file, syntax);\n return set;\n};\n\n// Traverses a namespace and assembles the descriptor set\nfunction Root_toDescriptorRecursive(ns, files, syntax) {\n\n // Create a new file\n var file = exports.FileDescriptorProto.create({ name: ns.filename || (ns.fullName.substring(1).replace(/\\./g, \"_\") || \"root\") + \".proto\" });\n if (syntax)\n file.syntax = syntax;\n if (!(ns instanceof Root))\n file[\"package\"] = ns.fullName.substring(1);\n\n // Add nested types\n for (var i = 0, nested; i < ns.nestedArray.length; ++i)\n if ((nested = ns._nestedArray[i]) instanceof Type)\n file.messageType.push(nested.toDescriptor(syntax));\n else if (nested instanceof Enum)\n file.enumType.push(nested.toDescriptor());\n else if (nested instanceof Field)\n file.extension.push(nested.toDescriptor(syntax));\n else if (nested instanceof Service)\n file.service.push(nested.toDescriptor());\n else if (nested instanceof /* plain */ Namespace)\n Root_toDescriptorRecursive(nested, files, syntax); // requires new file\n\n // Keep package-level options\n file.options = toDescriptorOptions(ns.options, exports.FileOptions);\n\n // And keep the file only if there is at least one nested object\n if (file.messageType.length + file.enumType.length + file.extension.length + file.service.length)\n files.push(file);\n}\n\n// --- Type ---\n\n/**\n * Properties of a DescriptorProto message.\n * @interface IDescriptorProto\n * @property {string} [name] Message type name\n * @property {IFieldDescriptorProto[]} [field] Fields\n * @property {IFieldDescriptorProto[]} [extension] Extension fields\n * @property {IDescriptorProto[]} [nestedType] Nested message types\n * @property {IEnumDescriptorProto[]} [enumType] Nested enums\n * @property {IDescriptorProtoExtensionRange[]} [extensionRange] Extension ranges\n * @property {IOneofDescriptorProto[]} [oneofDecl] Oneofs\n * @property {IMessageOptions} [options] Not supported\n * @property {IDescriptorProtoReservedRange[]} [reservedRange] Reserved ranges\n * @property {string[]} [reservedName] Reserved names\n */\n\n/**\n * Properties of a MessageOptions message.\n * @interface IMessageOptions\n * @property {boolean} [mapEntry=false] Whether this message is a map entry\n */\n\n/**\n * Properties of an ExtensionRange message.\n * @interface IDescriptorProtoExtensionRange\n * @property {number} [start] Start field id\n * @property {number} [end] End field id\n */\n\n/**\n * Properties of a ReservedRange message.\n * @interface IDescriptorProtoReservedRange\n * @property {number} [start] Start field id\n * @property {number} [end] End field id\n */\n\nvar unnamedMessageIndex = 0;\n\n/**\n * Creates a type from a descriptor.\n * @param {IDescriptorProto|Reader|Uint8Array} descriptor Descriptor\n * @param {string} [syntax=\"proto2\"] Syntax\n * @returns {Type} Type instance\n */\nType.fromDescriptor = function fromDescriptor(descriptor, syntax) {\n\n // Decode the descriptor message if specified as a buffer:\n if (typeof descriptor.length === \"number\")\n descriptor = exports.DescriptorProto.decode(descriptor);\n\n // Create the message type\n var type = new Type(descriptor.name.length ? descriptor.name : \"Type\" + unnamedMessageIndex++, fromDescriptorOptions(descriptor.options, exports.MessageOptions)),\n i;\n\n /* Oneofs */ if (descriptor.oneofDecl)\n for (i = 0; i < descriptor.oneofDecl.length; ++i)\n type.add(OneOf.fromDescriptor(descriptor.oneofDecl[i]));\n /* Fields */ if (descriptor.field)\n for (i = 0; i < descriptor.field.length; ++i) {\n var field = Field.fromDescriptor(descriptor.field[i], syntax);\n type.add(field);\n if (descriptor.field[i].hasOwnProperty(\"oneofIndex\")) // eslint-disable-line no-prototype-builtins\n type.oneofsArray[descriptor.field[i].oneofIndex].add(field);\n }\n /* Extension fields */ if (descriptor.extension)\n for (i = 0; i < descriptor.extension.length; ++i)\n type.add(Field.fromDescriptor(descriptor.extension[i], syntax));\n /* Nested types */ if (descriptor.nestedType)\n for (i = 0; i < descriptor.nestedType.length; ++i) {\n type.add(Type.fromDescriptor(descriptor.nestedType[i], syntax));\n if (descriptor.nestedType[i].options && descriptor.nestedType[i].options.mapEntry)\n type.setOption(\"map_entry\", true);\n }\n /* Nested enums */ if (descriptor.enumType)\n for (i = 0; i < descriptor.enumType.length; ++i)\n type.add(Enum.fromDescriptor(descriptor.enumType[i]));\n /* Extension ranges */ if (descriptor.extensionRange && descriptor.extensionRange.length) {\n type.extensions = [];\n for (i = 0; i < descriptor.extensionRange.length; ++i)\n type.extensions.push([ descriptor.extensionRange[i].start, descriptor.extensionRange[i].end ]);\n }\n /* Reserved... */ if (descriptor.reservedRange && descriptor.reservedRange.length || descriptor.reservedName && descriptor.reservedName.length) {\n type.reserved = [];\n /* Ranges */ if (descriptor.reservedRange)\n for (i = 0; i < descriptor.reservedRange.length; ++i)\n type.reserved.push([ descriptor.reservedRange[i].start, descriptor.reservedRange[i].end ]);\n /* Names */ if (descriptor.reservedName)\n for (i = 0; i < descriptor.reservedName.length; ++i)\n type.reserved.push(descriptor.reservedName[i]);\n }\n\n return type;\n};\n\n/**\n * Converts a type to a descriptor.\n * @returns {Message} Descriptor\n * @param {string} [syntax=\"proto2\"] Syntax\n */\nType.prototype.toDescriptor = function toDescriptor(syntax) {\n var descriptor = exports.DescriptorProto.create({ name: this.name }),\n i;\n\n /* Fields */ for (i = 0; i < this.fieldsArray.length; ++i) {\n var fieldDescriptor;\n descriptor.field.push(fieldDescriptor = this._fieldsArray[i].toDescriptor(syntax));\n if (this._fieldsArray[i] instanceof MapField) { // map fields are repeated FieldNameEntry\n var keyType = toDescriptorType(this._fieldsArray[i].keyType, this._fieldsArray[i].resolvedKeyType),\n valueType = toDescriptorType(this._fieldsArray[i].type, this._fieldsArray[i].resolvedType),\n valueTypeName = valueType === /* type */ 11 || valueType === /* enum */ 14\n ? this._fieldsArray[i].resolvedType && shortname(this.parent, this._fieldsArray[i].resolvedType) || this._fieldsArray[i].type\n : undefined;\n descriptor.nestedType.push(exports.DescriptorProto.create({\n name: fieldDescriptor.typeName,\n field: [\n exports.FieldDescriptorProto.create({ name: \"key\", number: 1, label: 1, type: keyType }), // can't reference a type or enum\n exports.FieldDescriptorProto.create({ name: \"value\", number: 2, label: 1, type: valueType, typeName: valueTypeName })\n ],\n options: exports.MessageOptions.create({ mapEntry: true })\n }));\n }\n }\n /* Oneofs */ for (i = 0; i < this.oneofsArray.length; ++i)\n descriptor.oneofDecl.push(this._oneofsArray[i].toDescriptor());\n /* Nested... */ for (i = 0; i < this.nestedArray.length; ++i) {\n /* Extension fields */ if (this._nestedArray[i] instanceof Field)\n descriptor.field.push(this._nestedArray[i].toDescriptor(syntax));\n /* Types */ else if (this._nestedArray[i] instanceof Type)\n descriptor.nestedType.push(this._nestedArray[i].toDescriptor(syntax));\n /* Enums */ else if (this._nestedArray[i] instanceof Enum)\n descriptor.enumType.push(this._nestedArray[i].toDescriptor());\n // plain nested namespaces become packages instead in Root#toDescriptor\n }\n /* Extension ranges */ if (this.extensions)\n for (i = 0; i < this.extensions.length; ++i)\n descriptor.extensionRange.push(exports.DescriptorProto.ExtensionRange.create({ start: this.extensions[i][0], end: this.extensions[i][1] }));\n /* Reserved... */ if (this.reserved)\n for (i = 0; i < this.reserved.length; ++i)\n /* Names */ if (typeof this.reserved[i] === \"string\")\n descriptor.reservedName.push(this.reserved[i]);\n /* Ranges */ else\n descriptor.reservedRange.push(exports.DescriptorProto.ReservedRange.create({ start: this.reserved[i][0], end: this.reserved[i][1] }));\n\n descriptor.options = toDescriptorOptions(this.options, exports.MessageOptions);\n\n return descriptor;\n};\n\n// --- Field ---\n\n/**\n * Properties of a FieldDescriptorProto message.\n * @interface IFieldDescriptorProto\n * @property {string} [name] Field name\n * @property {number} [number] Field id\n * @property {IFieldDescriptorProtoLabel} [label] Field rule\n * @property {IFieldDescriptorProtoType} [type] Field basic type\n * @property {string} [typeName] Field type name\n * @property {string} [extendee] Extended type name\n * @property {string} [defaultValue] Literal default value\n * @property {number} [oneofIndex] Oneof index if part of a oneof\n * @property {*} [jsonName] Not supported\n * @property {IFieldOptions} [options] Field options\n */\n\n/**\n * Values of the FieldDescriptorProto.Label enum.\n * @typedef IFieldDescriptorProtoLabel\n * @type {number}\n * @property {number} LABEL_OPTIONAL=1\n * @property {number} LABEL_REQUIRED=2\n * @property {number} LABEL_REPEATED=3\n */\n\n/**\n * Values of the FieldDescriptorProto.Type enum.\n * @typedef IFieldDescriptorProtoType\n * @type {number}\n * @property {number} TYPE_DOUBLE=1\n * @property {number} TYPE_FLOAT=2\n * @property {number} TYPE_INT64=3\n * @property {number} TYPE_UINT64=4\n * @property {number} TYPE_INT32=5\n * @property {number} TYPE_FIXED64=6\n * @property {number} TYPE_FIXED32=7\n * @property {number} TYPE_BOOL=8\n * @property {number} TYPE_STRING=9\n * @property {number} TYPE_GROUP=10\n * @property {number} TYPE_MESSAGE=11\n * @property {number} TYPE_BYTES=12\n * @property {number} TYPE_UINT32=13\n * @property {number} TYPE_ENUM=14\n * @property {number} TYPE_SFIXED32=15\n * @property {number} TYPE_SFIXED64=16\n * @property {number} TYPE_SINT32=17\n * @property {number} TYPE_SINT64=18\n */\n\n/**\n * Properties of a FieldOptions message.\n * @interface IFieldOptions\n * @property {boolean} [packed] Whether packed or not (defaults to `false` for proto2 and `true` for proto3)\n * @property {IFieldOptionsJSType} [jstype] JavaScript value type (not used by protobuf.js)\n */\n\n/**\n * Values of the FieldOptions.JSType enum.\n * @typedef IFieldOptionsJSType\n * @type {number}\n * @property {number} JS_NORMAL=0\n * @property {number} JS_STRING=1\n * @property {number} JS_NUMBER=2\n */\n\n// copied here from parse.js\nvar numberRe = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;\n\n/**\n * Creates a field from a descriptor.\n * @param {IFieldDescriptorProto|Reader|Uint8Array} descriptor Descriptor\n * @param {string} [syntax=\"proto2\"] Syntax\n * @returns {Field} Field instance\n */\nField.fromDescriptor = function fromDescriptor(descriptor, syntax) {\n\n // Decode the descriptor message if specified as a buffer:\n if (typeof descriptor.length === \"number\")\n descriptor = exports.DescriptorProto.decode(descriptor);\n\n if (typeof descriptor.number !== \"number\")\n throw Error(\"missing field id\");\n\n // Rewire field type\n var fieldType;\n if (descriptor.typeName && descriptor.typeName.length)\n fieldType = descriptor.typeName;\n else\n fieldType = fromDescriptorType(descriptor.type);\n\n // Rewire field rule\n var fieldRule;\n switch (descriptor.label) {\n // 0 is reserved for errors\n case 1: fieldRule = undefined; break;\n case 2: fieldRule = \"required\"; break;\n case 3: fieldRule = \"repeated\"; break;\n default: throw Error(\"illegal label: \" + descriptor.label);\n }\n\n\tvar extendee = descriptor.extendee;\n\tif (descriptor.extendee !== undefined) {\n\t\textendee = extendee.length ? extendee : undefined;\n\t}\n var field = new Field(\n descriptor.name.length ? descriptor.name : \"field\" + descriptor.number,\n descriptor.number,\n fieldType,\n fieldRule,\n extendee\n );\n\n field.options = fromDescriptorOptions(descriptor.options, exports.FieldOptions);\n\n if (descriptor.defaultValue && descriptor.defaultValue.length) {\n var defaultValue = descriptor.defaultValue;\n switch (defaultValue) {\n case \"true\": case \"TRUE\":\n defaultValue = true;\n break;\n case \"false\": case \"FALSE\":\n defaultValue = false;\n break;\n default:\n var match = numberRe.exec(defaultValue);\n if (match)\n defaultValue = parseInt(defaultValue); // eslint-disable-line radix\n break;\n }\n field.setOption(\"default\", defaultValue);\n }\n\n if (packableDescriptorType(descriptor.type)) {\n if (syntax === \"proto3\") { // defaults to packed=true (internal preset is packed=true)\n if (descriptor.options && !descriptor.options.packed)\n field.setOption(\"packed\", false);\n } else if (!(descriptor.options && descriptor.options.packed)) // defaults to packed=false\n field.setOption(\"packed\", false);\n }\n\n return field;\n};\n\n/**\n * Converts a field to a descriptor.\n * @returns {Message} Descriptor\n * @param {string} [syntax=\"proto2\"] Syntax\n */\nField.prototype.toDescriptor = function toDescriptor(syntax) {\n var descriptor = exports.FieldDescriptorProto.create({ name: this.name, number: this.id });\n\n if (this.map) {\n\n descriptor.type = 11; // message\n descriptor.typeName = $protobuf.util.ucFirst(this.name); // fieldName -> FieldNameEntry (built in Type#toDescriptor)\n descriptor.label = 3; // repeated\n\n } else {\n\n // Rewire field type\n switch (descriptor.type = toDescriptorType(this.type, this.resolve().resolvedType)) {\n case 10: // group\n case 11: // type\n case 14: // enum\n descriptor.typeName = this.resolvedType ? shortname(this.parent, this.resolvedType) : this.type;\n break;\n }\n\n // Rewire field rule\n switch (this.rule) {\n case \"repeated\": descriptor.label = 3; break;\n case \"required\": descriptor.label = 2; break;\n default: descriptor.label = 1; break;\n }\n\n }\n\n // Handle extension field\n descriptor.extendee = this.extensionField ? this.extensionField.parent.fullName : this.extend;\n\n // Handle part of oneof\n if (this.partOf)\n if ((descriptor.oneofIndex = this.parent.oneofsArray.indexOf(this.partOf)) < 0)\n throw Error(\"missing oneof\");\n\n if (this.options) {\n descriptor.options = toDescriptorOptions(this.options, exports.FieldOptions);\n if (this.options[\"default\"] != null)\n descriptor.defaultValue = String(this.options[\"default\"]);\n }\n\n if (syntax === \"proto3\") { // defaults to packed=true\n if (!this.packed)\n (descriptor.options || (descriptor.options = exports.FieldOptions.create())).packed = false;\n } else if (this.packed) // defaults to packed=false\n (descriptor.options || (descriptor.options = exports.FieldOptions.create())).packed = true;\n\n return descriptor;\n};\n\n// --- Enum ---\n\n/**\n * Properties of an EnumDescriptorProto message.\n * @interface IEnumDescriptorProto\n * @property {string} [name] Enum name\n * @property {IEnumValueDescriptorProto[]} [value] Enum values\n * @property {IEnumOptions} [options] Enum options\n */\n\n/**\n * Properties of an EnumValueDescriptorProto message.\n * @interface IEnumValueDescriptorProto\n * @property {string} [name] Name\n * @property {number} [number] Value\n * @property {*} [options] Not supported\n */\n\n/**\n * Properties of an EnumOptions message.\n * @interface IEnumOptions\n * @property {boolean} [allowAlias] Whether aliases are allowed\n * @property {boolean} [deprecated]\n */\n\nvar unnamedEnumIndex = 0;\n\n/**\n * Creates an enum from a descriptor.\n * @param {IEnumDescriptorProto|Reader|Uint8Array} descriptor Descriptor\n * @returns {Enum} Enum instance\n */\nEnum.fromDescriptor = function fromDescriptor(descriptor) {\n\n // Decode the descriptor message if specified as a buffer:\n if (typeof descriptor.length === \"number\")\n descriptor = exports.EnumDescriptorProto.decode(descriptor);\n\n // Construct values object\n var values = {};\n if (descriptor.value)\n for (var i = 0; i < descriptor.value.length; ++i) {\n var name = descriptor.value[i].name,\n value = descriptor.value[i].number || 0;\n values[name && name.length ? name : \"NAME\" + value] = value;\n }\n\n return new Enum(\n descriptor.name && descriptor.name.length ? descriptor.name : \"Enum\" + unnamedEnumIndex++,\n values,\n fromDescriptorOptions(descriptor.options, exports.EnumOptions)\n );\n};\n\n/**\n * Converts an enum to a descriptor.\n * @returns {Message} Descriptor\n */\nEnum.prototype.toDescriptor = function toDescriptor() {\n\n // Values\n var values = [];\n for (var i = 0, ks = Object.keys(this.values); i < ks.length; ++i)\n values.push(exports.EnumValueDescriptorProto.create({ name: ks[i], number: this.values[ks[i]] }));\n\n return exports.EnumDescriptorProto.create({\n name: this.name,\n value: values,\n options: toDescriptorOptions(this.options, exports.EnumOptions)\n });\n};\n\n// --- OneOf ---\n\n/**\n * Properties of a OneofDescriptorProto message.\n * @interface IOneofDescriptorProto\n * @property {string} [name] Oneof name\n * @property {*} [options] Not supported\n */\n\nvar unnamedOneofIndex = 0;\n\n/**\n * Creates a oneof from a descriptor.\n * @param {IOneofDescriptorProto|Reader|Uint8Array} descriptor Descriptor\n * @returns {OneOf} OneOf instance\n */\nOneOf.fromDescriptor = function fromDescriptor(descriptor) {\n\n // Decode the descriptor message if specified as a buffer:\n if (typeof descriptor.length === \"number\")\n descriptor = exports.OneofDescriptorProto.decode(descriptor);\n\n return new OneOf(\n // unnamedOneOfIndex is global, not per type, because we have no ref to a type here\n descriptor.name && descriptor.name.length ? descriptor.name : \"oneof\" + unnamedOneofIndex++\n // fromDescriptorOptions(descriptor.options, exports.OneofOptions) - only uninterpreted_option\n );\n};\n\n/**\n * Converts a oneof to a descriptor.\n * @returns {Message} Descriptor\n */\nOneOf.prototype.toDescriptor = function toDescriptor() {\n return exports.OneofDescriptorProto.create({\n name: this.name\n // options: toDescriptorOptions(this.options, exports.OneofOptions) - only uninterpreted_option\n });\n};\n\n// --- Service ---\n\n/**\n * Properties of a ServiceDescriptorProto message.\n * @interface IServiceDescriptorProto\n * @property {string} [name] Service name\n * @property {IMethodDescriptorProto[]} [method] Methods\n * @property {IServiceOptions} [options] Options\n */\n\n/**\n * Properties of a ServiceOptions message.\n * @interface IServiceOptions\n * @property {boolean} [deprecated]\n */\n\nvar unnamedServiceIndex = 0;\n\n/**\n * Creates a service from a descriptor.\n * @param {IServiceDescriptorProto|Reader|Uint8Array} descriptor Descriptor\n * @returns {Service} Service instance\n */\nService.fromDescriptor = function fromDescriptor(descriptor) {\n\n // Decode the descriptor message if specified as a buffer:\n if (typeof descriptor.length === \"number\")\n descriptor = exports.ServiceDescriptorProto.decode(descriptor);\n\n var service = new Service(descriptor.name && descriptor.name.length ? descriptor.name : \"Service\" + unnamedServiceIndex++, fromDescriptorOptions(descriptor.options, exports.ServiceOptions));\n if (descriptor.method)\n for (var i = 0; i < descriptor.method.length; ++i)\n service.add(Method.fromDescriptor(descriptor.method[i]));\n\n return service;\n};\n\n/**\n * Converts a service to a descriptor.\n * @returns {Message} Descriptor\n */\nService.prototype.toDescriptor = function toDescriptor() {\n\n // Methods\n var methods = [];\n for (var i = 0; i < this.methodsArray.length; ++i)\n methods.push(this._methodsArray[i].toDescriptor());\n\n return exports.ServiceDescriptorProto.create({\n name: this.name,\n method: methods,\n options: toDescriptorOptions(this.options, exports.ServiceOptions)\n });\n};\n\n// --- Method ---\n\n/**\n * Properties of a MethodDescriptorProto message.\n * @interface IMethodDescriptorProto\n * @property {string} [name] Method name\n * @property {string} [inputType] Request type name\n * @property {string} [outputType] Response type name\n * @property {IMethodOptions} [options] Not supported\n * @property {boolean} [clientStreaming=false] Whether requests are streamed\n * @property {boolean} [serverStreaming=false] Whether responses are streamed\n */\n\n/**\n * Properties of a MethodOptions message.\n * @interface IMethodOptions\n * @property {boolean} [deprecated]\n */\n\nvar unnamedMethodIndex = 0;\n\n/**\n * Creates a method from a descriptor.\n * @param {IMethodDescriptorProto|Reader|Uint8Array} descriptor Descriptor\n * @returns {Method} Reflected method instance\n */\nMethod.fromDescriptor = function fromDescriptor(descriptor) {\n\n // Decode the descriptor message if specified as a buffer:\n if (typeof descriptor.length === \"number\")\n descriptor = exports.MethodDescriptorProto.decode(descriptor);\n\n return new Method(\n // unnamedMethodIndex is global, not per service, because we have no ref to a service here\n descriptor.name && descriptor.name.length ? descriptor.name : \"Method\" + unnamedMethodIndex++,\n \"rpc\",\n descriptor.inputType,\n descriptor.outputType,\n Boolean(descriptor.clientStreaming),\n Boolean(descriptor.serverStreaming),\n fromDescriptorOptions(descriptor.options, exports.MethodOptions)\n );\n};\n\n/**\n * Converts a method to a descriptor.\n * @returns {Message} Descriptor\n */\nMethod.prototype.toDescriptor = function toDescriptor() {\n return exports.MethodDescriptorProto.create({\n name: this.name,\n inputType: this.resolvedRequestType ? this.resolvedRequestType.fullName : this.requestType,\n outputType: this.resolvedResponseType ? this.resolvedResponseType.fullName : this.responseType,\n clientStreaming: this.requestStream,\n serverStreaming: this.responseStream,\n options: toDescriptorOptions(this.options, exports.MethodOptions)\n });\n};\n\n// --- utility ---\n\n// Converts a descriptor type to a protobuf.js basic type\nfunction fromDescriptorType(type) {\n switch (type) {\n // 0 is reserved for errors\n case 1: return \"double\";\n case 2: return \"float\";\n case 3: return \"int64\";\n case 4: return \"uint64\";\n case 5: return \"int32\";\n case 6: return \"fixed64\";\n case 7: return \"fixed32\";\n case 8: return \"bool\";\n case 9: return \"string\";\n case 12: return \"bytes\";\n case 13: return \"uint32\";\n case 15: return \"sfixed32\";\n case 16: return \"sfixed64\";\n case 17: return \"sint32\";\n case 18: return \"sint64\";\n }\n throw Error(\"illegal type: \" + type);\n}\n\n// Tests if a descriptor type is packable\nfunction packableDescriptorType(type) {\n switch (type) {\n case 1: // double\n case 2: // float\n case 3: // int64\n case 4: // uint64\n case 5: // int32\n case 6: // fixed64\n case 7: // fixed32\n case 8: // bool\n case 13: // uint32\n case 14: // enum (!)\n case 15: // sfixed32\n case 16: // sfixed64\n case 17: // sint32\n case 18: // sint64\n return true;\n }\n return false;\n}\n\n// Converts a protobuf.js basic type to a descriptor type\nfunction toDescriptorType(type, resolvedType) {\n switch (type) {\n // 0 is reserved for errors\n case \"double\": return 1;\n case \"float\": return 2;\n case \"int64\": return 3;\n case \"uint64\": return 4;\n case \"int32\": return 5;\n case \"fixed64\": return 6;\n case \"fixed32\": return 7;\n case \"bool\": return 8;\n case \"string\": return 9;\n case \"bytes\": return 12;\n case \"uint32\": return 13;\n case \"sfixed32\": return 15;\n case \"sfixed64\": return 16;\n case \"sint32\": return 17;\n case \"sint64\": return 18;\n }\n if (resolvedType instanceof Enum)\n return 14;\n if (resolvedType instanceof Type)\n return resolvedType.group ? 10 : 11;\n throw Error(\"illegal type: \" + type);\n}\n\n// Converts descriptor options to an options object\nfunction fromDescriptorOptions(options, type) {\n if (!options)\n return undefined;\n var out = [];\n for (var i = 0, field, key, val; i < type.fieldsArray.length; ++i)\n if ((key = (field = type._fieldsArray[i]).name) !== \"uninterpretedOption\")\n if (options.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins\n val = options[key];\n if (field.resolvedType instanceof Enum && typeof val === \"number\" && field.resolvedType.valuesById[val] !== undefined)\n val = field.resolvedType.valuesById[val];\n out.push(underScore(key), val);\n }\n return out.length ? $protobuf.util.toObject(out) : undefined;\n}\n\n// Converts an options object to descriptor options\nfunction toDescriptorOptions(options, type) {\n if (!options)\n return undefined;\n var out = [];\n for (var i = 0, ks = Object.keys(options), key, val; i < ks.length; ++i) {\n val = options[key = ks[i]];\n if (key === \"default\")\n continue;\n var field = type.fields[key];\n if (!field && !(field = type.fields[key = $protobuf.util.camelCase(key)]))\n continue;\n out.push(key, val);\n }\n return out.length ? type.fromObject($protobuf.util.toObject(out)) : undefined;\n}\n\n// Calculates the shortest relative path from `from` to `to`.\nfunction shortname(from, to) {\n var fromPath = from.fullName.split(\".\"),\n toPath = to.fullName.split(\".\"),\n i = 0,\n j = 0,\n k = toPath.length - 1;\n if (!(from instanceof Root) && to instanceof Namespace)\n while (i < fromPath.length && j < k && fromPath[i] === toPath[j]) {\n var other = to.lookup(fromPath[i++], true);\n if (other !== null && other !== to)\n break;\n ++j;\n }\n else\n for (; i < fromPath.length && j < k && fromPath[i] === toPath[j]; ++i, ++j);\n return toPath.slice(j).join(\".\");\n}\n\n// copied here from cli/targets/proto.js\nfunction underScore(str) {\n return str.substring(0,1)\n + str.substring(1)\n .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return \"_\" + $1.toLowerCase(); });\n}\n\n// --- exports ---\n\n/**\n * Reflected file descriptor set.\n * @name FileDescriptorSet\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected file descriptor proto.\n * @name FileDescriptorProto\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected descriptor proto.\n * @name DescriptorProto\n * @type {Type}\n * @property {Type} ExtensionRange\n * @property {Type} ReservedRange\n * @const\n * @tstype $protobuf.Type & {\n * ExtensionRange: $protobuf.Type,\n * ReservedRange: $protobuf.Type\n * }\n */\n\n/**\n * Reflected field descriptor proto.\n * @name FieldDescriptorProto\n * @type {Type}\n * @property {Enum} Label\n * @property {Enum} Type\n * @const\n * @tstype $protobuf.Type & {\n * Label: $protobuf.Enum,\n * Type: $protobuf.Enum\n * }\n */\n\n/**\n * Reflected oneof descriptor proto.\n * @name OneofDescriptorProto\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected enum descriptor proto.\n * @name EnumDescriptorProto\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected service descriptor proto.\n * @name ServiceDescriptorProto\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected enum value descriptor proto.\n * @name EnumValueDescriptorProto\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected method descriptor proto.\n * @name MethodDescriptorProto\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected file options.\n * @name FileOptions\n * @type {Type}\n * @property {Enum} OptimizeMode\n * @const\n * @tstype $protobuf.Type & {\n * OptimizeMode: $protobuf.Enum\n * }\n */\n\n/**\n * Reflected message options.\n * @name MessageOptions\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected field options.\n * @name FieldOptions\n * @type {Type}\n * @property {Enum} CType\n * @property {Enum} JSType\n * @const\n * @tstype $protobuf.Type & {\n * CType: $protobuf.Enum,\n * JSType: $protobuf.Enum\n * }\n */\n\n/**\n * Reflected oneof options.\n * @name OneofOptions\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected enum options.\n * @name EnumOptions\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected enum value options.\n * @name EnumValueOptions\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected service options.\n * @name ServiceOptions\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected method options.\n * @name MethodOptions\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected uninterpretet option.\n * @name UninterpretedOption\n * @type {Type}\n * @property {Type} NamePart\n * @const\n * @tstype $protobuf.Type & {\n * NamePart: $protobuf.Type\n * }\n */\n\n/**\n * Reflected source code info.\n * @name SourceCodeInfo\n * @type {Type}\n * @property {Type} Location\n * @const\n * @tstype $protobuf.Type & {\n * Location: $protobuf.Type\n * }\n */\n\n/**\n * Reflected generated code info.\n * @name GeneratedCodeInfo\n * @type {Type}\n * @property {Type} Annotation\n * @const\n * @tstype $protobuf.Type & {\n * Annotation: $protobuf.Type\n * }\n */\n","\"use strict\";\n/**\n * @license\n * Copyright 2018 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.addCommonProtos = exports.loadProtosWithOptionsSync = exports.loadProtosWithOptions = void 0;\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nconst Protobuf = require(\"protobufjs\");\nfunction addIncludePathResolver(root, includePaths) {\n const originalResolvePath = root.resolvePath;\n root.resolvePath = (origin, target) => {\n if (path.isAbsolute(target)) {\n return target;\n }\n for (const directory of includePaths) {\n const fullPath = path.join(directory, target);\n try {\n fs.accessSync(fullPath, fs.constants.R_OK);\n return fullPath;\n }\n catch (err) {\n continue;\n }\n }\n process.emitWarning(`${target} not found in any of the include paths ${includePaths}`);\n return originalResolvePath(origin, target);\n };\n}\nasync function loadProtosWithOptions(filename, options) {\n const root = new Protobuf.Root();\n options = options || {};\n if (!!options.includeDirs) {\n if (!Array.isArray(options.includeDirs)) {\n return Promise.reject(new Error('The includeDirs option must be an array'));\n }\n addIncludePathResolver(root, options.includeDirs);\n }\n const loadedRoot = await root.load(filename, options);\n loadedRoot.resolveAll();\n return loadedRoot;\n}\nexports.loadProtosWithOptions = loadProtosWithOptions;\nfunction loadProtosWithOptionsSync(filename, options) {\n const root = new Protobuf.Root();\n options = options || {};\n if (!!options.includeDirs) {\n if (!Array.isArray(options.includeDirs)) {\n throw new Error('The includeDirs option must be an array');\n }\n addIncludePathResolver(root, options.includeDirs);\n }\n const loadedRoot = root.loadSync(filename, options);\n loadedRoot.resolveAll();\n return loadedRoot;\n}\nexports.loadProtosWithOptionsSync = loadProtosWithOptionsSync;\n/**\n * Load Google's well-known proto files that aren't exposed by Protobuf.js.\n */\nfunction addCommonProtos() {\n // Protobuf.js exposes: any, duration, empty, field_mask, struct, timestamp,\n // and wrappers. compiler/plugin is excluded in Protobuf.js and here.\n // Using constant strings for compatibility with tools like Webpack\n const apiDescriptor = require('protobufjs/google/protobuf/api.json');\n const descriptorDescriptor = require('protobufjs/google/protobuf/descriptor.json');\n const sourceContextDescriptor = require('protobufjs/google/protobuf/source_context.json');\n const typeDescriptor = require('protobufjs/google/protobuf/type.json');\n Protobuf.common('api', apiDescriptor.nested.google.nested.protobuf.nested);\n Protobuf.common('descriptor', descriptorDescriptor.nested.google.nested.protobuf.nested);\n Protobuf.common('source_context', sourceContextDescriptor.nested.google.nested.protobuf.nested);\n Protobuf.common('type', typeDescriptor.nested.google.nested.protobuf.nested);\n}\nexports.addCommonProtos = addCommonProtos;\n//# sourceMappingURL=util.js.map","// GENERATED FILE. DO NOT EDIT.\n(function (global, factory) {\n function preferDefault(exports) {\n return exports.default || exports;\n }\n if (typeof define === \"function\" && define.amd) {\n define([], function () {\n var exports = {};\n factory(exports);\n return preferDefault(exports);\n });\n } else if (typeof exports === \"object\") {\n factory(exports);\n if (typeof module === \"object\") module.exports = preferDefault(exports);\n } else {\n (function () {\n var exports = {};\n factory(exports);\n global.Long = preferDefault(exports);\n })();\n }\n})(\n typeof globalThis !== \"undefined\"\n ? globalThis\n : typeof self !== \"undefined\"\n ? self\n : this,\n function (_exports) {\n \"use strict\";\n\n Object.defineProperty(_exports, \"__esModule\", {\n value: true,\n });\n _exports.default = void 0;\n /**\n * @license\n * Copyright 2009 The Closure Library Authors\n * Copyright 2020 Daniel Wirtz / The long.js Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n // WebAssembly optimizations to do native i64 multiplication and divide\n var wasm = null;\n try {\n wasm = new WebAssembly.Instance(\n new WebAssembly.Module(\n new Uint8Array([\n // \\0asm\n 0, 97, 115, 109,\n // version 1\n 1, 0, 0, 0,\n // section \"type\"\n 1, 13, 2,\n // 0, () => i32\n 96, 0, 1, 127,\n // 1, (i32, i32, i32, i32) => i32\n 96, 4, 127, 127, 127, 127, 1, 127,\n // section \"function\"\n 3, 7, 6,\n // 0, type 0\n 0,\n // 1, type 1\n 1,\n // 2, type 1\n 1,\n // 3, type 1\n 1,\n // 4, type 1\n 1,\n // 5, type 1\n 1,\n // section \"global\"\n 6, 6, 1,\n // 0, \"high\", mutable i32\n 127, 1, 65, 0, 11,\n // section \"export\"\n 7, 50, 6,\n // 0, \"mul\"\n 3, 109, 117, 108, 0, 1,\n // 1, \"div_s\"\n 5, 100, 105, 118, 95, 115, 0, 2,\n // 2, \"div_u\"\n 5, 100, 105, 118, 95, 117, 0, 3,\n // 3, \"rem_s\"\n 5, 114, 101, 109, 95, 115, 0, 4,\n // 4, \"rem_u\"\n 5, 114, 101, 109, 95, 117, 0, 5,\n // 5, \"get_high\"\n 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0,\n // section \"code\"\n 10, 191, 1, 6,\n // 0, \"get_high\"\n 4, 0, 35, 0, 11,\n // 1, \"mul\"\n 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173,\n 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0,\n 32, 4, 167, 11,\n // 2, \"div_s\"\n 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173,\n 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0,\n 32, 4, 167, 11,\n // 3, \"div_u\"\n 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173,\n 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0,\n 32, 4, 167, 11,\n // 4, \"rem_s\"\n 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173,\n 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0,\n 32, 4, 167, 11,\n // 5, \"rem_u\"\n 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173,\n 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0,\n 32, 4, 167, 11,\n ]),\n ),\n {},\n ).exports;\n } catch {\n // no wasm support :(\n }\n\n /**\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\n * See the from* functions below for more convenient ways of constructing Longs.\n * @exports Long\n * @class A Long class for representing a 64 bit two's-complement integer value.\n * @param {number} low The low (signed) 32 bits of the long\n * @param {number} high The high (signed) 32 bits of the long\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @constructor\n */\n function Long(low, high, unsigned) {\n /**\n * The low 32 bits as a signed value.\n * @type {number}\n */\n this.low = low | 0;\n\n /**\n * The high 32 bits as a signed value.\n * @type {number}\n */\n this.high = high | 0;\n\n /**\n * Whether unsigned or not.\n * @type {boolean}\n */\n this.unsigned = !!unsigned;\n }\n\n // The internal representation of a long is the two given signed, 32-bit values.\n // We use 32-bit pieces because these are the size of integers on which\n // Javascript performs bit-operations. For operations like addition and\n // multiplication, we split each number into 16 bit pieces, which can easily be\n // multiplied within Javascript's floating-point representation without overflow\n // or change in sign.\n //\n // In the algorithms below, we frequently reduce the negative case to the\n // positive case by negating the input(s) and then post-processing the result.\n // Note that we must ALWAYS check specially whether those values are MIN_VALUE\n // (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n // a positive number, it overflows back into a negative). Not handling this\n // case would often result in infinite recursion.\n //\n // Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\n // methods on which they depend.\n\n /**\n * An indicator used to reliably determine if an object is a Long or not.\n * @type {boolean}\n * @const\n * @private\n */\n Long.prototype.__isLong__;\n Object.defineProperty(Long.prototype, \"__isLong__\", {\n value: true,\n });\n\n /**\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n * @inner\n */\n function isLong(obj) {\n return (obj && obj[\"__isLong__\"]) === true;\n }\n\n /**\n * @function\n * @param {*} value number\n * @returns {number}\n * @inner\n */\n function ctz32(value) {\n var c = Math.clz32(value & -value);\n return value ? 31 - c : c;\n }\n\n /**\n * Tests if the specified object is a Long.\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n */\n Long.isLong = isLong;\n\n /**\n * A cache of the Long representations of small integer values.\n * @type {!Object}\n * @inner\n */\n var INT_CACHE = {};\n\n /**\n * A cache of the Long representations of small unsigned integer values.\n * @type {!Object}\n * @inner\n */\n var UINT_CACHE = {};\n\n /**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\n function fromInt(value, unsigned) {\n var obj, cachedObj, cache;\n if (unsigned) {\n value >>>= 0;\n if ((cache = 0 <= value && value < 256)) {\n cachedObj = UINT_CACHE[value];\n if (cachedObj) return cachedObj;\n }\n obj = fromBits(value, 0, true);\n if (cache) UINT_CACHE[value] = obj;\n return obj;\n } else {\n value |= 0;\n if ((cache = -128 <= value && value < 128)) {\n cachedObj = INT_CACHE[value];\n if (cachedObj) return cachedObj;\n }\n obj = fromBits(value, value < 0 ? -1 : 0, false);\n if (cache) INT_CACHE[value] = obj;\n return obj;\n }\n }\n\n /**\n * Returns a Long representing the given 32 bit integer value.\n * @function\n * @param {number} value The 32 bit integer in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\n Long.fromInt = fromInt;\n\n /**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\n function fromNumber(value, unsigned) {\n if (isNaN(value)) return unsigned ? UZERO : ZERO;\n if (unsigned) {\n if (value < 0) return UZERO;\n if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE;\n } else {\n if (value <= -TWO_PWR_63_DBL) return MIN_VALUE;\n if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE;\n }\n if (value < 0) return fromNumber(-value, unsigned).neg();\n return fromBits(\n value % TWO_PWR_32_DBL | 0,\n (value / TWO_PWR_32_DBL) | 0,\n unsigned,\n );\n }\n\n /**\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\n * @function\n * @param {number} value The number in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\n Long.fromNumber = fromNumber;\n\n /**\n * @param {number} lowBits\n * @param {number} highBits\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\n function fromBits(lowBits, highBits, unsigned) {\n return new Long(lowBits, highBits, unsigned);\n }\n\n /**\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\n * assumed to use 32 bits.\n * @function\n * @param {number} lowBits The low 32 bits\n * @param {number} highBits The high 32 bits\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\n Long.fromBits = fromBits;\n\n /**\n * @function\n * @param {number} base\n * @param {number} exponent\n * @returns {number}\n * @inner\n */\n var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\n\n /**\n * @param {string} str\n * @param {(boolean|number)=} unsigned\n * @param {number=} radix\n * @returns {!Long}\n * @inner\n */\n function fromString(str, unsigned, radix) {\n if (str.length === 0) throw Error(\"empty string\");\n if (typeof unsigned === \"number\") {\n // For goog.math.long compatibility\n radix = unsigned;\n unsigned = false;\n } else {\n unsigned = !!unsigned;\n }\n if (\n str === \"NaN\" ||\n str === \"Infinity\" ||\n str === \"+Infinity\" ||\n str === \"-Infinity\"\n )\n return unsigned ? UZERO : ZERO;\n radix = radix || 10;\n if (radix < 2 || 36 < radix) throw RangeError(\"radix\");\n var p;\n if ((p = str.indexOf(\"-\")) > 0) throw Error(\"interior hyphen\");\n else if (p === 0) {\n return fromString(str.substring(1), unsigned, radix).neg();\n }\n\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 8));\n var result = ZERO;\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i),\n value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = fromNumber(pow_dbl(radix, size));\n result = result.mul(power).add(fromNumber(value));\n } else {\n result = result.mul(radixToPower);\n result = result.add(fromNumber(value));\n }\n }\n result.unsigned = unsigned;\n return result;\n }\n\n /**\n * Returns a Long representation of the given string, written using the specified radix.\n * @function\n * @param {string} str The textual representation of the Long\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\n * @returns {!Long} The corresponding Long value\n */\n Long.fromString = fromString;\n\n /**\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\n function fromValue(val, unsigned) {\n if (typeof val === \"number\") return fromNumber(val, unsigned);\n if (typeof val === \"string\") return fromString(val, unsigned);\n // Throws for non-objects, converts non-instanceof Long:\n return fromBits(\n val.low,\n val.high,\n typeof unsigned === \"boolean\" ? unsigned : val.unsigned,\n );\n }\n\n /**\n * Converts the specified value to a Long using the appropriate from* function for its type.\n * @function\n * @param {!Long|number|bigint|string|!{low: number, high: number, unsigned: boolean}} val Value\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long}\n */\n Long.fromValue = fromValue;\n\n // NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\n // no runtime penalty for these.\n\n /**\n * @type {number}\n * @const\n * @inner\n */\n var TWO_PWR_16_DBL = 1 << 16;\n\n /**\n * @type {number}\n * @const\n * @inner\n */\n var TWO_PWR_24_DBL = 1 << 24;\n\n /**\n * @type {number}\n * @const\n * @inner\n */\n var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\n\n /**\n * @type {number}\n * @const\n * @inner\n */\n var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\n\n /**\n * @type {number}\n * @const\n * @inner\n */\n var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\n\n /**\n * @type {!Long}\n * @const\n * @inner\n */\n var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\n\n /**\n * @type {!Long}\n * @inner\n */\n var ZERO = fromInt(0);\n\n /**\n * Signed zero.\n * @type {!Long}\n */\n Long.ZERO = ZERO;\n\n /**\n * @type {!Long}\n * @inner\n */\n var UZERO = fromInt(0, true);\n\n /**\n * Unsigned zero.\n * @type {!Long}\n */\n Long.UZERO = UZERO;\n\n /**\n * @type {!Long}\n * @inner\n */\n var ONE = fromInt(1);\n\n /**\n * Signed one.\n * @type {!Long}\n */\n Long.ONE = ONE;\n\n /**\n * @type {!Long}\n * @inner\n */\n var UONE = fromInt(1, true);\n\n /**\n * Unsigned one.\n * @type {!Long}\n */\n Long.UONE = UONE;\n\n /**\n * @type {!Long}\n * @inner\n */\n var NEG_ONE = fromInt(-1);\n\n /**\n * Signed negative one.\n * @type {!Long}\n */\n Long.NEG_ONE = NEG_ONE;\n\n /**\n * @type {!Long}\n * @inner\n */\n var MAX_VALUE = fromBits(0xffffffff | 0, 0x7fffffff | 0, false);\n\n /**\n * Maximum signed value.\n * @type {!Long}\n */\n Long.MAX_VALUE = MAX_VALUE;\n\n /**\n * @type {!Long}\n * @inner\n */\n var MAX_UNSIGNED_VALUE = fromBits(0xffffffff | 0, 0xffffffff | 0, true);\n\n /**\n * Maximum unsigned value.\n * @type {!Long}\n */\n Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\n\n /**\n * @type {!Long}\n * @inner\n */\n var MIN_VALUE = fromBits(0, 0x80000000 | 0, false);\n\n /**\n * Minimum signed value.\n * @type {!Long}\n */\n Long.MIN_VALUE = MIN_VALUE;\n\n /**\n * @alias Long.prototype\n * @inner\n */\n var LongPrototype = Long.prototype;\n\n /**\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\n * @this {!Long}\n * @returns {number}\n */\n LongPrototype.toInt = function toInt() {\n return this.unsigned ? this.low >>> 0 : this.low;\n };\n\n /**\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\n * @this {!Long}\n * @returns {number}\n */\n LongPrototype.toNumber = function toNumber() {\n if (this.unsigned)\n return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0);\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\n };\n\n /**\n * Converts the Long to a string written in the specified radix.\n * @this {!Long}\n * @param {number=} radix Radix (2-36), defaults to 10\n * @returns {string}\n * @override\n * @throws {RangeError} If `radix` is out of range\n */\n LongPrototype.toString = function toString(radix) {\n radix = radix || 10;\n if (radix < 2 || 36 < radix) throw RangeError(\"radix\");\n if (this.isZero()) return \"0\";\n if (this.isNegative()) {\n // Unsigned Longs are never negative\n if (this.eq(MIN_VALUE)) {\n // We need to change the Long value before it can be negated, so we remove\n // the bottom-most digit in this base and then recurse to do the rest.\n var radixLong = fromNumber(radix),\n div = this.div(radixLong),\n rem1 = div.mul(radixLong).sub(this);\n return div.toString(radix) + rem1.toInt().toString(radix);\n } else return \"-\" + this.neg().toString(radix);\n }\n\n // Do several (6) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\n rem = this;\n var result = \"\";\n while (true) {\n var remDiv = rem.div(radixToPower),\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\n digits = intval.toString(radix);\n rem = remDiv;\n if (rem.isZero()) return digits + result;\n else {\n while (digits.length < 6) digits = \"0\" + digits;\n result = \"\" + digits + result;\n }\n }\n };\n\n /**\n * Gets the high 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed high bits\n */\n LongPrototype.getHighBits = function getHighBits() {\n return this.high;\n };\n\n /**\n * Gets the high 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned high bits\n */\n LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\n return this.high >>> 0;\n };\n\n /**\n * Gets the low 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed low bits\n */\n LongPrototype.getLowBits = function getLowBits() {\n return this.low;\n };\n\n /**\n * Gets the low 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned low bits\n */\n LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\n return this.low >>> 0;\n };\n\n /**\n * Gets the number of bits needed to represent the absolute value of this Long.\n * @this {!Long}\n * @returns {number}\n */\n LongPrototype.getNumBitsAbs = function getNumBitsAbs() {\n if (this.isNegative())\n // Unsigned Longs are never negative\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\n var val = this.high != 0 ? this.high : this.low;\n for (var bit = 31; bit > 0; bit--) if ((val & (1 << bit)) != 0) break;\n return this.high != 0 ? bit + 33 : bit + 1;\n };\n\n /**\n * Tests if this Long can be safely represented as a JavaScript number.\n * @this {!Long}\n * @returns {boolean}\n */\n LongPrototype.isSafeInteger = function isSafeInteger() {\n // 2^53-1 is the maximum safe value\n var top11Bits = this.high >> 21;\n // [0, 2^53-1]\n if (!top11Bits) return true;\n // > 2^53-1\n if (this.unsigned) return false;\n // [-2^53, -1] except -2^53\n return top11Bits === -1 && !(this.low === 0 && this.high === -0x200000);\n };\n\n /**\n * Tests if this Long's value equals zero.\n * @this {!Long}\n * @returns {boolean}\n */\n LongPrototype.isZero = function isZero() {\n return this.high === 0 && this.low === 0;\n };\n\n /**\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\n * @returns {boolean}\n */\n LongPrototype.eqz = LongPrototype.isZero;\n\n /**\n * Tests if this Long's value is negative.\n * @this {!Long}\n * @returns {boolean}\n */\n LongPrototype.isNegative = function isNegative() {\n return !this.unsigned && this.high < 0;\n };\n\n /**\n * Tests if this Long's value is positive or zero.\n * @this {!Long}\n * @returns {boolean}\n */\n LongPrototype.isPositive = function isPositive() {\n return this.unsigned || this.high >= 0;\n };\n\n /**\n * Tests if this Long's value is odd.\n * @this {!Long}\n * @returns {boolean}\n */\n LongPrototype.isOdd = function isOdd() {\n return (this.low & 1) === 1;\n };\n\n /**\n * Tests if this Long's value is even.\n * @this {!Long}\n * @returns {boolean}\n */\n LongPrototype.isEven = function isEven() {\n return (this.low & 1) === 0;\n };\n\n /**\n * Tests if this Long's value equals the specified's.\n * @this {!Long}\n * @param {!Long|number|bigint|string} other Other value\n * @returns {boolean}\n */\n LongPrototype.equals = function equals(other) {\n if (!isLong(other)) other = fromValue(other);\n if (\n this.unsigned !== other.unsigned &&\n this.high >>> 31 === 1 &&\n other.high >>> 31 === 1\n )\n return false;\n return this.high === other.high && this.low === other.low;\n };\n\n /**\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\n * @function\n * @param {!Long|number|bigint|string} other Other value\n * @returns {boolean}\n */\n LongPrototype.eq = LongPrototype.equals;\n\n /**\n * Tests if this Long's value differs from the specified's.\n * @this {!Long}\n * @param {!Long|number|bigint|string} other Other value\n * @returns {boolean}\n */\n LongPrototype.notEquals = function notEquals(other) {\n return !this.eq(/* validates */ other);\n };\n\n /**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|bigint|string} other Other value\n * @returns {boolean}\n */\n LongPrototype.neq = LongPrototype.notEquals;\n\n /**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|bigint|string} other Other value\n * @returns {boolean}\n */\n LongPrototype.ne = LongPrototype.notEquals;\n\n /**\n * Tests if this Long's value is less than the specified's.\n * @this {!Long}\n * @param {!Long|number|bigint|string} other Other value\n * @returns {boolean}\n */\n LongPrototype.lessThan = function lessThan(other) {\n return this.comp(/* validates */ other) < 0;\n };\n\n /**\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\n * @function\n * @param {!Long|number|bigint|string} other Other value\n * @returns {boolean}\n */\n LongPrototype.lt = LongPrototype.lessThan;\n\n /**\n * Tests if this Long's value is less than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|bigint|string} other Other value\n * @returns {boolean}\n */\n LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\n return this.comp(/* validates */ other) <= 0;\n };\n\n /**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|bigint|string} other Other value\n * @returns {boolean}\n */\n LongPrototype.lte = LongPrototype.lessThanOrEqual;\n\n /**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|bigint|string} other Other value\n * @returns {boolean}\n */\n LongPrototype.le = LongPrototype.lessThanOrEqual;\n\n /**\n * Tests if this Long's value is greater than the specified's.\n * @this {!Long}\n * @param {!Long|number|bigint|string} other Other value\n * @returns {boolean}\n */\n LongPrototype.greaterThan = function greaterThan(other) {\n return this.comp(/* validates */ other) > 0;\n };\n\n /**\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\n * @function\n * @param {!Long|number|bigint|string} other Other value\n * @returns {boolean}\n */\n LongPrototype.gt = LongPrototype.greaterThan;\n\n /**\n * Tests if this Long's value is greater than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|bigint|string} other Other value\n * @returns {boolean}\n */\n LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\n return this.comp(/* validates */ other) >= 0;\n };\n\n /**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|bigint|string} other Other value\n * @returns {boolean}\n */\n LongPrototype.gte = LongPrototype.greaterThanOrEqual;\n\n /**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|bigint|string} other Other value\n * @returns {boolean}\n */\n LongPrototype.ge = LongPrototype.greaterThanOrEqual;\n\n /**\n * Compares this Long's value with the specified's.\n * @this {!Long}\n * @param {!Long|number|bigint|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\n LongPrototype.compare = function compare(other) {\n if (!isLong(other)) other = fromValue(other);\n if (this.eq(other)) return 0;\n var thisNeg = this.isNegative(),\n otherNeg = other.isNegative();\n if (thisNeg && !otherNeg) return -1;\n if (!thisNeg && otherNeg) return 1;\n // At this point the sign bits are the same\n if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1;\n // Both are positive if at least one is unsigned\n return other.high >>> 0 > this.high >>> 0 ||\n (other.high === this.high && other.low >>> 0 > this.low >>> 0)\n ? -1\n : 1;\n };\n\n /**\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\n * @function\n * @param {!Long|number|bigint|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\n LongPrototype.comp = LongPrototype.compare;\n\n /**\n * Negates this Long's value.\n * @this {!Long}\n * @returns {!Long} Negated Long\n */\n LongPrototype.negate = function negate() {\n if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE;\n return this.not().add(ONE);\n };\n\n /**\n * Negates this Long's value. This is an alias of {@link Long#negate}.\n * @function\n * @returns {!Long} Negated Long\n */\n LongPrototype.neg = LongPrototype.negate;\n\n /**\n * Returns the sum of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|bigint|string} addend Addend\n * @returns {!Long} Sum\n */\n LongPrototype.add = function add(addend) {\n if (!isLong(addend)) addend = fromValue(addend);\n\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n\n var a48 = this.high >>> 16;\n var a32 = this.high & 0xffff;\n var a16 = this.low >>> 16;\n var a00 = this.low & 0xffff;\n var b48 = addend.high >>> 16;\n var b32 = addend.high & 0xffff;\n var b16 = addend.low >>> 16;\n var b00 = addend.low & 0xffff;\n var c48 = 0,\n c32 = 0,\n c16 = 0,\n c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 0xffff;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 0xffff;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 0xffff;\n c48 += a48 + b48;\n c48 &= 0xffff;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\n };\n\n /**\n * Returns the difference of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|bigint|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\n LongPrototype.subtract = function subtract(subtrahend) {\n if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend);\n return this.add(subtrahend.neg());\n };\n\n /**\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\n * @function\n * @param {!Long|number|bigint|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\n LongPrototype.sub = LongPrototype.subtract;\n\n /**\n * Returns the product of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|bigint|string} multiplier Multiplier\n * @returns {!Long} Product\n */\n LongPrototype.multiply = function multiply(multiplier) {\n if (this.isZero()) return this;\n if (!isLong(multiplier)) multiplier = fromValue(multiplier);\n\n // use wasm support if present\n if (wasm) {\n var low = wasm[\"mul\"](\n this.low,\n this.high,\n multiplier.low,\n multiplier.high,\n );\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n if (multiplier.isZero()) return this.unsigned ? UZERO : ZERO;\n if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO;\n if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO;\n if (this.isNegative()) {\n if (multiplier.isNegative()) return this.neg().mul(multiplier.neg());\n else return this.neg().mul(multiplier).neg();\n } else if (multiplier.isNegative())\n return this.mul(multiplier.neg()).neg();\n\n // If both longs are small, use float multiplication\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\n return fromNumber(\n this.toNumber() * multiplier.toNumber(),\n this.unsigned,\n );\n\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n // We can skip products that would overflow.\n\n var a48 = this.high >>> 16;\n var a32 = this.high & 0xffff;\n var a16 = this.low >>> 16;\n var a00 = this.low & 0xffff;\n var b48 = multiplier.high >>> 16;\n var b32 = multiplier.high & 0xffff;\n var b16 = multiplier.low >>> 16;\n var b00 = multiplier.low & 0xffff;\n var c48 = 0,\n c32 = 0,\n c16 = 0,\n c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 0xffff;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 0xffff;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 0xffff;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 0xffff;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 0xffff;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 0xffff;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 0xffff;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\n };\n\n /**\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\n * @function\n * @param {!Long|number|bigint|string} multiplier Multiplier\n * @returns {!Long} Product\n */\n LongPrototype.mul = LongPrototype.multiply;\n\n /**\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\n * unsigned if this Long is unsigned.\n * @this {!Long}\n * @param {!Long|number|bigint|string} divisor Divisor\n * @returns {!Long} Quotient\n */\n LongPrototype.divide = function divide(divisor) {\n if (!isLong(divisor)) divisor = fromValue(divisor);\n if (divisor.isZero()) throw Error(\"division by zero\");\n\n // use wasm support if present\n if (wasm) {\n // guard against signed division overflow: the largest\n // negative number / -1 would be 1 larger than the largest\n // positive number, due to two's complement.\n if (\n !this.unsigned &&\n this.high === -0x80000000 &&\n divisor.low === -1 &&\n divisor.high === -1\n ) {\n // be consistent with non-wasm code path\n return this;\n }\n var low = (this.unsigned ? wasm[\"div_u\"] : wasm[\"div_s\"])(\n this.low,\n this.high,\n divisor.low,\n divisor.high,\n );\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n if (this.isZero()) return this.unsigned ? UZERO : ZERO;\n var approx, rem, res;\n if (!this.unsigned) {\n // This section is only relevant for signed longs and is derived from the\n // closure library as a whole.\n if (this.eq(MIN_VALUE)) {\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\n else if (divisor.eq(MIN_VALUE)) return ONE;\n else {\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n var halfThis = this.shr(1);\n approx = halfThis.div(divisor).shl(1);\n if (approx.eq(ZERO)) {\n return divisor.isNegative() ? ONE : NEG_ONE;\n } else {\n rem = this.sub(divisor.mul(approx));\n res = approx.add(rem.div(divisor));\n return res;\n }\n }\n } else if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO;\n if (this.isNegative()) {\n if (divisor.isNegative()) return this.neg().div(divisor.neg());\n return this.neg().div(divisor).neg();\n } else if (divisor.isNegative()) return this.div(divisor.neg()).neg();\n res = ZERO;\n } else {\n // The algorithm below has not been made for unsigned longs. It's therefore\n // required to take special care of the MSB prior to running it.\n if (!divisor.unsigned) divisor = divisor.toUnsigned();\n if (divisor.gt(this)) return UZERO;\n if (divisor.gt(this.shru(1)))\n // 15 >>> 1 = 7 ; with divisor = 8 ; true\n return UONE;\n res = UZERO;\n }\n\n // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n rem = this;\n while (rem.gte(divisor)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\n\n // We will tweak the approximate result by changing it in the 48-th digit or\n // the smallest non-fractional digit, whichever is larger.\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\n delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48),\n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n approxRes = fromNumber(approx),\n approxRem = approxRes.mul(divisor);\n while (approxRem.isNegative() || approxRem.gt(rem)) {\n approx -= delta;\n approxRes = fromNumber(approx, this.unsigned);\n approxRem = approxRes.mul(divisor);\n }\n\n // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n if (approxRes.isZero()) approxRes = ONE;\n res = res.add(approxRes);\n rem = rem.sub(approxRem);\n }\n return res;\n };\n\n /**\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\n * @function\n * @param {!Long|number|bigint|string} divisor Divisor\n * @returns {!Long} Quotient\n */\n LongPrototype.div = LongPrototype.divide;\n\n /**\n * Returns this Long modulo the specified.\n * @this {!Long}\n * @param {!Long|number|bigint|string} divisor Divisor\n * @returns {!Long} Remainder\n */\n LongPrototype.modulo = function modulo(divisor) {\n if (!isLong(divisor)) divisor = fromValue(divisor);\n\n // use wasm support if present\n if (wasm) {\n var low = (this.unsigned ? wasm[\"rem_u\"] : wasm[\"rem_s\"])(\n this.low,\n this.high,\n divisor.low,\n divisor.high,\n );\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n return this.sub(this.div(divisor).mul(divisor));\n };\n\n /**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|bigint|string} divisor Divisor\n * @returns {!Long} Remainder\n */\n LongPrototype.mod = LongPrototype.modulo;\n\n /**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|bigint|string} divisor Divisor\n * @returns {!Long} Remainder\n */\n LongPrototype.rem = LongPrototype.modulo;\n\n /**\n * Returns the bitwise NOT of this Long.\n * @this {!Long}\n * @returns {!Long}\n */\n LongPrototype.not = function not() {\n return fromBits(~this.low, ~this.high, this.unsigned);\n };\n\n /**\n * Returns count leading zeros of this Long.\n * @this {!Long}\n * @returns {!number}\n */\n LongPrototype.countLeadingZeros = function countLeadingZeros() {\n return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32;\n };\n\n /**\n * Returns count leading zeros. This is an alias of {@link Long#countLeadingZeros}.\n * @function\n * @param {!Long}\n * @returns {!number}\n */\n LongPrototype.clz = LongPrototype.countLeadingZeros;\n\n /**\n * Returns count trailing zeros of this Long.\n * @this {!Long}\n * @returns {!number}\n */\n LongPrototype.countTrailingZeros = function countTrailingZeros() {\n return this.low ? ctz32(this.low) : ctz32(this.high) + 32;\n };\n\n /**\n * Returns count trailing zeros. This is an alias of {@link Long#countTrailingZeros}.\n * @function\n * @param {!Long}\n * @returns {!number}\n */\n LongPrototype.ctz = LongPrototype.countTrailingZeros;\n\n /**\n * Returns the bitwise AND of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|bigint|string} other Other Long\n * @returns {!Long}\n */\n LongPrototype.and = function and(other) {\n if (!isLong(other)) other = fromValue(other);\n return fromBits(\n this.low & other.low,\n this.high & other.high,\n this.unsigned,\n );\n };\n\n /**\n * Returns the bitwise OR of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|bigint|string} other Other Long\n * @returns {!Long}\n */\n LongPrototype.or = function or(other) {\n if (!isLong(other)) other = fromValue(other);\n return fromBits(\n this.low | other.low,\n this.high | other.high,\n this.unsigned,\n );\n };\n\n /**\n * Returns the bitwise XOR of this Long and the given one.\n * @this {!Long}\n * @param {!Long|number|bigint|string} other Other Long\n * @returns {!Long}\n */\n LongPrototype.xor = function xor(other) {\n if (!isLong(other)) other = fromValue(other);\n return fromBits(\n this.low ^ other.low,\n this.high ^ other.high,\n this.unsigned,\n );\n };\n\n /**\n * Returns this Long with bits shifted to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n LongPrototype.shiftLeft = function shiftLeft(numBits) {\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n else if (numBits < 32)\n return fromBits(\n this.low << numBits,\n (this.high << numBits) | (this.low >>> (32 - numBits)),\n this.unsigned,\n );\n else return fromBits(0, this.low << (numBits - 32), this.unsigned);\n };\n\n /**\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n LongPrototype.shl = LongPrototype.shiftLeft;\n\n /**\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n LongPrototype.shiftRight = function shiftRight(numBits) {\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n else if (numBits < 32)\n return fromBits(\n (this.low >>> numBits) | (this.high << (32 - numBits)),\n this.high >> numBits,\n this.unsigned,\n );\n else\n return fromBits(\n this.high >> (numBits - 32),\n this.high >= 0 ? 0 : -1,\n this.unsigned,\n );\n };\n\n /**\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n LongPrototype.shr = LongPrototype.shiftRight;\n\n /**\n * Returns this Long with bits logically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits < 32)\n return fromBits(\n (this.low >>> numBits) | (this.high << (32 - numBits)),\n this.high >>> numBits,\n this.unsigned,\n );\n if (numBits === 32) return fromBits(this.high, 0, this.unsigned);\n return fromBits(this.high >>> (numBits - 32), 0, this.unsigned);\n };\n\n /**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n LongPrototype.shru = LongPrototype.shiftRightUnsigned;\n\n /**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n LongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\n\n /**\n * Returns this Long with bits rotated to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\n LongPrototype.rotateLeft = function rotateLeft(numBits) {\n var b;\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = 32 - numBits;\n return fromBits(\n (this.low << numBits) | (this.high >>> b),\n (this.high << numBits) | (this.low >>> b),\n this.unsigned,\n );\n }\n numBits -= 32;\n b = 32 - numBits;\n return fromBits(\n (this.high << numBits) | (this.low >>> b),\n (this.low << numBits) | (this.high >>> b),\n this.unsigned,\n );\n };\n /**\n * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\n LongPrototype.rotl = LongPrototype.rotateLeft;\n\n /**\n * Returns this Long with bits rotated to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\n LongPrototype.rotateRight = function rotateRight(numBits) {\n var b;\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = 32 - numBits;\n return fromBits(\n (this.high << b) | (this.low >>> numBits),\n (this.low << b) | (this.high >>> numBits),\n this.unsigned,\n );\n }\n numBits -= 32;\n b = 32 - numBits;\n return fromBits(\n (this.low << b) | (this.high >>> numBits),\n (this.high << b) | (this.low >>> numBits),\n this.unsigned,\n );\n };\n /**\n * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\n LongPrototype.rotr = LongPrototype.rotateRight;\n\n /**\n * Converts this Long to signed.\n * @this {!Long}\n * @returns {!Long} Signed long\n */\n LongPrototype.toSigned = function toSigned() {\n if (!this.unsigned) return this;\n return fromBits(this.low, this.high, false);\n };\n\n /**\n * Converts this Long to unsigned.\n * @this {!Long}\n * @returns {!Long} Unsigned long\n */\n LongPrototype.toUnsigned = function toUnsigned() {\n if (this.unsigned) return this;\n return fromBits(this.low, this.high, true);\n };\n\n /**\n * Converts this Long to its byte representation.\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @this {!Long}\n * @returns {!Array.} Byte representation\n */\n LongPrototype.toBytes = function toBytes(le) {\n return le ? this.toBytesLE() : this.toBytesBE();\n };\n\n /**\n * Converts this Long to its little endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Little endian byte representation\n */\n LongPrototype.toBytesLE = function toBytesLE() {\n var hi = this.high,\n lo = this.low;\n return [\n lo & 0xff,\n (lo >>> 8) & 0xff,\n (lo >>> 16) & 0xff,\n lo >>> 24,\n hi & 0xff,\n (hi >>> 8) & 0xff,\n (hi >>> 16) & 0xff,\n hi >>> 24,\n ];\n };\n\n /**\n * Converts this Long to its big endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Big endian byte representation\n */\n LongPrototype.toBytesBE = function toBytesBE() {\n var hi = this.high,\n lo = this.low;\n return [\n hi >>> 24,\n (hi >>> 16) & 0xff,\n (hi >>> 8) & 0xff,\n hi & 0xff,\n lo >>> 24,\n (lo >>> 16) & 0xff,\n (lo >>> 8) & 0xff,\n lo & 0xff,\n ];\n };\n\n /**\n * Creates a Long from its byte representation.\n * @param {!Array.} bytes Byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @returns {Long} The corresponding Long value\n */\n Long.fromBytes = function fromBytes(bytes, unsigned, le) {\n return le\n ? Long.fromBytesLE(bytes, unsigned)\n : Long.fromBytesBE(bytes, unsigned);\n };\n\n /**\n * Creates a Long from its little endian byte representation.\n * @param {!Array.} bytes Little endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\n Long.fromBytesLE = function fromBytesLE(bytes, unsigned) {\n return new Long(\n bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24),\n bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24),\n unsigned,\n );\n };\n\n /**\n * Creates a Long from its big endian byte representation.\n * @param {!Array.} bytes Big endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\n Long.fromBytesBE = function fromBytesBE(bytes, unsigned) {\n return new Long(\n (bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7],\n (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3],\n unsigned,\n );\n };\n\n // Support conversion to/from BigInt where available\n if (typeof BigInt === \"function\") {\n /**\n * Returns a Long representing the given big integer.\n * @function\n * @param {number} value The big integer value\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\n Long.fromBigInt = function fromBigInt(value, unsigned) {\n var lowBits = Number(BigInt.asIntN(32, value));\n var highBits = Number(BigInt.asIntN(32, value >> BigInt(32)));\n return fromBits(lowBits, highBits, unsigned);\n };\n\n // Override\n Long.fromValue = function fromValueWithBigInt(value, unsigned) {\n if (typeof value === \"bigint\") return Long.fromBigInt(value, unsigned);\n return fromValue(value, unsigned);\n };\n\n /**\n * Converts the Long to its big integer representation.\n * @this {!Long}\n * @returns {bigint}\n */\n LongPrototype.toBigInt = function toBigInt() {\n var lowBigInt = BigInt(this.low >>> 0);\n var highBigInt = BigInt(this.unsigned ? this.high >>> 0 : this.high);\n return (highBigInt << BigInt(32)) | lowBigInt;\n };\n }\n var _default = (_exports.default = Long);\n },\n);\n","\"use strict\";\n/**\n * @license\n * Copyright 2018 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.loadFileDescriptorSetFromObject = exports.loadFileDescriptorSetFromBuffer = exports.fromJSON = exports.loadSync = exports.load = exports.IdempotencyLevel = exports.isAnyExtension = exports.Long = void 0;\nconst camelCase = require(\"lodash.camelcase\");\nconst Protobuf = require(\"protobufjs\");\nconst descriptor = require(\"protobufjs/ext/descriptor\");\nconst util_1 = require(\"./util\");\nconst Long = require(\"long\");\nexports.Long = Long;\nfunction isAnyExtension(obj) {\n return ('@type' in obj) && (typeof obj['@type'] === 'string');\n}\nexports.isAnyExtension = isAnyExtension;\nvar IdempotencyLevel;\n(function (IdempotencyLevel) {\n IdempotencyLevel[\"IDEMPOTENCY_UNKNOWN\"] = \"IDEMPOTENCY_UNKNOWN\";\n IdempotencyLevel[\"NO_SIDE_EFFECTS\"] = \"NO_SIDE_EFFECTS\";\n IdempotencyLevel[\"IDEMPOTENT\"] = \"IDEMPOTENT\";\n})(IdempotencyLevel = exports.IdempotencyLevel || (exports.IdempotencyLevel = {}));\nconst descriptorOptions = {\n longs: String,\n enums: String,\n bytes: String,\n defaults: true,\n oneofs: true,\n json: true,\n};\nfunction joinName(baseName, name) {\n if (baseName === '') {\n return name;\n }\n else {\n return baseName + '.' + name;\n }\n}\nfunction isHandledReflectionObject(obj) {\n return (obj instanceof Protobuf.Service ||\n obj instanceof Protobuf.Type ||\n obj instanceof Protobuf.Enum);\n}\nfunction isNamespaceBase(obj) {\n return obj instanceof Protobuf.Namespace || obj instanceof Protobuf.Root;\n}\nfunction getAllHandledReflectionObjects(obj, parentName) {\n const objName = joinName(parentName, obj.name);\n if (isHandledReflectionObject(obj)) {\n return [[objName, obj]];\n }\n else {\n if (isNamespaceBase(obj) && typeof obj.nested !== 'undefined') {\n return Object.keys(obj.nested)\n .map(name => {\n return getAllHandledReflectionObjects(obj.nested[name], objName);\n })\n .reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);\n }\n }\n return [];\n}\nfunction createDeserializer(cls, options) {\n return function deserialize(argBuf) {\n return cls.toObject(cls.decode(argBuf), options);\n };\n}\nfunction createSerializer(cls) {\n return function serialize(arg) {\n if (Array.isArray(arg)) {\n throw new Error(`Failed to serialize message: expected object with ${cls.name} structure, got array instead`);\n }\n const message = cls.fromObject(arg);\n return cls.encode(message).finish();\n };\n}\nfunction mapMethodOptions(options) {\n return (options || []).reduce((obj, item) => {\n for (const [key, value] of Object.entries(item)) {\n switch (key) {\n case 'uninterpreted_option':\n obj.uninterpreted_option.push(item.uninterpreted_option);\n break;\n default:\n obj[key] = value;\n }\n }\n return obj;\n }, {\n deprecated: false,\n idempotency_level: IdempotencyLevel.IDEMPOTENCY_UNKNOWN,\n uninterpreted_option: [],\n });\n}\nfunction createMethodDefinition(method, serviceName, options, fileDescriptors) {\n /* This is only ever called after the corresponding root.resolveAll(), so we\n * can assume that the resolved request and response types are non-null */\n const requestType = method.resolvedRequestType;\n const responseType = method.resolvedResponseType;\n return {\n path: '/' + serviceName + '/' + method.name,\n requestStream: !!method.requestStream,\n responseStream: !!method.responseStream,\n requestSerialize: createSerializer(requestType),\n requestDeserialize: createDeserializer(requestType, options),\n responseSerialize: createSerializer(responseType),\n responseDeserialize: createDeserializer(responseType, options),\n // TODO(murgatroid99): Find a better way to handle this\n originalName: camelCase(method.name),\n requestType: createMessageDefinition(requestType, fileDescriptors),\n responseType: createMessageDefinition(responseType, fileDescriptors),\n options: mapMethodOptions(method.parsedOptions),\n };\n}\nfunction createServiceDefinition(service, name, options, fileDescriptors) {\n const def = {};\n for (const method of service.methodsArray) {\n def[method.name] = createMethodDefinition(method, name, options, fileDescriptors);\n }\n return def;\n}\nfunction createMessageDefinition(message, fileDescriptors) {\n const messageDescriptor = message.toDescriptor('proto3');\n return {\n format: 'Protocol Buffer 3 DescriptorProto',\n type: messageDescriptor.$type.toObject(messageDescriptor, descriptorOptions),\n fileDescriptorProtos: fileDescriptors,\n };\n}\nfunction createEnumDefinition(enumType, fileDescriptors) {\n const enumDescriptor = enumType.toDescriptor('proto3');\n return {\n format: 'Protocol Buffer 3 EnumDescriptorProto',\n type: enumDescriptor.$type.toObject(enumDescriptor, descriptorOptions),\n fileDescriptorProtos: fileDescriptors,\n };\n}\n/**\n * function createDefinition(obj: Protobuf.Service, name: string, options:\n * Options): ServiceDefinition; function createDefinition(obj: Protobuf.Type,\n * name: string, options: Options): MessageTypeDefinition; function\n * createDefinition(obj: Protobuf.Enum, name: string, options: Options):\n * EnumTypeDefinition;\n */\nfunction createDefinition(obj, name, options, fileDescriptors) {\n if (obj instanceof Protobuf.Service) {\n return createServiceDefinition(obj, name, options, fileDescriptors);\n }\n else if (obj instanceof Protobuf.Type) {\n return createMessageDefinition(obj, fileDescriptors);\n }\n else if (obj instanceof Protobuf.Enum) {\n return createEnumDefinition(obj, fileDescriptors);\n }\n else {\n throw new Error('Type mismatch in reflection object handling');\n }\n}\nfunction createPackageDefinition(root, options) {\n const def = {};\n root.resolveAll();\n const descriptorList = root.toDescriptor('proto3').file;\n const bufferList = descriptorList.map(value => Buffer.from(descriptor.FileDescriptorProto.encode(value).finish()));\n for (const [name, obj] of getAllHandledReflectionObjects(root, '')) {\n def[name] = createDefinition(obj, name, options, bufferList);\n }\n return def;\n}\nfunction createPackageDefinitionFromDescriptorSet(decodedDescriptorSet, options) {\n options = options || {};\n const root = Protobuf.Root.fromDescriptor(decodedDescriptorSet);\n root.resolveAll();\n return createPackageDefinition(root, options);\n}\n/**\n * Load a .proto file with the specified options.\n * @param filename One or multiple file paths to load. Can be an absolute path\n * or relative to an include path.\n * @param options.keepCase Preserve field names. The default is to change them\n * to camel case.\n * @param options.longs The type that should be used to represent `long` values.\n * Valid options are `Number` and `String`. Defaults to a `Long` object type\n * from a library.\n * @param options.enums The type that should be used to represent `enum` values.\n * The only valid option is `String`. Defaults to the numeric value.\n * @param options.bytes The type that should be used to represent `bytes`\n * values. Valid options are `Array` and `String`. The default is to use\n * `Buffer`.\n * @param options.defaults Set default values on output objects. Defaults to\n * `false`.\n * @param options.arrays Set empty arrays for missing array values even if\n * `defaults` is `false`. Defaults to `false`.\n * @param options.objects Set empty objects for missing object values even if\n * `defaults` is `false`. Defaults to `false`.\n * @param options.oneofs Set virtual oneof properties to the present field's\n * name\n * @param options.json Represent Infinity and NaN as strings in float fields,\n * and automatically decode google.protobuf.Any values.\n * @param options.includeDirs Paths to search for imported `.proto` files.\n */\nfunction load(filename, options) {\n return (0, util_1.loadProtosWithOptions)(filename, options).then(loadedRoot => {\n return createPackageDefinition(loadedRoot, options);\n });\n}\nexports.load = load;\nfunction loadSync(filename, options) {\n const loadedRoot = (0, util_1.loadProtosWithOptionsSync)(filename, options);\n return createPackageDefinition(loadedRoot, options);\n}\nexports.loadSync = loadSync;\nfunction fromJSON(json, options) {\n options = options || {};\n const loadedRoot = Protobuf.Root.fromJSON(json);\n loadedRoot.resolveAll();\n return createPackageDefinition(loadedRoot, options);\n}\nexports.fromJSON = fromJSON;\nfunction loadFileDescriptorSetFromBuffer(descriptorSet, options) {\n const decodedDescriptorSet = descriptor.FileDescriptorSet.decode(descriptorSet);\n return createPackageDefinitionFromDescriptorSet(decodedDescriptorSet, options);\n}\nexports.loadFileDescriptorSetFromBuffer = loadFileDescriptorSetFromBuffer;\nfunction loadFileDescriptorSetFromObject(descriptorSet, options) {\n const decodedDescriptorSet = descriptor.FileDescriptorSet.fromObject(descriptorSet);\n return createPackageDefinitionFromDescriptorSet(decodedDescriptorSet, options);\n}\nexports.loadFileDescriptorSetFromObject = loadFileDescriptorSetFromObject;\n(0, util_1.addCommonProtos)();\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright 2021 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.registerChannelzSocket = exports.registerChannelzServer = exports.registerChannelzSubchannel = exports.registerChannelzChannel = exports.ChannelzCallTrackerStub = exports.ChannelzCallTracker = exports.ChannelzChildrenTrackerStub = exports.ChannelzChildrenTracker = exports.ChannelzTrace = exports.ChannelzTraceStub = void 0;\nexports.unregisterChannelzRef = unregisterChannelzRef;\nexports.getChannelzHandlers = getChannelzHandlers;\nexports.getChannelzServiceDefinition = getChannelzServiceDefinition;\nexports.setup = setup;\nconst net_1 = require(\"net\");\nconst ordered_map_1 = require(\"@js-sdsl/ordered-map\");\nconst connectivity_state_1 = require(\"./connectivity-state\");\nconst constants_1 = require(\"./constants\");\nconst subchannel_address_1 = require(\"./subchannel-address\");\nconst admin_1 = require(\"./admin\");\nconst make_client_1 = require(\"./make-client\");\nfunction channelRefToMessage(ref) {\n return {\n channel_id: ref.id,\n name: ref.name,\n };\n}\nfunction subchannelRefToMessage(ref) {\n return {\n subchannel_id: ref.id,\n name: ref.name,\n };\n}\nfunction serverRefToMessage(ref) {\n return {\n server_id: ref.id,\n };\n}\nfunction socketRefToMessage(ref) {\n return {\n socket_id: ref.id,\n name: ref.name,\n };\n}\n/**\n * The loose upper bound on the number of events that should be retained in a\n * trace. This may be exceeded by up to a factor of 2. Arbitrarily chosen as a\n * number that should be large enough to contain the recent relevant\n * information, but small enough to not use excessive memory.\n */\nconst TARGET_RETAINED_TRACES = 32;\n/**\n * Default number of sockets/servers/channels/subchannels to return\n */\nconst DEFAULT_MAX_RESULTS = 100;\nclass ChannelzTraceStub {\n constructor() {\n this.events = [];\n this.creationTimestamp = new Date();\n this.eventsLogged = 0;\n }\n addTrace() { }\n getTraceMessage() {\n return {\n creation_timestamp: dateToProtoTimestamp(this.creationTimestamp),\n num_events_logged: this.eventsLogged,\n events: [],\n };\n }\n}\nexports.ChannelzTraceStub = ChannelzTraceStub;\nclass ChannelzTrace {\n constructor() {\n this.events = [];\n this.eventsLogged = 0;\n this.creationTimestamp = new Date();\n }\n addTrace(severity, description, child) {\n const timestamp = new Date();\n this.events.push({\n description: description,\n severity: severity,\n timestamp: timestamp,\n childChannel: (child === null || child === void 0 ? void 0 : child.kind) === 'channel' ? child : undefined,\n childSubchannel: (child === null || child === void 0 ? void 0 : child.kind) === 'subchannel' ? child : undefined,\n });\n // Whenever the trace array gets too large, discard the first half\n if (this.events.length >= TARGET_RETAINED_TRACES * 2) {\n this.events = this.events.slice(TARGET_RETAINED_TRACES);\n }\n this.eventsLogged += 1;\n }\n getTraceMessage() {\n return {\n creation_timestamp: dateToProtoTimestamp(this.creationTimestamp),\n num_events_logged: this.eventsLogged,\n events: this.events.map(event => {\n return {\n description: event.description,\n severity: event.severity,\n timestamp: dateToProtoTimestamp(event.timestamp),\n channel_ref: event.childChannel\n ? channelRefToMessage(event.childChannel)\n : null,\n subchannel_ref: event.childSubchannel\n ? subchannelRefToMessage(event.childSubchannel)\n : null,\n };\n }),\n };\n }\n}\nexports.ChannelzTrace = ChannelzTrace;\nclass ChannelzChildrenTracker {\n constructor() {\n this.channelChildren = new ordered_map_1.OrderedMap();\n this.subchannelChildren = new ordered_map_1.OrderedMap();\n this.socketChildren = new ordered_map_1.OrderedMap();\n this.trackerMap = {\n [\"channel\" /* EntityTypes.channel */]: this.channelChildren,\n [\"subchannel\" /* EntityTypes.subchannel */]: this.subchannelChildren,\n [\"socket\" /* EntityTypes.socket */]: this.socketChildren,\n };\n }\n refChild(child) {\n const tracker = this.trackerMap[child.kind];\n const trackedChild = tracker.find(child.id);\n if (trackedChild.equals(tracker.end())) {\n tracker.setElement(child.id, {\n ref: child,\n count: 1,\n }, trackedChild);\n }\n else {\n trackedChild.pointer[1].count += 1;\n }\n }\n unrefChild(child) {\n const tracker = this.trackerMap[child.kind];\n const trackedChild = tracker.getElementByKey(child.id);\n if (trackedChild !== undefined) {\n trackedChild.count -= 1;\n if (trackedChild.count === 0) {\n tracker.eraseElementByKey(child.id);\n }\n }\n }\n getChildLists() {\n return {\n channels: this.channelChildren,\n subchannels: this.subchannelChildren,\n sockets: this.socketChildren,\n };\n }\n}\nexports.ChannelzChildrenTracker = ChannelzChildrenTracker;\nclass ChannelzChildrenTrackerStub extends ChannelzChildrenTracker {\n refChild() { }\n unrefChild() { }\n}\nexports.ChannelzChildrenTrackerStub = ChannelzChildrenTrackerStub;\nclass ChannelzCallTracker {\n constructor() {\n this.callsStarted = 0;\n this.callsSucceeded = 0;\n this.callsFailed = 0;\n this.lastCallStartedTimestamp = null;\n }\n addCallStarted() {\n this.callsStarted += 1;\n this.lastCallStartedTimestamp = new Date();\n }\n addCallSucceeded() {\n this.callsSucceeded += 1;\n }\n addCallFailed() {\n this.callsFailed += 1;\n }\n}\nexports.ChannelzCallTracker = ChannelzCallTracker;\nclass ChannelzCallTrackerStub extends ChannelzCallTracker {\n addCallStarted() { }\n addCallSucceeded() { }\n addCallFailed() { }\n}\nexports.ChannelzCallTrackerStub = ChannelzCallTrackerStub;\nconst entityMaps = {\n [\"channel\" /* EntityTypes.channel */]: new ordered_map_1.OrderedMap(),\n [\"subchannel\" /* EntityTypes.subchannel */]: new ordered_map_1.OrderedMap(),\n [\"server\" /* EntityTypes.server */]: new ordered_map_1.OrderedMap(),\n [\"socket\" /* EntityTypes.socket */]: new ordered_map_1.OrderedMap(),\n};\nconst generateRegisterFn = (kind) => {\n let nextId = 1;\n function getNextId() {\n return nextId++;\n }\n const entityMap = entityMaps[kind];\n return (name, getInfo, channelzEnabled) => {\n const id = getNextId();\n const ref = { id, name, kind };\n if (channelzEnabled) {\n entityMap.setElement(id, { ref, getInfo });\n }\n return ref;\n };\n};\nexports.registerChannelzChannel = generateRegisterFn(\"channel\" /* EntityTypes.channel */);\nexports.registerChannelzSubchannel = generateRegisterFn(\"subchannel\" /* EntityTypes.subchannel */);\nexports.registerChannelzServer = generateRegisterFn(\"server\" /* EntityTypes.server */);\nexports.registerChannelzSocket = generateRegisterFn(\"socket\" /* EntityTypes.socket */);\nfunction unregisterChannelzRef(ref) {\n entityMaps[ref.kind].eraseElementByKey(ref.id);\n}\n/**\n * Parse a single section of an IPv6 address as two bytes\n * @param addressSection A hexadecimal string of length up to 4\n * @returns The pair of bytes representing this address section\n */\nfunction parseIPv6Section(addressSection) {\n const numberValue = Number.parseInt(addressSection, 16);\n return [(numberValue / 256) | 0, numberValue % 256];\n}\n/**\n * Parse a chunk of an IPv6 address string to some number of bytes\n * @param addressChunk Some number of segments of up to 4 hexadecimal\n * characters each, joined by colons.\n * @returns The list of bytes representing this address chunk\n */\nfunction parseIPv6Chunk(addressChunk) {\n if (addressChunk === '') {\n return [];\n }\n const bytePairs = addressChunk\n .split(':')\n .map(section => parseIPv6Section(section));\n const result = [];\n return result.concat(...bytePairs);\n}\nfunction isIPv6MappedIPv4(ipAddress) {\n return (0, net_1.isIPv6)(ipAddress) && ipAddress.toLowerCase().startsWith('::ffff:') && (0, net_1.isIPv4)(ipAddress.substring(7));\n}\n/**\n * Prerequisite: isIPv4(ipAddress)\n * @param ipAddress\n * @returns\n */\nfunction ipv4AddressStringToBuffer(ipAddress) {\n return Buffer.from(Uint8Array.from(ipAddress.split('.').map(segment => Number.parseInt(segment))));\n}\n/**\n * Converts an IPv4 or IPv6 address from string representation to binary\n * representation\n * @param ipAddress an IP address in standard IPv4 or IPv6 text format\n * @returns\n */\nfunction ipAddressStringToBuffer(ipAddress) {\n if ((0, net_1.isIPv4)(ipAddress)) {\n return ipv4AddressStringToBuffer(ipAddress);\n }\n else if (isIPv6MappedIPv4(ipAddress)) {\n return ipv4AddressStringToBuffer(ipAddress.substring(7));\n }\n else if ((0, net_1.isIPv6)(ipAddress)) {\n let leftSection;\n let rightSection;\n const doubleColonIndex = ipAddress.indexOf('::');\n if (doubleColonIndex === -1) {\n leftSection = ipAddress;\n rightSection = '';\n }\n else {\n leftSection = ipAddress.substring(0, doubleColonIndex);\n rightSection = ipAddress.substring(doubleColonIndex + 2);\n }\n const leftBuffer = Buffer.from(parseIPv6Chunk(leftSection));\n const rightBuffer = Buffer.from(parseIPv6Chunk(rightSection));\n const middleBuffer = Buffer.alloc(16 - leftBuffer.length - rightBuffer.length, 0);\n return Buffer.concat([leftBuffer, middleBuffer, rightBuffer]);\n }\n else {\n return null;\n }\n}\nfunction connectivityStateToMessage(state) {\n switch (state) {\n case connectivity_state_1.ConnectivityState.CONNECTING:\n return {\n state: 'CONNECTING',\n };\n case connectivity_state_1.ConnectivityState.IDLE:\n return {\n state: 'IDLE',\n };\n case connectivity_state_1.ConnectivityState.READY:\n return {\n state: 'READY',\n };\n case connectivity_state_1.ConnectivityState.SHUTDOWN:\n return {\n state: 'SHUTDOWN',\n };\n case connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE:\n return {\n state: 'TRANSIENT_FAILURE',\n };\n default:\n return {\n state: 'UNKNOWN',\n };\n }\n}\nfunction dateToProtoTimestamp(date) {\n if (!date) {\n return null;\n }\n const millisSinceEpoch = date.getTime();\n return {\n seconds: (millisSinceEpoch / 1000) | 0,\n nanos: (millisSinceEpoch % 1000) * 1000000,\n };\n}\nfunction getChannelMessage(channelEntry) {\n const resolvedInfo = channelEntry.getInfo();\n const channelRef = [];\n const subchannelRef = [];\n resolvedInfo.children.channels.forEach(el => {\n channelRef.push(channelRefToMessage(el[1].ref));\n });\n resolvedInfo.children.subchannels.forEach(el => {\n subchannelRef.push(subchannelRefToMessage(el[1].ref));\n });\n return {\n ref: channelRefToMessage(channelEntry.ref),\n data: {\n target: resolvedInfo.target,\n state: connectivityStateToMessage(resolvedInfo.state),\n calls_started: resolvedInfo.callTracker.callsStarted,\n calls_succeeded: resolvedInfo.callTracker.callsSucceeded,\n calls_failed: resolvedInfo.callTracker.callsFailed,\n last_call_started_timestamp: dateToProtoTimestamp(resolvedInfo.callTracker.lastCallStartedTimestamp),\n trace: resolvedInfo.trace.getTraceMessage(),\n },\n channel_ref: channelRef,\n subchannel_ref: subchannelRef,\n };\n}\nfunction GetChannel(call, callback) {\n const channelId = parseInt(call.request.channel_id, 10);\n const channelEntry = entityMaps[\"channel\" /* EntityTypes.channel */].getElementByKey(channelId);\n if (channelEntry === undefined) {\n callback({\n code: constants_1.Status.NOT_FOUND,\n details: 'No channel data found for id ' + channelId,\n });\n return;\n }\n callback(null, { channel: getChannelMessage(channelEntry) });\n}\nfunction GetTopChannels(call, callback) {\n const maxResults = parseInt(call.request.max_results, 10) || DEFAULT_MAX_RESULTS;\n const resultList = [];\n const startId = parseInt(call.request.start_channel_id, 10);\n const channelEntries = entityMaps[\"channel\" /* EntityTypes.channel */];\n let i;\n for (i = channelEntries.lowerBound(startId); !i.equals(channelEntries.end()) && resultList.length < maxResults; i = i.next()) {\n resultList.push(getChannelMessage(i.pointer[1]));\n }\n callback(null, {\n channel: resultList,\n end: i.equals(channelEntries.end()),\n });\n}\nfunction getServerMessage(serverEntry) {\n const resolvedInfo = serverEntry.getInfo();\n const listenSocket = [];\n resolvedInfo.listenerChildren.sockets.forEach(el => {\n listenSocket.push(socketRefToMessage(el[1].ref));\n });\n return {\n ref: serverRefToMessage(serverEntry.ref),\n data: {\n calls_started: resolvedInfo.callTracker.callsStarted,\n calls_succeeded: resolvedInfo.callTracker.callsSucceeded,\n calls_failed: resolvedInfo.callTracker.callsFailed,\n last_call_started_timestamp: dateToProtoTimestamp(resolvedInfo.callTracker.lastCallStartedTimestamp),\n trace: resolvedInfo.trace.getTraceMessage(),\n },\n listen_socket: listenSocket,\n };\n}\nfunction GetServer(call, callback) {\n const serverId = parseInt(call.request.server_id, 10);\n const serverEntries = entityMaps[\"server\" /* EntityTypes.server */];\n const serverEntry = serverEntries.getElementByKey(serverId);\n if (serverEntry === undefined) {\n callback({\n code: constants_1.Status.NOT_FOUND,\n details: 'No server data found for id ' + serverId,\n });\n return;\n }\n callback(null, { server: getServerMessage(serverEntry) });\n}\nfunction GetServers(call, callback) {\n const maxResults = parseInt(call.request.max_results, 10) || DEFAULT_MAX_RESULTS;\n const startId = parseInt(call.request.start_server_id, 10);\n const serverEntries = entityMaps[\"server\" /* EntityTypes.server */];\n const resultList = [];\n let i;\n for (i = serverEntries.lowerBound(startId); !i.equals(serverEntries.end()) && resultList.length < maxResults; i = i.next()) {\n resultList.push(getServerMessage(i.pointer[1]));\n }\n callback(null, {\n server: resultList,\n end: i.equals(serverEntries.end()),\n });\n}\nfunction GetSubchannel(call, callback) {\n const subchannelId = parseInt(call.request.subchannel_id, 10);\n const subchannelEntry = entityMaps[\"subchannel\" /* EntityTypes.subchannel */].getElementByKey(subchannelId);\n if (subchannelEntry === undefined) {\n callback({\n code: constants_1.Status.NOT_FOUND,\n details: 'No subchannel data found for id ' + subchannelId,\n });\n return;\n }\n const resolvedInfo = subchannelEntry.getInfo();\n const listenSocket = [];\n resolvedInfo.children.sockets.forEach(el => {\n listenSocket.push(socketRefToMessage(el[1].ref));\n });\n const subchannelMessage = {\n ref: subchannelRefToMessage(subchannelEntry.ref),\n data: {\n target: resolvedInfo.target,\n state: connectivityStateToMessage(resolvedInfo.state),\n calls_started: resolvedInfo.callTracker.callsStarted,\n calls_succeeded: resolvedInfo.callTracker.callsSucceeded,\n calls_failed: resolvedInfo.callTracker.callsFailed,\n last_call_started_timestamp: dateToProtoTimestamp(resolvedInfo.callTracker.lastCallStartedTimestamp),\n trace: resolvedInfo.trace.getTraceMessage(),\n },\n socket_ref: listenSocket,\n };\n callback(null, { subchannel: subchannelMessage });\n}\nfunction subchannelAddressToAddressMessage(subchannelAddress) {\n var _a;\n if ((0, subchannel_address_1.isTcpSubchannelAddress)(subchannelAddress)) {\n return {\n address: 'tcpip_address',\n tcpip_address: {\n ip_address: (_a = ipAddressStringToBuffer(subchannelAddress.host)) !== null && _a !== void 0 ? _a : undefined,\n port: subchannelAddress.port,\n },\n };\n }\n else {\n return {\n address: 'uds_address',\n uds_address: {\n filename: subchannelAddress.path,\n },\n };\n }\n}\nfunction GetSocket(call, callback) {\n var _a, _b, _c, _d, _e;\n const socketId = parseInt(call.request.socket_id, 10);\n const socketEntry = entityMaps[\"socket\" /* EntityTypes.socket */].getElementByKey(socketId);\n if (socketEntry === undefined) {\n callback({\n code: constants_1.Status.NOT_FOUND,\n details: 'No socket data found for id ' + socketId,\n });\n return;\n }\n const resolvedInfo = socketEntry.getInfo();\n const securityMessage = resolvedInfo.security\n ? {\n model: 'tls',\n tls: {\n cipher_suite: resolvedInfo.security.cipherSuiteStandardName\n ? 'standard_name'\n : 'other_name',\n standard_name: (_a = resolvedInfo.security.cipherSuiteStandardName) !== null && _a !== void 0 ? _a : undefined,\n other_name: (_b = resolvedInfo.security.cipherSuiteOtherName) !== null && _b !== void 0 ? _b : undefined,\n local_certificate: (_c = resolvedInfo.security.localCertificate) !== null && _c !== void 0 ? _c : undefined,\n remote_certificate: (_d = resolvedInfo.security.remoteCertificate) !== null && _d !== void 0 ? _d : undefined,\n },\n }\n : null;\n const socketMessage = {\n ref: socketRefToMessage(socketEntry.ref),\n local: resolvedInfo.localAddress\n ? subchannelAddressToAddressMessage(resolvedInfo.localAddress)\n : null,\n remote: resolvedInfo.remoteAddress\n ? subchannelAddressToAddressMessage(resolvedInfo.remoteAddress)\n : null,\n remote_name: (_e = resolvedInfo.remoteName) !== null && _e !== void 0 ? _e : undefined,\n security: securityMessage,\n data: {\n keep_alives_sent: resolvedInfo.keepAlivesSent,\n streams_started: resolvedInfo.streamsStarted,\n streams_succeeded: resolvedInfo.streamsSucceeded,\n streams_failed: resolvedInfo.streamsFailed,\n last_local_stream_created_timestamp: dateToProtoTimestamp(resolvedInfo.lastLocalStreamCreatedTimestamp),\n last_remote_stream_created_timestamp: dateToProtoTimestamp(resolvedInfo.lastRemoteStreamCreatedTimestamp),\n messages_received: resolvedInfo.messagesReceived,\n messages_sent: resolvedInfo.messagesSent,\n last_message_received_timestamp: dateToProtoTimestamp(resolvedInfo.lastMessageReceivedTimestamp),\n last_message_sent_timestamp: dateToProtoTimestamp(resolvedInfo.lastMessageSentTimestamp),\n local_flow_control_window: resolvedInfo.localFlowControlWindow\n ? { value: resolvedInfo.localFlowControlWindow }\n : null,\n remote_flow_control_window: resolvedInfo.remoteFlowControlWindow\n ? { value: resolvedInfo.remoteFlowControlWindow }\n : null,\n },\n };\n callback(null, { socket: socketMessage });\n}\nfunction GetServerSockets(call, callback) {\n const serverId = parseInt(call.request.server_id, 10);\n const serverEntry = entityMaps[\"server\" /* EntityTypes.server */].getElementByKey(serverId);\n if (serverEntry === undefined) {\n callback({\n code: constants_1.Status.NOT_FOUND,\n details: 'No server data found for id ' + serverId,\n });\n return;\n }\n const startId = parseInt(call.request.start_socket_id, 10);\n const maxResults = parseInt(call.request.max_results, 10) || DEFAULT_MAX_RESULTS;\n const resolvedInfo = serverEntry.getInfo();\n // If we wanted to include listener sockets in the result, this line would\n // instead say\n // const allSockets = resolvedInfo.listenerChildren.sockets.concat(resolvedInfo.sessionChildren.sockets).sort((ref1, ref2) => ref1.id - ref2.id);\n const allSockets = resolvedInfo.sessionChildren.sockets;\n const resultList = [];\n let i;\n for (i = allSockets.lowerBound(startId); !i.equals(allSockets.end()) && resultList.length < maxResults; i = i.next()) {\n resultList.push(socketRefToMessage(i.pointer[1].ref));\n }\n callback(null, {\n socket_ref: resultList,\n end: i.equals(allSockets.end()),\n });\n}\nfunction getChannelzHandlers() {\n return {\n GetChannel,\n GetTopChannels,\n GetServer,\n GetServers,\n GetSubchannel,\n GetSocket,\n GetServerSockets,\n };\n}\nlet loadedChannelzDefinition = null;\nfunction getChannelzServiceDefinition() {\n if (loadedChannelzDefinition) {\n return loadedChannelzDefinition;\n }\n /* The purpose of this complexity is to avoid loading @grpc/proto-loader at\n * runtime for users who will not use/enable channelz. */\n const loaderLoadSync = require('@grpc/proto-loader')\n .loadSync;\n const loadedProto = loaderLoadSync('channelz.proto', {\n keepCase: true,\n longs: String,\n enums: String,\n defaults: true,\n oneofs: true,\n includeDirs: [`${__dirname}/../../proto`],\n });\n const channelzGrpcObject = (0, make_client_1.loadPackageDefinition)(loadedProto);\n loadedChannelzDefinition =\n channelzGrpcObject.grpc.channelz.v1.Channelz.service;\n return loadedChannelzDefinition;\n}\nfunction setup() {\n (0, admin_1.registerAdminService)(getChannelzServiceDefinition, getChannelzHandlers);\n}\n//# sourceMappingURL=channelz.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Subchannel = void 0;\nconst connectivity_state_1 = require(\"./connectivity-state\");\nconst backoff_timeout_1 = require(\"./backoff-timeout\");\nconst logging = require(\"./logging\");\nconst constants_1 = require(\"./constants\");\nconst uri_parser_1 = require(\"./uri-parser\");\nconst subchannel_address_1 = require(\"./subchannel-address\");\nconst channelz_1 = require(\"./channelz\");\nconst TRACER_NAME = 'subchannel';\n/* setInterval and setTimeout only accept signed 32 bit integers. JS doesn't\n * have a constant for the max signed 32 bit integer, so this is a simple way\n * to calculate it */\nconst KEEPALIVE_MAX_TIME_MS = ~(1 << 31);\nclass Subchannel {\n /**\n * A class representing a connection to a single backend.\n * @param channelTarget The target string for the channel as a whole\n * @param subchannelAddress The address for the backend that this subchannel\n * will connect to\n * @param options The channel options, plus any specific subchannel options\n * for this subchannel\n * @param credentials The channel credentials used to establish this\n * connection\n */\n constructor(channelTarget, subchannelAddress, options, credentials, connector) {\n var _a;\n this.channelTarget = channelTarget;\n this.subchannelAddress = subchannelAddress;\n this.options = options;\n this.connector = connector;\n /**\n * The subchannel's current connectivity state. Invariant: `session` === `null`\n * if and only if `connectivityState` is IDLE or TRANSIENT_FAILURE.\n */\n this.connectivityState = connectivity_state_1.ConnectivityState.IDLE;\n /**\n * The underlying http2 session used to make requests.\n */\n this.transport = null;\n /**\n * Indicates that the subchannel should transition from TRANSIENT_FAILURE to\n * CONNECTING instead of IDLE when the backoff timeout ends.\n */\n this.continueConnecting = false;\n /**\n * A list of listener functions that will be called whenever the connectivity\n * state changes. Will be modified by `addConnectivityStateListener` and\n * `removeConnectivityStateListener`\n */\n this.stateListeners = new Set();\n /**\n * Tracks channels and subchannel pools with references to this subchannel\n */\n this.refcount = 0;\n // Channelz info\n this.channelzEnabled = true;\n const backoffOptions = {\n initialDelay: options['grpc.initial_reconnect_backoff_ms'],\n maxDelay: options['grpc.max_reconnect_backoff_ms'],\n };\n this.backoffTimeout = new backoff_timeout_1.BackoffTimeout(() => {\n this.handleBackoffTimer();\n }, backoffOptions);\n this.backoffTimeout.unref();\n this.subchannelAddressString = (0, subchannel_address_1.subchannelAddressToString)(subchannelAddress);\n this.keepaliveTime = (_a = options['grpc.keepalive_time_ms']) !== null && _a !== void 0 ? _a : -1;\n if (options['grpc.enable_channelz'] === 0) {\n this.channelzEnabled = false;\n this.channelzTrace = new channelz_1.ChannelzTraceStub();\n this.callTracker = new channelz_1.ChannelzCallTrackerStub();\n this.childrenTracker = new channelz_1.ChannelzChildrenTrackerStub();\n this.streamTracker = new channelz_1.ChannelzCallTrackerStub();\n }\n else {\n this.channelzTrace = new channelz_1.ChannelzTrace();\n this.callTracker = new channelz_1.ChannelzCallTracker();\n this.childrenTracker = new channelz_1.ChannelzChildrenTracker();\n this.streamTracker = new channelz_1.ChannelzCallTracker();\n }\n this.channelzRef = (0, channelz_1.registerChannelzSubchannel)(this.subchannelAddressString, () => this.getChannelzInfo(), this.channelzEnabled);\n this.channelzTrace.addTrace('CT_INFO', 'Subchannel created');\n this.trace('Subchannel constructed with options ' +\n JSON.stringify(options, undefined, 2));\n this.secureConnector = credentials._createSecureConnector(channelTarget, options);\n }\n getChannelzInfo() {\n return {\n state: this.connectivityState,\n trace: this.channelzTrace,\n callTracker: this.callTracker,\n children: this.childrenTracker.getChildLists(),\n target: this.subchannelAddressString,\n };\n }\n trace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, '(' +\n this.channelzRef.id +\n ') ' +\n this.subchannelAddressString +\n ' ' +\n text);\n }\n refTrace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, 'subchannel_refcount', '(' +\n this.channelzRef.id +\n ') ' +\n this.subchannelAddressString +\n ' ' +\n text);\n }\n handleBackoffTimer() {\n if (this.continueConnecting) {\n this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.CONNECTING);\n }\n else {\n this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.IDLE);\n }\n }\n /**\n * Start a backoff timer with the current nextBackoff timeout\n */\n startBackoff() {\n this.backoffTimeout.runOnce();\n }\n stopBackoff() {\n this.backoffTimeout.stop();\n this.backoffTimeout.reset();\n }\n startConnectingInternal() {\n let options = this.options;\n if (options['grpc.keepalive_time_ms']) {\n const adjustedKeepaliveTime = Math.min(this.keepaliveTime, KEEPALIVE_MAX_TIME_MS);\n options = Object.assign(Object.assign({}, options), { 'grpc.keepalive_time_ms': adjustedKeepaliveTime });\n }\n this.connector\n .connect(this.subchannelAddress, this.secureConnector, options)\n .then(transport => {\n if (this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING], connectivity_state_1.ConnectivityState.READY)) {\n this.transport = transport;\n if (this.channelzEnabled) {\n this.childrenTracker.refChild(transport.getChannelzRef());\n }\n transport.addDisconnectListener(tooManyPings => {\n this.transitionToState([connectivity_state_1.ConnectivityState.READY], connectivity_state_1.ConnectivityState.IDLE);\n if (tooManyPings && this.keepaliveTime > 0) {\n this.keepaliveTime *= 2;\n logging.log(constants_1.LogVerbosity.ERROR, `Connection to ${(0, uri_parser_1.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`);\n }\n });\n }\n else {\n /* If we can't transition from CONNECTING to READY here, we will\n * not be using this transport, so release its resources. */\n transport.shutdown();\n }\n }, error => {\n this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING], connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, `${error}`);\n });\n }\n /**\n * Initiate a state transition from any element of oldStates to the new\n * state. If the current connectivityState is not in oldStates, do nothing.\n * @param oldStates The set of states to transition from\n * @param newState The state to transition to\n * @returns True if the state changed, false otherwise\n */\n transitionToState(oldStates, newState, errorMessage) {\n var _a, _b;\n if (oldStates.indexOf(this.connectivityState) === -1) {\n return false;\n }\n if (errorMessage) {\n this.trace(connectivity_state_1.ConnectivityState[this.connectivityState] +\n ' -> ' +\n connectivity_state_1.ConnectivityState[newState] +\n ' with error \"' + errorMessage + '\"');\n }\n else {\n this.trace(connectivity_state_1.ConnectivityState[this.connectivityState] +\n ' -> ' +\n connectivity_state_1.ConnectivityState[newState]);\n }\n if (this.channelzEnabled) {\n this.channelzTrace.addTrace('CT_INFO', 'Connectivity state change to ' + connectivity_state_1.ConnectivityState[newState]);\n }\n const previousState = this.connectivityState;\n this.connectivityState = newState;\n switch (newState) {\n case connectivity_state_1.ConnectivityState.READY:\n this.stopBackoff();\n break;\n case connectivity_state_1.ConnectivityState.CONNECTING:\n this.startBackoff();\n this.startConnectingInternal();\n this.continueConnecting = false;\n break;\n case connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE:\n if (this.channelzEnabled && this.transport) {\n this.childrenTracker.unrefChild(this.transport.getChannelzRef());\n }\n (_a = this.transport) === null || _a === void 0 ? void 0 : _a.shutdown();\n this.transport = null;\n /* If the backoff timer has already ended by the time we get to the\n * TRANSIENT_FAILURE state, we want to immediately transition out of\n * TRANSIENT_FAILURE as though the backoff timer is ending right now */\n if (!this.backoffTimeout.isRunning()) {\n process.nextTick(() => {\n this.handleBackoffTimer();\n });\n }\n break;\n case connectivity_state_1.ConnectivityState.IDLE:\n if (this.channelzEnabled && this.transport) {\n this.childrenTracker.unrefChild(this.transport.getChannelzRef());\n }\n (_b = this.transport) === null || _b === void 0 ? void 0 : _b.shutdown();\n this.transport = null;\n break;\n default:\n throw new Error(`Invalid state: unknown ConnectivityState ${newState}`);\n }\n for (const listener of this.stateListeners) {\n listener(this, previousState, newState, this.keepaliveTime, errorMessage);\n }\n return true;\n }\n ref() {\n this.refTrace('refcount ' + this.refcount + ' -> ' + (this.refcount + 1));\n this.refcount += 1;\n }\n unref() {\n this.refTrace('refcount ' + this.refcount + ' -> ' + (this.refcount - 1));\n this.refcount -= 1;\n if (this.refcount === 0) {\n this.channelzTrace.addTrace('CT_INFO', 'Shutting down');\n (0, channelz_1.unregisterChannelzRef)(this.channelzRef);\n this.secureConnector.destroy();\n process.nextTick(() => {\n this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING, connectivity_state_1.ConnectivityState.READY], connectivity_state_1.ConnectivityState.IDLE);\n });\n }\n }\n unrefIfOneRef() {\n if (this.refcount === 1) {\n this.unref();\n return true;\n }\n return false;\n }\n createCall(metadata, host, method, listener) {\n if (!this.transport) {\n throw new Error('Cannot create call, subchannel not READY');\n }\n let statsTracker;\n if (this.channelzEnabled) {\n this.callTracker.addCallStarted();\n this.streamTracker.addCallStarted();\n statsTracker = {\n onCallEnd: status => {\n if (status.code === constants_1.Status.OK) {\n this.callTracker.addCallSucceeded();\n }\n else {\n this.callTracker.addCallFailed();\n }\n },\n };\n }\n else {\n statsTracker = {};\n }\n return this.transport.createCall(metadata, host, method, listener, statsTracker);\n }\n /**\n * If the subchannel is currently IDLE, start connecting and switch to the\n * CONNECTING state. If the subchannel is current in TRANSIENT_FAILURE,\n * the next time it would transition to IDLE, start connecting again instead.\n * Otherwise, do nothing.\n */\n startConnecting() {\n process.nextTick(() => {\n /* First, try to transition from IDLE to connecting. If that doesn't happen\n * because the state is not currently IDLE, check if it is\n * TRANSIENT_FAILURE, and if so indicate that it should go back to\n * connecting after the backoff timer ends. Otherwise do nothing */\n if (!this.transitionToState([connectivity_state_1.ConnectivityState.IDLE], connectivity_state_1.ConnectivityState.CONNECTING)) {\n if (this.connectivityState === connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) {\n this.continueConnecting = true;\n }\n }\n });\n }\n /**\n * Get the subchannel's current connectivity state.\n */\n getConnectivityState() {\n return this.connectivityState;\n }\n /**\n * Add a listener function to be called whenever the subchannel's\n * connectivity state changes.\n * @param listener\n */\n addConnectivityStateListener(listener) {\n this.stateListeners.add(listener);\n }\n /**\n * Remove a listener previously added with `addConnectivityStateListener`\n * @param listener A reference to a function previously passed to\n * `addConnectivityStateListener`\n */\n removeConnectivityStateListener(listener) {\n this.stateListeners.delete(listener);\n }\n /**\n * Reset the backoff timeout, and immediately start connecting if in backoff.\n */\n resetBackoff() {\n process.nextTick(() => {\n this.backoffTimeout.reset();\n this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.CONNECTING);\n });\n }\n getAddress() {\n return this.subchannelAddressString;\n }\n getChannelzRef() {\n return this.channelzRef;\n }\n isHealthy() {\n return true;\n }\n addHealthStateWatcher(listener) {\n // Do nothing with the listener\n }\n removeHealthStateWatcher(listener) {\n // Do nothing with the listener\n }\n getRealSubchannel() {\n return this;\n }\n realSubchannelEquals(other) {\n return other.getRealSubchannel() === this;\n }\n throttleKeepalive(newKeepaliveTime) {\n if (newKeepaliveTime > this.keepaliveTime) {\n this.keepaliveTime = newKeepaliveTime;\n }\n }\n getCallCredentials() {\n return this.secureConnector.getCallCredentials();\n }\n}\nexports.Subchannel = Subchannel;\n//# sourceMappingURL=subchannel.js.map","\"use strict\";\n/*\n * Copyright 2024 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GRPC_NODE_USE_ALTERNATIVE_RESOLVER = void 0;\nexports.GRPC_NODE_USE_ALTERNATIVE_RESOLVER = ((_a = process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER) !== null && _a !== void 0 ? _a : 'false') === 'true';\n//# sourceMappingURL=environment.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DEFAULT_PORT = void 0;\nexports.setup = setup;\nconst resolver_1 = require(\"./resolver\");\nconst dns_1 = require(\"dns\");\nconst service_config_1 = require(\"./service-config\");\nconst constants_1 = require(\"./constants\");\nconst metadata_1 = require(\"./metadata\");\nconst logging = require(\"./logging\");\nconst constants_2 = require(\"./constants\");\nconst uri_parser_1 = require(\"./uri-parser\");\nconst net_1 = require(\"net\");\nconst backoff_timeout_1 = require(\"./backoff-timeout\");\nconst environment_1 = require(\"./environment\");\nconst TRACER_NAME = 'dns_resolver';\nfunction trace(text) {\n logging.trace(constants_2.LogVerbosity.DEBUG, TRACER_NAME, text);\n}\n/**\n * The default TCP port to connect to if not explicitly specified in the target.\n */\nexports.DEFAULT_PORT = 443;\nconst DEFAULT_MIN_TIME_BETWEEN_RESOLUTIONS_MS = 30000;\n/**\n * Resolver implementation that handles DNS names and IP addresses.\n */\nclass DnsResolver {\n constructor(target, listener, channelOptions) {\n var _a, _b, _c;\n this.target = target;\n this.listener = listener;\n this.pendingLookupPromise = null;\n this.pendingTxtPromise = null;\n this.latestLookupResult = null;\n this.latestServiceConfig = null;\n this.latestServiceConfigError = null;\n this.continueResolving = false;\n this.isNextResolutionTimerRunning = false;\n this.isServiceConfigEnabled = true;\n this.returnedIpResult = false;\n this.alternativeResolver = new dns_1.promises.Resolver();\n trace('Resolver constructed for target ' + (0, uri_parser_1.uriToString)(target));\n if (target.authority) {\n this.alternativeResolver.setServers([target.authority]);\n }\n const hostPort = (0, uri_parser_1.splitHostPort)(target.path);\n if (hostPort === null) {\n this.ipResult = null;\n this.dnsHostname = null;\n this.port = null;\n }\n else {\n if ((0, net_1.isIPv4)(hostPort.host) || (0, net_1.isIPv6)(hostPort.host)) {\n this.ipResult = [\n {\n addresses: [\n {\n host: hostPort.host,\n port: (_a = hostPort.port) !== null && _a !== void 0 ? _a : exports.DEFAULT_PORT,\n },\n ],\n },\n ];\n this.dnsHostname = null;\n this.port = null;\n }\n else {\n this.ipResult = null;\n this.dnsHostname = hostPort.host;\n this.port = (_b = hostPort.port) !== null && _b !== void 0 ? _b : exports.DEFAULT_PORT;\n }\n }\n this.percentage = Math.random() * 100;\n if (channelOptions['grpc.service_config_disable_resolution'] === 1) {\n this.isServiceConfigEnabled = false;\n }\n this.defaultResolutionError = {\n code: constants_1.Status.UNAVAILABLE,\n details: `Name resolution failed for target ${(0, uri_parser_1.uriToString)(this.target)}`,\n metadata: new metadata_1.Metadata(),\n };\n const backoffOptions = {\n initialDelay: channelOptions['grpc.initial_reconnect_backoff_ms'],\n maxDelay: channelOptions['grpc.max_reconnect_backoff_ms'],\n };\n this.backoff = new backoff_timeout_1.BackoffTimeout(() => {\n if (this.continueResolving) {\n this.startResolutionWithBackoff();\n }\n }, backoffOptions);\n this.backoff.unref();\n this.minTimeBetweenResolutionsMs =\n (_c = channelOptions['grpc.dns_min_time_between_resolutions_ms']) !== null && _c !== void 0 ? _c : DEFAULT_MIN_TIME_BETWEEN_RESOLUTIONS_MS;\n this.nextResolutionTimer = setTimeout(() => { }, 0);\n clearTimeout(this.nextResolutionTimer);\n }\n /**\n * If the target is an IP address, just provide that address as a result.\n * Otherwise, initiate A, AAAA, and TXT lookups\n */\n startResolution() {\n if (this.ipResult !== null) {\n if (!this.returnedIpResult) {\n trace('Returning IP address for target ' + (0, uri_parser_1.uriToString)(this.target));\n setImmediate(() => {\n this.listener.onSuccessfulResolution(this.ipResult, null, null, null, {});\n });\n this.returnedIpResult = true;\n }\n this.backoff.stop();\n this.backoff.reset();\n this.stopNextResolutionTimer();\n return;\n }\n if (this.dnsHostname === null) {\n trace('Failed to parse DNS address ' + (0, uri_parser_1.uriToString)(this.target));\n setImmediate(() => {\n this.listener.onError({\n code: constants_1.Status.UNAVAILABLE,\n details: `Failed to parse DNS address ${(0, uri_parser_1.uriToString)(this.target)}`,\n metadata: new metadata_1.Metadata(),\n });\n });\n this.stopNextResolutionTimer();\n }\n else {\n if (this.pendingLookupPromise !== null) {\n return;\n }\n trace('Looking up DNS hostname ' + this.dnsHostname);\n /* We clear out latestLookupResult here to ensure that it contains the\n * latest result since the last time we started resolving. That way, the\n * TXT resolution handler can use it, but only if it finishes second. We\n * don't clear out any previous service config results because it's\n * better to use a service config that's slightly out of date than to\n * revert to an effectively blank one. */\n this.latestLookupResult = null;\n const hostname = this.dnsHostname;\n this.pendingLookupPromise = this.lookup(hostname);\n this.pendingLookupPromise.then(addressList => {\n if (this.pendingLookupPromise === null) {\n return;\n }\n this.pendingLookupPromise = null;\n this.backoff.reset();\n this.backoff.stop();\n this.latestLookupResult = addressList.map(address => ({\n addresses: [address],\n }));\n const allAddressesString = '[' +\n addressList.map(addr => addr.host + ':' + addr.port).join(',') +\n ']';\n trace('Resolved addresses for target ' +\n (0, uri_parser_1.uriToString)(this.target) +\n ': ' +\n allAddressesString);\n if (this.latestLookupResult.length === 0) {\n this.listener.onError(this.defaultResolutionError);\n return;\n }\n /* If the TXT lookup has not yet finished, both of the last two\n * arguments will be null, which is the equivalent of getting an\n * empty TXT response. When the TXT lookup does finish, its handler\n * can update the service config by using the same address list */\n this.listener.onSuccessfulResolution(this.latestLookupResult, this.latestServiceConfig, this.latestServiceConfigError, null, {});\n }, err => {\n if (this.pendingLookupPromise === null) {\n return;\n }\n trace('Resolution error for target ' +\n (0, uri_parser_1.uriToString)(this.target) +\n ': ' +\n err.message);\n this.pendingLookupPromise = null;\n this.stopNextResolutionTimer();\n this.listener.onError(this.defaultResolutionError);\n });\n /* If there already is a still-pending TXT resolution, we can just use\n * that result when it comes in */\n if (this.isServiceConfigEnabled && this.pendingTxtPromise === null) {\n /* We handle the TXT query promise differently than the others because\n * the name resolution attempt as a whole is a success even if the TXT\n * lookup fails */\n this.pendingTxtPromise = this.resolveTxt(hostname);\n this.pendingTxtPromise.then(txtRecord => {\n if (this.pendingTxtPromise === null) {\n return;\n }\n this.pendingTxtPromise = null;\n try {\n this.latestServiceConfig = (0, service_config_1.extractAndSelectServiceConfig)(txtRecord, this.percentage);\n }\n catch (err) {\n this.latestServiceConfigError = {\n code: constants_1.Status.UNAVAILABLE,\n details: `Parsing service config failed with error ${err.message}`,\n metadata: new metadata_1.Metadata(),\n };\n }\n if (this.latestLookupResult !== null) {\n /* We rely here on the assumption that calling this function with\n * identical parameters will be essentialy idempotent, and calling\n * it with the same address list and a different service config\n * should result in a fast and seamless switchover. */\n this.listener.onSuccessfulResolution(this.latestLookupResult, this.latestServiceConfig, this.latestServiceConfigError, null, {});\n }\n }, err => {\n /* If TXT lookup fails we should do nothing, which means that we\n * continue to use the result of the most recent successful lookup,\n * or the default null config object if there has never been a\n * successful lookup. We do not set the latestServiceConfigError\n * here because that is specifically used for response validation\n * errors. We still need to handle this error so that it does not\n * bubble up as an unhandled promise rejection. */\n });\n }\n }\n }\n async lookup(hostname) {\n if (environment_1.GRPC_NODE_USE_ALTERNATIVE_RESOLVER) {\n trace('Using alternative DNS resolver.');\n const records = await Promise.allSettled([\n this.alternativeResolver.resolve4(hostname),\n this.alternativeResolver.resolve6(hostname),\n ]);\n if (records.every(result => result.status === 'rejected')) {\n throw new Error(records[0].reason);\n }\n return records\n .reduce((acc, result) => {\n return result.status === 'fulfilled'\n ? [...acc, ...result.value]\n : acc;\n }, [])\n .map(addr => ({\n host: addr,\n port: +this.port,\n }));\n }\n /* We lookup both address families here and then split them up later\n * because when looking up a single family, dns.lookup outputs an error\n * if the name exists but there are no records for that family, and that\n * error is indistinguishable from other kinds of errors */\n const addressList = await dns_1.promises.lookup(hostname, { all: true });\n return addressList.map(addr => ({ host: addr.address, port: +this.port }));\n }\n async resolveTxt(hostname) {\n if (environment_1.GRPC_NODE_USE_ALTERNATIVE_RESOLVER) {\n trace('Using alternative DNS resolver.');\n return this.alternativeResolver.resolveTxt(hostname);\n }\n return dns_1.promises.resolveTxt(hostname);\n }\n startNextResolutionTimer() {\n var _a, _b;\n clearTimeout(this.nextResolutionTimer);\n this.nextResolutionTimer = setTimeout(() => {\n this.stopNextResolutionTimer();\n if (this.continueResolving) {\n this.startResolutionWithBackoff();\n }\n }, this.minTimeBetweenResolutionsMs);\n (_b = (_a = this.nextResolutionTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a);\n this.isNextResolutionTimerRunning = true;\n }\n stopNextResolutionTimer() {\n clearTimeout(this.nextResolutionTimer);\n this.isNextResolutionTimerRunning = false;\n }\n startResolutionWithBackoff() {\n if (this.pendingLookupPromise === null) {\n this.continueResolving = false;\n this.backoff.runOnce();\n this.startNextResolutionTimer();\n this.startResolution();\n }\n }\n updateResolution() {\n /* If there is a pending lookup, just let it finish. Otherwise, if the\n * nextResolutionTimer or backoff timer is running, set the\n * continueResolving flag to resolve when whichever of those timers\n * fires. Otherwise, start resolving immediately. */\n if (this.pendingLookupPromise === null) {\n if (this.isNextResolutionTimerRunning || this.backoff.isRunning()) {\n if (this.isNextResolutionTimerRunning) {\n trace('resolution update delayed by \"min time between resolutions\" rate limit');\n }\n else {\n trace('resolution update delayed by backoff timer until ' +\n this.backoff.getEndTime().toISOString());\n }\n this.continueResolving = true;\n }\n else {\n this.startResolutionWithBackoff();\n }\n }\n }\n /**\n * Reset the resolver to the same state it had when it was created. In-flight\n * DNS requests cannot be cancelled, but they are discarded and their results\n * will be ignored.\n */\n destroy() {\n this.continueResolving = false;\n this.backoff.reset();\n this.backoff.stop();\n this.stopNextResolutionTimer();\n this.pendingLookupPromise = null;\n this.pendingTxtPromise = null;\n this.latestLookupResult = null;\n this.latestServiceConfig = null;\n this.latestServiceConfigError = null;\n this.returnedIpResult = false;\n }\n /**\n * Get the default authority for the given target. For IP targets, that is\n * the IP address. For DNS targets, it is the hostname.\n * @param target\n */\n static getDefaultAuthority(target) {\n return target.path;\n }\n}\n/**\n * Set up the DNS resolver class by registering it as the handler for the\n * \"dns:\" prefix and as the default resolver.\n */\nfunction setup() {\n (0, resolver_1.registerResolver)('dns', DnsResolver);\n (0, resolver_1.registerDefaultScheme)('dns');\n}\n//# sourceMappingURL=resolver-dns.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseCIDR = parseCIDR;\nexports.mapProxyName = mapProxyName;\nexports.getProxiedConnection = getProxiedConnection;\nconst logging_1 = require(\"./logging\");\nconst constants_1 = require(\"./constants\");\nconst net_1 = require(\"net\");\nconst http = require(\"http\");\nconst logging = require(\"./logging\");\nconst subchannel_address_1 = require(\"./subchannel-address\");\nconst uri_parser_1 = require(\"./uri-parser\");\nconst url_1 = require(\"url\");\nconst resolver_dns_1 = require(\"./resolver-dns\");\nconst TRACER_NAME = 'proxy';\nfunction trace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text);\n}\nfunction getProxyInfo() {\n let proxyEnv = '';\n let envVar = '';\n /* Prefer using 'grpc_proxy'. Fallback on 'http_proxy' if it is not set.\n * Also prefer using 'https_proxy' with fallback on 'http_proxy'. The\n * fallback behavior can be removed if there's a demand for it.\n */\n if (process.env.grpc_proxy) {\n envVar = 'grpc_proxy';\n proxyEnv = process.env.grpc_proxy;\n }\n else if (process.env.https_proxy) {\n envVar = 'https_proxy';\n proxyEnv = process.env.https_proxy;\n }\n else if (process.env.http_proxy) {\n envVar = 'http_proxy';\n proxyEnv = process.env.http_proxy;\n }\n else {\n return {};\n }\n let proxyUrl;\n try {\n proxyUrl = new url_1.URL(proxyEnv);\n }\n catch (e) {\n (0, logging_1.log)(constants_1.LogVerbosity.ERROR, `cannot parse value of \"${envVar}\" env var`);\n return {};\n }\n if (proxyUrl.protocol !== 'http:') {\n (0, logging_1.log)(constants_1.LogVerbosity.ERROR, `\"${proxyUrl.protocol}\" scheme not supported in proxy URI`);\n return {};\n }\n let userCred = null;\n if (proxyUrl.username) {\n if (proxyUrl.password) {\n (0, logging_1.log)(constants_1.LogVerbosity.INFO, 'userinfo found in proxy URI');\n userCred = decodeURIComponent(`${proxyUrl.username}:${proxyUrl.password}`);\n }\n else {\n userCred = proxyUrl.username;\n }\n }\n const hostname = proxyUrl.hostname;\n let port = proxyUrl.port;\n /* The proxy URL uses the scheme \"http:\", which has a default port number of\n * 80. We need to set that explicitly here if it is omitted because otherwise\n * it will use gRPC's default port 443. */\n if (port === '') {\n port = '80';\n }\n const result = {\n address: `${hostname}:${port}`,\n };\n if (userCred) {\n result.creds = userCred;\n }\n trace('Proxy server ' + result.address + ' set by environment variable ' + envVar);\n return result;\n}\nfunction getNoProxyHostList() {\n /* Prefer using 'no_grpc_proxy'. Fallback on 'no_proxy' if it is not set. */\n let noProxyStr = process.env.no_grpc_proxy;\n let envVar = 'no_grpc_proxy';\n if (!noProxyStr) {\n noProxyStr = process.env.no_proxy;\n envVar = 'no_proxy';\n }\n if (noProxyStr) {\n trace('No proxy server list set by environment variable ' + envVar);\n return noProxyStr.split(',');\n }\n else {\n return [];\n }\n}\n/*\n * The groups correspond to CIDR parts as follows:\n * 1. ip\n * 2. prefixLength\n */\nfunction parseCIDR(cidrString) {\n const splitRange = cidrString.split('/');\n if (splitRange.length !== 2) {\n return null;\n }\n const prefixLength = parseInt(splitRange[1], 10);\n if (!(0, net_1.isIPv4)(splitRange[0]) || Number.isNaN(prefixLength) || prefixLength < 0 || prefixLength > 32) {\n return null;\n }\n return {\n ip: ipToInt(splitRange[0]),\n prefixLength: prefixLength\n };\n}\nfunction ipToInt(ip) {\n return ip.split(\".\").reduce((acc, octet) => (acc << 8) + parseInt(octet, 10), 0);\n}\nfunction isIpInCIDR(cidr, serverHost) {\n const ip = cidr.ip;\n const mask = -1 << (32 - cidr.prefixLength);\n const hostIP = ipToInt(serverHost);\n return (hostIP & mask) === (ip & mask);\n}\nfunction hostMatchesNoProxyList(serverHost) {\n for (const host of getNoProxyHostList()) {\n const parsedCIDR = parseCIDR(host);\n // host is a CIDR and serverHost is an IP address\n if ((0, net_1.isIPv4)(serverHost) && parsedCIDR && isIpInCIDR(parsedCIDR, serverHost)) {\n return true;\n }\n else if (serverHost.endsWith(host)) {\n // host is a single IP or a domain name suffix\n return true;\n }\n }\n return false;\n}\nfunction mapProxyName(target, options) {\n var _a;\n const noProxyResult = {\n target: target,\n extraOptions: {},\n };\n if (((_a = options['grpc.enable_http_proxy']) !== null && _a !== void 0 ? _a : 1) === 0) {\n return noProxyResult;\n }\n if (target.scheme === 'unix') {\n return noProxyResult;\n }\n const proxyInfo = getProxyInfo();\n if (!proxyInfo.address) {\n return noProxyResult;\n }\n const hostPort = (0, uri_parser_1.splitHostPort)(target.path);\n if (!hostPort) {\n return noProxyResult;\n }\n const serverHost = hostPort.host;\n if (hostMatchesNoProxyList(serverHost)) {\n trace('Not using proxy for target in no_proxy list: ' + (0, uri_parser_1.uriToString)(target));\n return noProxyResult;\n }\n const extraOptions = {\n 'grpc.http_connect_target': (0, uri_parser_1.uriToString)(target),\n };\n if (proxyInfo.creds) {\n extraOptions['grpc.http_connect_creds'] = proxyInfo.creds;\n }\n return {\n target: {\n scheme: 'dns',\n path: proxyInfo.address,\n },\n extraOptions: extraOptions,\n };\n}\nfunction getProxiedConnection(address, channelOptions) {\n var _a;\n if (!('grpc.http_connect_target' in channelOptions)) {\n return Promise.resolve(null);\n }\n const realTarget = channelOptions['grpc.http_connect_target'];\n const parsedTarget = (0, uri_parser_1.parseUri)(realTarget);\n if (parsedTarget === null) {\n return Promise.resolve(null);\n }\n const splitHostPost = (0, uri_parser_1.splitHostPort)(parsedTarget.path);\n if (splitHostPost === null) {\n return Promise.resolve(null);\n }\n const hostPort = `${splitHostPost.host}:${(_a = splitHostPost.port) !== null && _a !== void 0 ? _a : resolver_dns_1.DEFAULT_PORT}`;\n const options = {\n method: 'CONNECT',\n path: hostPort,\n };\n const headers = {\n Host: hostPort,\n };\n // Connect to the subchannel address as a proxy\n if ((0, subchannel_address_1.isTcpSubchannelAddress)(address)) {\n options.host = address.host;\n options.port = address.port;\n }\n else {\n options.socketPath = address.path;\n }\n if ('grpc.http_connect_creds' in channelOptions) {\n headers['Proxy-Authorization'] =\n 'Basic ' +\n Buffer.from(channelOptions['grpc.http_connect_creds']).toString('base64');\n }\n options.headers = headers;\n const proxyAddressString = (0, subchannel_address_1.subchannelAddressToString)(address);\n trace('Using proxy ' + proxyAddressString + ' to connect to ' + options.path);\n return new Promise((resolve, reject) => {\n const request = http.request(options);\n request.once('connect', (res, socket, head) => {\n request.removeAllListeners();\n socket.removeAllListeners();\n if (res.statusCode === 200) {\n trace('Successfully connected to ' +\n options.path +\n ' through proxy ' +\n proxyAddressString);\n // The HTTP client may have already read a few bytes of the proxied\n // connection. If that's the case, put them back into the socket.\n // See https://github.com/grpc/grpc-node/issues/2744.\n if (head.length > 0) {\n socket.unshift(head);\n }\n trace('Successfully established a plaintext connection to ' +\n options.path +\n ' through proxy ' +\n proxyAddressString);\n resolve(socket);\n }\n else {\n (0, logging_1.log)(constants_1.LogVerbosity.ERROR, 'Failed to connect to ' +\n options.path +\n ' through proxy ' +\n proxyAddressString +\n ' with status ' +\n res.statusCode);\n reject();\n }\n });\n request.once('error', err => {\n request.removeAllListeners();\n (0, logging_1.log)(constants_1.LogVerbosity.ERROR, 'Failed to connect to proxy ' +\n proxyAddressString +\n ' with error ' +\n err.message);\n reject();\n });\n request.end();\n });\n}\n//# sourceMappingURL=http_proxy.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StreamDecoder = void 0;\nvar ReadState;\n(function (ReadState) {\n ReadState[ReadState[\"NO_DATA\"] = 0] = \"NO_DATA\";\n ReadState[ReadState[\"READING_SIZE\"] = 1] = \"READING_SIZE\";\n ReadState[ReadState[\"READING_MESSAGE\"] = 2] = \"READING_MESSAGE\";\n})(ReadState || (ReadState = {}));\nclass StreamDecoder {\n constructor(maxReadMessageLength) {\n this.maxReadMessageLength = maxReadMessageLength;\n this.readState = ReadState.NO_DATA;\n this.readCompressFlag = Buffer.alloc(1);\n this.readPartialSize = Buffer.alloc(4);\n this.readSizeRemaining = 4;\n this.readMessageSize = 0;\n this.readPartialMessage = [];\n this.readMessageRemaining = 0;\n }\n write(data) {\n let readHead = 0;\n let toRead;\n const result = [];\n while (readHead < data.length) {\n switch (this.readState) {\n case ReadState.NO_DATA:\n this.readCompressFlag = data.slice(readHead, readHead + 1);\n readHead += 1;\n this.readState = ReadState.READING_SIZE;\n this.readPartialSize.fill(0);\n this.readSizeRemaining = 4;\n this.readMessageSize = 0;\n this.readMessageRemaining = 0;\n this.readPartialMessage = [];\n break;\n case ReadState.READING_SIZE:\n toRead = Math.min(data.length - readHead, this.readSizeRemaining);\n data.copy(this.readPartialSize, 4 - this.readSizeRemaining, readHead, readHead + toRead);\n this.readSizeRemaining -= toRead;\n readHead += toRead;\n // readSizeRemaining >=0 here\n if (this.readSizeRemaining === 0) {\n this.readMessageSize = this.readPartialSize.readUInt32BE(0);\n if (this.maxReadMessageLength !== -1 && this.readMessageSize > this.maxReadMessageLength) {\n throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);\n }\n this.readMessageRemaining = this.readMessageSize;\n if (this.readMessageRemaining > 0) {\n this.readState = ReadState.READING_MESSAGE;\n }\n else {\n const message = Buffer.concat([this.readCompressFlag, this.readPartialSize], 5);\n this.readState = ReadState.NO_DATA;\n result.push(message);\n }\n }\n break;\n case ReadState.READING_MESSAGE:\n toRead = Math.min(data.length - readHead, this.readMessageRemaining);\n this.readPartialMessage.push(data.slice(readHead, readHead + toRead));\n this.readMessageRemaining -= toRead;\n readHead += toRead;\n // readMessageRemaining >=0 here\n if (this.readMessageRemaining === 0) {\n // At this point, we have read a full message\n const framedMessageBuffers = [\n this.readCompressFlag,\n this.readPartialSize,\n ].concat(this.readPartialMessage);\n const framedMessage = Buffer.concat(framedMessageBuffers, this.readMessageSize + 5);\n this.readState = ReadState.NO_DATA;\n result.push(framedMessage);\n }\n break;\n default:\n throw new Error('Unexpected read state');\n }\n }\n return result;\n }\n}\nexports.StreamDecoder = StreamDecoder;\n//# sourceMappingURL=stream-decoder.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Http2SubchannelCall = void 0;\nconst http2 = require(\"http2\");\nconst os = require(\"os\");\nconst constants_1 = require(\"./constants\");\nconst metadata_1 = require(\"./metadata\");\nconst stream_decoder_1 = require(\"./stream-decoder\");\nconst logging = require(\"./logging\");\nconst constants_2 = require(\"./constants\");\nconst TRACER_NAME = 'subchannel_call';\n/**\n * Should do approximately the same thing as util.getSystemErrorName but the\n * TypeScript types don't have that function for some reason so I just made my\n * own.\n * @param errno\n */\nfunction getSystemErrorName(errno) {\n for (const [name, num] of Object.entries(os.constants.errno)) {\n if (num === errno) {\n return name;\n }\n }\n return 'Unknown system error ' + errno;\n}\nfunction mapHttpStatusCode(code) {\n const details = `Received HTTP status code ${code}`;\n let mappedStatusCode;\n switch (code) {\n // TODO(murgatroid99): handle 100 and 101\n case 400:\n mappedStatusCode = constants_1.Status.INTERNAL;\n break;\n case 401:\n mappedStatusCode = constants_1.Status.UNAUTHENTICATED;\n break;\n case 403:\n mappedStatusCode = constants_1.Status.PERMISSION_DENIED;\n break;\n case 404:\n mappedStatusCode = constants_1.Status.UNIMPLEMENTED;\n break;\n case 429:\n case 502:\n case 503:\n case 504:\n mappedStatusCode = constants_1.Status.UNAVAILABLE;\n break;\n default:\n mappedStatusCode = constants_1.Status.UNKNOWN;\n }\n return {\n code: mappedStatusCode,\n details: details,\n metadata: new metadata_1.Metadata()\n };\n}\nclass Http2SubchannelCall {\n constructor(http2Stream, callEventTracker, listener, transport, callId) {\n var _a;\n this.http2Stream = http2Stream;\n this.callEventTracker = callEventTracker;\n this.listener = listener;\n this.transport = transport;\n this.callId = callId;\n this.isReadFilterPending = false;\n this.isPushPending = false;\n this.canPush = false;\n /**\n * Indicates that an 'end' event has come from the http2 stream, so there\n * will be no more data events.\n */\n this.readsClosed = false;\n this.statusOutput = false;\n this.unpushedReadMessages = [];\n // This is populated (non-null) if and only if the call has ended\n this.finalStatus = null;\n this.internalError = null;\n this.serverEndedCall = false;\n this.connectionDropped = false;\n const maxReceiveMessageLength = (_a = transport.getOptions()['grpc.max_receive_message_length']) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;\n this.decoder = new stream_decoder_1.StreamDecoder(maxReceiveMessageLength);\n http2Stream.on('response', (headers, flags) => {\n let headersString = '';\n for (const header of Object.keys(headers)) {\n headersString += '\\t\\t' + header + ': ' + headers[header] + '\\n';\n }\n this.trace('Received server headers:\\n' + headersString);\n this.httpStatusCode = headers[':status'];\n if (flags & http2.constants.NGHTTP2_FLAG_END_STREAM) {\n this.handleTrailers(headers);\n }\n else {\n let metadata;\n try {\n metadata = metadata_1.Metadata.fromHttp2Headers(headers);\n }\n catch (error) {\n this.endCall({\n code: constants_1.Status.UNKNOWN,\n details: error.message,\n metadata: new metadata_1.Metadata(),\n });\n return;\n }\n this.listener.onReceiveMetadata(metadata);\n }\n });\n http2Stream.on('trailers', (headers) => {\n this.handleTrailers(headers);\n });\n http2Stream.on('data', (data) => {\n /* If the status has already been output, allow the http2 stream to\n * drain without processing the data. */\n if (this.statusOutput) {\n return;\n }\n this.trace('receive HTTP/2 data frame of length ' + data.length);\n let messages;\n try {\n messages = this.decoder.write(data);\n }\n catch (e) {\n /* Some servers send HTML error pages along with HTTP status codes.\n * When the client attempts to parse this as a length-delimited\n * message, the parsed message size is greater than the default limit,\n * resulting in a message decoding error. In that situation, the HTTP\n * error code information is more useful to the user than the\n * RESOURCE_EXHAUSTED error is, so we report that instead. Normally,\n * we delay processing the HTTP status until after the stream ends, to\n * prioritize reporting the gRPC status from trailers if it is present,\n * but when there is a message parsing error we end the stream early\n * before processing trailers. */\n if (this.httpStatusCode !== undefined && this.httpStatusCode !== 200) {\n const mappedStatus = mapHttpStatusCode(this.httpStatusCode);\n this.cancelWithStatus(mappedStatus.code, mappedStatus.details);\n }\n else {\n this.cancelWithStatus(constants_1.Status.RESOURCE_EXHAUSTED, e.message);\n }\n return;\n }\n for (const message of messages) {\n this.trace('parsed message of length ' + message.length);\n this.callEventTracker.addMessageReceived();\n this.tryPush(message);\n }\n });\n http2Stream.on('end', () => {\n this.readsClosed = true;\n this.maybeOutputStatus();\n });\n http2Stream.on('close', () => {\n this.serverEndedCall = true;\n /* Use process.next tick to ensure that this code happens after any\n * \"error\" event that may be emitted at about the same time, so that\n * we can bubble up the error message from that event. */\n process.nextTick(() => {\n var _a;\n this.trace('HTTP/2 stream closed with code ' + http2Stream.rstCode);\n /* If we have a final status with an OK status code, that means that\n * we have received all of the messages and we have processed the\n * trailers and the call completed successfully, so it doesn't matter\n * how the stream ends after that */\n if (((_a = this.finalStatus) === null || _a === void 0 ? void 0 : _a.code) === constants_1.Status.OK) {\n return;\n }\n let code;\n let details = '';\n switch (http2Stream.rstCode) {\n case http2.constants.NGHTTP2_NO_ERROR:\n /* If we get a NO_ERROR code and we already have a status, the\n * stream completed properly and we just haven't fully processed\n * it yet */\n if (this.finalStatus !== null) {\n return;\n }\n if (this.httpStatusCode && this.httpStatusCode !== 200) {\n const mappedStatus = mapHttpStatusCode(this.httpStatusCode);\n code = mappedStatus.code;\n details = mappedStatus.details;\n }\n else {\n code = constants_1.Status.INTERNAL;\n details = `Received RST_STREAM with code ${http2Stream.rstCode} (Call ended without gRPC status)`;\n }\n break;\n case http2.constants.NGHTTP2_REFUSED_STREAM:\n code = constants_1.Status.UNAVAILABLE;\n details = 'Stream refused by server';\n break;\n case http2.constants.NGHTTP2_CANCEL:\n /* Bug reports indicate that Node synthesizes a NGHTTP2_CANCEL\n * code from connection drops. We want to prioritize reporting\n * an unavailable status when that happens. */\n if (this.connectionDropped) {\n code = constants_1.Status.UNAVAILABLE;\n details = 'Connection dropped';\n }\n else {\n code = constants_1.Status.CANCELLED;\n details = 'Call cancelled';\n }\n break;\n case http2.constants.NGHTTP2_ENHANCE_YOUR_CALM:\n code = constants_1.Status.RESOURCE_EXHAUSTED;\n details = 'Bandwidth exhausted or memory limit exceeded';\n break;\n case http2.constants.NGHTTP2_INADEQUATE_SECURITY:\n code = constants_1.Status.PERMISSION_DENIED;\n details = 'Protocol not secure enough';\n break;\n case http2.constants.NGHTTP2_INTERNAL_ERROR:\n code = constants_1.Status.INTERNAL;\n if (this.internalError === null) {\n /* This error code was previously handled in the default case, and\n * there are several instances of it online, so I wanted to\n * preserve the original error message so that people find existing\n * information in searches, but also include the more recognizable\n * \"Internal server error\" message. */\n details = `Received RST_STREAM with code ${http2Stream.rstCode} (Internal server error)`;\n }\n else {\n if (this.internalError.code === 'ECONNRESET' ||\n this.internalError.code === 'ETIMEDOUT') {\n code = constants_1.Status.UNAVAILABLE;\n details = this.internalError.message;\n }\n else {\n /* The \"Received RST_STREAM with code ...\" error is preserved\n * here for continuity with errors reported online, but the\n * error message at the end will probably be more relevant in\n * most cases. */\n details = `Received RST_STREAM with code ${http2Stream.rstCode} triggered by internal client error: ${this.internalError.message}`;\n }\n }\n break;\n default:\n code = constants_1.Status.INTERNAL;\n details = `Received RST_STREAM with code ${http2Stream.rstCode}`;\n }\n // This is a no-op if trailers were received at all.\n // This is OK, because status codes emitted here correspond to more\n // catastrophic issues that prevent us from receiving trailers in the\n // first place.\n this.endCall({\n code,\n details,\n metadata: new metadata_1.Metadata(),\n rstCode: http2Stream.rstCode,\n });\n });\n });\n http2Stream.on('error', (err) => {\n /* We need an error handler here to stop \"Uncaught Error\" exceptions\n * from bubbling up. However, errors here should all correspond to\n * \"close\" events, where we will handle the error more granularly */\n /* Specifically looking for stream errors that were *not* constructed\n * from a RST_STREAM response here:\n * https://github.com/nodejs/node/blob/8b8620d580314050175983402dfddf2674e8e22a/lib/internal/http2/core.js#L2267\n */\n if (err.code !== 'ERR_HTTP2_STREAM_ERROR') {\n this.trace('Node error event: message=' +\n err.message +\n ' code=' +\n err.code +\n ' errno=' +\n getSystemErrorName(err.errno) +\n ' syscall=' +\n err.syscall);\n this.internalError = err;\n }\n this.callEventTracker.onStreamEnd(false);\n });\n }\n getDeadlineInfo() {\n return [`remote_addr=${this.getPeer()}`];\n }\n onDisconnect() {\n this.connectionDropped = true;\n /* Give the call an event loop cycle to finish naturally before reporting\n * the disconnection as an error. */\n setImmediate(() => {\n this.endCall({\n code: constants_1.Status.UNAVAILABLE,\n details: 'Connection dropped',\n metadata: new metadata_1.Metadata(),\n });\n });\n }\n outputStatus() {\n /* Precondition: this.finalStatus !== null */\n if (!this.statusOutput) {\n this.statusOutput = true;\n this.trace('ended with status: code=' +\n this.finalStatus.code +\n ' details=\"' +\n this.finalStatus.details +\n '\"');\n this.callEventTracker.onCallEnd(this.finalStatus);\n /* We delay the actual action of bubbling up the status to insulate the\n * cleanup code in this class from any errors that may be thrown in the\n * upper layers as a result of bubbling up the status. In particular,\n * if the status is not OK, the \"error\" event may be emitted\n * synchronously at the top level, which will result in a thrown error if\n * the user does not handle that event. */\n process.nextTick(() => {\n this.listener.onReceiveStatus(this.finalStatus);\n });\n /* Leave the http2 stream in flowing state to drain incoming messages, to\n * ensure that the stream closure completes. The call stream already does\n * not push more messages after the status is output, so the messages go\n * nowhere either way. */\n this.http2Stream.resume();\n }\n }\n trace(text) {\n logging.trace(constants_2.LogVerbosity.DEBUG, TRACER_NAME, '[' + this.callId + '] ' + text);\n }\n /**\n * On first call, emits a 'status' event with the given StatusObject.\n * Subsequent calls are no-ops.\n * @param status The status of the call.\n */\n endCall(status) {\n /* If the status is OK and a new status comes in (e.g. from a\n * deserialization failure), that new status takes priority */\n if (this.finalStatus === null || this.finalStatus.code === constants_1.Status.OK) {\n this.finalStatus = status;\n this.maybeOutputStatus();\n }\n this.destroyHttp2Stream();\n }\n maybeOutputStatus() {\n if (this.finalStatus !== null) {\n /* The combination check of readsClosed and that the two message buffer\n * arrays are empty checks that there all incoming data has been fully\n * processed */\n if (this.finalStatus.code !== constants_1.Status.OK ||\n (this.readsClosed &&\n this.unpushedReadMessages.length === 0 &&\n !this.isReadFilterPending &&\n !this.isPushPending)) {\n this.outputStatus();\n }\n }\n }\n push(message) {\n this.trace('pushing to reader message of length ' +\n (message instanceof Buffer ? message.length : null));\n this.canPush = false;\n this.isPushPending = true;\n process.nextTick(() => {\n this.isPushPending = false;\n /* If we have already output the status any later messages should be\n * ignored, and can cause out-of-order operation errors higher up in the\n * stack. Checking as late as possible here to avoid any race conditions.\n */\n if (this.statusOutput) {\n return;\n }\n this.listener.onReceiveMessage(message);\n this.maybeOutputStatus();\n });\n }\n tryPush(messageBytes) {\n if (this.canPush) {\n this.http2Stream.pause();\n this.push(messageBytes);\n }\n else {\n this.trace('unpushedReadMessages.push message of length ' + messageBytes.length);\n this.unpushedReadMessages.push(messageBytes);\n }\n }\n handleTrailers(headers) {\n this.serverEndedCall = true;\n this.callEventTracker.onStreamEnd(true);\n let headersString = '';\n for (const header of Object.keys(headers)) {\n headersString += '\\t\\t' + header + ': ' + headers[header] + '\\n';\n }\n this.trace('Received server trailers:\\n' + headersString);\n let metadata;\n try {\n metadata = metadata_1.Metadata.fromHttp2Headers(headers);\n }\n catch (e) {\n metadata = new metadata_1.Metadata();\n }\n const metadataMap = metadata.getMap();\n let status;\n if (typeof metadataMap['grpc-status'] === 'string') {\n const receivedStatus = Number(metadataMap['grpc-status']);\n this.trace('received status code ' + receivedStatus + ' from server');\n metadata.remove('grpc-status');\n let details = '';\n if (typeof metadataMap['grpc-message'] === 'string') {\n try {\n details = decodeURI(metadataMap['grpc-message']);\n }\n catch (e) {\n details = metadataMap['grpc-message'];\n }\n metadata.remove('grpc-message');\n this.trace('received status details string \"' + details + '\" from server');\n }\n status = {\n code: receivedStatus,\n details: details,\n metadata: metadata\n };\n }\n else if (this.httpStatusCode) {\n status = mapHttpStatusCode(this.httpStatusCode);\n status.metadata = metadata;\n }\n else {\n status = {\n code: constants_1.Status.UNKNOWN,\n details: 'No status information received',\n metadata: metadata\n };\n }\n // This is a no-op if the call was already ended when handling headers.\n this.endCall(status);\n }\n destroyHttp2Stream() {\n var _a;\n // The http2 stream could already have been destroyed if cancelWithStatus\n // is called in response to an internal http2 error.\n if (this.http2Stream.destroyed) {\n return;\n }\n /* If the server ended the call, sending an RST_STREAM is redundant, so we\n * just half close on the client side instead to finish closing the stream.\n */\n if (this.serverEndedCall) {\n this.http2Stream.end();\n }\n else {\n /* If the call has ended with an OK status, communicate that when closing\n * the stream, partly to avoid a situation in which we detect an error\n * RST_STREAM as a result after we have the status */\n let code;\n if (((_a = this.finalStatus) === null || _a === void 0 ? void 0 : _a.code) === constants_1.Status.OK) {\n code = http2.constants.NGHTTP2_NO_ERROR;\n }\n else {\n code = http2.constants.NGHTTP2_CANCEL;\n }\n this.trace('close http2 stream with code ' + code);\n this.http2Stream.close(code);\n }\n }\n cancelWithStatus(status, details) {\n this.trace('cancelWithStatus code: ' + status + ' details: \"' + details + '\"');\n this.endCall({ code: status, details, metadata: new metadata_1.Metadata() });\n }\n getStatus() {\n return this.finalStatus;\n }\n getPeer() {\n return this.transport.getPeerName();\n }\n getCallNumber() {\n return this.callId;\n }\n startRead() {\n /* If the stream has ended with an error, we should not emit any more\n * messages and we should communicate that the stream has ended */\n if (this.finalStatus !== null && this.finalStatus.code !== constants_1.Status.OK) {\n this.readsClosed = true;\n this.maybeOutputStatus();\n return;\n }\n this.canPush = true;\n if (this.unpushedReadMessages.length > 0) {\n const nextMessage = this.unpushedReadMessages.shift();\n this.push(nextMessage);\n return;\n }\n /* Only resume reading from the http2Stream if we don't have any pending\n * messages to emit */\n this.http2Stream.resume();\n }\n sendMessageWithContext(context, message) {\n this.trace('write() called with message of length ' + message.length);\n const cb = (error) => {\n /* nextTick here ensures that no stream action can be taken in the call\n * stack of the write callback, in order to hopefully work around\n * https://github.com/nodejs/node/issues/49147 */\n process.nextTick(() => {\n var _a;\n let code = constants_1.Status.UNAVAILABLE;\n if ((error === null || error === void 0 ? void 0 : error.code) ===\n 'ERR_STREAM_WRITE_AFTER_END') {\n code = constants_1.Status.INTERNAL;\n }\n if (error) {\n this.cancelWithStatus(code, `Write error: ${error.message}`);\n }\n (_a = context.callback) === null || _a === void 0 ? void 0 : _a.call(context);\n });\n };\n this.trace('sending data chunk of length ' + message.length);\n this.callEventTracker.addMessageSent();\n try {\n this.http2Stream.write(message, cb);\n }\n catch (error) {\n this.endCall({\n code: constants_1.Status.UNAVAILABLE,\n details: `Write failed with error ${error.message}`,\n metadata: new metadata_1.Metadata(),\n });\n }\n }\n halfClose() {\n this.trace('end() called');\n this.trace('calling end() on HTTP/2 stream');\n this.http2Stream.end();\n }\n}\nexports.Http2SubchannelCall = Http2SubchannelCall;\n//# sourceMappingURL=subchannel-call.js.map","\"use strict\";\n/*\n * Copyright 2022 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getNextCallNumber = getNextCallNumber;\nlet nextCallNumber = 0;\nfunction getNextCallNumber() {\n return nextCallNumber++;\n}\n//# sourceMappingURL=call-number.js.map","\"use strict\";\n/*\n * Copyright 2023 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Http2SubchannelConnector = void 0;\nconst http2 = require(\"http2\");\nconst channelz_1 = require(\"./channelz\");\nconst constants_1 = require(\"./constants\");\nconst http_proxy_1 = require(\"./http_proxy\");\nconst logging = require(\"./logging\");\nconst resolver_1 = require(\"./resolver\");\nconst subchannel_address_1 = require(\"./subchannel-address\");\nconst uri_parser_1 = require(\"./uri-parser\");\nconst net = require(\"net\");\nconst subchannel_call_1 = require(\"./subchannel-call\");\nconst call_number_1 = require(\"./call-number\");\nconst TRACER_NAME = 'transport';\nconst FLOW_CONTROL_TRACER_NAME = 'transport_flowctrl';\nconst clientVersion = require('../../package.json').version;\nconst { HTTP2_HEADER_AUTHORITY, HTTP2_HEADER_CONTENT_TYPE, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_TE, HTTP2_HEADER_USER_AGENT, } = http2.constants;\nconst KEEPALIVE_TIMEOUT_MS = 20000;\nconst tooManyPingsData = Buffer.from('too_many_pings', 'ascii');\nclass Http2Transport {\n constructor(session, subchannelAddress, options, \n /**\n * Name of the remote server, if it is not the same as the subchannel\n * address, i.e. if connecting through an HTTP CONNECT proxy.\n */\n remoteName) {\n this.session = session;\n this.options = options;\n this.remoteName = remoteName;\n /**\n * Timer reference indicating when to send the next ping or when the most recent ping will be considered lost.\n */\n this.keepaliveTimer = null;\n /**\n * Indicates that the keepalive timer ran out while there were no active\n * calls, and a ping should be sent the next time a call starts.\n */\n this.pendingSendKeepalivePing = false;\n this.activeCalls = new Set();\n this.disconnectListeners = [];\n this.disconnectHandled = false;\n this.channelzEnabled = true;\n this.keepalivesSent = 0;\n this.messagesSent = 0;\n this.messagesReceived = 0;\n this.lastMessageSentTimestamp = null;\n this.lastMessageReceivedTimestamp = null;\n /* Populate subchannelAddressString and channelzRef before doing anything\n * else, because they are used in the trace methods. */\n this.subchannelAddressString = (0, subchannel_address_1.subchannelAddressToString)(subchannelAddress);\n if (options['grpc.enable_channelz'] === 0) {\n this.channelzEnabled = false;\n this.streamTracker = new channelz_1.ChannelzCallTrackerStub();\n }\n else {\n this.streamTracker = new channelz_1.ChannelzCallTracker();\n }\n this.channelzRef = (0, channelz_1.registerChannelzSocket)(this.subchannelAddressString, () => this.getChannelzInfo(), this.channelzEnabled);\n // Build user-agent string.\n this.userAgent = [\n options['grpc.primary_user_agent'],\n `grpc-node-js/${clientVersion}`,\n options['grpc.secondary_user_agent'],\n ]\n .filter(e => e)\n .join(' '); // remove falsey values first\n if ('grpc.keepalive_time_ms' in options) {\n this.keepaliveTimeMs = options['grpc.keepalive_time_ms'];\n }\n else {\n this.keepaliveTimeMs = -1;\n }\n if ('grpc.keepalive_timeout_ms' in options) {\n this.keepaliveTimeoutMs = options['grpc.keepalive_timeout_ms'];\n }\n else {\n this.keepaliveTimeoutMs = KEEPALIVE_TIMEOUT_MS;\n }\n if ('grpc.keepalive_permit_without_calls' in options) {\n this.keepaliveWithoutCalls =\n options['grpc.keepalive_permit_without_calls'] === 1;\n }\n else {\n this.keepaliveWithoutCalls = false;\n }\n session.once('close', () => {\n this.trace('session closed');\n this.handleDisconnect();\n });\n session.once('goaway', (errorCode, lastStreamID, opaqueData) => {\n let tooManyPings = false;\n /* See the last paragraph of\n * https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md#basic-keepalive */\n if (errorCode === http2.constants.NGHTTP2_ENHANCE_YOUR_CALM &&\n opaqueData &&\n opaqueData.equals(tooManyPingsData)) {\n tooManyPings = true;\n }\n this.trace('connection closed by GOAWAY with code ' +\n errorCode +\n ' and data ' +\n (opaqueData === null || opaqueData === void 0 ? void 0 : opaqueData.toString()));\n this.reportDisconnectToOwner(tooManyPings);\n });\n session.once('error', error => {\n this.trace('connection closed with error ' + error.message);\n this.handleDisconnect();\n });\n session.socket.once('close', (hadError) => {\n this.trace('connection closed. hadError=' + hadError);\n this.handleDisconnect();\n });\n if (logging.isTracerEnabled(TRACER_NAME)) {\n session.on('remoteSettings', (settings) => {\n this.trace('new settings received' +\n (this.session !== session ? ' on the old connection' : '') +\n ': ' +\n JSON.stringify(settings));\n });\n session.on('localSettings', (settings) => {\n this.trace('local settings acknowledged by remote' +\n (this.session !== session ? ' on the old connection' : '') +\n ': ' +\n JSON.stringify(settings));\n });\n }\n /* Start the keepalive timer last, because this can trigger trace logs,\n * which should only happen after everything else is set up. */\n if (this.keepaliveWithoutCalls) {\n this.maybeStartKeepalivePingTimer();\n }\n }\n getChannelzInfo() {\n var _a, _b, _c;\n const sessionSocket = this.session.socket;\n const remoteAddress = sessionSocket.remoteAddress\n ? (0, subchannel_address_1.stringToSubchannelAddress)(sessionSocket.remoteAddress, sessionSocket.remotePort)\n : null;\n const localAddress = sessionSocket.localAddress\n ? (0, subchannel_address_1.stringToSubchannelAddress)(sessionSocket.localAddress, sessionSocket.localPort)\n : null;\n let tlsInfo;\n if (this.session.encrypted) {\n const tlsSocket = sessionSocket;\n const cipherInfo = tlsSocket.getCipher();\n const certificate = tlsSocket.getCertificate();\n const peerCertificate = tlsSocket.getPeerCertificate();\n tlsInfo = {\n cipherSuiteStandardName: (_a = cipherInfo.standardName) !== null && _a !== void 0 ? _a : null,\n cipherSuiteOtherName: cipherInfo.standardName ? null : cipherInfo.name,\n localCertificate: certificate && 'raw' in certificate ? certificate.raw : null,\n remoteCertificate: peerCertificate && 'raw' in peerCertificate\n ? peerCertificate.raw\n : null,\n };\n }\n else {\n tlsInfo = null;\n }\n const socketInfo = {\n remoteAddress: remoteAddress,\n localAddress: localAddress,\n security: tlsInfo,\n remoteName: this.remoteName,\n streamsStarted: this.streamTracker.callsStarted,\n streamsSucceeded: this.streamTracker.callsSucceeded,\n streamsFailed: this.streamTracker.callsFailed,\n messagesSent: this.messagesSent,\n messagesReceived: this.messagesReceived,\n keepAlivesSent: this.keepalivesSent,\n lastLocalStreamCreatedTimestamp: this.streamTracker.lastCallStartedTimestamp,\n lastRemoteStreamCreatedTimestamp: null,\n lastMessageSentTimestamp: this.lastMessageSentTimestamp,\n lastMessageReceivedTimestamp: this.lastMessageReceivedTimestamp,\n localFlowControlWindow: (_b = this.session.state.localWindowSize) !== null && _b !== void 0 ? _b : null,\n remoteFlowControlWindow: (_c = this.session.state.remoteWindowSize) !== null && _c !== void 0 ? _c : null,\n };\n return socketInfo;\n }\n trace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, '(' +\n this.channelzRef.id +\n ') ' +\n this.subchannelAddressString +\n ' ' +\n text);\n }\n keepaliveTrace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, 'keepalive', '(' +\n this.channelzRef.id +\n ') ' +\n this.subchannelAddressString +\n ' ' +\n text);\n }\n flowControlTrace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, FLOW_CONTROL_TRACER_NAME, '(' +\n this.channelzRef.id +\n ') ' +\n this.subchannelAddressString +\n ' ' +\n text);\n }\n internalsTrace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, 'transport_internals', '(' +\n this.channelzRef.id +\n ') ' +\n this.subchannelAddressString +\n ' ' +\n text);\n }\n /**\n * Indicate to the owner of this object that this transport should no longer\n * be used. That happens if the connection drops, or if the server sends a\n * GOAWAY.\n * @param tooManyPings If true, this was triggered by a GOAWAY with data\n * indicating that the session was closed becaues the client sent too many\n * pings.\n * @returns\n */\n reportDisconnectToOwner(tooManyPings) {\n if (this.disconnectHandled) {\n return;\n }\n this.disconnectHandled = true;\n this.disconnectListeners.forEach(listener => listener(tooManyPings));\n }\n /**\n * Handle connection drops, but not GOAWAYs.\n */\n handleDisconnect() {\n this.clearKeepaliveTimeout();\n this.reportDisconnectToOwner(false);\n for (const call of this.activeCalls) {\n call.onDisconnect();\n }\n // Wait an event loop cycle before destroying the connection\n setImmediate(() => {\n this.session.destroy();\n });\n }\n addDisconnectListener(listener) {\n this.disconnectListeners.push(listener);\n }\n canSendPing() {\n return (!this.session.destroyed &&\n this.keepaliveTimeMs > 0 &&\n (this.keepaliveWithoutCalls || this.activeCalls.size > 0));\n }\n maybeSendPing() {\n var _a, _b;\n if (!this.canSendPing()) {\n this.pendingSendKeepalivePing = true;\n return;\n }\n if (this.keepaliveTimer) {\n console.error('keepaliveTimeout is not null');\n return;\n }\n if (this.channelzEnabled) {\n this.keepalivesSent += 1;\n }\n this.keepaliveTrace('Sending ping with timeout ' + this.keepaliveTimeoutMs + 'ms');\n this.keepaliveTimer = setTimeout(() => {\n this.keepaliveTimer = null;\n this.keepaliveTrace('Ping timeout passed without response');\n this.handleDisconnect();\n }, this.keepaliveTimeoutMs);\n (_b = (_a = this.keepaliveTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a);\n let pingSendError = '';\n try {\n const pingSentSuccessfully = this.session.ping((err, duration, payload) => {\n this.clearKeepaliveTimeout();\n if (err) {\n this.keepaliveTrace('Ping failed with error ' + err.message);\n this.handleDisconnect();\n }\n else {\n this.keepaliveTrace('Received ping response');\n this.maybeStartKeepalivePingTimer();\n }\n });\n if (!pingSentSuccessfully) {\n pingSendError = 'Ping returned false';\n }\n }\n catch (e) {\n // grpc/grpc-node#2139\n pingSendError = (e instanceof Error ? e.message : '') || 'Unknown error';\n }\n if (pingSendError) {\n this.keepaliveTrace('Ping send failed: ' + pingSendError);\n this.handleDisconnect();\n }\n }\n /**\n * Starts the keepalive ping timer if appropriate. If the timer already ran\n * out while there were no active requests, instead send a ping immediately.\n * If the ping timer is already running or a ping is currently in flight,\n * instead do nothing and wait for them to resolve.\n */\n maybeStartKeepalivePingTimer() {\n var _a, _b;\n if (!this.canSendPing()) {\n return;\n }\n if (this.pendingSendKeepalivePing) {\n this.pendingSendKeepalivePing = false;\n this.maybeSendPing();\n }\n else if (!this.keepaliveTimer) {\n this.keepaliveTrace('Starting keepalive timer for ' + this.keepaliveTimeMs + 'ms');\n this.keepaliveTimer = setTimeout(() => {\n this.keepaliveTimer = null;\n this.maybeSendPing();\n }, this.keepaliveTimeMs);\n (_b = (_a = this.keepaliveTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n /* Otherwise, there is already either a keepalive timer or a ping pending,\n * wait for those to resolve. */\n }\n /**\n * Clears whichever keepalive timeout is currently active, if any.\n */\n clearKeepaliveTimeout() {\n if (this.keepaliveTimer) {\n clearTimeout(this.keepaliveTimer);\n this.keepaliveTimer = null;\n }\n }\n removeActiveCall(call) {\n this.activeCalls.delete(call);\n if (this.activeCalls.size === 0) {\n this.session.unref();\n }\n }\n addActiveCall(call) {\n this.activeCalls.add(call);\n if (this.activeCalls.size === 1) {\n this.session.ref();\n if (!this.keepaliveWithoutCalls) {\n this.maybeStartKeepalivePingTimer();\n }\n }\n }\n createCall(metadata, host, method, listener, subchannelCallStatsTracker) {\n const headers = metadata.toHttp2Headers();\n headers[HTTP2_HEADER_AUTHORITY] = host;\n headers[HTTP2_HEADER_USER_AGENT] = this.userAgent;\n headers[HTTP2_HEADER_CONTENT_TYPE] = 'application/grpc';\n headers[HTTP2_HEADER_METHOD] = 'POST';\n headers[HTTP2_HEADER_PATH] = method;\n headers[HTTP2_HEADER_TE] = 'trailers';\n let http2Stream;\n /* In theory, if an error is thrown by session.request because session has\n * become unusable (e.g. because it has received a goaway), this subchannel\n * should soon see the corresponding close or goaway event anyway and leave\n * READY. But we have seen reports that this does not happen\n * (https://github.com/googleapis/nodejs-firestore/issues/1023#issuecomment-653204096)\n * so for defense in depth, we just discard the session when we see an\n * error here.\n */\n try {\n http2Stream = this.session.request(headers);\n }\n catch (e) {\n this.handleDisconnect();\n throw e;\n }\n this.flowControlTrace('local window size: ' +\n this.session.state.localWindowSize +\n ' remote window size: ' +\n this.session.state.remoteWindowSize);\n this.internalsTrace('session.closed=' +\n this.session.closed +\n ' session.destroyed=' +\n this.session.destroyed +\n ' session.socket.destroyed=' +\n this.session.socket.destroyed);\n let eventTracker;\n // eslint-disable-next-line prefer-const\n let call;\n if (this.channelzEnabled) {\n this.streamTracker.addCallStarted();\n eventTracker = {\n addMessageSent: () => {\n var _a;\n this.messagesSent += 1;\n this.lastMessageSentTimestamp = new Date();\n (_a = subchannelCallStatsTracker.addMessageSent) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker);\n },\n addMessageReceived: () => {\n var _a;\n this.messagesReceived += 1;\n this.lastMessageReceivedTimestamp = new Date();\n (_a = subchannelCallStatsTracker.addMessageReceived) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker);\n },\n onCallEnd: status => {\n var _a;\n (_a = subchannelCallStatsTracker.onCallEnd) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker, status);\n this.removeActiveCall(call);\n },\n onStreamEnd: success => {\n var _a;\n if (success) {\n this.streamTracker.addCallSucceeded();\n }\n else {\n this.streamTracker.addCallFailed();\n }\n (_a = subchannelCallStatsTracker.onStreamEnd) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker, success);\n },\n };\n }\n else {\n eventTracker = {\n addMessageSent: () => {\n var _a;\n (_a = subchannelCallStatsTracker.addMessageSent) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker);\n },\n addMessageReceived: () => {\n var _a;\n (_a = subchannelCallStatsTracker.addMessageReceived) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker);\n },\n onCallEnd: status => {\n var _a;\n (_a = subchannelCallStatsTracker.onCallEnd) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker, status);\n this.removeActiveCall(call);\n },\n onStreamEnd: success => {\n var _a;\n (_a = subchannelCallStatsTracker.onStreamEnd) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker, success);\n },\n };\n }\n call = new subchannel_call_1.Http2SubchannelCall(http2Stream, eventTracker, listener, this, (0, call_number_1.getNextCallNumber)());\n this.addActiveCall(call);\n return call;\n }\n getChannelzRef() {\n return this.channelzRef;\n }\n getPeerName() {\n return this.subchannelAddressString;\n }\n getOptions() {\n return this.options;\n }\n shutdown() {\n this.session.close();\n (0, channelz_1.unregisterChannelzRef)(this.channelzRef);\n }\n}\nclass Http2SubchannelConnector {\n constructor(channelTarget) {\n this.channelTarget = channelTarget;\n this.session = null;\n this.isShutdown = false;\n }\n trace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, (0, uri_parser_1.uriToString)(this.channelTarget) + ' ' + text);\n }\n createSession(secureConnectResult, address, options) {\n if (this.isShutdown) {\n return Promise.reject();\n }\n if (secureConnectResult.socket.closed) {\n return Promise.reject('Connection closed before starting HTTP/2 handshake');\n }\n return new Promise((resolve, reject) => {\n let remoteName = null;\n let realTarget = this.channelTarget;\n if ('grpc.http_connect_target' in options) {\n const parsedTarget = (0, uri_parser_1.parseUri)(options['grpc.http_connect_target']);\n if (parsedTarget) {\n realTarget = parsedTarget;\n remoteName = (0, uri_parser_1.uriToString)(parsedTarget);\n }\n }\n const scheme = secureConnectResult.secure ? 'https' : 'http';\n const targetPath = (0, resolver_1.getDefaultAuthority)(realTarget);\n const closeHandler = () => {\n var _a;\n (_a = this.session) === null || _a === void 0 ? void 0 : _a.destroy();\n this.session = null;\n // Leave time for error event to happen before rejecting\n setImmediate(() => {\n if (!reportedError) {\n reportedError = true;\n reject(`${errorMessage.trim()} (${new Date().toISOString()})`);\n }\n });\n };\n const errorHandler = (error) => {\n var _a;\n (_a = this.session) === null || _a === void 0 ? void 0 : _a.destroy();\n errorMessage = error.message;\n this.trace('connection failed with error ' + errorMessage);\n if (!reportedError) {\n reportedError = true;\n reject(`${errorMessage} (${new Date().toISOString()})`);\n }\n };\n const sessionOptions = {\n createConnection: (authority, option) => {\n return secureConnectResult.socket;\n }\n };\n if (options['grpc-node.flow_control_window'] !== undefined) {\n sessionOptions.settings = {\n initialWindowSize: options['grpc-node.flow_control_window']\n };\n }\n const session = http2.connect(`${scheme}://${targetPath}`, sessionOptions);\n this.session = session;\n let errorMessage = 'Failed to connect';\n let reportedError = false;\n session.unref();\n session.once('remoteSettings', () => {\n session.removeAllListeners();\n secureConnectResult.socket.removeListener('close', closeHandler);\n secureConnectResult.socket.removeListener('error', errorHandler);\n resolve(new Http2Transport(session, address, options, remoteName));\n this.session = null;\n });\n session.once('close', closeHandler);\n session.once('error', errorHandler);\n secureConnectResult.socket.once('close', closeHandler);\n secureConnectResult.socket.once('error', errorHandler);\n });\n }\n tcpConnect(address, options) {\n return (0, http_proxy_1.getProxiedConnection)(address, options).then(proxiedSocket => {\n if (proxiedSocket) {\n return proxiedSocket;\n }\n else {\n return new Promise((resolve, reject) => {\n const closeCallback = () => {\n reject(new Error('Socket closed'));\n };\n const errorCallback = (error) => {\n reject(error);\n };\n const socket = net.connect(address, () => {\n socket.removeListener('close', closeCallback);\n socket.removeListener('error', errorCallback);\n resolve(socket);\n });\n socket.once('close', closeCallback);\n socket.once('error', errorCallback);\n });\n }\n });\n }\n async connect(address, secureConnector, options) {\n if (this.isShutdown) {\n return Promise.reject();\n }\n let tcpConnection = null;\n let secureConnectResult = null;\n const addressString = (0, subchannel_address_1.subchannelAddressToString)(address);\n try {\n this.trace(addressString + ' Waiting for secureConnector to be ready');\n await secureConnector.waitForReady();\n this.trace(addressString + ' secureConnector is ready');\n tcpConnection = await this.tcpConnect(address, options);\n tcpConnection.setNoDelay();\n this.trace(addressString + ' Established TCP connection');\n secureConnectResult = await secureConnector.connect(tcpConnection);\n this.trace(addressString + ' Established secure connection');\n return this.createSession(secureConnectResult, address, options);\n }\n catch (e) {\n tcpConnection === null || tcpConnection === void 0 ? void 0 : tcpConnection.destroy();\n secureConnectResult === null || secureConnectResult === void 0 ? void 0 : secureConnectResult.socket.destroy();\n throw e;\n }\n }\n shutdown() {\n var _a;\n this.isShutdown = true;\n (_a = this.session) === null || _a === void 0 ? void 0 : _a.close();\n this.session = null;\n }\n}\nexports.Http2SubchannelConnector = Http2SubchannelConnector;\n//# sourceMappingURL=transport.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SubchannelPool = void 0;\nexports.getSubchannelPool = getSubchannelPool;\nconst channel_options_1 = require(\"./channel-options\");\nconst subchannel_1 = require(\"./subchannel\");\nconst subchannel_address_1 = require(\"./subchannel-address\");\nconst uri_parser_1 = require(\"./uri-parser\");\nconst transport_1 = require(\"./transport\");\n// 10 seconds in milliseconds. This value is arbitrary.\n/**\n * The amount of time in between checks for dropping subchannels that have no\n * other references\n */\nconst REF_CHECK_INTERVAL = 10000;\nclass SubchannelPool {\n /**\n * A pool of subchannels use for making connections. Subchannels with the\n * exact same parameters will be reused.\n */\n constructor() {\n this.pool = Object.create(null);\n /**\n * A timer of a task performing a periodic subchannel cleanup.\n */\n this.cleanupTimer = null;\n }\n /**\n * Unrefs all unused subchannels and cancels the cleanup task if all\n * subchannels have been unrefed.\n */\n unrefUnusedSubchannels() {\n let allSubchannelsUnrefed = true;\n /* These objects are created with Object.create(null), so they do not\n * have a prototype, which means that for (... in ...) loops over them\n * do not need to be filtered */\n // eslint-disable-disable-next-line:forin\n for (const channelTarget in this.pool) {\n const subchannelObjArray = this.pool[channelTarget];\n const refedSubchannels = subchannelObjArray.filter(value => !value.subchannel.unrefIfOneRef());\n if (refedSubchannels.length > 0) {\n allSubchannelsUnrefed = false;\n }\n /* For each subchannel in the pool, try to unref it if it has\n * exactly one ref (which is the ref from the pool itself). If that\n * does happen, remove the subchannel from the pool */\n this.pool[channelTarget] = refedSubchannels;\n }\n /* Currently we do not delete keys with empty values. If that results\n * in significant memory usage we should change it. */\n // Cancel the cleanup task if all subchannels have been unrefed.\n if (allSubchannelsUnrefed && this.cleanupTimer !== null) {\n clearInterval(this.cleanupTimer);\n this.cleanupTimer = null;\n }\n }\n /**\n * Ensures that the cleanup task is spawned.\n */\n ensureCleanupTask() {\n var _a, _b;\n if (this.cleanupTimer === null) {\n this.cleanupTimer = setInterval(() => {\n this.unrefUnusedSubchannels();\n }, REF_CHECK_INTERVAL);\n // Unref because this timer should not keep the event loop running.\n // Call unref only if it exists to address electron/electron#21162\n (_b = (_a = this.cleanupTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n }\n /**\n * Get a subchannel if one already exists with exactly matching parameters.\n * Otherwise, create and save a subchannel with those parameters.\n * @param channelTarget\n * @param subchannelTarget\n * @param channelArguments\n * @param channelCredentials\n */\n getOrCreateSubchannel(channelTargetUri, subchannelTarget, channelArguments, channelCredentials) {\n this.ensureCleanupTask();\n const channelTarget = (0, uri_parser_1.uriToString)(channelTargetUri);\n if (channelTarget in this.pool) {\n const subchannelObjArray = this.pool[channelTarget];\n for (const subchannelObj of subchannelObjArray) {\n if ((0, subchannel_address_1.subchannelAddressEqual)(subchannelTarget, subchannelObj.subchannelAddress) &&\n (0, channel_options_1.channelOptionsEqual)(channelArguments, subchannelObj.channelArguments) &&\n channelCredentials._equals(subchannelObj.channelCredentials)) {\n return subchannelObj.subchannel;\n }\n }\n }\n // If we get here, no matching subchannel was found\n const subchannel = new subchannel_1.Subchannel(channelTargetUri, subchannelTarget, channelArguments, channelCredentials, new transport_1.Http2SubchannelConnector(channelTargetUri));\n if (!(channelTarget in this.pool)) {\n this.pool[channelTarget] = [];\n }\n this.pool[channelTarget].push({\n subchannelAddress: subchannelTarget,\n channelArguments,\n channelCredentials,\n subchannel,\n });\n subchannel.ref();\n return subchannel;\n }\n}\nexports.SubchannelPool = SubchannelPool;\nconst globalSubchannelPool = new SubchannelPool();\n/**\n * Get either the global subchannel pool, or a new subchannel pool.\n * @param global\n */\nfunction getSubchannelPool(global) {\n if (global) {\n return globalSubchannelPool;\n }\n else {\n return new SubchannelPool();\n }\n}\n//# sourceMappingURL=subchannel-pool.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FilterStackFactory = exports.FilterStack = void 0;\nclass FilterStack {\n constructor(filters) {\n this.filters = filters;\n }\n sendMetadata(metadata) {\n let result = metadata;\n for (let i = 0; i < this.filters.length; i++) {\n result = this.filters[i].sendMetadata(result);\n }\n return result;\n }\n receiveMetadata(metadata) {\n let result = metadata;\n for (let i = this.filters.length - 1; i >= 0; i--) {\n result = this.filters[i].receiveMetadata(result);\n }\n return result;\n }\n sendMessage(message) {\n let result = message;\n for (let i = 0; i < this.filters.length; i++) {\n result = this.filters[i].sendMessage(result);\n }\n return result;\n }\n receiveMessage(message) {\n let result = message;\n for (let i = this.filters.length - 1; i >= 0; i--) {\n result = this.filters[i].receiveMessage(result);\n }\n return result;\n }\n receiveTrailers(status) {\n let result = status;\n for (let i = this.filters.length - 1; i >= 0; i--) {\n result = this.filters[i].receiveTrailers(result);\n }\n return result;\n }\n push(filters) {\n this.filters.unshift(...filters);\n }\n getFilters() {\n return this.filters;\n }\n}\nexports.FilterStack = FilterStack;\nclass FilterStackFactory {\n constructor(factories) {\n this.factories = factories;\n }\n push(filterFactories) {\n this.factories.unshift(...filterFactories);\n }\n clone() {\n return new FilterStackFactory([...this.factories]);\n }\n createFilter() {\n return new FilterStack(this.factories.map(factory => factory.createFilter()));\n }\n}\nexports.FilterStackFactory = FilterStackFactory;\n//# sourceMappingURL=filter-stack.js.map","\"use strict\";\n/*\n * Copyright 2021 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CompressionAlgorithms = void 0;\nvar CompressionAlgorithms;\n(function (CompressionAlgorithms) {\n CompressionAlgorithms[CompressionAlgorithms[\"identity\"] = 0] = \"identity\";\n CompressionAlgorithms[CompressionAlgorithms[\"deflate\"] = 1] = \"deflate\";\n CompressionAlgorithms[CompressionAlgorithms[\"gzip\"] = 2] = \"gzip\";\n})(CompressionAlgorithms || (exports.CompressionAlgorithms = CompressionAlgorithms = {}));\n//# sourceMappingURL=compression-algorithms.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseFilter = void 0;\nclass BaseFilter {\n async sendMetadata(metadata) {\n return metadata;\n }\n receiveMetadata(metadata) {\n return metadata;\n }\n async sendMessage(message) {\n return message;\n }\n async receiveMessage(message) {\n return message;\n }\n receiveTrailers(status) {\n return status;\n }\n}\nexports.BaseFilter = BaseFilter;\n//# sourceMappingURL=filter.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CompressionFilterFactory = exports.CompressionFilter = void 0;\nconst zlib = require(\"zlib\");\nconst compression_algorithms_1 = require(\"./compression-algorithms\");\nconst constants_1 = require(\"./constants\");\nconst filter_1 = require(\"./filter\");\nconst logging = require(\"./logging\");\nconst isCompressionAlgorithmKey = (key) => {\n return (typeof key === 'number' && typeof compression_algorithms_1.CompressionAlgorithms[key] === 'string');\n};\nclass CompressionHandler {\n /**\n * @param message Raw uncompressed message bytes\n * @param compress Indicates whether the message should be compressed\n * @return Framed message, compressed if applicable\n */\n async writeMessage(message, compress) {\n let messageBuffer = message;\n if (compress) {\n messageBuffer = await this.compressMessage(messageBuffer);\n }\n const output = Buffer.allocUnsafe(messageBuffer.length + 5);\n output.writeUInt8(compress ? 1 : 0, 0);\n output.writeUInt32BE(messageBuffer.length, 1);\n messageBuffer.copy(output, 5);\n return output;\n }\n /**\n * @param data Framed message, possibly compressed\n * @return Uncompressed message\n */\n async readMessage(data) {\n const compressed = data.readUInt8(0) === 1;\n let messageBuffer = data.slice(5);\n if (compressed) {\n messageBuffer = await this.decompressMessage(messageBuffer);\n }\n return messageBuffer;\n }\n}\nclass IdentityHandler extends CompressionHandler {\n async compressMessage(message) {\n return message;\n }\n async writeMessage(message, compress) {\n const output = Buffer.allocUnsafe(message.length + 5);\n /* With \"identity\" compression, messages should always be marked as\n * uncompressed */\n output.writeUInt8(0, 0);\n output.writeUInt32BE(message.length, 1);\n message.copy(output, 5);\n return output;\n }\n decompressMessage(message) {\n return Promise.reject(new Error('Received compressed message but \"grpc-encoding\" header was identity'));\n }\n}\nclass DeflateHandler extends CompressionHandler {\n constructor(maxRecvMessageLength) {\n super();\n this.maxRecvMessageLength = maxRecvMessageLength;\n }\n compressMessage(message) {\n return new Promise((resolve, reject) => {\n zlib.deflate(message, (err, output) => {\n if (err) {\n reject(err);\n }\n else {\n resolve(output);\n }\n });\n });\n }\n decompressMessage(message) {\n return new Promise((resolve, reject) => {\n let totalLength = 0;\n const messageParts = [];\n const decompresser = zlib.createInflate();\n decompresser.on('data', (chunk) => {\n messageParts.push(chunk);\n totalLength += chunk.byteLength;\n if (this.maxRecvMessageLength !== -1 && totalLength > this.maxRecvMessageLength) {\n decompresser.destroy();\n reject({\n code: constants_1.Status.RESOURCE_EXHAUSTED,\n details: `Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`\n });\n }\n });\n decompresser.on('end', () => {\n resolve(Buffer.concat(messageParts));\n });\n decompresser.write(message);\n decompresser.end();\n });\n }\n}\nclass GzipHandler extends CompressionHandler {\n constructor(maxRecvMessageLength) {\n super();\n this.maxRecvMessageLength = maxRecvMessageLength;\n }\n compressMessage(message) {\n return new Promise((resolve, reject) => {\n zlib.gzip(message, (err, output) => {\n if (err) {\n reject(err);\n }\n else {\n resolve(output);\n }\n });\n });\n }\n decompressMessage(message) {\n return new Promise((resolve, reject) => {\n let totalLength = 0;\n const messageParts = [];\n const decompresser = zlib.createGunzip();\n decompresser.on('data', (chunk) => {\n messageParts.push(chunk);\n totalLength += chunk.byteLength;\n if (this.maxRecvMessageLength !== -1 && totalLength > this.maxRecvMessageLength) {\n decompresser.destroy();\n reject({\n code: constants_1.Status.RESOURCE_EXHAUSTED,\n details: `Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`\n });\n }\n });\n decompresser.on('end', () => {\n resolve(Buffer.concat(messageParts));\n });\n decompresser.write(message);\n decompresser.end();\n });\n }\n}\nclass UnknownHandler extends CompressionHandler {\n constructor(compressionName) {\n super();\n this.compressionName = compressionName;\n }\n compressMessage(message) {\n return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`));\n }\n decompressMessage(message) {\n // This should be unreachable\n return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`));\n }\n}\nfunction getCompressionHandler(compressionName, maxReceiveMessageSize) {\n switch (compressionName) {\n case 'identity':\n return new IdentityHandler();\n case 'deflate':\n return new DeflateHandler(maxReceiveMessageSize);\n case 'gzip':\n return new GzipHandler(maxReceiveMessageSize);\n default:\n return new UnknownHandler(compressionName);\n }\n}\nclass CompressionFilter extends filter_1.BaseFilter {\n constructor(channelOptions, sharedFilterConfig) {\n var _a, _b, _c;\n super();\n this.sharedFilterConfig = sharedFilterConfig;\n this.sendCompression = new IdentityHandler();\n this.receiveCompression = new IdentityHandler();\n this.currentCompressionAlgorithm = 'identity';\n const compressionAlgorithmKey = channelOptions['grpc.default_compression_algorithm'];\n this.maxReceiveMessageLength = (_a = channelOptions['grpc.max_receive_message_length']) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;\n this.maxSendMessageLength = (_b = channelOptions['grpc.max_send_message_length']) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_MAX_SEND_MESSAGE_LENGTH;\n if (compressionAlgorithmKey !== undefined) {\n if (isCompressionAlgorithmKey(compressionAlgorithmKey)) {\n const clientSelectedEncoding = compression_algorithms_1.CompressionAlgorithms[compressionAlgorithmKey];\n const serverSupportedEncodings = (_c = sharedFilterConfig.serverSupportedEncodingHeader) === null || _c === void 0 ? void 0 : _c.split(',');\n /**\n * There are two possible situations here:\n * 1) We don't have any info yet from the server about what compression it supports\n * In that case we should just use what the client tells us to use\n * 2) We've previously received a response from the server including a grpc-accept-encoding header\n * In that case we only want to use the encoding chosen by the client if the server supports it\n */\n if (!serverSupportedEncodings ||\n serverSupportedEncodings.includes(clientSelectedEncoding)) {\n this.currentCompressionAlgorithm = clientSelectedEncoding;\n this.sendCompression = getCompressionHandler(this.currentCompressionAlgorithm, -1);\n }\n }\n else {\n logging.log(constants_1.LogVerbosity.ERROR, `Invalid value provided for grpc.default_compression_algorithm option: ${compressionAlgorithmKey}`);\n }\n }\n }\n async sendMetadata(metadata) {\n const headers = await metadata;\n headers.set('grpc-accept-encoding', 'identity,deflate,gzip');\n headers.set('accept-encoding', 'identity');\n // No need to send the header if it's \"identity\" - behavior is identical; save the bandwidth\n if (this.currentCompressionAlgorithm === 'identity') {\n headers.remove('grpc-encoding');\n }\n else {\n headers.set('grpc-encoding', this.currentCompressionAlgorithm);\n }\n return headers;\n }\n receiveMetadata(metadata) {\n const receiveEncoding = metadata.get('grpc-encoding');\n if (receiveEncoding.length > 0) {\n const encoding = receiveEncoding[0];\n if (typeof encoding === 'string') {\n this.receiveCompression = getCompressionHandler(encoding, this.maxReceiveMessageLength);\n }\n }\n metadata.remove('grpc-encoding');\n /* Check to see if the compression we're using to send messages is supported by the server\n * If not, reset the sendCompression filter and have it use the default IdentityHandler */\n const serverSupportedEncodingsHeader = metadata.get('grpc-accept-encoding')[0];\n if (serverSupportedEncodingsHeader) {\n this.sharedFilterConfig.serverSupportedEncodingHeader =\n serverSupportedEncodingsHeader;\n const serverSupportedEncodings = serverSupportedEncodingsHeader.split(',');\n if (!serverSupportedEncodings.includes(this.currentCompressionAlgorithm)) {\n this.sendCompression = new IdentityHandler();\n this.currentCompressionAlgorithm = 'identity';\n }\n }\n metadata.remove('grpc-accept-encoding');\n return metadata;\n }\n async sendMessage(message) {\n var _a;\n /* This filter is special. The input message is the bare message bytes,\n * and the output is a framed and possibly compressed message. For this\n * reason, this filter should be at the bottom of the filter stack */\n const resolvedMessage = await message;\n if (this.maxSendMessageLength !== -1 && resolvedMessage.message.length > this.maxSendMessageLength) {\n throw {\n code: constants_1.Status.RESOURCE_EXHAUSTED,\n details: `Attempted to send message with a size larger than ${this.maxSendMessageLength}`\n };\n }\n let compress;\n if (this.sendCompression instanceof IdentityHandler) {\n compress = false;\n }\n else {\n compress = (((_a = resolvedMessage.flags) !== null && _a !== void 0 ? _a : 0) & 2 /* WriteFlags.NoCompress */) === 0;\n }\n return {\n message: await this.sendCompression.writeMessage(resolvedMessage.message, compress),\n flags: resolvedMessage.flags,\n };\n }\n async receiveMessage(message) {\n /* This filter is also special. The input message is framed and possibly\n * compressed, and the output message is deframed and uncompressed. So\n * this is another reason that this filter should be at the bottom of the\n * filter stack. */\n return this.receiveCompression.readMessage(await message);\n }\n}\nexports.CompressionFilter = CompressionFilter;\nclass CompressionFilterFactory {\n constructor(channel, options) {\n this.options = options;\n this.sharedFilterConfig = {};\n }\n createFilter() {\n return new CompressionFilter(this.options, this.sharedFilterConfig);\n }\n}\nexports.CompressionFilterFactory = CompressionFilterFactory;\n//# sourceMappingURL=compression-filter.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.minDeadline = minDeadline;\nexports.getDeadlineTimeoutString = getDeadlineTimeoutString;\nexports.getRelativeTimeout = getRelativeTimeout;\nexports.deadlineToString = deadlineToString;\nexports.formatDateDifference = formatDateDifference;\nfunction minDeadline(...deadlineList) {\n let minValue = Infinity;\n for (const deadline of deadlineList) {\n const deadlineMsecs = deadline instanceof Date ? deadline.getTime() : deadline;\n if (deadlineMsecs < minValue) {\n minValue = deadlineMsecs;\n }\n }\n return minValue;\n}\nconst units = [\n ['m', 1],\n ['S', 1000],\n ['M', 60 * 1000],\n ['H', 60 * 60 * 1000],\n];\nfunction getDeadlineTimeoutString(deadline) {\n const now = new Date().getTime();\n if (deadline instanceof Date) {\n deadline = deadline.getTime();\n }\n const timeoutMs = Math.max(deadline - now, 0);\n for (const [unit, factor] of units) {\n const amount = timeoutMs / factor;\n if (amount < 1e8) {\n return String(Math.ceil(amount)) + unit;\n }\n }\n throw new Error('Deadline is too far in the future');\n}\n/**\n * See https://nodejs.org/api/timers.html#settimeoutcallback-delay-args\n * In particular, \"When delay is larger than 2147483647 or less than 1, the\n * delay will be set to 1. Non-integer delays are truncated to an integer.\"\n * This number of milliseconds is almost 25 days.\n */\nconst MAX_TIMEOUT_TIME = 2147483647;\n/**\n * Get the timeout value that should be passed to setTimeout now for the timer\n * to end at the deadline. For any deadline before now, the timer should end\n * immediately, represented by a value of 0. For any deadline more than\n * MAX_TIMEOUT_TIME milliseconds in the future, a timer cannot be set that will\n * end at that time, so it is treated as infinitely far in the future.\n * @param deadline\n * @returns\n */\nfunction getRelativeTimeout(deadline) {\n const deadlineMs = deadline instanceof Date ? deadline.getTime() : deadline;\n const now = new Date().getTime();\n const timeout = deadlineMs - now;\n if (timeout < 0) {\n return 0;\n }\n else if (timeout > MAX_TIMEOUT_TIME) {\n return Infinity;\n }\n else {\n return timeout;\n }\n}\nfunction deadlineToString(deadline) {\n if (deadline instanceof Date) {\n return deadline.toISOString();\n }\n else {\n const dateDeadline = new Date(deadline);\n if (Number.isNaN(dateDeadline.getTime())) {\n return '' + deadline;\n }\n else {\n return dateDeadline.toISOString();\n }\n }\n}\n/**\n * Calculate the difference between two dates as a number of seconds and format\n * it as a string.\n * @param startDate\n * @param endDate\n * @returns\n */\nfunction formatDateDifference(startDate, endDate) {\n return ((endDate.getTime() - startDate.getTime()) / 1000).toFixed(3) + 's';\n}\n//# sourceMappingURL=deadline.js.map","\"use strict\";\n/*\n * Copyright 2022 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.restrictControlPlaneStatusCode = restrictControlPlaneStatusCode;\nconst constants_1 = require(\"./constants\");\nconst INAPPROPRIATE_CONTROL_PLANE_CODES = [\n constants_1.Status.OK,\n constants_1.Status.INVALID_ARGUMENT,\n constants_1.Status.NOT_FOUND,\n constants_1.Status.ALREADY_EXISTS,\n constants_1.Status.FAILED_PRECONDITION,\n constants_1.Status.ABORTED,\n constants_1.Status.OUT_OF_RANGE,\n constants_1.Status.DATA_LOSS,\n];\nfunction restrictControlPlaneStatusCode(code, details) {\n if (INAPPROPRIATE_CONTROL_PLANE_CODES.includes(code)) {\n return {\n code: constants_1.Status.INTERNAL,\n details: `Invalid status from control plane: ${code} ${constants_1.Status[code]} ${details}`,\n };\n }\n else {\n return { code, details };\n }\n}\n//# sourceMappingURL=control-plane-status.js.map","\"use strict\";\n/*\n * Copyright 2022 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LoadBalancingCall = void 0;\nconst connectivity_state_1 = require(\"./connectivity-state\");\nconst constants_1 = require(\"./constants\");\nconst deadline_1 = require(\"./deadline\");\nconst metadata_1 = require(\"./metadata\");\nconst picker_1 = require(\"./picker\");\nconst uri_parser_1 = require(\"./uri-parser\");\nconst logging = require(\"./logging\");\nconst control_plane_status_1 = require(\"./control-plane-status\");\nconst http2 = require(\"http2\");\nconst TRACER_NAME = 'load_balancing_call';\nclass LoadBalancingCall {\n constructor(channel, callConfig, methodName, host, credentials, deadline, callNumber) {\n var _a, _b;\n this.channel = channel;\n this.callConfig = callConfig;\n this.methodName = methodName;\n this.host = host;\n this.credentials = credentials;\n this.deadline = deadline;\n this.callNumber = callNumber;\n this.child = null;\n this.readPending = false;\n this.pendingMessage = null;\n this.pendingHalfClose = false;\n this.ended = false;\n this.metadata = null;\n this.listener = null;\n this.onCallEnded = null;\n this.childStartTime = null;\n const splitPath = this.methodName.split('/');\n let serviceName = '';\n /* The standard path format is \"/{serviceName}/{methodName}\", so if we split\n * by '/', the first item should be empty and the second should be the\n * service name */\n if (splitPath.length >= 2) {\n serviceName = splitPath[1];\n }\n const hostname = (_b = (_a = (0, uri_parser_1.splitHostPort)(this.host)) === null || _a === void 0 ? void 0 : _a.host) !== null && _b !== void 0 ? _b : 'localhost';\n /* Currently, call credentials are only allowed on HTTPS connections, so we\n * can assume that the scheme is \"https\" */\n this.serviceUrl = `https://${hostname}/${serviceName}`;\n this.startTime = new Date();\n }\n getDeadlineInfo() {\n var _a, _b;\n const deadlineInfo = [];\n if (this.childStartTime) {\n if (this.childStartTime > this.startTime) {\n if ((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.getOptions().waitForReady) {\n deadlineInfo.push('wait_for_ready');\n }\n deadlineInfo.push(`LB pick: ${(0, deadline_1.formatDateDifference)(this.startTime, this.childStartTime)}`);\n }\n deadlineInfo.push(...this.child.getDeadlineInfo());\n return deadlineInfo;\n }\n else {\n if ((_b = this.metadata) === null || _b === void 0 ? void 0 : _b.getOptions().waitForReady) {\n deadlineInfo.push('wait_for_ready');\n }\n deadlineInfo.push('Waiting for LB pick');\n }\n return deadlineInfo;\n }\n trace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, '[' + this.callNumber + '] ' + text);\n }\n outputStatus(status, progress) {\n var _a, _b;\n if (!this.ended) {\n this.ended = true;\n this.trace('ended with status: code=' +\n status.code +\n ' details=\"' +\n status.details +\n '\" start time=' +\n this.startTime.toISOString());\n const finalStatus = Object.assign(Object.assign({}, status), { progress });\n (_a = this.listener) === null || _a === void 0 ? void 0 : _a.onReceiveStatus(finalStatus);\n (_b = this.onCallEnded) === null || _b === void 0 ? void 0 : _b.call(this, finalStatus.code);\n }\n }\n doPick() {\n var _a, _b;\n if (this.ended) {\n return;\n }\n if (!this.metadata) {\n throw new Error('doPick called before start');\n }\n this.trace('Pick called');\n const finalMetadata = this.metadata.clone();\n const pickResult = this.channel.doPick(finalMetadata, this.callConfig.pickInformation);\n const subchannelString = pickResult.subchannel\n ? '(' +\n pickResult.subchannel.getChannelzRef().id +\n ') ' +\n pickResult.subchannel.getAddress()\n : '' + pickResult.subchannel;\n this.trace('Pick result: ' +\n picker_1.PickResultType[pickResult.pickResultType] +\n ' subchannel: ' +\n subchannelString +\n ' status: ' +\n ((_a = pickResult.status) === null || _a === void 0 ? void 0 : _a.code) +\n ' ' +\n ((_b = pickResult.status) === null || _b === void 0 ? void 0 : _b.details));\n switch (pickResult.pickResultType) {\n case picker_1.PickResultType.COMPLETE:\n const combinedCallCredentials = this.credentials.compose(pickResult.subchannel.getCallCredentials());\n combinedCallCredentials\n .generateMetadata({ method_name: this.methodName, service_url: this.serviceUrl })\n .then(credsMetadata => {\n var _a;\n /* If this call was cancelled (e.g. by the deadline) before\n * metadata generation finished, we shouldn't do anything with\n * it. */\n if (this.ended) {\n this.trace('Credentials metadata generation finished after call ended');\n return;\n }\n finalMetadata.merge(credsMetadata);\n if (finalMetadata.get('authorization').length > 1) {\n this.outputStatus({\n code: constants_1.Status.INTERNAL,\n details: '\"authorization\" metadata cannot have multiple values',\n metadata: new metadata_1.Metadata(),\n }, 'PROCESSED');\n }\n if (pickResult.subchannel.getConnectivityState() !==\n connectivity_state_1.ConnectivityState.READY) {\n this.trace('Picked subchannel ' +\n subchannelString +\n ' has state ' +\n connectivity_state_1.ConnectivityState[pickResult.subchannel.getConnectivityState()] +\n ' after getting credentials metadata. Retrying pick');\n this.doPick();\n return;\n }\n if (this.deadline !== Infinity) {\n finalMetadata.set('grpc-timeout', (0, deadline_1.getDeadlineTimeoutString)(this.deadline));\n }\n try {\n this.child = pickResult\n .subchannel.getRealSubchannel()\n .createCall(finalMetadata, this.host, this.methodName, {\n onReceiveMetadata: metadata => {\n this.trace('Received metadata');\n this.listener.onReceiveMetadata(metadata);\n },\n onReceiveMessage: message => {\n this.trace('Received message');\n this.listener.onReceiveMessage(message);\n },\n onReceiveStatus: status => {\n this.trace('Received status');\n if (status.rstCode ===\n http2.constants.NGHTTP2_REFUSED_STREAM) {\n this.outputStatus(status, 'REFUSED');\n }\n else {\n this.outputStatus(status, 'PROCESSED');\n }\n },\n });\n this.childStartTime = new Date();\n }\n catch (error) {\n this.trace('Failed to start call on picked subchannel ' +\n subchannelString +\n ' with error ' +\n error.message);\n this.outputStatus({\n code: constants_1.Status.INTERNAL,\n details: 'Failed to start HTTP/2 stream with error ' +\n error.message,\n metadata: new metadata_1.Metadata(),\n }, 'NOT_STARTED');\n return;\n }\n (_a = pickResult.onCallStarted) === null || _a === void 0 ? void 0 : _a.call(pickResult);\n this.onCallEnded = pickResult.onCallEnded;\n this.trace('Created child call [' + this.child.getCallNumber() + ']');\n if (this.readPending) {\n this.child.startRead();\n }\n if (this.pendingMessage) {\n this.child.sendMessageWithContext(this.pendingMessage.context, this.pendingMessage.message);\n }\n if (this.pendingHalfClose) {\n this.child.halfClose();\n }\n }, (error) => {\n // We assume the error code isn't 0 (Status.OK)\n const { code, details } = (0, control_plane_status_1.restrictControlPlaneStatusCode)(typeof error.code === 'number' ? error.code : constants_1.Status.UNKNOWN, `Getting metadata from plugin failed with error: ${error.message}`);\n this.outputStatus({\n code: code,\n details: details,\n metadata: new metadata_1.Metadata(),\n }, 'PROCESSED');\n });\n break;\n case picker_1.PickResultType.DROP:\n const { code, details } = (0, control_plane_status_1.restrictControlPlaneStatusCode)(pickResult.status.code, pickResult.status.details);\n setImmediate(() => {\n this.outputStatus({ code, details, metadata: pickResult.status.metadata }, 'DROP');\n });\n break;\n case picker_1.PickResultType.TRANSIENT_FAILURE:\n if (this.metadata.getOptions().waitForReady) {\n this.channel.queueCallForPick(this);\n }\n else {\n const { code, details } = (0, control_plane_status_1.restrictControlPlaneStatusCode)(pickResult.status.code, pickResult.status.details);\n setImmediate(() => {\n this.outputStatus({ code, details, metadata: pickResult.status.metadata }, 'PROCESSED');\n });\n }\n break;\n case picker_1.PickResultType.QUEUE:\n this.channel.queueCallForPick(this);\n }\n }\n cancelWithStatus(status, details) {\n var _a;\n this.trace('cancelWithStatus code: ' + status + ' details: \"' + details + '\"');\n (_a = this.child) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(status, details);\n this.outputStatus({ code: status, details: details, metadata: new metadata_1.Metadata() }, 'PROCESSED');\n }\n getPeer() {\n var _a, _b;\n return (_b = (_a = this.child) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : this.channel.getTarget();\n }\n start(metadata, listener) {\n this.trace('start called');\n this.listener = listener;\n this.metadata = metadata;\n this.doPick();\n }\n sendMessageWithContext(context, message) {\n this.trace('write() called with message of length ' + message.length);\n if (this.child) {\n this.child.sendMessageWithContext(context, message);\n }\n else {\n this.pendingMessage = { context, message };\n }\n }\n startRead() {\n this.trace('startRead called');\n if (this.child) {\n this.child.startRead();\n }\n else {\n this.readPending = true;\n }\n }\n halfClose() {\n this.trace('halfClose called');\n if (this.child) {\n this.child.halfClose();\n }\n else {\n this.pendingHalfClose = true;\n }\n }\n setCredentials(credentials) {\n throw new Error('Method not implemented.');\n }\n getCallNumber() {\n return this.callNumber;\n }\n}\nexports.LoadBalancingCall = LoadBalancingCall;\n//# sourceMappingURL=load-balancing-call.js.map","\"use strict\";\n/*\n * Copyright 2022 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ResolvingCall = void 0;\nconst call_credentials_1 = require(\"./call-credentials\");\nconst constants_1 = require(\"./constants\");\nconst deadline_1 = require(\"./deadline\");\nconst metadata_1 = require(\"./metadata\");\nconst logging = require(\"./logging\");\nconst control_plane_status_1 = require(\"./control-plane-status\");\nconst TRACER_NAME = 'resolving_call';\nclass ResolvingCall {\n constructor(channel, method, options, filterStackFactory, callNumber) {\n this.channel = channel;\n this.method = method;\n this.filterStackFactory = filterStackFactory;\n this.callNumber = callNumber;\n this.child = null;\n this.readPending = false;\n this.pendingMessage = null;\n this.pendingHalfClose = false;\n this.ended = false;\n this.readFilterPending = false;\n this.writeFilterPending = false;\n this.pendingChildStatus = null;\n this.metadata = null;\n this.listener = null;\n this.statusWatchers = [];\n this.deadlineTimer = setTimeout(() => { }, 0);\n this.filterStack = null;\n this.deadlineStartTime = null;\n this.configReceivedTime = null;\n this.childStartTime = null;\n /**\n * Credentials configured for this specific call. Does not include\n * call credentials associated with the channel credentials used to create\n * the channel.\n */\n this.credentials = call_credentials_1.CallCredentials.createEmpty();\n this.deadline = options.deadline;\n this.host = options.host;\n if (options.parentCall) {\n if (options.flags & constants_1.Propagate.CANCELLATION) {\n options.parentCall.on('cancelled', () => {\n this.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled by parent call');\n });\n }\n if (options.flags & constants_1.Propagate.DEADLINE) {\n this.trace('Propagating deadline from parent: ' +\n options.parentCall.getDeadline());\n this.deadline = (0, deadline_1.minDeadline)(this.deadline, options.parentCall.getDeadline());\n }\n }\n this.trace('Created');\n this.runDeadlineTimer();\n }\n trace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, '[' + this.callNumber + '] ' + text);\n }\n runDeadlineTimer() {\n clearTimeout(this.deadlineTimer);\n this.deadlineStartTime = new Date();\n this.trace('Deadline: ' + (0, deadline_1.deadlineToString)(this.deadline));\n const timeout = (0, deadline_1.getRelativeTimeout)(this.deadline);\n if (timeout !== Infinity) {\n this.trace('Deadline will be reached in ' + timeout + 'ms');\n const handleDeadline = () => {\n if (!this.deadlineStartTime) {\n this.cancelWithStatus(constants_1.Status.DEADLINE_EXCEEDED, 'Deadline exceeded');\n return;\n }\n const deadlineInfo = [];\n const deadlineEndTime = new Date();\n deadlineInfo.push(`Deadline exceeded after ${(0, deadline_1.formatDateDifference)(this.deadlineStartTime, deadlineEndTime)}`);\n if (this.configReceivedTime) {\n if (this.configReceivedTime > this.deadlineStartTime) {\n deadlineInfo.push(`name resolution: ${(0, deadline_1.formatDateDifference)(this.deadlineStartTime, this.configReceivedTime)}`);\n }\n if (this.childStartTime) {\n if (this.childStartTime > this.configReceivedTime) {\n deadlineInfo.push(`metadata filters: ${(0, deadline_1.formatDateDifference)(this.configReceivedTime, this.childStartTime)}`);\n }\n }\n else {\n deadlineInfo.push('waiting for metadata filters');\n }\n }\n else {\n deadlineInfo.push('waiting for name resolution');\n }\n if (this.child) {\n deadlineInfo.push(...this.child.getDeadlineInfo());\n }\n this.cancelWithStatus(constants_1.Status.DEADLINE_EXCEEDED, deadlineInfo.join(','));\n };\n if (timeout <= 0) {\n process.nextTick(handleDeadline);\n }\n else {\n this.deadlineTimer = setTimeout(handleDeadline, timeout);\n }\n }\n }\n outputStatus(status) {\n if (!this.ended) {\n this.ended = true;\n if (!this.filterStack) {\n this.filterStack = this.filterStackFactory.createFilter();\n }\n clearTimeout(this.deadlineTimer);\n const filteredStatus = this.filterStack.receiveTrailers(status);\n this.trace('ended with status: code=' +\n filteredStatus.code +\n ' details=\"' +\n filteredStatus.details +\n '\"');\n this.statusWatchers.forEach(watcher => watcher(filteredStatus));\n process.nextTick(() => {\n var _a;\n (_a = this.listener) === null || _a === void 0 ? void 0 : _a.onReceiveStatus(filteredStatus);\n });\n }\n }\n sendMessageOnChild(context, message) {\n if (!this.child) {\n throw new Error('sendMessageonChild called with child not populated');\n }\n const child = this.child;\n this.writeFilterPending = true;\n this.filterStack.sendMessage(Promise.resolve({ message: message, flags: context.flags })).then(filteredMessage => {\n this.writeFilterPending = false;\n child.sendMessageWithContext(context, filteredMessage.message);\n if (this.pendingHalfClose) {\n child.halfClose();\n }\n }, (status) => {\n this.cancelWithStatus(status.code, status.details);\n });\n }\n getConfig() {\n if (this.ended) {\n return;\n }\n if (!this.metadata || !this.listener) {\n throw new Error('getConfig called before start');\n }\n const configResult = this.channel.getConfig(this.method, this.metadata);\n if (configResult.type === 'NONE') {\n this.channel.queueCallForConfig(this);\n return;\n }\n else if (configResult.type === 'ERROR') {\n if (this.metadata.getOptions().waitForReady) {\n this.channel.queueCallForConfig(this);\n }\n else {\n this.outputStatus(configResult.error);\n }\n return;\n }\n // configResult.type === 'SUCCESS'\n this.configReceivedTime = new Date();\n const config = configResult.config;\n if (config.status !== constants_1.Status.OK) {\n const { code, details } = (0, control_plane_status_1.restrictControlPlaneStatusCode)(config.status, 'Failed to route call to method ' + this.method);\n this.outputStatus({\n code: code,\n details: details,\n metadata: new metadata_1.Metadata(),\n });\n return;\n }\n if (config.methodConfig.timeout) {\n const configDeadline = new Date();\n configDeadline.setSeconds(configDeadline.getSeconds() + config.methodConfig.timeout.seconds);\n configDeadline.setMilliseconds(configDeadline.getMilliseconds() +\n config.methodConfig.timeout.nanos / 1000000);\n this.deadline = (0, deadline_1.minDeadline)(this.deadline, configDeadline);\n this.runDeadlineTimer();\n }\n this.filterStackFactory.push(config.dynamicFilterFactories);\n this.filterStack = this.filterStackFactory.createFilter();\n this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(filteredMetadata => {\n this.child = this.channel.createRetryingCall(config, this.method, this.host, this.credentials, this.deadline);\n this.trace('Created child [' + this.child.getCallNumber() + ']');\n this.childStartTime = new Date();\n this.child.start(filteredMetadata, {\n onReceiveMetadata: metadata => {\n this.trace('Received metadata');\n this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(metadata));\n },\n onReceiveMessage: message => {\n this.trace('Received message');\n this.readFilterPending = true;\n this.filterStack.receiveMessage(message).then(filteredMesssage => {\n this.trace('Finished filtering received message');\n this.readFilterPending = false;\n this.listener.onReceiveMessage(filteredMesssage);\n if (this.pendingChildStatus) {\n this.outputStatus(this.pendingChildStatus);\n }\n }, (status) => {\n this.cancelWithStatus(status.code, status.details);\n });\n },\n onReceiveStatus: status => {\n this.trace('Received status');\n if (this.readFilterPending) {\n this.pendingChildStatus = status;\n }\n else {\n this.outputStatus(status);\n }\n },\n });\n if (this.readPending) {\n this.child.startRead();\n }\n if (this.pendingMessage) {\n this.sendMessageOnChild(this.pendingMessage.context, this.pendingMessage.message);\n }\n else if (this.pendingHalfClose) {\n this.child.halfClose();\n }\n }, (status) => {\n this.outputStatus(status);\n });\n }\n reportResolverError(status) {\n var _a;\n if ((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.getOptions().waitForReady) {\n this.channel.queueCallForConfig(this);\n }\n else {\n this.outputStatus(status);\n }\n }\n cancelWithStatus(status, details) {\n var _a;\n this.trace('cancelWithStatus code: ' + status + ' details: \"' + details + '\"');\n (_a = this.child) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(status, details);\n this.outputStatus({\n code: status,\n details: details,\n metadata: new metadata_1.Metadata(),\n });\n }\n getPeer() {\n var _a, _b;\n return (_b = (_a = this.child) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : this.channel.getTarget();\n }\n start(metadata, listener) {\n this.trace('start called');\n this.metadata = metadata.clone();\n this.listener = listener;\n this.getConfig();\n }\n sendMessageWithContext(context, message) {\n this.trace('write() called with message of length ' + message.length);\n if (this.child) {\n this.sendMessageOnChild(context, message);\n }\n else {\n this.pendingMessage = { context, message };\n }\n }\n startRead() {\n this.trace('startRead called');\n if (this.child) {\n this.child.startRead();\n }\n else {\n this.readPending = true;\n }\n }\n halfClose() {\n this.trace('halfClose called');\n if (this.child && !this.writeFilterPending) {\n this.child.halfClose();\n }\n else {\n this.pendingHalfClose = true;\n }\n }\n setCredentials(credentials) {\n this.credentials = credentials;\n }\n addStatusWatcher(watcher) {\n this.statusWatchers.push(watcher);\n }\n getCallNumber() {\n return this.callNumber;\n }\n}\nexports.ResolvingCall = ResolvingCall;\n//# sourceMappingURL=resolving-call.js.map","\"use strict\";\n/*\n * Copyright 2022 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RetryingCall = exports.MessageBufferTracker = exports.RetryThrottler = void 0;\nconst constants_1 = require(\"./constants\");\nconst deadline_1 = require(\"./deadline\");\nconst metadata_1 = require(\"./metadata\");\nconst logging = require(\"./logging\");\nconst TRACER_NAME = 'retrying_call';\nclass RetryThrottler {\n constructor(maxTokens, tokenRatio, previousRetryThrottler) {\n this.maxTokens = maxTokens;\n this.tokenRatio = tokenRatio;\n if (previousRetryThrottler) {\n /* When carrying over tokens from a previous config, rescale them to the\n * new max value */\n this.tokens =\n previousRetryThrottler.tokens *\n (maxTokens / previousRetryThrottler.maxTokens);\n }\n else {\n this.tokens = maxTokens;\n }\n }\n addCallSucceeded() {\n this.tokens = Math.min(this.tokens + this.tokenRatio, this.maxTokens);\n }\n addCallFailed() {\n this.tokens = Math.max(this.tokens - 1, 0);\n }\n canRetryCall() {\n return this.tokens > (this.maxTokens / 2);\n }\n}\nexports.RetryThrottler = RetryThrottler;\nclass MessageBufferTracker {\n constructor(totalLimit, limitPerCall) {\n this.totalLimit = totalLimit;\n this.limitPerCall = limitPerCall;\n this.totalAllocated = 0;\n this.allocatedPerCall = new Map();\n }\n allocate(size, callId) {\n var _a;\n const currentPerCall = (_a = this.allocatedPerCall.get(callId)) !== null && _a !== void 0 ? _a : 0;\n if (this.limitPerCall - currentPerCall < size ||\n this.totalLimit - this.totalAllocated < size) {\n return false;\n }\n this.allocatedPerCall.set(callId, currentPerCall + size);\n this.totalAllocated += size;\n return true;\n }\n free(size, callId) {\n var _a;\n if (this.totalAllocated < size) {\n throw new Error(`Invalid buffer allocation state: call ${callId} freed ${size} > total allocated ${this.totalAllocated}`);\n }\n this.totalAllocated -= size;\n const currentPerCall = (_a = this.allocatedPerCall.get(callId)) !== null && _a !== void 0 ? _a : 0;\n if (currentPerCall < size) {\n throw new Error(`Invalid buffer allocation state: call ${callId} freed ${size} > allocated for call ${currentPerCall}`);\n }\n this.allocatedPerCall.set(callId, currentPerCall - size);\n }\n freeAll(callId) {\n var _a;\n const currentPerCall = (_a = this.allocatedPerCall.get(callId)) !== null && _a !== void 0 ? _a : 0;\n if (this.totalAllocated < currentPerCall) {\n throw new Error(`Invalid buffer allocation state: call ${callId} allocated ${currentPerCall} > total allocated ${this.totalAllocated}`);\n }\n this.totalAllocated -= currentPerCall;\n this.allocatedPerCall.delete(callId);\n }\n}\nexports.MessageBufferTracker = MessageBufferTracker;\nconst PREVIONS_RPC_ATTEMPTS_METADATA_KEY = 'grpc-previous-rpc-attempts';\nconst DEFAULT_MAX_ATTEMPTS_LIMIT = 5;\nclass RetryingCall {\n constructor(channel, callConfig, methodName, host, credentials, deadline, callNumber, bufferTracker, retryThrottler) {\n var _a;\n this.channel = channel;\n this.callConfig = callConfig;\n this.methodName = methodName;\n this.host = host;\n this.credentials = credentials;\n this.deadline = deadline;\n this.callNumber = callNumber;\n this.bufferTracker = bufferTracker;\n this.retryThrottler = retryThrottler;\n this.listener = null;\n this.initialMetadata = null;\n this.underlyingCalls = [];\n this.writeBuffer = [];\n /**\n * The offset of message indices in the writeBuffer. For example, if\n * writeBufferOffset is 10, message 10 is in writeBuffer[0] and message 15\n * is in writeBuffer[5].\n */\n this.writeBufferOffset = 0;\n /**\n * Tracks whether a read has been started, so that we know whether to start\n * reads on new child calls. This only matters for the first read, because\n * once a message comes in the child call becomes committed and there will\n * be no new child calls.\n */\n this.readStarted = false;\n this.transparentRetryUsed = false;\n /**\n * Number of attempts so far\n */\n this.attempts = 0;\n this.hedgingTimer = null;\n this.committedCallIndex = null;\n this.initialRetryBackoffSec = 0;\n this.nextRetryBackoffSec = 0;\n const maxAttemptsLimit = (_a = channel.getOptions()['grpc-node.retry_max_attempts_limit']) !== null && _a !== void 0 ? _a : DEFAULT_MAX_ATTEMPTS_LIMIT;\n if (channel.getOptions()['grpc.enable_retries'] === 0) {\n this.state = 'NO_RETRY';\n this.maxAttempts = 1;\n }\n else if (callConfig.methodConfig.retryPolicy) {\n this.state = 'RETRY';\n const retryPolicy = callConfig.methodConfig.retryPolicy;\n this.nextRetryBackoffSec = this.initialRetryBackoffSec = Number(retryPolicy.initialBackoff.substring(0, retryPolicy.initialBackoff.length - 1));\n this.maxAttempts = Math.min(retryPolicy.maxAttempts, maxAttemptsLimit);\n }\n else if (callConfig.methodConfig.hedgingPolicy) {\n this.state = 'HEDGING';\n this.maxAttempts = Math.min(callConfig.methodConfig.hedgingPolicy.maxAttempts, maxAttemptsLimit);\n }\n else {\n this.state = 'TRANSPARENT_ONLY';\n this.maxAttempts = 1;\n }\n this.startTime = new Date();\n }\n getDeadlineInfo() {\n if (this.underlyingCalls.length === 0) {\n return [];\n }\n const deadlineInfo = [];\n const latestCall = this.underlyingCalls[this.underlyingCalls.length - 1];\n if (this.underlyingCalls.length > 1) {\n deadlineInfo.push(`previous attempts: ${this.underlyingCalls.length - 1}`);\n }\n if (latestCall.startTime > this.startTime) {\n deadlineInfo.push(`time to current attempt start: ${(0, deadline_1.formatDateDifference)(this.startTime, latestCall.startTime)}`);\n }\n deadlineInfo.push(...latestCall.call.getDeadlineInfo());\n return deadlineInfo;\n }\n getCallNumber() {\n return this.callNumber;\n }\n trace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, '[' + this.callNumber + '] ' + text);\n }\n reportStatus(statusObject) {\n this.trace('ended with status: code=' +\n statusObject.code +\n ' details=\"' +\n statusObject.details +\n '\" start time=' +\n this.startTime.toISOString());\n this.bufferTracker.freeAll(this.callNumber);\n this.writeBufferOffset = this.writeBufferOffset + this.writeBuffer.length;\n this.writeBuffer = [];\n process.nextTick(() => {\n var _a;\n // Explicitly construct status object to remove progress field\n (_a = this.listener) === null || _a === void 0 ? void 0 : _a.onReceiveStatus({\n code: statusObject.code,\n details: statusObject.details,\n metadata: statusObject.metadata,\n });\n });\n }\n cancelWithStatus(status, details) {\n this.trace('cancelWithStatus code: ' + status + ' details: \"' + details + '\"');\n this.reportStatus({ code: status, details, metadata: new metadata_1.Metadata() });\n for (const { call } of this.underlyingCalls) {\n call.cancelWithStatus(status, details);\n }\n }\n getPeer() {\n if (this.committedCallIndex !== null) {\n return this.underlyingCalls[this.committedCallIndex].call.getPeer();\n }\n else {\n return 'unknown';\n }\n }\n getBufferEntry(messageIndex) {\n var _a;\n return ((_a = this.writeBuffer[messageIndex - this.writeBufferOffset]) !== null && _a !== void 0 ? _a : {\n entryType: 'FREED',\n allocated: false,\n });\n }\n getNextBufferIndex() {\n return this.writeBufferOffset + this.writeBuffer.length;\n }\n clearSentMessages() {\n if (this.state !== 'COMMITTED') {\n return;\n }\n let earliestNeededMessageIndex;\n if (this.underlyingCalls[this.committedCallIndex].state === 'COMPLETED') {\n /* If the committed call is completed, clear all messages, even if some\n * have not been sent. */\n earliestNeededMessageIndex = this.getNextBufferIndex();\n }\n else {\n earliestNeededMessageIndex =\n this.underlyingCalls[this.committedCallIndex].nextMessageToSend;\n }\n for (let messageIndex = this.writeBufferOffset; messageIndex < earliestNeededMessageIndex; messageIndex++) {\n const bufferEntry = this.getBufferEntry(messageIndex);\n if (bufferEntry.allocated) {\n this.bufferTracker.free(bufferEntry.message.message.length, this.callNumber);\n }\n }\n this.writeBuffer = this.writeBuffer.slice(earliestNeededMessageIndex - this.writeBufferOffset);\n this.writeBufferOffset = earliestNeededMessageIndex;\n }\n commitCall(index) {\n var _a, _b;\n if (this.state === 'COMMITTED') {\n return;\n }\n this.trace('Committing call [' +\n this.underlyingCalls[index].call.getCallNumber() +\n '] at index ' +\n index);\n this.state = 'COMMITTED';\n (_b = (_a = this.callConfig).onCommitted) === null || _b === void 0 ? void 0 : _b.call(_a);\n this.committedCallIndex = index;\n for (let i = 0; i < this.underlyingCalls.length; i++) {\n if (i === index) {\n continue;\n }\n if (this.underlyingCalls[i].state === 'COMPLETED') {\n continue;\n }\n this.underlyingCalls[i].state = 'COMPLETED';\n this.underlyingCalls[i].call.cancelWithStatus(constants_1.Status.CANCELLED, 'Discarded in favor of other hedged attempt');\n }\n this.clearSentMessages();\n }\n commitCallWithMostMessages() {\n if (this.state === 'COMMITTED') {\n return;\n }\n let mostMessages = -1;\n let callWithMostMessages = -1;\n for (const [index, childCall] of this.underlyingCalls.entries()) {\n if (childCall.state === 'ACTIVE' &&\n childCall.nextMessageToSend > mostMessages) {\n mostMessages = childCall.nextMessageToSend;\n callWithMostMessages = index;\n }\n }\n if (callWithMostMessages === -1) {\n /* There are no active calls, disable retries to force the next call that\n * is started to be committed. */\n this.state = 'TRANSPARENT_ONLY';\n }\n else {\n this.commitCall(callWithMostMessages);\n }\n }\n isStatusCodeInList(list, code) {\n return list.some(value => {\n var _a;\n return value === code ||\n value.toString().toLowerCase() === ((_a = constants_1.Status[code]) === null || _a === void 0 ? void 0 : _a.toLowerCase());\n });\n }\n getNextRetryBackoffMs() {\n var _a;\n const retryPolicy = (_a = this.callConfig) === null || _a === void 0 ? void 0 : _a.methodConfig.retryPolicy;\n if (!retryPolicy) {\n return 0;\n }\n const nextBackoffMs = Math.random() * this.nextRetryBackoffSec * 1000;\n const maxBackoffSec = Number(retryPolicy.maxBackoff.substring(0, retryPolicy.maxBackoff.length - 1));\n this.nextRetryBackoffSec = Math.min(this.nextRetryBackoffSec * retryPolicy.backoffMultiplier, maxBackoffSec);\n return nextBackoffMs;\n }\n maybeRetryCall(pushback, callback) {\n if (this.state !== 'RETRY') {\n callback(false);\n return;\n }\n if (this.attempts >= this.maxAttempts) {\n callback(false);\n return;\n }\n let retryDelayMs;\n if (pushback === null) {\n retryDelayMs = this.getNextRetryBackoffMs();\n }\n else if (pushback < 0) {\n this.state = 'TRANSPARENT_ONLY';\n callback(false);\n return;\n }\n else {\n retryDelayMs = pushback;\n this.nextRetryBackoffSec = this.initialRetryBackoffSec;\n }\n setTimeout(() => {\n var _a, _b;\n if (this.state !== 'RETRY') {\n callback(false);\n return;\n }\n if ((_b = (_a = this.retryThrottler) === null || _a === void 0 ? void 0 : _a.canRetryCall()) !== null && _b !== void 0 ? _b : true) {\n callback(true);\n this.attempts += 1;\n this.startNewAttempt();\n }\n else {\n this.trace('Retry attempt denied by throttling policy');\n callback(false);\n }\n }, retryDelayMs);\n }\n countActiveCalls() {\n let count = 0;\n for (const call of this.underlyingCalls) {\n if ((call === null || call === void 0 ? void 0 : call.state) === 'ACTIVE') {\n count += 1;\n }\n }\n return count;\n }\n handleProcessedStatus(status, callIndex, pushback) {\n var _a, _b, _c;\n switch (this.state) {\n case 'COMMITTED':\n case 'NO_RETRY':\n case 'TRANSPARENT_ONLY':\n this.commitCall(callIndex);\n this.reportStatus(status);\n break;\n case 'HEDGING':\n if (this.isStatusCodeInList((_a = this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes) !== null && _a !== void 0 ? _a : [], status.code)) {\n (_b = this.retryThrottler) === null || _b === void 0 ? void 0 : _b.addCallFailed();\n let delayMs;\n if (pushback === null) {\n delayMs = 0;\n }\n else if (pushback < 0) {\n this.state = 'TRANSPARENT_ONLY';\n this.commitCall(callIndex);\n this.reportStatus(status);\n return;\n }\n else {\n delayMs = pushback;\n }\n setTimeout(() => {\n this.maybeStartHedgingAttempt();\n // If after trying to start a call there are no active calls, this was the last one\n if (this.countActiveCalls() === 0) {\n this.commitCall(callIndex);\n this.reportStatus(status);\n }\n }, delayMs);\n }\n else {\n this.commitCall(callIndex);\n this.reportStatus(status);\n }\n break;\n case 'RETRY':\n if (this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes, status.code)) {\n (_c = this.retryThrottler) === null || _c === void 0 ? void 0 : _c.addCallFailed();\n this.maybeRetryCall(pushback, retried => {\n if (!retried) {\n this.commitCall(callIndex);\n this.reportStatus(status);\n }\n });\n }\n else {\n this.commitCall(callIndex);\n this.reportStatus(status);\n }\n break;\n }\n }\n getPushback(metadata) {\n const mdValue = metadata.get('grpc-retry-pushback-ms');\n if (mdValue.length === 0) {\n return null;\n }\n try {\n return parseInt(mdValue[0]);\n }\n catch (e) {\n return -1;\n }\n }\n handleChildStatus(status, callIndex) {\n var _a;\n if (this.underlyingCalls[callIndex].state === 'COMPLETED') {\n return;\n }\n this.trace('state=' +\n this.state +\n ' handling status with progress ' +\n status.progress +\n ' from child [' +\n this.underlyingCalls[callIndex].call.getCallNumber() +\n '] in state ' +\n this.underlyingCalls[callIndex].state);\n this.underlyingCalls[callIndex].state = 'COMPLETED';\n if (status.code === constants_1.Status.OK) {\n (_a = this.retryThrottler) === null || _a === void 0 ? void 0 : _a.addCallSucceeded();\n this.commitCall(callIndex);\n this.reportStatus(status);\n return;\n }\n if (this.state === 'NO_RETRY') {\n this.commitCall(callIndex);\n this.reportStatus(status);\n return;\n }\n if (this.state === 'COMMITTED') {\n this.reportStatus(status);\n return;\n }\n const pushback = this.getPushback(status.metadata);\n switch (status.progress) {\n case 'NOT_STARTED':\n // RPC never leaves the client, always safe to retry\n this.startNewAttempt();\n break;\n case 'REFUSED':\n // RPC reaches the server library, but not the server application logic\n if (this.transparentRetryUsed) {\n this.handleProcessedStatus(status, callIndex, pushback);\n }\n else {\n this.transparentRetryUsed = true;\n this.startNewAttempt();\n }\n break;\n case 'DROP':\n this.commitCall(callIndex);\n this.reportStatus(status);\n break;\n case 'PROCESSED':\n this.handleProcessedStatus(status, callIndex, pushback);\n break;\n }\n }\n maybeStartHedgingAttempt() {\n if (this.state !== 'HEDGING') {\n return;\n }\n if (!this.callConfig.methodConfig.hedgingPolicy) {\n return;\n }\n if (this.attempts >= this.maxAttempts) {\n return;\n }\n this.attempts += 1;\n this.startNewAttempt();\n this.maybeStartHedgingTimer();\n }\n maybeStartHedgingTimer() {\n var _a, _b, _c;\n if (this.hedgingTimer) {\n clearTimeout(this.hedgingTimer);\n }\n if (this.state !== 'HEDGING') {\n return;\n }\n if (!this.callConfig.methodConfig.hedgingPolicy) {\n return;\n }\n const hedgingPolicy = this.callConfig.methodConfig.hedgingPolicy;\n if (this.attempts >= this.maxAttempts) {\n return;\n }\n const hedgingDelayString = (_a = hedgingPolicy.hedgingDelay) !== null && _a !== void 0 ? _a : '0s';\n const hedgingDelaySec = Number(hedgingDelayString.substring(0, hedgingDelayString.length - 1));\n this.hedgingTimer = setTimeout(() => {\n this.maybeStartHedgingAttempt();\n }, hedgingDelaySec * 1000);\n (_c = (_b = this.hedgingTimer).unref) === null || _c === void 0 ? void 0 : _c.call(_b);\n }\n startNewAttempt() {\n const child = this.channel.createLoadBalancingCall(this.callConfig, this.methodName, this.host, this.credentials, this.deadline);\n this.trace('Created child call [' +\n child.getCallNumber() +\n '] for attempt ' +\n this.attempts);\n const index = this.underlyingCalls.length;\n this.underlyingCalls.push({\n state: 'ACTIVE',\n call: child,\n nextMessageToSend: 0,\n startTime: new Date()\n });\n const previousAttempts = this.attempts - 1;\n const initialMetadata = this.initialMetadata.clone();\n if (previousAttempts > 0) {\n initialMetadata.set(PREVIONS_RPC_ATTEMPTS_METADATA_KEY, `${previousAttempts}`);\n }\n let receivedMetadata = false;\n child.start(initialMetadata, {\n onReceiveMetadata: metadata => {\n this.trace('Received metadata from child [' + child.getCallNumber() + ']');\n this.commitCall(index);\n receivedMetadata = true;\n if (previousAttempts > 0) {\n metadata.set(PREVIONS_RPC_ATTEMPTS_METADATA_KEY, `${previousAttempts}`);\n }\n if (this.underlyingCalls[index].state === 'ACTIVE') {\n this.listener.onReceiveMetadata(metadata);\n }\n },\n onReceiveMessage: message => {\n this.trace('Received message from child [' + child.getCallNumber() + ']');\n this.commitCall(index);\n if (this.underlyingCalls[index].state === 'ACTIVE') {\n this.listener.onReceiveMessage(message);\n }\n },\n onReceiveStatus: status => {\n this.trace('Received status from child [' + child.getCallNumber() + ']');\n if (!receivedMetadata && previousAttempts > 0) {\n status.metadata.set(PREVIONS_RPC_ATTEMPTS_METADATA_KEY, `${previousAttempts}`);\n }\n this.handleChildStatus(status, index);\n },\n });\n this.sendNextChildMessage(index);\n if (this.readStarted) {\n child.startRead();\n }\n }\n start(metadata, listener) {\n this.trace('start called');\n this.listener = listener;\n this.initialMetadata = metadata;\n this.attempts += 1;\n this.startNewAttempt();\n this.maybeStartHedgingTimer();\n }\n handleChildWriteCompleted(childIndex) {\n var _a, _b;\n const childCall = this.underlyingCalls[childIndex];\n const messageIndex = childCall.nextMessageToSend;\n (_b = (_a = this.getBufferEntry(messageIndex)).callback) === null || _b === void 0 ? void 0 : _b.call(_a);\n this.clearSentMessages();\n childCall.nextMessageToSend += 1;\n this.sendNextChildMessage(childIndex);\n }\n sendNextChildMessage(childIndex) {\n const childCall = this.underlyingCalls[childIndex];\n if (childCall.state === 'COMPLETED') {\n return;\n }\n if (this.getBufferEntry(childCall.nextMessageToSend)) {\n const bufferEntry = this.getBufferEntry(childCall.nextMessageToSend);\n switch (bufferEntry.entryType) {\n case 'MESSAGE':\n childCall.call.sendMessageWithContext({\n callback: error => {\n // Ignore error\n this.handleChildWriteCompleted(childIndex);\n },\n }, bufferEntry.message.message);\n break;\n case 'HALF_CLOSE':\n childCall.nextMessageToSend += 1;\n childCall.call.halfClose();\n break;\n case 'FREED':\n // Should not be possible\n break;\n }\n }\n }\n sendMessageWithContext(context, message) {\n var _a;\n this.trace('write() called with message of length ' + message.length);\n const writeObj = {\n message,\n flags: context.flags,\n };\n const messageIndex = this.getNextBufferIndex();\n const bufferEntry = {\n entryType: 'MESSAGE',\n message: writeObj,\n allocated: this.bufferTracker.allocate(message.length, this.callNumber),\n };\n this.writeBuffer.push(bufferEntry);\n if (bufferEntry.allocated) {\n (_a = context.callback) === null || _a === void 0 ? void 0 : _a.call(context);\n for (const [callIndex, call] of this.underlyingCalls.entries()) {\n if (call.state === 'ACTIVE' &&\n call.nextMessageToSend === messageIndex) {\n call.call.sendMessageWithContext({\n callback: error => {\n // Ignore error\n this.handleChildWriteCompleted(callIndex);\n },\n }, message);\n }\n }\n }\n else {\n this.commitCallWithMostMessages();\n // commitCallWithMostMessages can fail if we are between ping attempts\n if (this.committedCallIndex === null) {\n return;\n }\n const call = this.underlyingCalls[this.committedCallIndex];\n bufferEntry.callback = context.callback;\n if (call.state === 'ACTIVE' && call.nextMessageToSend === messageIndex) {\n call.call.sendMessageWithContext({\n callback: error => {\n // Ignore error\n this.handleChildWriteCompleted(this.committedCallIndex);\n },\n }, message);\n }\n }\n }\n startRead() {\n this.trace('startRead called');\n this.readStarted = true;\n for (const underlyingCall of this.underlyingCalls) {\n if ((underlyingCall === null || underlyingCall === void 0 ? void 0 : underlyingCall.state) === 'ACTIVE') {\n underlyingCall.call.startRead();\n }\n }\n }\n halfClose() {\n this.trace('halfClose called');\n const halfCloseIndex = this.getNextBufferIndex();\n this.writeBuffer.push({\n entryType: 'HALF_CLOSE',\n allocated: false,\n });\n for (const call of this.underlyingCalls) {\n if ((call === null || call === void 0 ? void 0 : call.state) === 'ACTIVE' &&\n call.nextMessageToSend === halfCloseIndex) {\n call.nextMessageToSend += 1;\n call.call.halfClose();\n }\n }\n }\n setCredentials(newCredentials) {\n throw new Error('Method not implemented.');\n }\n getMethod() {\n return this.methodName;\n }\n getHost() {\n return this.host;\n }\n}\nexports.RetryingCall = RetryingCall;\n//# sourceMappingURL=retrying-call.js.map","\"use strict\";\n/*\n * Copyright 2022 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseSubchannelWrapper = void 0;\nclass BaseSubchannelWrapper {\n constructor(child) {\n this.child = child;\n this.healthy = true;\n this.healthListeners = new Set();\n child.addHealthStateWatcher(childHealthy => {\n /* A change to the child health state only affects this wrapper's overall\n * health state if this wrapper is reporting healthy. */\n if (this.healthy) {\n this.updateHealthListeners();\n }\n });\n }\n updateHealthListeners() {\n for (const listener of this.healthListeners) {\n listener(this.isHealthy());\n }\n }\n getConnectivityState() {\n return this.child.getConnectivityState();\n }\n addConnectivityStateListener(listener) {\n this.child.addConnectivityStateListener(listener);\n }\n removeConnectivityStateListener(listener) {\n this.child.removeConnectivityStateListener(listener);\n }\n startConnecting() {\n this.child.startConnecting();\n }\n getAddress() {\n return this.child.getAddress();\n }\n throttleKeepalive(newKeepaliveTime) {\n this.child.throttleKeepalive(newKeepaliveTime);\n }\n ref() {\n this.child.ref();\n }\n unref() {\n this.child.unref();\n }\n getChannelzRef() {\n return this.child.getChannelzRef();\n }\n isHealthy() {\n return this.healthy && this.child.isHealthy();\n }\n addHealthStateWatcher(listener) {\n this.healthListeners.add(listener);\n }\n removeHealthStateWatcher(listener) {\n this.healthListeners.delete(listener);\n }\n setHealthy(healthy) {\n if (healthy !== this.healthy) {\n this.healthy = healthy;\n /* A change to this wrapper's health state only affects the overall\n * reported health state if the child is healthy. */\n if (this.child.isHealthy()) {\n this.updateHealthListeners();\n }\n }\n }\n getRealSubchannel() {\n return this.child.getRealSubchannel();\n }\n realSubchannelEquals(other) {\n return this.getRealSubchannel() === other.getRealSubchannel();\n }\n getCallCredentials() {\n return this.child.getCallCredentials();\n }\n}\nexports.BaseSubchannelWrapper = BaseSubchannelWrapper;\n//# sourceMappingURL=subchannel-interface.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InternalChannel = exports.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX = void 0;\nconst channel_credentials_1 = require(\"./channel-credentials\");\nconst resolving_load_balancer_1 = require(\"./resolving-load-balancer\");\nconst subchannel_pool_1 = require(\"./subchannel-pool\");\nconst picker_1 = require(\"./picker\");\nconst metadata_1 = require(\"./metadata\");\nconst constants_1 = require(\"./constants\");\nconst filter_stack_1 = require(\"./filter-stack\");\nconst compression_filter_1 = require(\"./compression-filter\");\nconst resolver_1 = require(\"./resolver\");\nconst logging_1 = require(\"./logging\");\nconst http_proxy_1 = require(\"./http_proxy\");\nconst uri_parser_1 = require(\"./uri-parser\");\nconst connectivity_state_1 = require(\"./connectivity-state\");\nconst channelz_1 = require(\"./channelz\");\nconst load_balancing_call_1 = require(\"./load-balancing-call\");\nconst deadline_1 = require(\"./deadline\");\nconst resolving_call_1 = require(\"./resolving-call\");\nconst call_number_1 = require(\"./call-number\");\nconst control_plane_status_1 = require(\"./control-plane-status\");\nconst retrying_call_1 = require(\"./retrying-call\");\nconst subchannel_interface_1 = require(\"./subchannel-interface\");\n/**\n * See https://nodejs.org/api/timers.html#timers_setinterval_callback_delay_args\n */\nconst MAX_TIMEOUT_TIME = 2147483647;\nconst MIN_IDLE_TIMEOUT_MS = 1000;\n// 30 minutes\nconst DEFAULT_IDLE_TIMEOUT_MS = 30 * 60 * 1000;\nconst RETRY_THROTTLER_MAP = new Map();\nconst DEFAULT_RETRY_BUFFER_SIZE_BYTES = 1 << 24; // 16 MB\nconst DEFAULT_PER_RPC_RETRY_BUFFER_SIZE_BYTES = 1 << 20; // 1 MB\nclass ChannelSubchannelWrapper extends subchannel_interface_1.BaseSubchannelWrapper {\n constructor(childSubchannel, channel) {\n super(childSubchannel);\n this.channel = channel;\n this.refCount = 0;\n this.subchannelStateListener = (subchannel, previousState, newState, keepaliveTime) => {\n channel.throttleKeepalive(keepaliveTime);\n };\n }\n ref() {\n if (this.refCount === 0) {\n this.child.addConnectivityStateListener(this.subchannelStateListener);\n this.channel.addWrappedSubchannel(this);\n }\n this.child.ref();\n this.refCount += 1;\n }\n unref() {\n this.child.unref();\n this.refCount -= 1;\n if (this.refCount <= 0) {\n this.child.removeConnectivityStateListener(this.subchannelStateListener);\n this.channel.removeWrappedSubchannel(this);\n }\n }\n}\nclass ShutdownPicker {\n pick(pickArgs) {\n return {\n pickResultType: picker_1.PickResultType.DROP,\n status: {\n code: constants_1.Status.UNAVAILABLE,\n details: 'Channel closed before call started',\n metadata: new metadata_1.Metadata()\n },\n subchannel: null,\n onCallStarted: null,\n onCallEnded: null\n };\n }\n}\nexports.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX = 'grpc.internal.no_subchannel';\nclass ChannelzInfoTracker {\n constructor(target) {\n this.target = target;\n this.trace = new channelz_1.ChannelzTrace();\n this.callTracker = new channelz_1.ChannelzCallTracker();\n this.childrenTracker = new channelz_1.ChannelzChildrenTracker();\n this.state = connectivity_state_1.ConnectivityState.IDLE;\n }\n getChannelzInfoCallback() {\n return () => {\n return {\n target: this.target,\n state: this.state,\n trace: this.trace,\n callTracker: this.callTracker,\n children: this.childrenTracker.getChildLists()\n };\n };\n }\n}\nclass InternalChannel {\n constructor(target, credentials, options) {\n var _a, _b, _c, _d, _e, _f;\n this.credentials = credentials;\n this.options = options;\n this.connectivityState = connectivity_state_1.ConnectivityState.IDLE;\n this.currentPicker = new picker_1.UnavailablePicker();\n /**\n * Calls queued up to get a call config. Should only be populated before the\n * first time the resolver returns a result, which includes the ConfigSelector.\n */\n this.configSelectionQueue = [];\n this.pickQueue = [];\n this.connectivityStateWatchers = [];\n /**\n * This timer does not do anything on its own. Its purpose is to hold the\n * event loop open while there are any pending calls for the channel that\n * have not yet been assigned to specific subchannels. In other words,\n * the invariant is that callRefTimer is reffed if and only if pickQueue\n * is non-empty. In addition, the timer is null while the state is IDLE or\n * SHUTDOWN and there are no pending calls.\n */\n this.callRefTimer = null;\n this.configSelector = null;\n /**\n * This is the error from the name resolver if it failed most recently. It\n * is only used to end calls that start while there is no config selector\n * and the name resolver is in backoff, so it should be nulled if\n * configSelector becomes set or the channel state becomes anything other\n * than TRANSIENT_FAILURE.\n */\n this.currentResolutionError = null;\n this.wrappedSubchannels = new Set();\n this.callCount = 0;\n this.idleTimer = null;\n // Channelz info\n this.channelzEnabled = true;\n /**\n * Randomly generated ID to be passed to the config selector, for use by\n * ring_hash in xDS. An integer distributed approximately uniformly between\n * 0 and MAX_SAFE_INTEGER.\n */\n this.randomChannelId = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);\n if (typeof target !== 'string') {\n throw new TypeError('Channel target must be a string');\n }\n if (!(credentials instanceof channel_credentials_1.ChannelCredentials)) {\n throw new TypeError('Channel credentials must be a ChannelCredentials object');\n }\n if (options) {\n if (typeof options !== 'object') {\n throw new TypeError('Channel options must be an object');\n }\n }\n this.channelzInfoTracker = new ChannelzInfoTracker(target);\n const originalTargetUri = (0, uri_parser_1.parseUri)(target);\n if (originalTargetUri === null) {\n throw new Error(`Could not parse target name \"${target}\"`);\n }\n /* This ensures that the target has a scheme that is registered with the\n * resolver */\n const defaultSchemeMapResult = (0, resolver_1.mapUriDefaultScheme)(originalTargetUri);\n if (defaultSchemeMapResult === null) {\n throw new Error(`Could not find a default scheme for target name \"${target}\"`);\n }\n if (this.options['grpc.enable_channelz'] === 0) {\n this.channelzEnabled = false;\n }\n this.channelzRef = (0, channelz_1.registerChannelzChannel)(target, this.channelzInfoTracker.getChannelzInfoCallback(), this.channelzEnabled);\n if (this.channelzEnabled) {\n this.channelzInfoTracker.trace.addTrace('CT_INFO', 'Channel created');\n }\n if (this.options['grpc.default_authority']) {\n this.defaultAuthority = this.options['grpc.default_authority'];\n }\n else {\n this.defaultAuthority = (0, resolver_1.getDefaultAuthority)(defaultSchemeMapResult);\n }\n const proxyMapResult = (0, http_proxy_1.mapProxyName)(defaultSchemeMapResult, options);\n this.target = proxyMapResult.target;\n this.options = Object.assign({}, this.options, proxyMapResult.extraOptions);\n /* The global boolean parameter to getSubchannelPool has the inverse meaning to what\n * the grpc.use_local_subchannel_pool channel option means. */\n this.subchannelPool = (0, subchannel_pool_1.getSubchannelPool)(((_a = this.options['grpc.use_local_subchannel_pool']) !== null && _a !== void 0 ? _a : 0) === 0);\n this.retryBufferTracker = new retrying_call_1.MessageBufferTracker((_b = this.options['grpc.retry_buffer_size']) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_BUFFER_SIZE_BYTES, (_c = this.options['grpc.per_rpc_retry_buffer_size']) !== null && _c !== void 0 ? _c : DEFAULT_PER_RPC_RETRY_BUFFER_SIZE_BYTES);\n this.keepaliveTime = (_d = this.options['grpc.keepalive_time_ms']) !== null && _d !== void 0 ? _d : -1;\n this.idleTimeoutMs = Math.max((_e = this.options['grpc.client_idle_timeout_ms']) !== null && _e !== void 0 ? _e : DEFAULT_IDLE_TIMEOUT_MS, MIN_IDLE_TIMEOUT_MS);\n const channelControlHelper = {\n createSubchannel: (subchannelAddress, subchannelArgs) => {\n const finalSubchannelArgs = {};\n for (const [key, value] of Object.entries(subchannelArgs)) {\n if (!key.startsWith(exports.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)) {\n finalSubchannelArgs[key] = value;\n }\n }\n const subchannel = this.subchannelPool.getOrCreateSubchannel(this.target, subchannelAddress, finalSubchannelArgs, this.credentials);\n subchannel.throttleKeepalive(this.keepaliveTime);\n if (this.channelzEnabled) {\n this.channelzInfoTracker.trace.addTrace('CT_INFO', 'Created subchannel or used existing subchannel', subchannel.getChannelzRef());\n }\n const wrappedSubchannel = new ChannelSubchannelWrapper(subchannel, this);\n return wrappedSubchannel;\n },\n updateState: (connectivityState, picker) => {\n this.currentPicker = picker;\n const queueCopy = this.pickQueue.slice();\n this.pickQueue = [];\n if (queueCopy.length > 0) {\n this.callRefTimerUnref();\n }\n for (const call of queueCopy) {\n call.doPick();\n }\n this.updateState(connectivityState);\n },\n requestReresolution: () => {\n // This should never be called.\n throw new Error('Resolving load balancer should never call requestReresolution');\n },\n addChannelzChild: (child) => {\n if (this.channelzEnabled) {\n this.channelzInfoTracker.childrenTracker.refChild(child);\n }\n },\n removeChannelzChild: (child) => {\n if (this.channelzEnabled) {\n this.channelzInfoTracker.childrenTracker.unrefChild(child);\n }\n },\n };\n this.resolvingLoadBalancer = new resolving_load_balancer_1.ResolvingLoadBalancer(this.target, channelControlHelper, this.options, (serviceConfig, configSelector) => {\n var _a;\n if (serviceConfig.retryThrottling) {\n RETRY_THROTTLER_MAP.set(this.getTarget(), new retrying_call_1.RetryThrottler(serviceConfig.retryThrottling.maxTokens, serviceConfig.retryThrottling.tokenRatio, RETRY_THROTTLER_MAP.get(this.getTarget())));\n }\n else {\n RETRY_THROTTLER_MAP.delete(this.getTarget());\n }\n if (this.channelzEnabled) {\n this.channelzInfoTracker.trace.addTrace('CT_INFO', 'Address resolution succeeded');\n }\n (_a = this.configSelector) === null || _a === void 0 ? void 0 : _a.unref();\n this.configSelector = configSelector;\n this.currentResolutionError = null;\n /* We process the queue asynchronously to ensure that the corresponding\n * load balancer update has completed. */\n process.nextTick(() => {\n const localQueue = this.configSelectionQueue;\n this.configSelectionQueue = [];\n if (localQueue.length > 0) {\n this.callRefTimerUnref();\n }\n for (const call of localQueue) {\n call.getConfig();\n }\n });\n }, status => {\n if (this.channelzEnabled) {\n this.channelzInfoTracker.trace.addTrace('CT_WARNING', 'Address resolution failed with code ' +\n status.code +\n ' and details \"' +\n status.details +\n '\"');\n }\n if (this.configSelectionQueue.length > 0) {\n this.trace('Name resolution failed with calls queued for config selection');\n }\n if (this.configSelector === null) {\n this.currentResolutionError = Object.assign(Object.assign({}, (0, control_plane_status_1.restrictControlPlaneStatusCode)(status.code, status.details)), { metadata: status.metadata });\n }\n const localQueue = this.configSelectionQueue;\n this.configSelectionQueue = [];\n if (localQueue.length > 0) {\n this.callRefTimerUnref();\n }\n for (const call of localQueue) {\n call.reportResolverError(status);\n }\n });\n this.filterStackFactory = new filter_stack_1.FilterStackFactory([\n new compression_filter_1.CompressionFilterFactory(this, this.options),\n ]);\n this.trace('Channel constructed with options ' +\n JSON.stringify(options, undefined, 2));\n const error = new Error();\n if ((0, logging_1.isTracerEnabled)('channel_stacktrace')) {\n (0, logging_1.trace)(constants_1.LogVerbosity.DEBUG, 'channel_stacktrace', '(' +\n this.channelzRef.id +\n ') ' +\n 'Channel constructed \\n' +\n ((_f = error.stack) === null || _f === void 0 ? void 0 : _f.substring(error.stack.indexOf('\\n') + 1)));\n }\n this.lastActivityTimestamp = new Date();\n }\n trace(text, verbosityOverride) {\n (0, logging_1.trace)(verbosityOverride !== null && verbosityOverride !== void 0 ? verbosityOverride : constants_1.LogVerbosity.DEBUG, 'channel', '(' + this.channelzRef.id + ') ' + (0, uri_parser_1.uriToString)(this.target) + ' ' + text);\n }\n callRefTimerRef() {\n var _a, _b, _c, _d;\n if (!this.callRefTimer) {\n this.callRefTimer = setInterval(() => { }, MAX_TIMEOUT_TIME);\n }\n // If the hasRef function does not exist, always run the code\n if (!((_b = (_a = this.callRefTimer).hasRef) === null || _b === void 0 ? void 0 : _b.call(_a))) {\n this.trace('callRefTimer.ref | configSelectionQueue.length=' +\n this.configSelectionQueue.length +\n ' pickQueue.length=' +\n this.pickQueue.length);\n (_d = (_c = this.callRefTimer).ref) === null || _d === void 0 ? void 0 : _d.call(_c);\n }\n }\n callRefTimerUnref() {\n var _a, _b, _c;\n // If the timer or the hasRef function does not exist, always run the code\n if (!((_a = this.callRefTimer) === null || _a === void 0 ? void 0 : _a.hasRef) || this.callRefTimer.hasRef()) {\n this.trace('callRefTimer.unref | configSelectionQueue.length=' +\n this.configSelectionQueue.length +\n ' pickQueue.length=' +\n this.pickQueue.length);\n (_c = (_b = this.callRefTimer) === null || _b === void 0 ? void 0 : _b.unref) === null || _c === void 0 ? void 0 : _c.call(_b);\n }\n }\n removeConnectivityStateWatcher(watcherObject) {\n const watcherIndex = this.connectivityStateWatchers.findIndex(value => value === watcherObject);\n if (watcherIndex >= 0) {\n this.connectivityStateWatchers.splice(watcherIndex, 1);\n }\n }\n updateState(newState) {\n (0, logging_1.trace)(constants_1.LogVerbosity.DEBUG, 'connectivity_state', '(' +\n this.channelzRef.id +\n ') ' +\n (0, uri_parser_1.uriToString)(this.target) +\n ' ' +\n connectivity_state_1.ConnectivityState[this.connectivityState] +\n ' -> ' +\n connectivity_state_1.ConnectivityState[newState]);\n if (this.channelzEnabled) {\n this.channelzInfoTracker.trace.addTrace('CT_INFO', 'Connectivity state change to ' + connectivity_state_1.ConnectivityState[newState]);\n }\n this.connectivityState = newState;\n this.channelzInfoTracker.state = newState;\n const watchersCopy = this.connectivityStateWatchers.slice();\n for (const watcherObject of watchersCopy) {\n if (newState !== watcherObject.currentState) {\n if (watcherObject.timer) {\n clearTimeout(watcherObject.timer);\n }\n this.removeConnectivityStateWatcher(watcherObject);\n watcherObject.callback();\n }\n }\n if (newState !== connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) {\n this.currentResolutionError = null;\n }\n }\n throttleKeepalive(newKeepaliveTime) {\n if (newKeepaliveTime > this.keepaliveTime) {\n this.keepaliveTime = newKeepaliveTime;\n for (const wrappedSubchannel of this.wrappedSubchannels) {\n wrappedSubchannel.throttleKeepalive(newKeepaliveTime);\n }\n }\n }\n addWrappedSubchannel(wrappedSubchannel) {\n this.wrappedSubchannels.add(wrappedSubchannel);\n }\n removeWrappedSubchannel(wrappedSubchannel) {\n this.wrappedSubchannels.delete(wrappedSubchannel);\n }\n doPick(metadata, extraPickInfo) {\n return this.currentPicker.pick({\n metadata: metadata,\n extraPickInfo: extraPickInfo,\n });\n }\n queueCallForPick(call) {\n this.pickQueue.push(call);\n this.callRefTimerRef();\n }\n getConfig(method, metadata) {\n if (this.connectivityState !== connectivity_state_1.ConnectivityState.SHUTDOWN) {\n this.resolvingLoadBalancer.exitIdle();\n }\n if (this.configSelector) {\n return {\n type: 'SUCCESS',\n config: this.configSelector.invoke(method, metadata, this.randomChannelId),\n };\n }\n else {\n if (this.currentResolutionError) {\n return {\n type: 'ERROR',\n error: this.currentResolutionError,\n };\n }\n else {\n return {\n type: 'NONE',\n };\n }\n }\n }\n queueCallForConfig(call) {\n this.configSelectionQueue.push(call);\n this.callRefTimerRef();\n }\n enterIdle() {\n this.resolvingLoadBalancer.destroy();\n this.updateState(connectivity_state_1.ConnectivityState.IDLE);\n this.currentPicker = new picker_1.QueuePicker(this.resolvingLoadBalancer);\n if (this.idleTimer) {\n clearTimeout(this.idleTimer);\n this.idleTimer = null;\n }\n if (this.callRefTimer) {\n clearInterval(this.callRefTimer);\n this.callRefTimer = null;\n }\n }\n startIdleTimeout(timeoutMs) {\n var _a, _b;\n this.idleTimer = setTimeout(() => {\n if (this.callCount > 0) {\n /* If there is currently a call, the channel will not go idle for a\n * period of at least idleTimeoutMs, so check again after that time.\n */\n this.startIdleTimeout(this.idleTimeoutMs);\n return;\n }\n const now = new Date();\n const timeSinceLastActivity = now.valueOf() - this.lastActivityTimestamp.valueOf();\n if (timeSinceLastActivity >= this.idleTimeoutMs) {\n this.trace('Idle timer triggered after ' +\n this.idleTimeoutMs +\n 'ms of inactivity');\n this.enterIdle();\n }\n else {\n /* Whenever the timer fires with the latest activity being too recent,\n * set the timer again for the time when the time since the last\n * activity is equal to the timeout. This should result in the timer\n * firing no more than once every idleTimeoutMs/2 on average. */\n this.startIdleTimeout(this.idleTimeoutMs - timeSinceLastActivity);\n }\n }, timeoutMs);\n (_b = (_a = this.idleTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n maybeStartIdleTimer() {\n if (this.connectivityState !== connectivity_state_1.ConnectivityState.SHUTDOWN &&\n !this.idleTimer) {\n this.startIdleTimeout(this.idleTimeoutMs);\n }\n }\n onCallStart() {\n if (this.channelzEnabled) {\n this.channelzInfoTracker.callTracker.addCallStarted();\n }\n this.callCount += 1;\n }\n onCallEnd(status) {\n if (this.channelzEnabled) {\n if (status.code === constants_1.Status.OK) {\n this.channelzInfoTracker.callTracker.addCallSucceeded();\n }\n else {\n this.channelzInfoTracker.callTracker.addCallFailed();\n }\n }\n this.callCount -= 1;\n this.lastActivityTimestamp = new Date();\n this.maybeStartIdleTimer();\n }\n createLoadBalancingCall(callConfig, method, host, credentials, deadline) {\n const callNumber = (0, call_number_1.getNextCallNumber)();\n this.trace('createLoadBalancingCall [' + callNumber + '] method=\"' + method + '\"');\n return new load_balancing_call_1.LoadBalancingCall(this, callConfig, method, host, credentials, deadline, callNumber);\n }\n createRetryingCall(callConfig, method, host, credentials, deadline) {\n const callNumber = (0, call_number_1.getNextCallNumber)();\n this.trace('createRetryingCall [' + callNumber + '] method=\"' + method + '\"');\n return new retrying_call_1.RetryingCall(this, callConfig, method, host, credentials, deadline, callNumber, this.retryBufferTracker, RETRY_THROTTLER_MAP.get(this.getTarget()));\n }\n createResolvingCall(method, deadline, host, parentCall, propagateFlags) {\n const callNumber = (0, call_number_1.getNextCallNumber)();\n this.trace('createResolvingCall [' +\n callNumber +\n '] method=\"' +\n method +\n '\", deadline=' +\n (0, deadline_1.deadlineToString)(deadline));\n const finalOptions = {\n deadline: deadline,\n flags: propagateFlags !== null && propagateFlags !== void 0 ? propagateFlags : constants_1.Propagate.DEFAULTS,\n host: host !== null && host !== void 0 ? host : this.defaultAuthority,\n parentCall: parentCall,\n };\n const call = new resolving_call_1.ResolvingCall(this, method, finalOptions, this.filterStackFactory.clone(), callNumber);\n this.onCallStart();\n call.addStatusWatcher(status => {\n this.onCallEnd(status);\n });\n return call;\n }\n close() {\n var _a;\n this.resolvingLoadBalancer.destroy();\n this.updateState(connectivity_state_1.ConnectivityState.SHUTDOWN);\n this.currentPicker = new ShutdownPicker();\n for (const call of this.configSelectionQueue) {\n call.cancelWithStatus(constants_1.Status.UNAVAILABLE, 'Channel closed before call started');\n }\n this.configSelectionQueue = [];\n for (const call of this.pickQueue) {\n call.cancelWithStatus(constants_1.Status.UNAVAILABLE, 'Channel closed before call started');\n }\n this.pickQueue = [];\n if (this.callRefTimer) {\n clearInterval(this.callRefTimer);\n }\n if (this.idleTimer) {\n clearTimeout(this.idleTimer);\n }\n if (this.channelzEnabled) {\n (0, channelz_1.unregisterChannelzRef)(this.channelzRef);\n }\n this.subchannelPool.unrefUnusedSubchannels();\n (_a = this.configSelector) === null || _a === void 0 ? void 0 : _a.unref();\n this.configSelector = null;\n }\n getTarget() {\n return (0, uri_parser_1.uriToString)(this.target);\n }\n getConnectivityState(tryToConnect) {\n const connectivityState = this.connectivityState;\n if (tryToConnect) {\n this.resolvingLoadBalancer.exitIdle();\n this.lastActivityTimestamp = new Date();\n this.maybeStartIdleTimer();\n }\n return connectivityState;\n }\n watchConnectivityState(currentState, deadline, callback) {\n if (this.connectivityState === connectivity_state_1.ConnectivityState.SHUTDOWN) {\n throw new Error('Channel has been shut down');\n }\n let timer = null;\n if (deadline !== Infinity) {\n const deadlineDate = deadline instanceof Date ? deadline : new Date(deadline);\n const now = new Date();\n if (deadline === -Infinity || deadlineDate <= now) {\n process.nextTick(callback, new Error('Deadline passed without connectivity state change'));\n return;\n }\n timer = setTimeout(() => {\n this.removeConnectivityStateWatcher(watcherObject);\n callback(new Error('Deadline passed without connectivity state change'));\n }, deadlineDate.getTime() - now.getTime());\n }\n const watcherObject = {\n currentState,\n callback,\n timer,\n };\n this.connectivityStateWatchers.push(watcherObject);\n }\n /**\n * Get the channelz reference object for this channel. The returned value is\n * garbage if channelz is disabled for this channel.\n * @returns\n */\n getChannelzRef() {\n return this.channelzRef;\n }\n createCall(method, deadline, host, parentCall, propagateFlags) {\n if (typeof method !== 'string') {\n throw new TypeError('Channel#createCall: method must be a string');\n }\n if (!(typeof deadline === 'number' || deadline instanceof Date)) {\n throw new TypeError('Channel#createCall: deadline must be a number or Date');\n }\n if (this.connectivityState === connectivity_state_1.ConnectivityState.SHUTDOWN) {\n throw new Error('Channel has been shut down');\n }\n return this.createResolvingCall(method, deadline, host, parentCall, propagateFlags);\n }\n getOptions() {\n return this.options;\n }\n}\nexports.InternalChannel = InternalChannel;\n//# sourceMappingURL=internal-channel.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ChannelImplementation = void 0;\nconst channel_credentials_1 = require(\"./channel-credentials\");\nconst internal_channel_1 = require(\"./internal-channel\");\nclass ChannelImplementation {\n constructor(target, credentials, options) {\n if (typeof target !== 'string') {\n throw new TypeError('Channel target must be a string');\n }\n if (!(credentials instanceof channel_credentials_1.ChannelCredentials)) {\n throw new TypeError('Channel credentials must be a ChannelCredentials object');\n }\n if (options) {\n if (typeof options !== 'object') {\n throw new TypeError('Channel options must be an object');\n }\n }\n this.internalChannel = new internal_channel_1.InternalChannel(target, credentials, options);\n }\n close() {\n this.internalChannel.close();\n }\n getTarget() {\n return this.internalChannel.getTarget();\n }\n getConnectivityState(tryToConnect) {\n return this.internalChannel.getConnectivityState(tryToConnect);\n }\n watchConnectivityState(currentState, deadline, callback) {\n this.internalChannel.watchConnectivityState(currentState, deadline, callback);\n }\n /**\n * Get the channelz reference object for this channel. The returned value is\n * garbage if channelz is disabled for this channel.\n * @returns\n */\n getChannelzRef() {\n return this.internalChannel.getChannelzRef();\n }\n createCall(method, deadline, host, parentCall, propagateFlags) {\n if (typeof method !== 'string') {\n throw new TypeError('Channel#createCall: method must be a string');\n }\n if (!(typeof deadline === 'number' || deadline instanceof Date)) {\n throw new TypeError('Channel#createCall: deadline must be a number or Date');\n }\n return this.internalChannel.createCall(method, deadline, host, parentCall, propagateFlags);\n }\n}\nexports.ChannelImplementation = ChannelImplementation;\n//# sourceMappingURL=channel.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ServerDuplexStreamImpl = exports.ServerWritableStreamImpl = exports.ServerReadableStreamImpl = exports.ServerUnaryCallImpl = void 0;\nexports.serverErrorToStatus = serverErrorToStatus;\nconst events_1 = require(\"events\");\nconst stream_1 = require(\"stream\");\nconst constants_1 = require(\"./constants\");\nconst metadata_1 = require(\"./metadata\");\nfunction serverErrorToStatus(error, overrideTrailers) {\n var _a;\n const status = {\n code: constants_1.Status.UNKNOWN,\n details: 'message' in error ? error.message : 'Unknown Error',\n metadata: (_a = overrideTrailers !== null && overrideTrailers !== void 0 ? overrideTrailers : error.metadata) !== null && _a !== void 0 ? _a : null,\n };\n if ('code' in error &&\n typeof error.code === 'number' &&\n Number.isInteger(error.code)) {\n status.code = error.code;\n if ('details' in error && typeof error.details === 'string') {\n status.details = error.details;\n }\n }\n return status;\n}\nclass ServerUnaryCallImpl extends events_1.EventEmitter {\n constructor(path, call, metadata, request) {\n super();\n this.path = path;\n this.call = call;\n this.metadata = metadata;\n this.request = request;\n this.cancelled = false;\n }\n getPeer() {\n return this.call.getPeer();\n }\n sendMetadata(responseMetadata) {\n this.call.sendMetadata(responseMetadata);\n }\n getDeadline() {\n return this.call.getDeadline();\n }\n getPath() {\n return this.path;\n }\n getHost() {\n return this.call.getHost();\n }\n}\nexports.ServerUnaryCallImpl = ServerUnaryCallImpl;\nclass ServerReadableStreamImpl extends stream_1.Readable {\n constructor(path, call, metadata) {\n super({ objectMode: true });\n this.path = path;\n this.call = call;\n this.metadata = metadata;\n this.cancelled = false;\n }\n _read(size) {\n this.call.startRead();\n }\n getPeer() {\n return this.call.getPeer();\n }\n sendMetadata(responseMetadata) {\n this.call.sendMetadata(responseMetadata);\n }\n getDeadline() {\n return this.call.getDeadline();\n }\n getPath() {\n return this.path;\n }\n getHost() {\n return this.call.getHost();\n }\n}\nexports.ServerReadableStreamImpl = ServerReadableStreamImpl;\nclass ServerWritableStreamImpl extends stream_1.Writable {\n constructor(path, call, metadata, request) {\n super({ objectMode: true });\n this.path = path;\n this.call = call;\n this.metadata = metadata;\n this.request = request;\n this.pendingStatus = {\n code: constants_1.Status.OK,\n details: 'OK',\n };\n this.cancelled = false;\n this.trailingMetadata = new metadata_1.Metadata();\n this.on('error', err => {\n this.pendingStatus = serverErrorToStatus(err);\n this.end();\n });\n }\n getPeer() {\n return this.call.getPeer();\n }\n sendMetadata(responseMetadata) {\n this.call.sendMetadata(responseMetadata);\n }\n getDeadline() {\n return this.call.getDeadline();\n }\n getPath() {\n return this.path;\n }\n getHost() {\n return this.call.getHost();\n }\n _write(chunk, encoding, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n callback) {\n this.call.sendMessage(chunk, callback);\n }\n _final(callback) {\n var _a;\n callback(null);\n this.call.sendStatus(Object.assign(Object.assign({}, this.pendingStatus), { metadata: (_a = this.pendingStatus.metadata) !== null && _a !== void 0 ? _a : this.trailingMetadata }));\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n end(metadata) {\n if (metadata) {\n this.trailingMetadata = metadata;\n }\n return super.end();\n }\n}\nexports.ServerWritableStreamImpl = ServerWritableStreamImpl;\nclass ServerDuplexStreamImpl extends stream_1.Duplex {\n constructor(path, call, metadata) {\n super({ objectMode: true });\n this.path = path;\n this.call = call;\n this.metadata = metadata;\n this.pendingStatus = {\n code: constants_1.Status.OK,\n details: 'OK',\n };\n this.cancelled = false;\n this.trailingMetadata = new metadata_1.Metadata();\n this.on('error', err => {\n this.pendingStatus = serverErrorToStatus(err);\n this.end();\n });\n }\n getPeer() {\n return this.call.getPeer();\n }\n sendMetadata(responseMetadata) {\n this.call.sendMetadata(responseMetadata);\n }\n getDeadline() {\n return this.call.getDeadline();\n }\n getPath() {\n return this.path;\n }\n getHost() {\n return this.call.getHost();\n }\n _read(size) {\n this.call.startRead();\n }\n _write(chunk, encoding, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n callback) {\n this.call.sendMessage(chunk, callback);\n }\n _final(callback) {\n var _a;\n callback(null);\n this.call.sendStatus(Object.assign(Object.assign({}, this.pendingStatus), { metadata: (_a = this.pendingStatus.metadata) !== null && _a !== void 0 ? _a : this.trailingMetadata }));\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n end(metadata) {\n if (metadata) {\n this.trailingMetadata = metadata;\n }\n return super.end();\n }\n}\nexports.ServerDuplexStreamImpl = ServerDuplexStreamImpl;\n//# sourceMappingURL=server-call.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ServerCredentials = void 0;\nexports.createCertificateProviderServerCredentials = createCertificateProviderServerCredentials;\nexports.createServerCredentialsWithInterceptors = createServerCredentialsWithInterceptors;\nconst tls_helpers_1 = require(\"./tls-helpers\");\nclass ServerCredentials {\n constructor(serverConstructorOptions, contextOptions) {\n this.serverConstructorOptions = serverConstructorOptions;\n this.watchers = new Set();\n this.latestContextOptions = null;\n this.latestContextOptions = contextOptions !== null && contextOptions !== void 0 ? contextOptions : null;\n }\n _addWatcher(watcher) {\n this.watchers.add(watcher);\n }\n _removeWatcher(watcher) {\n this.watchers.delete(watcher);\n }\n getWatcherCount() {\n return this.watchers.size;\n }\n updateSecureContextOptions(options) {\n this.latestContextOptions = options;\n for (const watcher of this.watchers) {\n watcher(this.latestContextOptions);\n }\n }\n _isSecure() {\n return this.serverConstructorOptions !== null;\n }\n _getSecureContextOptions() {\n return this.latestContextOptions;\n }\n _getConstructorOptions() {\n return this.serverConstructorOptions;\n }\n _getInterceptors() {\n return [];\n }\n static createInsecure() {\n return new InsecureServerCredentials();\n }\n static createSsl(rootCerts, keyCertPairs, checkClientCertificate = false) {\n var _a;\n if (rootCerts !== null && !Buffer.isBuffer(rootCerts)) {\n throw new TypeError('rootCerts must be null or a Buffer');\n }\n if (!Array.isArray(keyCertPairs)) {\n throw new TypeError('keyCertPairs must be an array');\n }\n if (typeof checkClientCertificate !== 'boolean') {\n throw new TypeError('checkClientCertificate must be a boolean');\n }\n const cert = [];\n const key = [];\n for (let i = 0; i < keyCertPairs.length; i++) {\n const pair = keyCertPairs[i];\n if (pair === null || typeof pair !== 'object') {\n throw new TypeError(`keyCertPair[${i}] must be an object`);\n }\n if (!Buffer.isBuffer(pair.private_key)) {\n throw new TypeError(`keyCertPair[${i}].private_key must be a Buffer`);\n }\n if (!Buffer.isBuffer(pair.cert_chain)) {\n throw new TypeError(`keyCertPair[${i}].cert_chain must be a Buffer`);\n }\n cert.push(pair.cert_chain);\n key.push(pair.private_key);\n }\n return new SecureServerCredentials({\n requestCert: checkClientCertificate,\n ciphers: tls_helpers_1.CIPHER_SUITES,\n }, {\n ca: (_a = rootCerts !== null && rootCerts !== void 0 ? rootCerts : (0, tls_helpers_1.getDefaultRootsData)()) !== null && _a !== void 0 ? _a : undefined,\n cert,\n key,\n });\n }\n}\nexports.ServerCredentials = ServerCredentials;\nclass InsecureServerCredentials extends ServerCredentials {\n constructor() {\n super(null);\n }\n _getSettings() {\n return null;\n }\n _equals(other) {\n return other instanceof InsecureServerCredentials;\n }\n}\nclass SecureServerCredentials extends ServerCredentials {\n constructor(constructorOptions, contextOptions) {\n super(constructorOptions, contextOptions);\n this.options = Object.assign(Object.assign({}, constructorOptions), contextOptions);\n }\n /**\n * Checks equality by checking the options that are actually set by\n * createSsl.\n * @param other\n * @returns\n */\n _equals(other) {\n if (this === other) {\n return true;\n }\n if (!(other instanceof SecureServerCredentials)) {\n return false;\n }\n // options.ca equality check\n if (Buffer.isBuffer(this.options.ca) && Buffer.isBuffer(other.options.ca)) {\n if (!this.options.ca.equals(other.options.ca)) {\n return false;\n }\n }\n else {\n if (this.options.ca !== other.options.ca) {\n return false;\n }\n }\n // options.cert equality check\n if (Array.isArray(this.options.cert) && Array.isArray(other.options.cert)) {\n if (this.options.cert.length !== other.options.cert.length) {\n return false;\n }\n for (let i = 0; i < this.options.cert.length; i++) {\n const thisCert = this.options.cert[i];\n const otherCert = other.options.cert[i];\n if (Buffer.isBuffer(thisCert) && Buffer.isBuffer(otherCert)) {\n if (!thisCert.equals(otherCert)) {\n return false;\n }\n }\n else {\n if (thisCert !== otherCert) {\n return false;\n }\n }\n }\n }\n else {\n if (this.options.cert !== other.options.cert) {\n return false;\n }\n }\n // options.key equality check\n if (Array.isArray(this.options.key) && Array.isArray(other.options.key)) {\n if (this.options.key.length !== other.options.key.length) {\n return false;\n }\n for (let i = 0; i < this.options.key.length; i++) {\n const thisKey = this.options.key[i];\n const otherKey = other.options.key[i];\n if (Buffer.isBuffer(thisKey) && Buffer.isBuffer(otherKey)) {\n if (!thisKey.equals(otherKey)) {\n return false;\n }\n }\n else {\n if (thisKey !== otherKey) {\n return false;\n }\n }\n }\n }\n else {\n if (this.options.key !== other.options.key) {\n return false;\n }\n }\n // options.requestCert equality check\n if (this.options.requestCert !== other.options.requestCert) {\n return false;\n }\n /* ciphers is derived from a value that is constant for the process, so no\n * equality check is needed. */\n return true;\n }\n}\nclass CertificateProviderServerCredentials extends ServerCredentials {\n constructor(identityCertificateProvider, caCertificateProvider, requireClientCertificate) {\n super({\n requestCert: caCertificateProvider !== null,\n rejectUnauthorized: requireClientCertificate,\n ciphers: tls_helpers_1.CIPHER_SUITES\n });\n this.identityCertificateProvider = identityCertificateProvider;\n this.caCertificateProvider = caCertificateProvider;\n this.requireClientCertificate = requireClientCertificate;\n this.latestCaUpdate = null;\n this.latestIdentityUpdate = null;\n this.caCertificateUpdateListener = this.handleCaCertificateUpdate.bind(this);\n this.identityCertificateUpdateListener = this.handleIdentityCertitificateUpdate.bind(this);\n }\n _addWatcher(watcher) {\n var _a;\n if (this.getWatcherCount() === 0) {\n (_a = this.caCertificateProvider) === null || _a === void 0 ? void 0 : _a.addCaCertificateListener(this.caCertificateUpdateListener);\n this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener);\n }\n super._addWatcher(watcher);\n }\n _removeWatcher(watcher) {\n var _a;\n super._removeWatcher(watcher);\n if (this.getWatcherCount() === 0) {\n (_a = this.caCertificateProvider) === null || _a === void 0 ? void 0 : _a.removeCaCertificateListener(this.caCertificateUpdateListener);\n this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener);\n }\n }\n _equals(other) {\n if (this === other) {\n return true;\n }\n if (!(other instanceof CertificateProviderServerCredentials)) {\n return false;\n }\n return (this.caCertificateProvider === other.caCertificateProvider &&\n this.identityCertificateProvider === other.identityCertificateProvider &&\n this.requireClientCertificate === other.requireClientCertificate);\n }\n calculateSecureContextOptions() {\n var _a;\n if (this.latestIdentityUpdate === null) {\n return null;\n }\n if (this.caCertificateProvider !== null && this.latestCaUpdate === null) {\n return null;\n }\n return {\n ca: (_a = this.latestCaUpdate) === null || _a === void 0 ? void 0 : _a.caCertificate,\n cert: [this.latestIdentityUpdate.certificate],\n key: [this.latestIdentityUpdate.privateKey],\n };\n }\n finalizeUpdate() {\n const secureContextOptions = this.calculateSecureContextOptions();\n this.updateSecureContextOptions(secureContextOptions);\n }\n handleCaCertificateUpdate(update) {\n this.latestCaUpdate = update;\n this.finalizeUpdate();\n }\n handleIdentityCertitificateUpdate(update) {\n this.latestIdentityUpdate = update;\n this.finalizeUpdate();\n }\n}\nfunction createCertificateProviderServerCredentials(caCertificateProvider, identityCertificateProvider, requireClientCertificate) {\n return new CertificateProviderServerCredentials(caCertificateProvider, identityCertificateProvider, requireClientCertificate);\n}\nclass InterceptorServerCredentials extends ServerCredentials {\n constructor(childCredentials, interceptors) {\n super({});\n this.childCredentials = childCredentials;\n this.interceptors = interceptors;\n }\n _isSecure() {\n return this.childCredentials._isSecure();\n }\n _equals(other) {\n if (!(other instanceof InterceptorServerCredentials)) {\n return false;\n }\n if (!(this.childCredentials._equals(other.childCredentials))) {\n return false;\n }\n if (this.interceptors.length !== other.interceptors.length) {\n return false;\n }\n for (let i = 0; i < this.interceptors.length; i++) {\n if (this.interceptors[i] !== other.interceptors[i]) {\n return false;\n }\n }\n return true;\n }\n _getInterceptors() {\n return this.interceptors;\n }\n _addWatcher(watcher) {\n this.childCredentials._addWatcher(watcher);\n }\n _removeWatcher(watcher) {\n this.childCredentials._removeWatcher(watcher);\n }\n _getConstructorOptions() {\n return this.childCredentials._getConstructorOptions();\n }\n _getSecureContextOptions() {\n return this.childCredentials._getSecureContextOptions();\n }\n}\nfunction createServerCredentialsWithInterceptors(credentials, interceptors) {\n return new InterceptorServerCredentials(credentials, interceptors);\n}\n//# sourceMappingURL=server-credentials.js.map","\"use strict\";\n/*\n * Copyright 2024 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseServerInterceptingCall = exports.ServerInterceptingCall = exports.ResponderBuilder = exports.ServerListenerBuilder = void 0;\nexports.isInterceptingServerListener = isInterceptingServerListener;\nexports.getServerInterceptingCall = getServerInterceptingCall;\nconst metadata_1 = require(\"./metadata\");\nconst constants_1 = require(\"./constants\");\nconst http2 = require(\"http2\");\nconst error_1 = require(\"./error\");\nconst zlib = require(\"zlib\");\nconst stream_decoder_1 = require(\"./stream-decoder\");\nconst logging = require(\"./logging\");\nconst TRACER_NAME = 'server_call';\nfunction trace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text);\n}\nclass ServerListenerBuilder {\n constructor() {\n this.metadata = undefined;\n this.message = undefined;\n this.halfClose = undefined;\n this.cancel = undefined;\n }\n withOnReceiveMetadata(onReceiveMetadata) {\n this.metadata = onReceiveMetadata;\n return this;\n }\n withOnReceiveMessage(onReceiveMessage) {\n this.message = onReceiveMessage;\n return this;\n }\n withOnReceiveHalfClose(onReceiveHalfClose) {\n this.halfClose = onReceiveHalfClose;\n return this;\n }\n withOnCancel(onCancel) {\n this.cancel = onCancel;\n return this;\n }\n build() {\n return {\n onReceiveMetadata: this.metadata,\n onReceiveMessage: this.message,\n onReceiveHalfClose: this.halfClose,\n onCancel: this.cancel,\n };\n }\n}\nexports.ServerListenerBuilder = ServerListenerBuilder;\nfunction isInterceptingServerListener(listener) {\n return (listener.onReceiveMetadata !== undefined &&\n listener.onReceiveMetadata.length === 1);\n}\nclass InterceptingServerListenerImpl {\n constructor(listener, nextListener) {\n this.listener = listener;\n this.nextListener = nextListener;\n /**\n * Once the call is cancelled, ignore all other events.\n */\n this.cancelled = false;\n this.processingMetadata = false;\n this.hasPendingMessage = false;\n this.pendingMessage = null;\n this.processingMessage = false;\n this.hasPendingHalfClose = false;\n }\n processPendingMessage() {\n if (this.hasPendingMessage) {\n this.nextListener.onReceiveMessage(this.pendingMessage);\n this.pendingMessage = null;\n this.hasPendingMessage = false;\n }\n }\n processPendingHalfClose() {\n if (this.hasPendingHalfClose) {\n this.nextListener.onReceiveHalfClose();\n this.hasPendingHalfClose = false;\n }\n }\n onReceiveMetadata(metadata) {\n if (this.cancelled) {\n return;\n }\n this.processingMetadata = true;\n this.listener.onReceiveMetadata(metadata, interceptedMetadata => {\n this.processingMetadata = false;\n if (this.cancelled) {\n return;\n }\n this.nextListener.onReceiveMetadata(interceptedMetadata);\n this.processPendingMessage();\n this.processPendingHalfClose();\n });\n }\n onReceiveMessage(message) {\n if (this.cancelled) {\n return;\n }\n this.processingMessage = true;\n this.listener.onReceiveMessage(message, msg => {\n this.processingMessage = false;\n if (this.cancelled) {\n return;\n }\n if (this.processingMetadata) {\n this.pendingMessage = msg;\n this.hasPendingMessage = true;\n }\n else {\n this.nextListener.onReceiveMessage(msg);\n this.processPendingHalfClose();\n }\n });\n }\n onReceiveHalfClose() {\n if (this.cancelled) {\n return;\n }\n this.listener.onReceiveHalfClose(() => {\n if (this.cancelled) {\n return;\n }\n if (this.processingMetadata || this.processingMessage) {\n this.hasPendingHalfClose = true;\n }\n else {\n this.nextListener.onReceiveHalfClose();\n }\n });\n }\n onCancel() {\n this.cancelled = true;\n this.listener.onCancel();\n this.nextListener.onCancel();\n }\n}\nclass ResponderBuilder {\n constructor() {\n this.start = undefined;\n this.metadata = undefined;\n this.message = undefined;\n this.status = undefined;\n }\n withStart(start) {\n this.start = start;\n return this;\n }\n withSendMetadata(sendMetadata) {\n this.metadata = sendMetadata;\n return this;\n }\n withSendMessage(sendMessage) {\n this.message = sendMessage;\n return this;\n }\n withSendStatus(sendStatus) {\n this.status = sendStatus;\n return this;\n }\n build() {\n return {\n start: this.start,\n sendMetadata: this.metadata,\n sendMessage: this.message,\n sendStatus: this.status,\n };\n }\n}\nexports.ResponderBuilder = ResponderBuilder;\nconst defaultServerListener = {\n onReceiveMetadata: (metadata, next) => {\n next(metadata);\n },\n onReceiveMessage: (message, next) => {\n next(message);\n },\n onReceiveHalfClose: next => {\n next();\n },\n onCancel: () => { },\n};\nconst defaultResponder = {\n start: next => {\n next();\n },\n sendMetadata: (metadata, next) => {\n next(metadata);\n },\n sendMessage: (message, next) => {\n next(message);\n },\n sendStatus: (status, next) => {\n next(status);\n },\n};\nclass ServerInterceptingCall {\n constructor(nextCall, responder) {\n var _a, _b, _c, _d;\n this.nextCall = nextCall;\n this.processingMetadata = false;\n this.sentMetadata = false;\n this.processingMessage = false;\n this.pendingMessage = null;\n this.pendingMessageCallback = null;\n this.pendingStatus = null;\n this.responder = {\n start: (_a = responder === null || responder === void 0 ? void 0 : responder.start) !== null && _a !== void 0 ? _a : defaultResponder.start,\n sendMetadata: (_b = responder === null || responder === void 0 ? void 0 : responder.sendMetadata) !== null && _b !== void 0 ? _b : defaultResponder.sendMetadata,\n sendMessage: (_c = responder === null || responder === void 0 ? void 0 : responder.sendMessage) !== null && _c !== void 0 ? _c : defaultResponder.sendMessage,\n sendStatus: (_d = responder === null || responder === void 0 ? void 0 : responder.sendStatus) !== null && _d !== void 0 ? _d : defaultResponder.sendStatus,\n };\n }\n processPendingMessage() {\n if (this.pendingMessageCallback) {\n this.nextCall.sendMessage(this.pendingMessage, this.pendingMessageCallback);\n this.pendingMessage = null;\n this.pendingMessageCallback = null;\n }\n }\n processPendingStatus() {\n if (this.pendingStatus) {\n this.nextCall.sendStatus(this.pendingStatus);\n this.pendingStatus = null;\n }\n }\n start(listener) {\n this.responder.start(interceptedListener => {\n var _a, _b, _c, _d;\n const fullInterceptedListener = {\n onReceiveMetadata: (_a = interceptedListener === null || interceptedListener === void 0 ? void 0 : interceptedListener.onReceiveMetadata) !== null && _a !== void 0 ? _a : defaultServerListener.onReceiveMetadata,\n onReceiveMessage: (_b = interceptedListener === null || interceptedListener === void 0 ? void 0 : interceptedListener.onReceiveMessage) !== null && _b !== void 0 ? _b : defaultServerListener.onReceiveMessage,\n onReceiveHalfClose: (_c = interceptedListener === null || interceptedListener === void 0 ? void 0 : interceptedListener.onReceiveHalfClose) !== null && _c !== void 0 ? _c : defaultServerListener.onReceiveHalfClose,\n onCancel: (_d = interceptedListener === null || interceptedListener === void 0 ? void 0 : interceptedListener.onCancel) !== null && _d !== void 0 ? _d : defaultServerListener.onCancel,\n };\n const finalInterceptingListener = new InterceptingServerListenerImpl(fullInterceptedListener, listener);\n this.nextCall.start(finalInterceptingListener);\n });\n }\n sendMetadata(metadata) {\n this.processingMetadata = true;\n this.sentMetadata = true;\n this.responder.sendMetadata(metadata, interceptedMetadata => {\n this.processingMetadata = false;\n this.nextCall.sendMetadata(interceptedMetadata);\n this.processPendingMessage();\n this.processPendingStatus();\n });\n }\n sendMessage(message, callback) {\n this.processingMessage = true;\n if (!this.sentMetadata) {\n this.sendMetadata(new metadata_1.Metadata());\n }\n this.responder.sendMessage(message, interceptedMessage => {\n this.processingMessage = false;\n if (this.processingMetadata) {\n this.pendingMessage = interceptedMessage;\n this.pendingMessageCallback = callback;\n }\n else {\n this.nextCall.sendMessage(interceptedMessage, callback);\n }\n });\n }\n sendStatus(status) {\n this.responder.sendStatus(status, interceptedStatus => {\n if (this.processingMetadata || this.processingMessage) {\n this.pendingStatus = interceptedStatus;\n }\n else {\n this.nextCall.sendStatus(interceptedStatus);\n }\n });\n }\n startRead() {\n this.nextCall.startRead();\n }\n getPeer() {\n return this.nextCall.getPeer();\n }\n getDeadline() {\n return this.nextCall.getDeadline();\n }\n getHost() {\n return this.nextCall.getHost();\n }\n}\nexports.ServerInterceptingCall = ServerInterceptingCall;\nconst GRPC_ACCEPT_ENCODING_HEADER = 'grpc-accept-encoding';\nconst GRPC_ENCODING_HEADER = 'grpc-encoding';\nconst GRPC_MESSAGE_HEADER = 'grpc-message';\nconst GRPC_STATUS_HEADER = 'grpc-status';\nconst GRPC_TIMEOUT_HEADER = 'grpc-timeout';\nconst DEADLINE_REGEX = /(\\d{1,8})\\s*([HMSmun])/;\nconst deadlineUnitsToMs = {\n H: 3600000,\n M: 60000,\n S: 1000,\n m: 1,\n u: 0.001,\n n: 0.000001,\n};\nconst defaultCompressionHeaders = {\n // TODO(cjihrig): Remove these encoding headers from the default response\n // once compression is integrated.\n [GRPC_ACCEPT_ENCODING_HEADER]: 'identity,deflate,gzip',\n [GRPC_ENCODING_HEADER]: 'identity',\n};\nconst defaultResponseHeaders = {\n [http2.constants.HTTP2_HEADER_STATUS]: http2.constants.HTTP_STATUS_OK,\n [http2.constants.HTTP2_HEADER_CONTENT_TYPE]: 'application/grpc+proto',\n};\nconst defaultResponseOptions = {\n waitForTrailers: true,\n};\nclass BaseServerInterceptingCall {\n constructor(stream, headers, callEventTracker, handler, options) {\n var _a;\n this.stream = stream;\n this.callEventTracker = callEventTracker;\n this.handler = handler;\n this.listener = null;\n this.deadlineTimer = null;\n this.deadline = Infinity;\n this.maxSendMessageSize = constants_1.DEFAULT_MAX_SEND_MESSAGE_LENGTH;\n this.maxReceiveMessageSize = constants_1.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;\n this.cancelled = false;\n this.metadataSent = false;\n this.wantTrailers = false;\n this.cancelNotified = false;\n this.incomingEncoding = 'identity';\n this.readQueue = [];\n this.isReadPending = false;\n this.receivedHalfClose = false;\n this.streamEnded = false;\n this.stream.once('error', (err) => {\n /* We need an error handler to avoid uncaught error event exceptions, but\n * there is nothing we can reasonably do here. Any error event should\n * have a corresponding close event, which handles emitting the cancelled\n * event. And the stream is now in a bad state, so we can't reasonably\n * expect to be able to send an error over it. */\n });\n this.stream.once('close', () => {\n var _a;\n trace('Request to method ' +\n ((_a = this.handler) === null || _a === void 0 ? void 0 : _a.path) +\n ' stream closed with rstCode ' +\n this.stream.rstCode);\n if (this.callEventTracker && !this.streamEnded) {\n this.streamEnded = true;\n this.callEventTracker.onStreamEnd(false);\n this.callEventTracker.onCallEnd({\n code: constants_1.Status.CANCELLED,\n details: 'Stream closed before sending status',\n metadata: null,\n });\n }\n this.notifyOnCancel();\n });\n this.stream.on('data', (data) => {\n this.handleDataFrame(data);\n });\n this.stream.pause();\n this.stream.on('end', () => {\n this.handleEndEvent();\n });\n if ('grpc.max_send_message_length' in options) {\n this.maxSendMessageSize = options['grpc.max_send_message_length'];\n }\n if ('grpc.max_receive_message_length' in options) {\n this.maxReceiveMessageSize = options['grpc.max_receive_message_length'];\n }\n this.host = (_a = headers[':authority']) !== null && _a !== void 0 ? _a : headers.host;\n this.decoder = new stream_decoder_1.StreamDecoder(this.maxReceiveMessageSize);\n const metadata = metadata_1.Metadata.fromHttp2Headers(headers);\n if (logging.isTracerEnabled(TRACER_NAME)) {\n trace('Request to ' +\n this.handler.path +\n ' received headers ' +\n JSON.stringify(metadata.toJSON()));\n }\n const timeoutHeader = metadata.get(GRPC_TIMEOUT_HEADER);\n if (timeoutHeader.length > 0) {\n this.handleTimeoutHeader(timeoutHeader[0]);\n }\n const encodingHeader = metadata.get(GRPC_ENCODING_HEADER);\n if (encodingHeader.length > 0) {\n this.incomingEncoding = encodingHeader[0];\n }\n // Remove several headers that should not be propagated to the application\n metadata.remove(GRPC_TIMEOUT_HEADER);\n metadata.remove(GRPC_ENCODING_HEADER);\n metadata.remove(GRPC_ACCEPT_ENCODING_HEADER);\n metadata.remove(http2.constants.HTTP2_HEADER_ACCEPT_ENCODING);\n metadata.remove(http2.constants.HTTP2_HEADER_TE);\n metadata.remove(http2.constants.HTTP2_HEADER_CONTENT_TYPE);\n this.metadata = metadata;\n }\n handleTimeoutHeader(timeoutHeader) {\n const match = timeoutHeader.toString().match(DEADLINE_REGEX);\n if (match === null) {\n const status = {\n code: constants_1.Status.INTERNAL,\n details: `Invalid ${GRPC_TIMEOUT_HEADER} value \"${timeoutHeader}\"`,\n metadata: null,\n };\n // Wait for the constructor to complete before sending the error.\n process.nextTick(() => {\n this.sendStatus(status);\n });\n return;\n }\n const timeout = (+match[1] * deadlineUnitsToMs[match[2]]) | 0;\n const now = new Date();\n this.deadline = now.setMilliseconds(now.getMilliseconds() + timeout);\n this.deadlineTimer = setTimeout(() => {\n const status = {\n code: constants_1.Status.DEADLINE_EXCEEDED,\n details: 'Deadline exceeded',\n metadata: null,\n };\n this.sendStatus(status);\n }, timeout);\n }\n checkCancelled() {\n /* In some cases the stream can become destroyed before the close event\n * fires. That creates a race condition that this check works around */\n if (!this.cancelled && (this.stream.destroyed || this.stream.closed)) {\n this.notifyOnCancel();\n this.cancelled = true;\n }\n return this.cancelled;\n }\n notifyOnCancel() {\n if (this.cancelNotified) {\n return;\n }\n this.cancelNotified = true;\n this.cancelled = true;\n process.nextTick(() => {\n var _a;\n (_a = this.listener) === null || _a === void 0 ? void 0 : _a.onCancel();\n });\n if (this.deadlineTimer) {\n clearTimeout(this.deadlineTimer);\n }\n // Flush incoming data frames\n this.stream.resume();\n }\n /**\n * A server handler can start sending messages without explicitly sending\n * metadata. In that case, we need to send headers before sending any\n * messages. This function does that if necessary.\n */\n maybeSendMetadata() {\n if (!this.metadataSent) {\n this.sendMetadata(new metadata_1.Metadata());\n }\n }\n /**\n * Serialize a message to a length-delimited byte string.\n * @param value\n * @returns\n */\n serializeMessage(value) {\n const messageBuffer = this.handler.serialize(value);\n const byteLength = messageBuffer.byteLength;\n const output = Buffer.allocUnsafe(byteLength + 5);\n /* Note: response compression is currently not supported, so this\n * compressed bit is always 0. */\n output.writeUInt8(0, 0);\n output.writeUInt32BE(byteLength, 1);\n messageBuffer.copy(output, 5);\n return output;\n }\n decompressMessage(message, encoding) {\n const messageContents = message.subarray(5);\n if (encoding === 'identity') {\n return messageContents;\n }\n else if (encoding === 'deflate' || encoding === 'gzip') {\n let decompresser;\n if (encoding === 'deflate') {\n decompresser = zlib.createInflate();\n }\n else {\n decompresser = zlib.createGunzip();\n }\n return new Promise((resolve, reject) => {\n let totalLength = 0;\n const messageParts = [];\n decompresser.on('data', (chunk) => {\n messageParts.push(chunk);\n totalLength += chunk.byteLength;\n if (this.maxReceiveMessageSize !== -1 && totalLength > this.maxReceiveMessageSize) {\n decompresser.destroy();\n reject({\n code: constants_1.Status.RESOURCE_EXHAUSTED,\n details: `Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`\n });\n }\n });\n decompresser.on('end', () => {\n resolve(Buffer.concat(messageParts));\n });\n decompresser.write(messageContents);\n decompresser.end();\n });\n }\n else {\n return Promise.reject({\n code: constants_1.Status.UNIMPLEMENTED,\n details: `Received message compressed with unsupported encoding \"${encoding}\"`,\n });\n }\n }\n async decompressAndMaybePush(queueEntry) {\n if (queueEntry.type !== 'COMPRESSED') {\n throw new Error(`Invalid queue entry type: ${queueEntry.type}`);\n }\n const compressed = queueEntry.compressedMessage.readUInt8(0) === 1;\n const compressedMessageEncoding = compressed\n ? this.incomingEncoding\n : 'identity';\n let decompressedMessage;\n try {\n decompressedMessage = await this.decompressMessage(queueEntry.compressedMessage, compressedMessageEncoding);\n }\n catch (err) {\n this.sendStatus(err);\n return;\n }\n try {\n queueEntry.parsedMessage = this.handler.deserialize(decompressedMessage);\n }\n catch (err) {\n this.sendStatus({\n code: constants_1.Status.INTERNAL,\n details: `Error deserializing request: ${err.message}`,\n });\n return;\n }\n queueEntry.type = 'READABLE';\n this.maybePushNextMessage();\n }\n maybePushNextMessage() {\n if (this.listener &&\n this.isReadPending &&\n this.readQueue.length > 0 &&\n this.readQueue[0].type !== 'COMPRESSED') {\n this.isReadPending = false;\n const nextQueueEntry = this.readQueue.shift();\n if (nextQueueEntry.type === 'READABLE') {\n this.listener.onReceiveMessage(nextQueueEntry.parsedMessage);\n }\n else {\n // nextQueueEntry.type === 'HALF_CLOSE'\n this.listener.onReceiveHalfClose();\n }\n }\n }\n handleDataFrame(data) {\n var _a;\n if (this.checkCancelled()) {\n return;\n }\n trace('Request to ' +\n this.handler.path +\n ' received data frame of size ' +\n data.length);\n let rawMessages;\n try {\n rawMessages = this.decoder.write(data);\n }\n catch (e) {\n this.sendStatus({ code: constants_1.Status.RESOURCE_EXHAUSTED, details: e.message });\n return;\n }\n for (const messageBytes of rawMessages) {\n this.stream.pause();\n const queueEntry = {\n type: 'COMPRESSED',\n compressedMessage: messageBytes,\n parsedMessage: null,\n };\n this.readQueue.push(queueEntry);\n this.decompressAndMaybePush(queueEntry);\n (_a = this.callEventTracker) === null || _a === void 0 ? void 0 : _a.addMessageReceived();\n }\n }\n handleEndEvent() {\n this.readQueue.push({\n type: 'HALF_CLOSE',\n compressedMessage: null,\n parsedMessage: null,\n });\n this.receivedHalfClose = true;\n this.maybePushNextMessage();\n }\n start(listener) {\n trace('Request to ' + this.handler.path + ' start called');\n if (this.checkCancelled()) {\n return;\n }\n this.listener = listener;\n listener.onReceiveMetadata(this.metadata);\n }\n sendMetadata(metadata) {\n if (this.checkCancelled()) {\n return;\n }\n if (this.metadataSent) {\n return;\n }\n this.metadataSent = true;\n const custom = metadata ? metadata.toHttp2Headers() : null;\n const headers = Object.assign(Object.assign(Object.assign({}, defaultResponseHeaders), defaultCompressionHeaders), custom);\n this.stream.respond(headers, defaultResponseOptions);\n }\n sendMessage(message, callback) {\n if (this.checkCancelled()) {\n return;\n }\n let response;\n try {\n response = this.serializeMessage(message);\n }\n catch (e) {\n this.sendStatus({\n code: constants_1.Status.INTERNAL,\n details: `Error serializing response: ${(0, error_1.getErrorMessage)(e)}`,\n metadata: null,\n });\n return;\n }\n if (this.maxSendMessageSize !== -1 &&\n response.length - 5 > this.maxSendMessageSize) {\n this.sendStatus({\n code: constants_1.Status.RESOURCE_EXHAUSTED,\n details: `Sent message larger than max (${response.length} vs. ${this.maxSendMessageSize})`,\n metadata: null,\n });\n return;\n }\n this.maybeSendMetadata();\n trace('Request to ' +\n this.handler.path +\n ' sent data frame of size ' +\n response.length);\n this.stream.write(response, error => {\n var _a;\n if (error) {\n this.sendStatus({\n code: constants_1.Status.INTERNAL,\n details: `Error writing message: ${(0, error_1.getErrorMessage)(error)}`,\n metadata: null,\n });\n return;\n }\n (_a = this.callEventTracker) === null || _a === void 0 ? void 0 : _a.addMessageSent();\n callback();\n });\n }\n sendStatus(status) {\n var _a, _b;\n if (this.checkCancelled()) {\n return;\n }\n trace('Request to method ' +\n ((_a = this.handler) === null || _a === void 0 ? void 0 : _a.path) +\n ' ended with status code: ' +\n constants_1.Status[status.code] +\n ' details: ' +\n status.details);\n if (this.metadataSent) {\n if (!this.wantTrailers) {\n this.wantTrailers = true;\n this.stream.once('wantTrailers', () => {\n var _a;\n if (this.callEventTracker && !this.streamEnded) {\n this.streamEnded = true;\n this.callEventTracker.onStreamEnd(true);\n this.callEventTracker.onCallEnd(status);\n }\n const trailersToSend = Object.assign({ [GRPC_STATUS_HEADER]: status.code, [GRPC_MESSAGE_HEADER]: encodeURI(status.details) }, (_a = status.metadata) === null || _a === void 0 ? void 0 : _a.toHttp2Headers());\n this.stream.sendTrailers(trailersToSend);\n this.notifyOnCancel();\n });\n this.stream.end();\n }\n else {\n this.notifyOnCancel();\n }\n }\n else {\n if (this.callEventTracker && !this.streamEnded) {\n this.streamEnded = true;\n this.callEventTracker.onStreamEnd(true);\n this.callEventTracker.onCallEnd(status);\n }\n // Trailers-only response\n const trailersToSend = Object.assign(Object.assign({ [GRPC_STATUS_HEADER]: status.code, [GRPC_MESSAGE_HEADER]: encodeURI(status.details) }, defaultResponseHeaders), (_b = status.metadata) === null || _b === void 0 ? void 0 : _b.toHttp2Headers());\n this.stream.respond(trailersToSend, { endStream: true });\n this.notifyOnCancel();\n }\n }\n startRead() {\n trace('Request to ' + this.handler.path + ' startRead called');\n if (this.checkCancelled()) {\n return;\n }\n this.isReadPending = true;\n if (this.readQueue.length === 0) {\n if (!this.receivedHalfClose) {\n this.stream.resume();\n }\n }\n else {\n this.maybePushNextMessage();\n }\n }\n getPeer() {\n var _a;\n const socket = (_a = this.stream.session) === null || _a === void 0 ? void 0 : _a.socket;\n if (socket === null || socket === void 0 ? void 0 : socket.remoteAddress) {\n if (socket.remotePort) {\n return `${socket.remoteAddress}:${socket.remotePort}`;\n }\n else {\n return socket.remoteAddress;\n }\n }\n else {\n return 'unknown';\n }\n }\n getDeadline() {\n return this.deadline;\n }\n getHost() {\n return this.host;\n }\n}\nexports.BaseServerInterceptingCall = BaseServerInterceptingCall;\nfunction getServerInterceptingCall(interceptors, stream, headers, callEventTracker, handler, options) {\n const methodDefinition = {\n path: handler.path,\n requestStream: handler.type === 'clientStream' || handler.type === 'bidi',\n responseStream: handler.type === 'serverStream' || handler.type === 'bidi',\n requestDeserialize: handler.deserialize,\n responseSerialize: handler.serialize,\n };\n const baseCall = new BaseServerInterceptingCall(stream, headers, callEventTracker, handler, options);\n return interceptors.reduce((call, interceptor) => {\n return interceptor(methodDefinition, call);\n }, baseCall);\n}\n//# sourceMappingURL=server-interceptors.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\nvar __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Server = void 0;\nconst http2 = require(\"http2\");\nconst util = require(\"util\");\nconst constants_1 = require(\"./constants\");\nconst server_call_1 = require(\"./server-call\");\nconst server_credentials_1 = require(\"./server-credentials\");\nconst resolver_1 = require(\"./resolver\");\nconst logging = require(\"./logging\");\nconst subchannel_address_1 = require(\"./subchannel-address\");\nconst uri_parser_1 = require(\"./uri-parser\");\nconst channelz_1 = require(\"./channelz\");\nconst server_interceptors_1 = require(\"./server-interceptors\");\nconst UNLIMITED_CONNECTION_AGE_MS = ~(1 << 31);\nconst KEEPALIVE_MAX_TIME_MS = ~(1 << 31);\nconst KEEPALIVE_TIMEOUT_MS = 20000;\nconst MAX_CONNECTION_IDLE_MS = ~(1 << 31);\nconst { HTTP2_HEADER_PATH } = http2.constants;\nconst TRACER_NAME = 'server';\nconst kMaxAge = Buffer.from('max_age');\nfunction serverCallTrace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, 'server_call', text);\n}\nfunction noop() { }\n/**\n * Decorator to wrap a class method with util.deprecate\n * @param message The message to output if the deprecated method is called\n * @returns\n */\nfunction deprecate(message) {\n return function (target, context) {\n return util.deprecate(target, message);\n };\n}\nfunction getUnimplementedStatusResponse(methodName) {\n return {\n code: constants_1.Status.UNIMPLEMENTED,\n details: `The server does not implement the method ${methodName}`,\n };\n}\nfunction getDefaultHandler(handlerType, methodName) {\n const unimplementedStatusResponse = getUnimplementedStatusResponse(methodName);\n switch (handlerType) {\n case 'unary':\n return (call, callback) => {\n callback(unimplementedStatusResponse, null);\n };\n case 'clientStream':\n return (call, callback) => {\n callback(unimplementedStatusResponse, null);\n };\n case 'serverStream':\n return (call) => {\n call.emit('error', unimplementedStatusResponse);\n };\n case 'bidi':\n return (call) => {\n call.emit('error', unimplementedStatusResponse);\n };\n default:\n throw new Error(`Invalid handlerType ${handlerType}`);\n }\n}\nlet Server = (() => {\n var _a;\n let _instanceExtraInitializers = [];\n let _start_decorators;\n return _a = class Server {\n constructor(options) {\n var _b, _c, _d, _e, _f, _g;\n this.boundPorts = (__runInitializers(this, _instanceExtraInitializers), new Map());\n this.http2Servers = new Map();\n this.sessionIdleTimeouts = new Map();\n this.handlers = new Map();\n this.sessions = new Map();\n /**\n * This field only exists to ensure that the start method throws an error if\n * it is called twice, as it did previously.\n */\n this.started = false;\n this.shutdown = false;\n this.serverAddressString = 'null';\n // Channelz Info\n this.channelzEnabled = true;\n this.options = options !== null && options !== void 0 ? options : {};\n if (this.options['grpc.enable_channelz'] === 0) {\n this.channelzEnabled = false;\n this.channelzTrace = new channelz_1.ChannelzTraceStub();\n this.callTracker = new channelz_1.ChannelzCallTrackerStub();\n this.listenerChildrenTracker = new channelz_1.ChannelzChildrenTrackerStub();\n this.sessionChildrenTracker = new channelz_1.ChannelzChildrenTrackerStub();\n }\n else {\n this.channelzTrace = new channelz_1.ChannelzTrace();\n this.callTracker = new channelz_1.ChannelzCallTracker();\n this.listenerChildrenTracker = new channelz_1.ChannelzChildrenTracker();\n this.sessionChildrenTracker = new channelz_1.ChannelzChildrenTracker();\n }\n this.channelzRef = (0, channelz_1.registerChannelzServer)('server', () => this.getChannelzInfo(), this.channelzEnabled);\n this.channelzTrace.addTrace('CT_INFO', 'Server created');\n this.maxConnectionAgeMs =\n (_b = this.options['grpc.max_connection_age_ms']) !== null && _b !== void 0 ? _b : UNLIMITED_CONNECTION_AGE_MS;\n this.maxConnectionAgeGraceMs =\n (_c = this.options['grpc.max_connection_age_grace_ms']) !== null && _c !== void 0 ? _c : UNLIMITED_CONNECTION_AGE_MS;\n this.keepaliveTimeMs =\n (_d = this.options['grpc.keepalive_time_ms']) !== null && _d !== void 0 ? _d : KEEPALIVE_MAX_TIME_MS;\n this.keepaliveTimeoutMs =\n (_e = this.options['grpc.keepalive_timeout_ms']) !== null && _e !== void 0 ? _e : KEEPALIVE_TIMEOUT_MS;\n this.sessionIdleTimeout =\n (_f = this.options['grpc.max_connection_idle_ms']) !== null && _f !== void 0 ? _f : MAX_CONNECTION_IDLE_MS;\n this.commonServerOptions = {\n maxSendHeaderBlockLength: Number.MAX_SAFE_INTEGER,\n };\n if ('grpc-node.max_session_memory' in this.options) {\n this.commonServerOptions.maxSessionMemory =\n this.options['grpc-node.max_session_memory'];\n }\n else {\n /* By default, set a very large max session memory limit, to effectively\n * disable enforcement of the limit. Some testing indicates that Node's\n * behavior degrades badly when this limit is reached, so we solve that\n * by disabling the check entirely. */\n this.commonServerOptions.maxSessionMemory = Number.MAX_SAFE_INTEGER;\n }\n if ('grpc.max_concurrent_streams' in this.options) {\n this.commonServerOptions.settings = {\n maxConcurrentStreams: this.options['grpc.max_concurrent_streams'],\n };\n }\n this.interceptors = (_g = this.options.interceptors) !== null && _g !== void 0 ? _g : [];\n this.trace('Server constructed');\n }\n getChannelzInfo() {\n return {\n trace: this.channelzTrace,\n callTracker: this.callTracker,\n listenerChildren: this.listenerChildrenTracker.getChildLists(),\n sessionChildren: this.sessionChildrenTracker.getChildLists(),\n };\n }\n getChannelzSessionInfo(session) {\n var _b, _c, _d;\n const sessionInfo = this.sessions.get(session);\n const sessionSocket = session.socket;\n const remoteAddress = sessionSocket.remoteAddress\n ? (0, subchannel_address_1.stringToSubchannelAddress)(sessionSocket.remoteAddress, sessionSocket.remotePort)\n : null;\n const localAddress = sessionSocket.localAddress\n ? (0, subchannel_address_1.stringToSubchannelAddress)(sessionSocket.localAddress, sessionSocket.localPort)\n : null;\n let tlsInfo;\n if (session.encrypted) {\n const tlsSocket = sessionSocket;\n const cipherInfo = tlsSocket.getCipher();\n const certificate = tlsSocket.getCertificate();\n const peerCertificate = tlsSocket.getPeerCertificate();\n tlsInfo = {\n cipherSuiteStandardName: (_b = cipherInfo.standardName) !== null && _b !== void 0 ? _b : null,\n cipherSuiteOtherName: cipherInfo.standardName ? null : cipherInfo.name,\n localCertificate: certificate && 'raw' in certificate ? certificate.raw : null,\n remoteCertificate: peerCertificate && 'raw' in peerCertificate\n ? peerCertificate.raw\n : null,\n };\n }\n else {\n tlsInfo = null;\n }\n const socketInfo = {\n remoteAddress: remoteAddress,\n localAddress: localAddress,\n security: tlsInfo,\n remoteName: null,\n streamsStarted: sessionInfo.streamTracker.callsStarted,\n streamsSucceeded: sessionInfo.streamTracker.callsSucceeded,\n streamsFailed: sessionInfo.streamTracker.callsFailed,\n messagesSent: sessionInfo.messagesSent,\n messagesReceived: sessionInfo.messagesReceived,\n keepAlivesSent: sessionInfo.keepAlivesSent,\n lastLocalStreamCreatedTimestamp: null,\n lastRemoteStreamCreatedTimestamp: sessionInfo.streamTracker.lastCallStartedTimestamp,\n lastMessageSentTimestamp: sessionInfo.lastMessageSentTimestamp,\n lastMessageReceivedTimestamp: sessionInfo.lastMessageReceivedTimestamp,\n localFlowControlWindow: (_c = session.state.localWindowSize) !== null && _c !== void 0 ? _c : null,\n remoteFlowControlWindow: (_d = session.state.remoteWindowSize) !== null && _d !== void 0 ? _d : null,\n };\n return socketInfo;\n }\n trace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, '(' + this.channelzRef.id + ') ' + text);\n }\n keepaliveTrace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, 'keepalive', '(' + this.channelzRef.id + ') ' + text);\n }\n addProtoService() {\n throw new Error('Not implemented. Use addService() instead');\n }\n addService(service, implementation) {\n if (service === null ||\n typeof service !== 'object' ||\n implementation === null ||\n typeof implementation !== 'object') {\n throw new Error('addService() requires two objects as arguments');\n }\n const serviceKeys = Object.keys(service);\n if (serviceKeys.length === 0) {\n throw new Error('Cannot add an empty service to a server');\n }\n serviceKeys.forEach(name => {\n const attrs = service[name];\n let methodType;\n if (attrs.requestStream) {\n if (attrs.responseStream) {\n methodType = 'bidi';\n }\n else {\n methodType = 'clientStream';\n }\n }\n else {\n if (attrs.responseStream) {\n methodType = 'serverStream';\n }\n else {\n methodType = 'unary';\n }\n }\n let implFn = implementation[name];\n let impl;\n if (implFn === undefined && typeof attrs.originalName === 'string') {\n implFn = implementation[attrs.originalName];\n }\n if (implFn !== undefined) {\n impl = implFn.bind(implementation);\n }\n else {\n impl = getDefaultHandler(methodType, name);\n }\n const success = this.register(attrs.path, impl, attrs.responseSerialize, attrs.requestDeserialize, methodType);\n if (success === false) {\n throw new Error(`Method handler for ${attrs.path} already provided.`);\n }\n });\n }\n removeService(service) {\n if (service === null || typeof service !== 'object') {\n throw new Error('removeService() requires object as argument');\n }\n const serviceKeys = Object.keys(service);\n serviceKeys.forEach(name => {\n const attrs = service[name];\n this.unregister(attrs.path);\n });\n }\n bind(port, creds) {\n throw new Error('Not implemented. Use bindAsync() instead');\n }\n /**\n * This API is experimental, so API stability is not guaranteed across minor versions.\n * @param boundAddress\n * @returns\n */\n experimentalRegisterListenerToChannelz(boundAddress) {\n return (0, channelz_1.registerChannelzSocket)((0, subchannel_address_1.subchannelAddressToString)(boundAddress), () => {\n return {\n localAddress: boundAddress,\n remoteAddress: null,\n security: null,\n remoteName: null,\n streamsStarted: 0,\n streamsSucceeded: 0,\n streamsFailed: 0,\n messagesSent: 0,\n messagesReceived: 0,\n keepAlivesSent: 0,\n lastLocalStreamCreatedTimestamp: null,\n lastRemoteStreamCreatedTimestamp: null,\n lastMessageSentTimestamp: null,\n lastMessageReceivedTimestamp: null,\n localFlowControlWindow: null,\n remoteFlowControlWindow: null,\n };\n }, this.channelzEnabled);\n }\n experimentalUnregisterListenerFromChannelz(channelzRef) {\n (0, channelz_1.unregisterChannelzRef)(channelzRef);\n }\n createHttp2Server(credentials) {\n let http2Server;\n if (credentials._isSecure()) {\n const constructorOptions = credentials._getConstructorOptions();\n const contextOptions = credentials._getSecureContextOptions();\n const secureServerOptions = Object.assign(Object.assign(Object.assign(Object.assign({}, this.commonServerOptions), constructorOptions), contextOptions), { enableTrace: this.options['grpc-node.tls_enable_trace'] === 1 });\n let areCredentialsValid = contextOptions !== null;\n this.trace('Initial credentials valid: ' + areCredentialsValid);\n http2Server = http2.createSecureServer(secureServerOptions);\n http2Server.prependListener('connection', (socket) => {\n if (!areCredentialsValid) {\n this.trace('Dropped connection from ' + JSON.stringify(socket.address()) + ' due to unloaded credentials');\n socket.destroy();\n }\n });\n http2Server.on('secureConnection', (socket) => {\n /* These errors need to be handled by the user of Http2SecureServer,\n * according to https://github.com/nodejs/node/issues/35824 */\n socket.on('error', (e) => {\n this.trace('An incoming TLS connection closed with error: ' + e.message);\n });\n });\n const credsWatcher = options => {\n if (options) {\n const secureServer = http2Server;\n try {\n secureServer.setSecureContext(options);\n }\n catch (e) {\n logging.log(constants_1.LogVerbosity.ERROR, 'Failed to set secure context with error ' + e.message);\n options = null;\n }\n }\n areCredentialsValid = options !== null;\n this.trace('Post-update credentials valid: ' + areCredentialsValid);\n };\n credentials._addWatcher(credsWatcher);\n http2Server.on('close', () => {\n credentials._removeWatcher(credsWatcher);\n });\n }\n else {\n http2Server = http2.createServer(this.commonServerOptions);\n }\n http2Server.setTimeout(0, noop);\n this._setupHandlers(http2Server, credentials._getInterceptors());\n return http2Server;\n }\n bindOneAddress(address, boundPortObject) {\n this.trace('Attempting to bind ' + (0, subchannel_address_1.subchannelAddressToString)(address));\n const http2Server = this.createHttp2Server(boundPortObject.credentials);\n return new Promise((resolve, reject) => {\n const onError = (err) => {\n this.trace('Failed to bind ' +\n (0, subchannel_address_1.subchannelAddressToString)(address) +\n ' with error ' +\n err.message);\n resolve({\n port: 'port' in address ? address.port : 1,\n error: err.message,\n });\n };\n http2Server.once('error', onError);\n http2Server.listen(address, () => {\n const boundAddress = http2Server.address();\n let boundSubchannelAddress;\n if (typeof boundAddress === 'string') {\n boundSubchannelAddress = {\n path: boundAddress,\n };\n }\n else {\n boundSubchannelAddress = {\n host: boundAddress.address,\n port: boundAddress.port,\n };\n }\n const channelzRef = this.experimentalRegisterListenerToChannelz(boundSubchannelAddress);\n this.listenerChildrenTracker.refChild(channelzRef);\n this.http2Servers.set(http2Server, {\n channelzRef: channelzRef,\n sessions: new Set(),\n ownsChannelzRef: true\n });\n boundPortObject.listeningServers.add(http2Server);\n this.trace('Successfully bound ' +\n (0, subchannel_address_1.subchannelAddressToString)(boundSubchannelAddress));\n resolve({\n port: 'port' in boundSubchannelAddress ? boundSubchannelAddress.port : 1,\n });\n http2Server.removeListener('error', onError);\n });\n });\n }\n async bindManyPorts(addressList, boundPortObject) {\n if (addressList.length === 0) {\n return {\n count: 0,\n port: 0,\n errors: [],\n };\n }\n if ((0, subchannel_address_1.isTcpSubchannelAddress)(addressList[0]) && addressList[0].port === 0) {\n /* If binding to port 0, first try to bind the first address, then bind\n * the rest of the address list to the specific port that it binds. */\n const firstAddressResult = await this.bindOneAddress(addressList[0], boundPortObject);\n if (firstAddressResult.error) {\n /* If the first address fails to bind, try the same operation starting\n * from the second item in the list. */\n const restAddressResult = await this.bindManyPorts(addressList.slice(1), boundPortObject);\n return Object.assign(Object.assign({}, restAddressResult), { errors: [firstAddressResult.error, ...restAddressResult.errors] });\n }\n else {\n const restAddresses = addressList\n .slice(1)\n .map(address => (0, subchannel_address_1.isTcpSubchannelAddress)(address)\n ? { host: address.host, port: firstAddressResult.port }\n : address);\n const restAddressResult = await Promise.all(restAddresses.map(address => this.bindOneAddress(address, boundPortObject)));\n const allResults = [firstAddressResult, ...restAddressResult];\n return {\n count: allResults.filter(result => result.error === undefined).length,\n port: firstAddressResult.port,\n errors: allResults\n .filter(result => result.error)\n .map(result => result.error),\n };\n }\n }\n else {\n const allResults = await Promise.all(addressList.map(address => this.bindOneAddress(address, boundPortObject)));\n return {\n count: allResults.filter(result => result.error === undefined).length,\n port: allResults[0].port,\n errors: allResults\n .filter(result => result.error)\n .map(result => result.error),\n };\n }\n }\n async bindAddressList(addressList, boundPortObject) {\n const bindResult = await this.bindManyPorts(addressList, boundPortObject);\n if (bindResult.count > 0) {\n if (bindResult.count < addressList.length) {\n logging.log(constants_1.LogVerbosity.INFO, `WARNING Only ${bindResult.count} addresses added out of total ${addressList.length} resolved`);\n }\n return bindResult.port;\n }\n else {\n const errorString = `No address added out of total ${addressList.length} resolved`;\n logging.log(constants_1.LogVerbosity.ERROR, errorString);\n throw new Error(`${errorString} errors: [${bindResult.errors.join(',')}]`);\n }\n }\n resolvePort(port) {\n return new Promise((resolve, reject) => {\n const resolverListener = {\n onSuccessfulResolution: (endpointList, serviceConfig, serviceConfigError) => {\n // We only want one resolution result. Discard all future results\n resolverListener.onSuccessfulResolution = () => { };\n const addressList = [].concat(...endpointList.map(endpoint => endpoint.addresses));\n if (addressList.length === 0) {\n reject(new Error(`No addresses resolved for port ${port}`));\n return;\n }\n resolve(addressList);\n },\n onError: error => {\n reject(new Error(error.details));\n },\n };\n const resolver = (0, resolver_1.createResolver)(port, resolverListener, this.options);\n resolver.updateResolution();\n });\n }\n async bindPort(port, boundPortObject) {\n const addressList = await this.resolvePort(port);\n if (boundPortObject.cancelled) {\n this.completeUnbind(boundPortObject);\n throw new Error('bindAsync operation cancelled by unbind call');\n }\n const portNumber = await this.bindAddressList(addressList, boundPortObject);\n if (boundPortObject.cancelled) {\n this.completeUnbind(boundPortObject);\n throw new Error('bindAsync operation cancelled by unbind call');\n }\n return portNumber;\n }\n normalizePort(port) {\n const initialPortUri = (0, uri_parser_1.parseUri)(port);\n if (initialPortUri === null) {\n throw new Error(`Could not parse port \"${port}\"`);\n }\n const portUri = (0, resolver_1.mapUriDefaultScheme)(initialPortUri);\n if (portUri === null) {\n throw new Error(`Could not get a default scheme for port \"${port}\"`);\n }\n return portUri;\n }\n bindAsync(port, creds, callback) {\n if (this.shutdown) {\n throw new Error('bindAsync called after shutdown');\n }\n if (typeof port !== 'string') {\n throw new TypeError('port must be a string');\n }\n if (creds === null || !(creds instanceof server_credentials_1.ServerCredentials)) {\n throw new TypeError('creds must be a ServerCredentials object');\n }\n if (typeof callback !== 'function') {\n throw new TypeError('callback must be a function');\n }\n this.trace('bindAsync port=' + port);\n const portUri = this.normalizePort(port);\n const deferredCallback = (error, port) => {\n process.nextTick(() => callback(error, port));\n };\n /* First, if this port is already bound or that bind operation is in\n * progress, use that result. */\n let boundPortObject = this.boundPorts.get((0, uri_parser_1.uriToString)(portUri));\n if (boundPortObject) {\n if (!creds._equals(boundPortObject.credentials)) {\n deferredCallback(new Error(`${port} already bound with incompatible credentials`), 0);\n return;\n }\n /* If that operation has previously been cancelled by an unbind call,\n * uncancel it. */\n boundPortObject.cancelled = false;\n if (boundPortObject.completionPromise) {\n boundPortObject.completionPromise.then(portNum => callback(null, portNum), error => callback(error, 0));\n }\n else {\n deferredCallback(null, boundPortObject.portNumber);\n }\n return;\n }\n boundPortObject = {\n mapKey: (0, uri_parser_1.uriToString)(portUri),\n originalUri: portUri,\n completionPromise: null,\n cancelled: false,\n portNumber: 0,\n credentials: creds,\n listeningServers: new Set(),\n };\n const splitPort = (0, uri_parser_1.splitHostPort)(portUri.path);\n const completionPromise = this.bindPort(portUri, boundPortObject);\n boundPortObject.completionPromise = completionPromise;\n /* If the port number is 0, defer populating the map entry until after the\n * bind operation completes and we have a specific port number. Otherwise,\n * populate it immediately. */\n if ((splitPort === null || splitPort === void 0 ? void 0 : splitPort.port) === 0) {\n completionPromise.then(portNum => {\n const finalUri = {\n scheme: portUri.scheme,\n authority: portUri.authority,\n path: (0, uri_parser_1.combineHostPort)({ host: splitPort.host, port: portNum }),\n };\n boundPortObject.mapKey = (0, uri_parser_1.uriToString)(finalUri);\n boundPortObject.completionPromise = null;\n boundPortObject.portNumber = portNum;\n this.boundPorts.set(boundPortObject.mapKey, boundPortObject);\n callback(null, portNum);\n }, error => {\n callback(error, 0);\n });\n }\n else {\n this.boundPorts.set(boundPortObject.mapKey, boundPortObject);\n completionPromise.then(portNum => {\n boundPortObject.completionPromise = null;\n boundPortObject.portNumber = portNum;\n callback(null, portNum);\n }, error => {\n callback(error, 0);\n });\n }\n }\n registerInjectorToChannelz() {\n return (0, channelz_1.registerChannelzSocket)('injector', () => {\n return {\n localAddress: null,\n remoteAddress: null,\n security: null,\n remoteName: null,\n streamsStarted: 0,\n streamsSucceeded: 0,\n streamsFailed: 0,\n messagesSent: 0,\n messagesReceived: 0,\n keepAlivesSent: 0,\n lastLocalStreamCreatedTimestamp: null,\n lastRemoteStreamCreatedTimestamp: null,\n lastMessageSentTimestamp: null,\n lastMessageReceivedTimestamp: null,\n localFlowControlWindow: null,\n remoteFlowControlWindow: null,\n };\n }, this.channelzEnabled);\n }\n /**\n * This API is experimental, so API stability is not guaranteed across minor versions.\n * @param credentials\n * @param channelzRef\n * @returns\n */\n experimentalCreateConnectionInjectorWithChannelzRef(credentials, channelzRef, ownsChannelzRef = false) {\n if (credentials === null || !(credentials instanceof server_credentials_1.ServerCredentials)) {\n throw new TypeError('creds must be a ServerCredentials object');\n }\n if (this.channelzEnabled) {\n this.listenerChildrenTracker.refChild(channelzRef);\n }\n const server = this.createHttp2Server(credentials);\n const sessionsSet = new Set();\n this.http2Servers.set(server, {\n channelzRef: channelzRef,\n sessions: sessionsSet,\n ownsChannelzRef\n });\n return {\n injectConnection: (connection) => {\n server.emit('connection', connection);\n },\n drain: (graceTimeMs) => {\n var _b, _c;\n for (const session of sessionsSet) {\n this.closeSession(session);\n }\n (_c = (_b = setTimeout(() => {\n for (const session of sessionsSet) {\n session.destroy(http2.constants.NGHTTP2_CANCEL);\n }\n }, graceTimeMs)).unref) === null || _c === void 0 ? void 0 : _c.call(_b);\n },\n destroy: () => {\n this.closeServer(server);\n for (const session of sessionsSet) {\n this.closeSession(session);\n }\n }\n };\n }\n createConnectionInjector(credentials) {\n if (credentials === null || !(credentials instanceof server_credentials_1.ServerCredentials)) {\n throw new TypeError('creds must be a ServerCredentials object');\n }\n const channelzRef = this.registerInjectorToChannelz();\n return this.experimentalCreateConnectionInjectorWithChannelzRef(credentials, channelzRef, true);\n }\n closeServer(server, callback) {\n this.trace('Closing server with address ' + JSON.stringify(server.address()));\n const serverInfo = this.http2Servers.get(server);\n server.close(() => {\n if (serverInfo && serverInfo.ownsChannelzRef) {\n this.listenerChildrenTracker.unrefChild(serverInfo.channelzRef);\n (0, channelz_1.unregisterChannelzRef)(serverInfo.channelzRef);\n }\n this.http2Servers.delete(server);\n callback === null || callback === void 0 ? void 0 : callback();\n });\n }\n closeSession(session, callback) {\n var _b;\n this.trace('Closing session initiated by ' + ((_b = session.socket) === null || _b === void 0 ? void 0 : _b.remoteAddress));\n const sessionInfo = this.sessions.get(session);\n const closeCallback = () => {\n if (sessionInfo) {\n this.sessionChildrenTracker.unrefChild(sessionInfo.ref);\n (0, channelz_1.unregisterChannelzRef)(sessionInfo.ref);\n }\n callback === null || callback === void 0 ? void 0 : callback();\n };\n if (session.closed) {\n queueMicrotask(closeCallback);\n }\n else {\n session.close(closeCallback);\n }\n }\n completeUnbind(boundPortObject) {\n for (const server of boundPortObject.listeningServers) {\n const serverInfo = this.http2Servers.get(server);\n this.closeServer(server, () => {\n boundPortObject.listeningServers.delete(server);\n });\n if (serverInfo) {\n for (const session of serverInfo.sessions) {\n this.closeSession(session);\n }\n }\n }\n this.boundPorts.delete(boundPortObject.mapKey);\n }\n /**\n * Unbind a previously bound port, or cancel an in-progress bindAsync\n * operation. If port 0 was bound, only the actual bound port can be\n * unbound. For example, if bindAsync was called with \"localhost:0\" and the\n * bound port result was 54321, it can be unbound as \"localhost:54321\".\n * @param port\n */\n unbind(port) {\n this.trace('unbind port=' + port);\n const portUri = this.normalizePort(port);\n const splitPort = (0, uri_parser_1.splitHostPort)(portUri.path);\n if ((splitPort === null || splitPort === void 0 ? void 0 : splitPort.port) === 0) {\n throw new Error('Cannot unbind port 0');\n }\n const boundPortObject = this.boundPorts.get((0, uri_parser_1.uriToString)(portUri));\n if (boundPortObject) {\n this.trace('unbinding ' +\n boundPortObject.mapKey +\n ' originally bound as ' +\n (0, uri_parser_1.uriToString)(boundPortObject.originalUri));\n /* If the bind operation is pending, the cancelled flag will trigger\n * the unbind operation later. */\n if (boundPortObject.completionPromise) {\n boundPortObject.cancelled = true;\n }\n else {\n this.completeUnbind(boundPortObject);\n }\n }\n }\n /**\n * Gracefully close all connections associated with a previously bound port.\n * After the grace time, forcefully close all remaining open connections.\n *\n * If port 0 was bound, only the actual bound port can be\n * drained. For example, if bindAsync was called with \"localhost:0\" and the\n * bound port result was 54321, it can be drained as \"localhost:54321\".\n * @param port\n * @param graceTimeMs\n * @returns\n */\n drain(port, graceTimeMs) {\n var _b, _c;\n this.trace('drain port=' + port + ' graceTimeMs=' + graceTimeMs);\n const portUri = this.normalizePort(port);\n const splitPort = (0, uri_parser_1.splitHostPort)(portUri.path);\n if ((splitPort === null || splitPort === void 0 ? void 0 : splitPort.port) === 0) {\n throw new Error('Cannot drain port 0');\n }\n const boundPortObject = this.boundPorts.get((0, uri_parser_1.uriToString)(portUri));\n if (!boundPortObject) {\n return;\n }\n const allSessions = new Set();\n for (const http2Server of boundPortObject.listeningServers) {\n const serverEntry = this.http2Servers.get(http2Server);\n if (serverEntry) {\n for (const session of serverEntry.sessions) {\n allSessions.add(session);\n this.closeSession(session, () => {\n allSessions.delete(session);\n });\n }\n }\n }\n /* After the grace time ends, send another goaway to all remaining sessions\n * with the CANCEL code. */\n (_c = (_b = setTimeout(() => {\n for (const session of allSessions) {\n session.destroy(http2.constants.NGHTTP2_CANCEL);\n }\n }, graceTimeMs)).unref) === null || _c === void 0 ? void 0 : _c.call(_b);\n }\n forceShutdown() {\n for (const boundPortObject of this.boundPorts.values()) {\n boundPortObject.cancelled = true;\n }\n this.boundPorts.clear();\n // Close the server if it is still running.\n for (const server of this.http2Servers.keys()) {\n this.closeServer(server);\n }\n // Always destroy any available sessions. It's possible that one or more\n // tryShutdown() calls are in progress. Don't wait on them to finish.\n this.sessions.forEach((channelzInfo, session) => {\n this.closeSession(session);\n // Cast NGHTTP2_CANCEL to any because TypeScript doesn't seem to\n // recognize destroy(code) as a valid signature.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n session.destroy(http2.constants.NGHTTP2_CANCEL);\n });\n this.sessions.clear();\n (0, channelz_1.unregisterChannelzRef)(this.channelzRef);\n this.shutdown = true;\n }\n register(name, handler, serialize, deserialize, type) {\n if (this.handlers.has(name)) {\n return false;\n }\n this.handlers.set(name, {\n func: handler,\n serialize,\n deserialize,\n type,\n path: name,\n });\n return true;\n }\n unregister(name) {\n return this.handlers.delete(name);\n }\n /**\n * @deprecated No longer needed as of version 1.10.x\n */\n start() {\n if (this.http2Servers.size === 0 ||\n [...this.http2Servers.keys()].every(server => !server.listening)) {\n throw new Error('server must be bound in order to start');\n }\n if (this.started === true) {\n throw new Error('server is already started');\n }\n this.started = true;\n }\n tryShutdown(callback) {\n var _b;\n const wrappedCallback = (error) => {\n (0, channelz_1.unregisterChannelzRef)(this.channelzRef);\n callback(error);\n };\n let pendingChecks = 0;\n function maybeCallback() {\n pendingChecks--;\n if (pendingChecks === 0) {\n wrappedCallback();\n }\n }\n this.shutdown = true;\n for (const [serverKey, server] of this.http2Servers.entries()) {\n pendingChecks++;\n const serverString = server.channelzRef.name;\n this.trace('Waiting for server ' + serverString + ' to close');\n this.closeServer(serverKey, () => {\n this.trace('Server ' + serverString + ' finished closing');\n maybeCallback();\n });\n for (const session of server.sessions.keys()) {\n pendingChecks++;\n const sessionString = (_b = session.socket) === null || _b === void 0 ? void 0 : _b.remoteAddress;\n this.trace('Waiting for session ' + sessionString + ' to close');\n this.closeSession(session, () => {\n this.trace('Session ' + sessionString + ' finished closing');\n maybeCallback();\n });\n }\n }\n if (pendingChecks === 0) {\n wrappedCallback();\n }\n }\n addHttp2Port() {\n throw new Error('Not yet implemented');\n }\n /**\n * Get the channelz reference object for this server. The returned value is\n * garbage if channelz is disabled for this server.\n * @returns\n */\n getChannelzRef() {\n return this.channelzRef;\n }\n _verifyContentType(stream, headers) {\n const contentType = headers[http2.constants.HTTP2_HEADER_CONTENT_TYPE];\n if (typeof contentType !== 'string' ||\n !contentType.startsWith('application/grpc')) {\n stream.respond({\n [http2.constants.HTTP2_HEADER_STATUS]: http2.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE,\n }, { endStream: true });\n return false;\n }\n return true;\n }\n _retrieveHandler(path) {\n serverCallTrace('Received call to method ' +\n path +\n ' at address ' +\n this.serverAddressString);\n const handler = this.handlers.get(path);\n if (handler === undefined) {\n serverCallTrace('No handler registered for method ' +\n path +\n '. Sending UNIMPLEMENTED status.');\n return null;\n }\n return handler;\n }\n _respondWithError(err, stream, channelzSessionInfo = null) {\n var _b, _c;\n const trailersToSend = Object.assign({ 'grpc-status': (_b = err.code) !== null && _b !== void 0 ? _b : constants_1.Status.INTERNAL, 'grpc-message': err.details, [http2.constants.HTTP2_HEADER_STATUS]: http2.constants.HTTP_STATUS_OK, [http2.constants.HTTP2_HEADER_CONTENT_TYPE]: 'application/grpc+proto' }, (_c = err.metadata) === null || _c === void 0 ? void 0 : _c.toHttp2Headers());\n stream.respond(trailersToSend, { endStream: true });\n this.callTracker.addCallFailed();\n channelzSessionInfo === null || channelzSessionInfo === void 0 ? void 0 : channelzSessionInfo.streamTracker.addCallFailed();\n }\n _channelzHandler(extraInterceptors, stream, headers) {\n // for handling idle timeout\n this.onStreamOpened(stream);\n const channelzSessionInfo = this.sessions.get(stream.session);\n this.callTracker.addCallStarted();\n channelzSessionInfo === null || channelzSessionInfo === void 0 ? void 0 : channelzSessionInfo.streamTracker.addCallStarted();\n if (!this._verifyContentType(stream, headers)) {\n this.callTracker.addCallFailed();\n channelzSessionInfo === null || channelzSessionInfo === void 0 ? void 0 : channelzSessionInfo.streamTracker.addCallFailed();\n return;\n }\n const path = headers[HTTP2_HEADER_PATH];\n const handler = this._retrieveHandler(path);\n if (!handler) {\n this._respondWithError(getUnimplementedStatusResponse(path), stream, channelzSessionInfo);\n return;\n }\n const callEventTracker = {\n addMessageSent: () => {\n if (channelzSessionInfo) {\n channelzSessionInfo.messagesSent += 1;\n channelzSessionInfo.lastMessageSentTimestamp = new Date();\n }\n },\n addMessageReceived: () => {\n if (channelzSessionInfo) {\n channelzSessionInfo.messagesReceived += 1;\n channelzSessionInfo.lastMessageReceivedTimestamp = new Date();\n }\n },\n onCallEnd: status => {\n if (status.code === constants_1.Status.OK) {\n this.callTracker.addCallSucceeded();\n }\n else {\n this.callTracker.addCallFailed();\n }\n },\n onStreamEnd: success => {\n if (channelzSessionInfo) {\n if (success) {\n channelzSessionInfo.streamTracker.addCallSucceeded();\n }\n else {\n channelzSessionInfo.streamTracker.addCallFailed();\n }\n }\n },\n };\n const call = (0, server_interceptors_1.getServerInterceptingCall)([...extraInterceptors, ...this.interceptors], stream, headers, callEventTracker, handler, this.options);\n if (!this._runHandlerForCall(call, handler)) {\n this.callTracker.addCallFailed();\n channelzSessionInfo === null || channelzSessionInfo === void 0 ? void 0 : channelzSessionInfo.streamTracker.addCallFailed();\n call.sendStatus({\n code: constants_1.Status.INTERNAL,\n details: `Unknown handler type: ${handler.type}`,\n });\n }\n }\n _streamHandler(extraInterceptors, stream, headers) {\n // for handling idle timeout\n this.onStreamOpened(stream);\n if (this._verifyContentType(stream, headers) !== true) {\n return;\n }\n const path = headers[HTTP2_HEADER_PATH];\n const handler = this._retrieveHandler(path);\n if (!handler) {\n this._respondWithError(getUnimplementedStatusResponse(path), stream, null);\n return;\n }\n const call = (0, server_interceptors_1.getServerInterceptingCall)([...extraInterceptors, ...this.interceptors], stream, headers, null, handler, this.options);\n if (!this._runHandlerForCall(call, handler)) {\n call.sendStatus({\n code: constants_1.Status.INTERNAL,\n details: `Unknown handler type: ${handler.type}`,\n });\n }\n }\n _runHandlerForCall(call, handler) {\n const { type } = handler;\n if (type === 'unary') {\n handleUnary(call, handler);\n }\n else if (type === 'clientStream') {\n handleClientStreaming(call, handler);\n }\n else if (type === 'serverStream') {\n handleServerStreaming(call, handler);\n }\n else if (type === 'bidi') {\n handleBidiStreaming(call, handler);\n }\n else {\n return false;\n }\n return true;\n }\n _setupHandlers(http2Server, extraInterceptors) {\n if (http2Server === null) {\n return;\n }\n const serverAddress = http2Server.address();\n let serverAddressString = 'null';\n if (serverAddress) {\n if (typeof serverAddress === 'string') {\n serverAddressString = serverAddress;\n }\n else {\n serverAddressString = serverAddress.address + ':' + serverAddress.port;\n }\n }\n this.serverAddressString = serverAddressString;\n const handler = this.channelzEnabled\n ? this._channelzHandler\n : this._streamHandler;\n const sessionHandler = this.channelzEnabled\n ? this._channelzSessionHandler(http2Server)\n : this._sessionHandler(http2Server);\n http2Server.on('stream', handler.bind(this, extraInterceptors));\n http2Server.on('session', sessionHandler);\n }\n _sessionHandler(http2Server) {\n return (session) => {\n var _b, _c;\n (_b = this.http2Servers.get(http2Server)) === null || _b === void 0 ? void 0 : _b.sessions.add(session);\n let connectionAgeTimer = null;\n let connectionAgeGraceTimer = null;\n let keepaliveTimer = null;\n let sessionClosedByServer = false;\n const idleTimeoutObj = this.enableIdleTimeout(session);\n if (this.maxConnectionAgeMs !== UNLIMITED_CONNECTION_AGE_MS) {\n // Apply a random jitter within a +/-10% range\n const jitterMagnitude = this.maxConnectionAgeMs / 10;\n const jitter = Math.random() * jitterMagnitude * 2 - jitterMagnitude;\n connectionAgeTimer = setTimeout(() => {\n var _b, _c;\n sessionClosedByServer = true;\n this.trace('Connection dropped by max connection age: ' +\n ((_b = session.socket) === null || _b === void 0 ? void 0 : _b.remoteAddress));\n try {\n session.goaway(http2.constants.NGHTTP2_NO_ERROR, ~(1 << 31), kMaxAge);\n }\n catch (e) {\n // The goaway can't be sent because the session is already closed\n session.destroy();\n return;\n }\n session.close();\n /* Allow a grace period after sending the GOAWAY before forcibly\n * closing the connection. */\n if (this.maxConnectionAgeGraceMs !== UNLIMITED_CONNECTION_AGE_MS) {\n connectionAgeGraceTimer = setTimeout(() => {\n session.destroy();\n }, this.maxConnectionAgeGraceMs);\n (_c = connectionAgeGraceTimer.unref) === null || _c === void 0 ? void 0 : _c.call(connectionAgeGraceTimer);\n }\n }, this.maxConnectionAgeMs + jitter);\n (_c = connectionAgeTimer.unref) === null || _c === void 0 ? void 0 : _c.call(connectionAgeTimer);\n }\n const clearKeepaliveTimeout = () => {\n if (keepaliveTimer) {\n clearTimeout(keepaliveTimer);\n keepaliveTimer = null;\n }\n };\n const canSendPing = () => {\n return (!session.destroyed &&\n this.keepaliveTimeMs < KEEPALIVE_MAX_TIME_MS &&\n this.keepaliveTimeMs > 0);\n };\n /* eslint-disable-next-line prefer-const */\n let sendPing; // hoisted for use in maybeStartKeepalivePingTimer\n const maybeStartKeepalivePingTimer = () => {\n var _b;\n if (!canSendPing()) {\n return;\n }\n this.keepaliveTrace('Starting keepalive timer for ' + this.keepaliveTimeMs + 'ms');\n keepaliveTimer = setTimeout(() => {\n clearKeepaliveTimeout();\n sendPing();\n }, this.keepaliveTimeMs);\n (_b = keepaliveTimer.unref) === null || _b === void 0 ? void 0 : _b.call(keepaliveTimer);\n };\n sendPing = () => {\n var _b;\n if (!canSendPing()) {\n return;\n }\n this.keepaliveTrace('Sending ping with timeout ' + this.keepaliveTimeoutMs + 'ms');\n let pingSendError = '';\n try {\n const pingSentSuccessfully = session.ping((err, duration, payload) => {\n clearKeepaliveTimeout();\n if (err) {\n this.keepaliveTrace('Ping failed with error: ' + err.message);\n sessionClosedByServer = true;\n session.close();\n }\n else {\n this.keepaliveTrace('Received ping response');\n maybeStartKeepalivePingTimer();\n }\n });\n if (!pingSentSuccessfully) {\n pingSendError = 'Ping returned false';\n }\n }\n catch (e) {\n // grpc/grpc-node#2139\n pingSendError =\n (e instanceof Error ? e.message : '') || 'Unknown error';\n }\n if (pingSendError) {\n this.keepaliveTrace('Ping send failed: ' + pingSendError);\n this.trace('Connection dropped due to ping send error: ' + pingSendError);\n sessionClosedByServer = true;\n session.close();\n return;\n }\n keepaliveTimer = setTimeout(() => {\n clearKeepaliveTimeout();\n this.keepaliveTrace('Ping timeout passed without response');\n this.trace('Connection dropped by keepalive timeout');\n sessionClosedByServer = true;\n session.close();\n }, this.keepaliveTimeoutMs);\n (_b = keepaliveTimer.unref) === null || _b === void 0 ? void 0 : _b.call(keepaliveTimer);\n };\n maybeStartKeepalivePingTimer();\n session.on('close', () => {\n var _b, _c;\n if (!sessionClosedByServer) {\n this.trace(`Connection dropped by client ${(_b = session.socket) === null || _b === void 0 ? void 0 : _b.remoteAddress}`);\n }\n if (connectionAgeTimer) {\n clearTimeout(connectionAgeTimer);\n }\n if (connectionAgeGraceTimer) {\n clearTimeout(connectionAgeGraceTimer);\n }\n clearKeepaliveTimeout();\n if (idleTimeoutObj !== null) {\n clearTimeout(idleTimeoutObj.timeout);\n this.sessionIdleTimeouts.delete(session);\n }\n (_c = this.http2Servers.get(http2Server)) === null || _c === void 0 ? void 0 : _c.sessions.delete(session);\n });\n };\n }\n _channelzSessionHandler(http2Server) {\n return (session) => {\n var _b, _c, _d, _e;\n const channelzRef = (0, channelz_1.registerChannelzSocket)((_c = (_b = session.socket) === null || _b === void 0 ? void 0 : _b.remoteAddress) !== null && _c !== void 0 ? _c : 'unknown', this.getChannelzSessionInfo.bind(this, session), this.channelzEnabled);\n const channelzSessionInfo = {\n ref: channelzRef,\n streamTracker: new channelz_1.ChannelzCallTracker(),\n messagesSent: 0,\n messagesReceived: 0,\n keepAlivesSent: 0,\n lastMessageSentTimestamp: null,\n lastMessageReceivedTimestamp: null,\n };\n (_d = this.http2Servers.get(http2Server)) === null || _d === void 0 ? void 0 : _d.sessions.add(session);\n this.sessions.set(session, channelzSessionInfo);\n const clientAddress = `${session.socket.remoteAddress}:${session.socket.remotePort}`;\n this.channelzTrace.addTrace('CT_INFO', 'Connection established by client ' + clientAddress);\n this.trace('Connection established by client ' + clientAddress);\n this.sessionChildrenTracker.refChild(channelzRef);\n let connectionAgeTimer = null;\n let connectionAgeGraceTimer = null;\n let keepaliveTimeout = null;\n let sessionClosedByServer = false;\n const idleTimeoutObj = this.enableIdleTimeout(session);\n if (this.maxConnectionAgeMs !== UNLIMITED_CONNECTION_AGE_MS) {\n // Apply a random jitter within a +/-10% range\n const jitterMagnitude = this.maxConnectionAgeMs / 10;\n const jitter = Math.random() * jitterMagnitude * 2 - jitterMagnitude;\n connectionAgeTimer = setTimeout(() => {\n var _b;\n sessionClosedByServer = true;\n this.channelzTrace.addTrace('CT_INFO', 'Connection dropped by max connection age from ' + clientAddress);\n try {\n session.goaway(http2.constants.NGHTTP2_NO_ERROR, ~(1 << 31), kMaxAge);\n }\n catch (e) {\n // The goaway can't be sent because the session is already closed\n session.destroy();\n return;\n }\n session.close();\n /* Allow a grace period after sending the GOAWAY before forcibly\n * closing the connection. */\n if (this.maxConnectionAgeGraceMs !== UNLIMITED_CONNECTION_AGE_MS) {\n connectionAgeGraceTimer = setTimeout(() => {\n session.destroy();\n }, this.maxConnectionAgeGraceMs);\n (_b = connectionAgeGraceTimer.unref) === null || _b === void 0 ? void 0 : _b.call(connectionAgeGraceTimer);\n }\n }, this.maxConnectionAgeMs + jitter);\n (_e = connectionAgeTimer.unref) === null || _e === void 0 ? void 0 : _e.call(connectionAgeTimer);\n }\n const clearKeepaliveTimeout = () => {\n if (keepaliveTimeout) {\n clearTimeout(keepaliveTimeout);\n keepaliveTimeout = null;\n }\n };\n const canSendPing = () => {\n return (!session.destroyed &&\n this.keepaliveTimeMs < KEEPALIVE_MAX_TIME_MS &&\n this.keepaliveTimeMs > 0);\n };\n /* eslint-disable-next-line prefer-const */\n let sendPing; // hoisted for use in maybeStartKeepalivePingTimer\n const maybeStartKeepalivePingTimer = () => {\n var _b;\n if (!canSendPing()) {\n return;\n }\n this.keepaliveTrace('Starting keepalive timer for ' + this.keepaliveTimeMs + 'ms');\n keepaliveTimeout = setTimeout(() => {\n clearKeepaliveTimeout();\n sendPing();\n }, this.keepaliveTimeMs);\n (_b = keepaliveTimeout.unref) === null || _b === void 0 ? void 0 : _b.call(keepaliveTimeout);\n };\n sendPing = () => {\n var _b;\n if (!canSendPing()) {\n return;\n }\n this.keepaliveTrace('Sending ping with timeout ' + this.keepaliveTimeoutMs + 'ms');\n let pingSendError = '';\n try {\n const pingSentSuccessfully = session.ping((err, duration, payload) => {\n clearKeepaliveTimeout();\n if (err) {\n this.keepaliveTrace('Ping failed with error: ' + err.message);\n this.channelzTrace.addTrace('CT_INFO', 'Connection dropped due to error of a ping frame ' +\n err.message +\n ' return in ' +\n duration);\n sessionClosedByServer = true;\n session.close();\n }\n else {\n this.keepaliveTrace('Received ping response');\n maybeStartKeepalivePingTimer();\n }\n });\n if (!pingSentSuccessfully) {\n pingSendError = 'Ping returned false';\n }\n }\n catch (e) {\n // grpc/grpc-node#2139\n pingSendError =\n (e instanceof Error ? e.message : '') || 'Unknown error';\n }\n if (pingSendError) {\n this.keepaliveTrace('Ping send failed: ' + pingSendError);\n this.channelzTrace.addTrace('CT_INFO', 'Connection dropped due to ping send error: ' + pingSendError);\n sessionClosedByServer = true;\n session.close();\n return;\n }\n channelzSessionInfo.keepAlivesSent += 1;\n keepaliveTimeout = setTimeout(() => {\n clearKeepaliveTimeout();\n this.keepaliveTrace('Ping timeout passed without response');\n this.channelzTrace.addTrace('CT_INFO', 'Connection dropped by keepalive timeout from ' + clientAddress);\n sessionClosedByServer = true;\n session.close();\n }, this.keepaliveTimeoutMs);\n (_b = keepaliveTimeout.unref) === null || _b === void 0 ? void 0 : _b.call(keepaliveTimeout);\n };\n maybeStartKeepalivePingTimer();\n session.on('close', () => {\n var _b;\n if (!sessionClosedByServer) {\n this.channelzTrace.addTrace('CT_INFO', 'Connection dropped by client ' + clientAddress);\n }\n this.sessionChildrenTracker.unrefChild(channelzRef);\n (0, channelz_1.unregisterChannelzRef)(channelzRef);\n if (connectionAgeTimer) {\n clearTimeout(connectionAgeTimer);\n }\n if (connectionAgeGraceTimer) {\n clearTimeout(connectionAgeGraceTimer);\n }\n clearKeepaliveTimeout();\n if (idleTimeoutObj !== null) {\n clearTimeout(idleTimeoutObj.timeout);\n this.sessionIdleTimeouts.delete(session);\n }\n (_b = this.http2Servers.get(http2Server)) === null || _b === void 0 ? void 0 : _b.sessions.delete(session);\n this.sessions.delete(session);\n });\n };\n }\n enableIdleTimeout(session) {\n var _b, _c;\n if (this.sessionIdleTimeout >= MAX_CONNECTION_IDLE_MS) {\n return null;\n }\n const idleTimeoutObj = {\n activeStreams: 0,\n lastIdle: Date.now(),\n onClose: this.onStreamClose.bind(this, session),\n timeout: setTimeout(this.onIdleTimeout, this.sessionIdleTimeout, this, session),\n };\n (_c = (_b = idleTimeoutObj.timeout).unref) === null || _c === void 0 ? void 0 : _c.call(_b);\n this.sessionIdleTimeouts.set(session, idleTimeoutObj);\n const { socket } = session;\n this.trace('Enable idle timeout for ' +\n socket.remoteAddress +\n ':' +\n socket.remotePort);\n return idleTimeoutObj;\n }\n onIdleTimeout(ctx, session) {\n const { socket } = session;\n const sessionInfo = ctx.sessionIdleTimeouts.get(session);\n // if it is called while we have activeStreams - timer will not be rescheduled\n // until last active stream is closed, then it will call .refresh() on the timer\n // important part is to not clearTimeout(timer) or it becomes unusable\n // for future refreshes\n if (sessionInfo !== undefined &&\n sessionInfo.activeStreams === 0) {\n if (Date.now() - sessionInfo.lastIdle >= ctx.sessionIdleTimeout) {\n ctx.trace('Session idle timeout triggered for ' +\n (socket === null || socket === void 0 ? void 0 : socket.remoteAddress) +\n ':' +\n (socket === null || socket === void 0 ? void 0 : socket.remotePort) +\n ' last idle at ' +\n sessionInfo.lastIdle);\n ctx.closeSession(session);\n }\n else {\n sessionInfo.timeout.refresh();\n }\n }\n }\n onStreamOpened(stream) {\n const session = stream.session;\n const idleTimeoutObj = this.sessionIdleTimeouts.get(session);\n if (idleTimeoutObj) {\n idleTimeoutObj.activeStreams += 1;\n stream.once('close', idleTimeoutObj.onClose);\n }\n }\n onStreamClose(session) {\n var _b, _c;\n const idleTimeoutObj = this.sessionIdleTimeouts.get(session);\n if (idleTimeoutObj) {\n idleTimeoutObj.activeStreams -= 1;\n if (idleTimeoutObj.activeStreams === 0) {\n idleTimeoutObj.lastIdle = Date.now();\n idleTimeoutObj.timeout.refresh();\n this.trace('Session onStreamClose' +\n ((_b = session.socket) === null || _b === void 0 ? void 0 : _b.remoteAddress) +\n ':' +\n ((_c = session.socket) === null || _c === void 0 ? void 0 : _c.remotePort) +\n ' at ' +\n idleTimeoutObj.lastIdle);\n }\n }\n }\n },\n (() => {\n const _metadata = typeof Symbol === \"function\" && Symbol.metadata ? Object.create(null) : void 0;\n _start_decorators = [deprecate('Calling start() is no longer necessary. It can be safely omitted.')];\n __esDecorate(_a, null, _start_decorators, { kind: \"method\", name: \"start\", static: false, private: false, access: { has: obj => \"start\" in obj, get: obj => obj.start }, metadata: _metadata }, null, _instanceExtraInitializers);\n if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });\n })(),\n _a;\n})();\nexports.Server = Server;\nasync function handleUnary(call, handler) {\n let stream;\n function respond(err, value, trailer, flags) {\n if (err) {\n call.sendStatus((0, server_call_1.serverErrorToStatus)(err, trailer));\n return;\n }\n call.sendMessage(value, () => {\n call.sendStatus({\n code: constants_1.Status.OK,\n details: 'OK',\n metadata: trailer !== null && trailer !== void 0 ? trailer : null,\n });\n });\n }\n let requestMetadata;\n let requestMessage = null;\n call.start({\n onReceiveMetadata(metadata) {\n requestMetadata = metadata;\n call.startRead();\n },\n onReceiveMessage(message) {\n if (requestMessage) {\n call.sendStatus({\n code: constants_1.Status.UNIMPLEMENTED,\n details: `Received a second request message for server streaming method ${handler.path}`,\n metadata: null,\n });\n return;\n }\n requestMessage = message;\n call.startRead();\n },\n onReceiveHalfClose() {\n if (!requestMessage) {\n call.sendStatus({\n code: constants_1.Status.UNIMPLEMENTED,\n details: `Received no request message for server streaming method ${handler.path}`,\n metadata: null,\n });\n return;\n }\n stream = new server_call_1.ServerWritableStreamImpl(handler.path, call, requestMetadata, requestMessage);\n try {\n handler.func(stream, respond);\n }\n catch (err) {\n call.sendStatus({\n code: constants_1.Status.UNKNOWN,\n details: `Server method handler threw error ${err.message}`,\n metadata: null,\n });\n }\n },\n onCancel() {\n if (stream) {\n stream.cancelled = true;\n stream.emit('cancelled', 'cancelled');\n }\n },\n });\n}\nfunction handleClientStreaming(call, handler) {\n let stream;\n function respond(err, value, trailer, flags) {\n if (err) {\n call.sendStatus((0, server_call_1.serverErrorToStatus)(err, trailer));\n return;\n }\n call.sendMessage(value, () => {\n call.sendStatus({\n code: constants_1.Status.OK,\n details: 'OK',\n metadata: trailer !== null && trailer !== void 0 ? trailer : null,\n });\n });\n }\n call.start({\n onReceiveMetadata(metadata) {\n stream = new server_call_1.ServerDuplexStreamImpl(handler.path, call, metadata);\n try {\n handler.func(stream, respond);\n }\n catch (err) {\n call.sendStatus({\n code: constants_1.Status.UNKNOWN,\n details: `Server method handler threw error ${err.message}`,\n metadata: null,\n });\n }\n },\n onReceiveMessage(message) {\n stream.push(message);\n },\n onReceiveHalfClose() {\n stream.push(null);\n },\n onCancel() {\n if (stream) {\n stream.cancelled = true;\n stream.emit('cancelled', 'cancelled');\n stream.destroy();\n }\n },\n });\n}\nfunction handleServerStreaming(call, handler) {\n let stream;\n let requestMetadata;\n let requestMessage = null;\n call.start({\n onReceiveMetadata(metadata) {\n requestMetadata = metadata;\n call.startRead();\n },\n onReceiveMessage(message) {\n if (requestMessage) {\n call.sendStatus({\n code: constants_1.Status.UNIMPLEMENTED,\n details: `Received a second request message for server streaming method ${handler.path}`,\n metadata: null,\n });\n return;\n }\n requestMessage = message;\n call.startRead();\n },\n onReceiveHalfClose() {\n if (!requestMessage) {\n call.sendStatus({\n code: constants_1.Status.UNIMPLEMENTED,\n details: `Received no request message for server streaming method ${handler.path}`,\n metadata: null,\n });\n return;\n }\n stream = new server_call_1.ServerWritableStreamImpl(handler.path, call, requestMetadata, requestMessage);\n try {\n handler.func(stream);\n }\n catch (err) {\n call.sendStatus({\n code: constants_1.Status.UNKNOWN,\n details: `Server method handler threw error ${err.message}`,\n metadata: null,\n });\n }\n },\n onCancel() {\n if (stream) {\n stream.cancelled = true;\n stream.emit('cancelled', 'cancelled');\n stream.destroy();\n }\n },\n });\n}\nfunction handleBidiStreaming(call, handler) {\n let stream;\n call.start({\n onReceiveMetadata(metadata) {\n stream = new server_call_1.ServerDuplexStreamImpl(handler.path, call, metadata);\n try {\n handler.func(stream);\n }\n catch (err) {\n call.sendStatus({\n code: constants_1.Status.UNKNOWN,\n details: `Server method handler threw error ${err.message}`,\n metadata: null,\n });\n }\n },\n onReceiveMessage(message) {\n stream.push(message);\n },\n onReceiveHalfClose() {\n stream.push(null);\n },\n onCancel() {\n if (stream) {\n stream.cancelled = true;\n stream.emit('cancelled', 'cancelled');\n stream.destroy();\n }\n },\n });\n}\n//# sourceMappingURL=server.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StatusBuilder = void 0;\n/**\n * A builder for gRPC status objects.\n */\nclass StatusBuilder {\n constructor() {\n this.code = null;\n this.details = null;\n this.metadata = null;\n }\n /**\n * Adds a status code to the builder.\n */\n withCode(code) {\n this.code = code;\n return this;\n }\n /**\n * Adds details to the builder.\n */\n withDetails(details) {\n this.details = details;\n return this;\n }\n /**\n * Adds metadata to the builder.\n */\n withMetadata(metadata) {\n this.metadata = metadata;\n return this;\n }\n /**\n * Builds the status object.\n */\n build() {\n const status = {};\n if (this.code !== null) {\n status.code = this.code;\n }\n if (this.details !== null) {\n status.details = this.details;\n }\n if (this.metadata !== null) {\n status.metadata = this.metadata;\n }\n return status;\n }\n}\nexports.StatusBuilder = StatusBuilder;\n//# sourceMappingURL=status-builder.js.map","\"use strict\";\n/*\n * Copyright 2022 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.msToDuration = msToDuration;\nexports.durationToMs = durationToMs;\nexports.isDuration = isDuration;\nexports.parseDuration = parseDuration;\nfunction msToDuration(millis) {\n return {\n seconds: (millis / 1000) | 0,\n nanos: ((millis % 1000) * 1000000) | 0,\n };\n}\nfunction durationToMs(duration) {\n return (duration.seconds * 1000 + duration.nanos / 1000000) | 0;\n}\nfunction isDuration(value) {\n return typeof value.seconds === 'number' && typeof value.nanos === 'number';\n}\nconst durationRegex = /^(\\d+)(?:\\.(\\d+))?s$/;\nfunction parseDuration(value) {\n const match = value.match(durationRegex);\n if (!match) {\n return null;\n }\n return {\n seconds: Number.parseInt(match[1], 10),\n nanos: match[2] ? Number.parseInt(match[2].padEnd(9, '0'), 10) : 0\n };\n}\n//# sourceMappingURL=duration.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LeafLoadBalancer = exports.PickFirstLoadBalancer = exports.PickFirstLoadBalancingConfig = void 0;\nexports.shuffled = shuffled;\nexports.setup = setup;\nconst load_balancer_1 = require(\"./load-balancer\");\nconst connectivity_state_1 = require(\"./connectivity-state\");\nconst picker_1 = require(\"./picker\");\nconst subchannel_address_1 = require(\"./subchannel-address\");\nconst logging = require(\"./logging\");\nconst constants_1 = require(\"./constants\");\nconst subchannel_address_2 = require(\"./subchannel-address\");\nconst net_1 = require(\"net\");\nconst TRACER_NAME = 'pick_first';\nfunction trace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text);\n}\nconst TYPE_NAME = 'pick_first';\n/**\n * Delay after starting a connection on a subchannel before starting a\n * connection on the next subchannel in the list, for Happy Eyeballs algorithm.\n */\nconst CONNECTION_DELAY_INTERVAL_MS = 250;\nclass PickFirstLoadBalancingConfig {\n constructor(shuffleAddressList) {\n this.shuffleAddressList = shuffleAddressList;\n }\n getLoadBalancerName() {\n return TYPE_NAME;\n }\n toJsonObject() {\n return {\n [TYPE_NAME]: {\n shuffleAddressList: this.shuffleAddressList,\n },\n };\n }\n getShuffleAddressList() {\n return this.shuffleAddressList;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static createFromJson(obj) {\n if ('shuffleAddressList' in obj &&\n !(typeof obj.shuffleAddressList === 'boolean')) {\n throw new Error('pick_first config field shuffleAddressList must be a boolean if provided');\n }\n return new PickFirstLoadBalancingConfig(obj.shuffleAddressList === true);\n }\n}\nexports.PickFirstLoadBalancingConfig = PickFirstLoadBalancingConfig;\n/**\n * Picker for a `PickFirstLoadBalancer` in the READY state. Always returns the\n * picked subchannel.\n */\nclass PickFirstPicker {\n constructor(subchannel) {\n this.subchannel = subchannel;\n }\n pick(pickArgs) {\n return {\n pickResultType: picker_1.PickResultType.COMPLETE,\n subchannel: this.subchannel,\n status: null,\n onCallStarted: null,\n onCallEnded: null,\n };\n }\n}\n/**\n * Return a new array with the elements of the input array in a random order\n * @param list The input array\n * @returns A shuffled array of the elements of list\n */\nfunction shuffled(list) {\n const result = list.slice();\n for (let i = result.length - 1; i > 1; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const temp = result[i];\n result[i] = result[j];\n result[j] = temp;\n }\n return result;\n}\n/**\n * Interleave addresses in addressList by family in accordance with RFC-8304 section 4\n * @param addressList\n * @returns\n */\nfunction interleaveAddressFamilies(addressList) {\n if (addressList.length === 0) {\n return [];\n }\n const result = [];\n const ipv6Addresses = [];\n const ipv4Addresses = [];\n const ipv6First = (0, subchannel_address_2.isTcpSubchannelAddress)(addressList[0]) && (0, net_1.isIPv6)(addressList[0].host);\n for (const address of addressList) {\n if ((0, subchannel_address_2.isTcpSubchannelAddress)(address) && (0, net_1.isIPv6)(address.host)) {\n ipv6Addresses.push(address);\n }\n else {\n ipv4Addresses.push(address);\n }\n }\n const firstList = ipv6First ? ipv6Addresses : ipv4Addresses;\n const secondList = ipv6First ? ipv4Addresses : ipv6Addresses;\n for (let i = 0; i < Math.max(firstList.length, secondList.length); i++) {\n if (i < firstList.length) {\n result.push(firstList[i]);\n }\n if (i < secondList.length) {\n result.push(secondList[i]);\n }\n }\n return result;\n}\nconst REPORT_HEALTH_STATUS_OPTION_NAME = 'grpc-node.internal.pick-first.report_health_status';\nclass PickFirstLoadBalancer {\n /**\n * Load balancer that attempts to connect to each backend in the address list\n * in order, and picks the first one that connects, using it for every\n * request.\n * @param channelControlHelper `ChannelControlHelper` instance provided by\n * this load balancer's owner.\n */\n constructor(channelControlHelper) {\n this.channelControlHelper = channelControlHelper;\n /**\n * The list of subchannels this load balancer is currently attempting to\n * connect to.\n */\n this.children = [];\n /**\n * The current connectivity state of the load balancer.\n */\n this.currentState = connectivity_state_1.ConnectivityState.IDLE;\n /**\n * The index within the `subchannels` array of the subchannel with the most\n * recently started connection attempt.\n */\n this.currentSubchannelIndex = 0;\n /**\n * The currently picked subchannel used for making calls. Populated if\n * and only if the load balancer's current state is READY. In that case,\n * the subchannel's current state is also READY.\n */\n this.currentPick = null;\n /**\n * Listener callback attached to each subchannel in the `subchannels` list\n * while establishing a connection.\n */\n this.subchannelStateListener = (subchannel, previousState, newState, keepaliveTime, errorMessage) => {\n this.onSubchannelStateUpdate(subchannel, previousState, newState, errorMessage);\n };\n this.pickedSubchannelHealthListener = () => this.calculateAndReportNewState();\n /**\n * The LB policy enters sticky TRANSIENT_FAILURE mode when all\n * subchannels have failed to connect at least once, and it stays in that\n * mode until a connection attempt is successful. While in sticky TF mode,\n * the LB policy continuously attempts to connect to all of its subchannels.\n */\n this.stickyTransientFailureMode = false;\n this.reportHealthStatus = false;\n /**\n * The most recent error reported by any subchannel as it transitioned to\n * TRANSIENT_FAILURE.\n */\n this.lastError = null;\n this.latestAddressList = null;\n this.latestOptions = {};\n this.connectionDelayTimeout = setTimeout(() => { }, 0);\n clearTimeout(this.connectionDelayTimeout);\n }\n allChildrenHaveReportedTF() {\n return this.children.every(child => child.hasReportedTransientFailure);\n }\n resetChildrenReportedTF() {\n this.children.every(child => child.hasReportedTransientFailure = false);\n }\n calculateAndReportNewState() {\n var _a;\n if (this.currentPick) {\n if (this.reportHealthStatus && !this.currentPick.isHealthy()) {\n const errorMessage = `Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;\n this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker({\n details: errorMessage,\n }), errorMessage);\n }\n else {\n this.updateState(connectivity_state_1.ConnectivityState.READY, new PickFirstPicker(this.currentPick), null);\n }\n }\n else if (((_a = this.latestAddressList) === null || _a === void 0 ? void 0 : _a.length) === 0) {\n const errorMessage = `No connection established. Last error: ${this.lastError}`;\n this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker({\n details: errorMessage,\n }), errorMessage);\n }\n else if (this.children.length === 0) {\n this.updateState(connectivity_state_1.ConnectivityState.IDLE, new picker_1.QueuePicker(this), null);\n }\n else {\n if (this.stickyTransientFailureMode) {\n const errorMessage = `No connection established. Last error: ${this.lastError}`;\n this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker({\n details: errorMessage,\n }), errorMessage);\n }\n else {\n this.updateState(connectivity_state_1.ConnectivityState.CONNECTING, new picker_1.QueuePicker(this), null);\n }\n }\n }\n requestReresolution() {\n this.channelControlHelper.requestReresolution();\n }\n maybeEnterStickyTransientFailureMode() {\n if (!this.allChildrenHaveReportedTF()) {\n return;\n }\n this.requestReresolution();\n this.resetChildrenReportedTF();\n if (this.stickyTransientFailureMode) {\n this.calculateAndReportNewState();\n return;\n }\n this.stickyTransientFailureMode = true;\n for (const { subchannel } of this.children) {\n subchannel.startConnecting();\n }\n this.calculateAndReportNewState();\n }\n removeCurrentPick() {\n if (this.currentPick !== null) {\n this.currentPick.removeConnectivityStateListener(this.subchannelStateListener);\n this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef());\n this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener);\n // Unref last, to avoid triggering listeners\n this.currentPick.unref();\n this.currentPick = null;\n }\n }\n onSubchannelStateUpdate(subchannel, previousState, newState, errorMessage) {\n var _a;\n if ((_a = this.currentPick) === null || _a === void 0 ? void 0 : _a.realSubchannelEquals(subchannel)) {\n if (newState !== connectivity_state_1.ConnectivityState.READY) {\n this.removeCurrentPick();\n this.calculateAndReportNewState();\n }\n return;\n }\n for (const [index, child] of this.children.entries()) {\n if (subchannel.realSubchannelEquals(child.subchannel)) {\n if (newState === connectivity_state_1.ConnectivityState.READY) {\n this.pickSubchannel(child.subchannel);\n }\n if (newState === connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) {\n child.hasReportedTransientFailure = true;\n if (errorMessage) {\n this.lastError = errorMessage;\n }\n this.maybeEnterStickyTransientFailureMode();\n if (index === this.currentSubchannelIndex) {\n this.startNextSubchannelConnecting(index + 1);\n }\n }\n child.subchannel.startConnecting();\n return;\n }\n }\n }\n startNextSubchannelConnecting(startIndex) {\n clearTimeout(this.connectionDelayTimeout);\n for (const [index, child] of this.children.entries()) {\n if (index >= startIndex) {\n const subchannelState = child.subchannel.getConnectivityState();\n if (subchannelState === connectivity_state_1.ConnectivityState.IDLE ||\n subchannelState === connectivity_state_1.ConnectivityState.CONNECTING) {\n this.startConnecting(index);\n return;\n }\n }\n }\n this.maybeEnterStickyTransientFailureMode();\n }\n /**\n * Have a single subchannel in the `subchannels` list start connecting.\n * @param subchannelIndex The index into the `subchannels` list.\n */\n startConnecting(subchannelIndex) {\n var _a, _b;\n clearTimeout(this.connectionDelayTimeout);\n this.currentSubchannelIndex = subchannelIndex;\n if (this.children[subchannelIndex].subchannel.getConnectivityState() ===\n connectivity_state_1.ConnectivityState.IDLE) {\n trace('Start connecting to subchannel with address ' +\n this.children[subchannelIndex].subchannel.getAddress());\n process.nextTick(() => {\n var _a;\n (_a = this.children[subchannelIndex]) === null || _a === void 0 ? void 0 : _a.subchannel.startConnecting();\n });\n }\n this.connectionDelayTimeout = setTimeout(() => {\n this.startNextSubchannelConnecting(subchannelIndex + 1);\n }, CONNECTION_DELAY_INTERVAL_MS);\n (_b = (_a = this.connectionDelayTimeout).unref) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n /**\n * Declare that the specified subchannel should be used to make requests.\n * This functions the same independent of whether subchannel is a member of\n * this.children and whether it is equal to this.currentPick.\n * Prerequisite: subchannel.getConnectivityState() === READY.\n * @param subchannel\n */\n pickSubchannel(subchannel) {\n trace('Pick subchannel with address ' + subchannel.getAddress());\n this.stickyTransientFailureMode = false;\n /* Ref before removeCurrentPick and resetSubchannelList to avoid the\n * refcount dropping to 0 during this process. */\n subchannel.ref();\n this.channelControlHelper.addChannelzChild(subchannel.getChannelzRef());\n this.removeCurrentPick();\n this.resetSubchannelList();\n subchannel.addConnectivityStateListener(this.subchannelStateListener);\n subchannel.addHealthStateWatcher(this.pickedSubchannelHealthListener);\n this.currentPick = subchannel;\n clearTimeout(this.connectionDelayTimeout);\n this.calculateAndReportNewState();\n }\n updateState(newState, picker, errorMessage) {\n trace(connectivity_state_1.ConnectivityState[this.currentState] +\n ' -> ' +\n connectivity_state_1.ConnectivityState[newState]);\n this.currentState = newState;\n this.channelControlHelper.updateState(newState, picker, errorMessage);\n }\n resetSubchannelList() {\n for (const child of this.children) {\n /* Always remoev the connectivity state listener. If the subchannel is\n getting picked, it will be re-added then. */\n child.subchannel.removeConnectivityStateListener(this.subchannelStateListener);\n /* Refs are counted independently for the children list and the\n * currentPick, so we call unref whether or not the child is the\n * currentPick. Channelz child references are also refcounted, so\n * removeChannelzChild can be handled the same way. */\n child.subchannel.unref();\n this.channelControlHelper.removeChannelzChild(child.subchannel.getChannelzRef());\n }\n this.currentSubchannelIndex = 0;\n this.children = [];\n }\n connectToAddressList(addressList, options) {\n trace('connectToAddressList([' + addressList.map(address => (0, subchannel_address_1.subchannelAddressToString)(address)) + '])');\n const newChildrenList = addressList.map(address => ({\n subchannel: this.channelControlHelper.createSubchannel(address, options),\n hasReportedTransientFailure: false,\n }));\n for (const { subchannel } of newChildrenList) {\n if (subchannel.getConnectivityState() === connectivity_state_1.ConnectivityState.READY) {\n this.pickSubchannel(subchannel);\n return;\n }\n }\n /* Ref each subchannel before resetting the list, to ensure that\n * subchannels shared between the list don't drop to 0 refs during the\n * transition. */\n for (const { subchannel } of newChildrenList) {\n subchannel.ref();\n this.channelControlHelper.addChannelzChild(subchannel.getChannelzRef());\n }\n this.resetSubchannelList();\n this.children = newChildrenList;\n for (const { subchannel } of this.children) {\n subchannel.addConnectivityStateListener(this.subchannelStateListener);\n }\n for (const child of this.children) {\n if (child.subchannel.getConnectivityState() ===\n connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) {\n child.hasReportedTransientFailure = true;\n }\n }\n this.startNextSubchannelConnecting(0);\n this.calculateAndReportNewState();\n }\n updateAddressList(endpointList, lbConfig, options) {\n if (!(lbConfig instanceof PickFirstLoadBalancingConfig)) {\n return;\n }\n this.reportHealthStatus = options[REPORT_HEALTH_STATUS_OPTION_NAME];\n /* Previously, an update would be discarded if it was identical to the\n * previous update, to minimize churn. Now the DNS resolver is\n * rate-limited, so that is less of a concern. */\n if (lbConfig.getShuffleAddressList()) {\n endpointList = shuffled(endpointList);\n }\n const rawAddressList = [].concat(...endpointList.map(endpoint => endpoint.addresses));\n trace('updateAddressList([' + rawAddressList.map(address => (0, subchannel_address_1.subchannelAddressToString)(address)) + '])');\n if (rawAddressList.length === 0) {\n this.lastError = 'No addresses resolved';\n }\n const addressList = interleaveAddressFamilies(rawAddressList);\n this.latestAddressList = addressList;\n this.latestOptions = options;\n this.connectToAddressList(addressList, options);\n }\n exitIdle() {\n if (this.currentState === connectivity_state_1.ConnectivityState.IDLE &&\n this.latestAddressList) {\n this.connectToAddressList(this.latestAddressList, this.latestOptions);\n }\n }\n resetBackoff() {\n /* The pick first load balancer does not have a connection backoff, so this\n * does nothing */\n }\n destroy() {\n this.resetSubchannelList();\n this.removeCurrentPick();\n }\n getTypeName() {\n return TYPE_NAME;\n }\n}\nexports.PickFirstLoadBalancer = PickFirstLoadBalancer;\nconst LEAF_CONFIG = new PickFirstLoadBalancingConfig(false);\n/**\n * This class handles the leaf load balancing operations for a single endpoint.\n * It is a thin wrapper around a PickFirstLoadBalancer with a different API\n * that more closely reflects how it will be used as a leaf balancer.\n */\nclass LeafLoadBalancer {\n constructor(endpoint, channelControlHelper, options) {\n this.endpoint = endpoint;\n this.options = options;\n this.latestState = connectivity_state_1.ConnectivityState.IDLE;\n const childChannelControlHelper = (0, load_balancer_1.createChildChannelControlHelper)(channelControlHelper, {\n updateState: (connectivityState, picker, errorMessage) => {\n this.latestState = connectivityState;\n this.latestPicker = picker;\n channelControlHelper.updateState(connectivityState, picker, errorMessage);\n },\n });\n this.pickFirstBalancer = new PickFirstLoadBalancer(childChannelControlHelper);\n this.latestPicker = new picker_1.QueuePicker(this.pickFirstBalancer);\n }\n startConnecting() {\n this.pickFirstBalancer.updateAddressList([this.endpoint], LEAF_CONFIG, Object.assign(Object.assign({}, this.options), { [REPORT_HEALTH_STATUS_OPTION_NAME]: true }));\n }\n /**\n * Update the endpoint associated with this LeafLoadBalancer to a new\n * endpoint. Does not trigger connection establishment if a connection\n * attempt is not already in progress.\n * @param newEndpoint\n */\n updateEndpoint(newEndpoint, newOptions) {\n this.options = newOptions;\n this.endpoint = newEndpoint;\n if (this.latestState !== connectivity_state_1.ConnectivityState.IDLE) {\n this.startConnecting();\n }\n }\n getConnectivityState() {\n return this.latestState;\n }\n getPicker() {\n return this.latestPicker;\n }\n getEndpoint() {\n return this.endpoint;\n }\n exitIdle() {\n this.pickFirstBalancer.exitIdle();\n }\n destroy() {\n this.pickFirstBalancer.destroy();\n }\n}\nexports.LeafLoadBalancer = LeafLoadBalancer;\nfunction setup() {\n (0, load_balancer_1.registerLoadBalancerType)(TYPE_NAME, PickFirstLoadBalancer, PickFirstLoadBalancingConfig);\n (0, load_balancer_1.registerDefaultLoadBalancerType)(TYPE_NAME);\n}\n//# sourceMappingURL=load-balancer-pick-first.js.map","\"use strict\";\n/*\n * Copyright 2024 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FileWatcherCertificateProvider = void 0;\nconst fs = require(\"fs\");\nconst logging = require(\"./logging\");\nconst constants_1 = require(\"./constants\");\nconst util_1 = require(\"util\");\nconst TRACER_NAME = 'certificate_provider';\nfunction trace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text);\n}\nconst readFilePromise = (0, util_1.promisify)(fs.readFile);\nclass FileWatcherCertificateProvider {\n constructor(config) {\n this.config = config;\n this.refreshTimer = null;\n this.fileResultPromise = null;\n this.latestCaUpdate = undefined;\n this.caListeners = new Set();\n this.latestIdentityUpdate = undefined;\n this.identityListeners = new Set();\n this.lastUpdateTime = null;\n if ((config.certificateFile === undefined) !== (config.privateKeyFile === undefined)) {\n throw new Error('certificateFile and privateKeyFile must be set or unset together');\n }\n if (config.certificateFile === undefined && config.caCertificateFile === undefined) {\n throw new Error('At least one of certificateFile and caCertificateFile must be set');\n }\n trace('File watcher constructed with config ' + JSON.stringify(config));\n }\n updateCertificates() {\n if (this.fileResultPromise) {\n return;\n }\n this.fileResultPromise = Promise.allSettled([\n this.config.certificateFile ? readFilePromise(this.config.certificateFile) : Promise.reject(),\n this.config.privateKeyFile ? readFilePromise(this.config.privateKeyFile) : Promise.reject(),\n this.config.caCertificateFile ? readFilePromise(this.config.caCertificateFile) : Promise.reject()\n ]);\n this.fileResultPromise.then(([certificateResult, privateKeyResult, caCertificateResult]) => {\n if (!this.refreshTimer) {\n return;\n }\n trace('File watcher read certificates certificate ' + certificateResult.status + ', privateKey ' + privateKeyResult.status + ', CA certificate ' + caCertificateResult.status);\n this.lastUpdateTime = new Date();\n this.fileResultPromise = null;\n if (certificateResult.status === 'fulfilled' && privateKeyResult.status === 'fulfilled') {\n this.latestIdentityUpdate = {\n certificate: certificateResult.value,\n privateKey: privateKeyResult.value\n };\n }\n else {\n this.latestIdentityUpdate = null;\n }\n if (caCertificateResult.status === 'fulfilled') {\n this.latestCaUpdate = {\n caCertificate: caCertificateResult.value\n };\n }\n else {\n this.latestCaUpdate = null;\n }\n for (const listener of this.identityListeners) {\n listener(this.latestIdentityUpdate);\n }\n for (const listener of this.caListeners) {\n listener(this.latestCaUpdate);\n }\n });\n trace('File watcher initiated certificate update');\n }\n maybeStartWatchingFiles() {\n if (!this.refreshTimer) {\n /* Perform the first read immediately, but only if there was not already\n * a recent read, to avoid reading from the filesystem significantly more\n * frequently than configured if the provider quickly switches between\n * used and unused. */\n const timeSinceLastUpdate = this.lastUpdateTime ? (new Date()).getTime() - this.lastUpdateTime.getTime() : Infinity;\n if (timeSinceLastUpdate > this.config.refreshIntervalMs) {\n this.updateCertificates();\n }\n if (timeSinceLastUpdate > this.config.refreshIntervalMs * 2) {\n // Clear out old updates if they are definitely stale\n this.latestCaUpdate = undefined;\n this.latestIdentityUpdate = undefined;\n }\n this.refreshTimer = setInterval(() => this.updateCertificates(), this.config.refreshIntervalMs);\n trace('File watcher started watching');\n }\n }\n maybeStopWatchingFiles() {\n if (this.caListeners.size === 0 && this.identityListeners.size === 0) {\n this.fileResultPromise = null;\n if (this.refreshTimer) {\n clearInterval(this.refreshTimer);\n this.refreshTimer = null;\n }\n }\n }\n addCaCertificateListener(listener) {\n this.caListeners.add(listener);\n this.maybeStartWatchingFiles();\n if (this.latestCaUpdate !== undefined) {\n process.nextTick(listener, this.latestCaUpdate);\n }\n }\n removeCaCertificateListener(listener) {\n this.caListeners.delete(listener);\n this.maybeStopWatchingFiles();\n }\n addIdentityCertificateListener(listener) {\n this.identityListeners.add(listener);\n this.maybeStartWatchingFiles();\n if (this.latestIdentityUpdate !== undefined) {\n process.nextTick(listener, this.latestIdentityUpdate);\n }\n }\n removeIdentityCertificateListener(listener) {\n this.identityListeners.delete(listener);\n this.maybeStopWatchingFiles();\n }\n}\nexports.FileWatcherCertificateProvider = FileWatcherCertificateProvider;\n//# sourceMappingURL=certificate-provider.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX = exports.createCertificateProviderChannelCredentials = exports.FileWatcherCertificateProvider = exports.createCertificateProviderServerCredentials = exports.createServerCredentialsWithInterceptors = exports.BaseSubchannelWrapper = exports.registerAdminService = exports.FilterStackFactory = exports.BaseFilter = exports.PickResultType = exports.QueuePicker = exports.UnavailablePicker = exports.ChildLoadBalancerHandler = exports.EndpointMap = exports.endpointHasAddress = exports.endpointToString = exports.subchannelAddressToString = exports.LeafLoadBalancer = exports.isLoadBalancerNameRegistered = exports.parseLoadBalancingConfig = exports.selectLbConfigFromList = exports.registerLoadBalancerType = exports.createChildChannelControlHelper = exports.BackoffTimeout = exports.parseDuration = exports.durationToMs = exports.splitHostPort = exports.uriToString = exports.createResolver = exports.registerResolver = exports.log = exports.trace = void 0;\nvar logging_1 = require(\"./logging\");\nObject.defineProperty(exports, \"trace\", { enumerable: true, get: function () { return logging_1.trace; } });\nObject.defineProperty(exports, \"log\", { enumerable: true, get: function () { return logging_1.log; } });\nvar resolver_1 = require(\"./resolver\");\nObject.defineProperty(exports, \"registerResolver\", { enumerable: true, get: function () { return resolver_1.registerResolver; } });\nObject.defineProperty(exports, \"createResolver\", { enumerable: true, get: function () { return resolver_1.createResolver; } });\nvar uri_parser_1 = require(\"./uri-parser\");\nObject.defineProperty(exports, \"uriToString\", { enumerable: true, get: function () { return uri_parser_1.uriToString; } });\nObject.defineProperty(exports, \"splitHostPort\", { enumerable: true, get: function () { return uri_parser_1.splitHostPort; } });\nvar duration_1 = require(\"./duration\");\nObject.defineProperty(exports, \"durationToMs\", { enumerable: true, get: function () { return duration_1.durationToMs; } });\nObject.defineProperty(exports, \"parseDuration\", { enumerable: true, get: function () { return duration_1.parseDuration; } });\nvar backoff_timeout_1 = require(\"./backoff-timeout\");\nObject.defineProperty(exports, \"BackoffTimeout\", { enumerable: true, get: function () { return backoff_timeout_1.BackoffTimeout; } });\nvar load_balancer_1 = require(\"./load-balancer\");\nObject.defineProperty(exports, \"createChildChannelControlHelper\", { enumerable: true, get: function () { return load_balancer_1.createChildChannelControlHelper; } });\nObject.defineProperty(exports, \"registerLoadBalancerType\", { enumerable: true, get: function () { return load_balancer_1.registerLoadBalancerType; } });\nObject.defineProperty(exports, \"selectLbConfigFromList\", { enumerable: true, get: function () { return load_balancer_1.selectLbConfigFromList; } });\nObject.defineProperty(exports, \"parseLoadBalancingConfig\", { enumerable: true, get: function () { return load_balancer_1.parseLoadBalancingConfig; } });\nObject.defineProperty(exports, \"isLoadBalancerNameRegistered\", { enumerable: true, get: function () { return load_balancer_1.isLoadBalancerNameRegistered; } });\nvar load_balancer_pick_first_1 = require(\"./load-balancer-pick-first\");\nObject.defineProperty(exports, \"LeafLoadBalancer\", { enumerable: true, get: function () { return load_balancer_pick_first_1.LeafLoadBalancer; } });\nvar subchannel_address_1 = require(\"./subchannel-address\");\nObject.defineProperty(exports, \"subchannelAddressToString\", { enumerable: true, get: function () { return subchannel_address_1.subchannelAddressToString; } });\nObject.defineProperty(exports, \"endpointToString\", { enumerable: true, get: function () { return subchannel_address_1.endpointToString; } });\nObject.defineProperty(exports, \"endpointHasAddress\", { enumerable: true, get: function () { return subchannel_address_1.endpointHasAddress; } });\nObject.defineProperty(exports, \"EndpointMap\", { enumerable: true, get: function () { return subchannel_address_1.EndpointMap; } });\nvar load_balancer_child_handler_1 = require(\"./load-balancer-child-handler\");\nObject.defineProperty(exports, \"ChildLoadBalancerHandler\", { enumerable: true, get: function () { return load_balancer_child_handler_1.ChildLoadBalancerHandler; } });\nvar picker_1 = require(\"./picker\");\nObject.defineProperty(exports, \"UnavailablePicker\", { enumerable: true, get: function () { return picker_1.UnavailablePicker; } });\nObject.defineProperty(exports, \"QueuePicker\", { enumerable: true, get: function () { return picker_1.QueuePicker; } });\nObject.defineProperty(exports, \"PickResultType\", { enumerable: true, get: function () { return picker_1.PickResultType; } });\nvar filter_1 = require(\"./filter\");\nObject.defineProperty(exports, \"BaseFilter\", { enumerable: true, get: function () { return filter_1.BaseFilter; } });\nvar filter_stack_1 = require(\"./filter-stack\");\nObject.defineProperty(exports, \"FilterStackFactory\", { enumerable: true, get: function () { return filter_stack_1.FilterStackFactory; } });\nvar admin_1 = require(\"./admin\");\nObject.defineProperty(exports, \"registerAdminService\", { enumerable: true, get: function () { return admin_1.registerAdminService; } });\nvar subchannel_interface_1 = require(\"./subchannel-interface\");\nObject.defineProperty(exports, \"BaseSubchannelWrapper\", { enumerable: true, get: function () { return subchannel_interface_1.BaseSubchannelWrapper; } });\nvar server_credentials_1 = require(\"./server-credentials\");\nObject.defineProperty(exports, \"createServerCredentialsWithInterceptors\", { enumerable: true, get: function () { return server_credentials_1.createServerCredentialsWithInterceptors; } });\nObject.defineProperty(exports, \"createCertificateProviderServerCredentials\", { enumerable: true, get: function () { return server_credentials_1.createCertificateProviderServerCredentials; } });\nvar certificate_provider_1 = require(\"./certificate-provider\");\nObject.defineProperty(exports, \"FileWatcherCertificateProvider\", { enumerable: true, get: function () { return certificate_provider_1.FileWatcherCertificateProvider; } });\nvar channel_credentials_1 = require(\"./channel-credentials\");\nObject.defineProperty(exports, \"createCertificateProviderChannelCredentials\", { enumerable: true, get: function () { return channel_credentials_1.createCertificateProviderChannelCredentials; } });\nvar internal_channel_1 = require(\"./internal-channel\");\nObject.defineProperty(exports, \"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX\", { enumerable: true, get: function () { return internal_channel_1.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX; } });\n//# sourceMappingURL=experimental.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setup = setup;\nconst resolver_1 = require(\"./resolver\");\nclass UdsResolver {\n constructor(target, listener, channelOptions) {\n this.listener = listener;\n this.hasReturnedResult = false;\n this.endpoints = [];\n let path;\n if (target.authority === '') {\n path = '/' + target.path;\n }\n else {\n path = target.path;\n }\n this.endpoints = [{ addresses: [{ path }] }];\n }\n updateResolution() {\n if (!this.hasReturnedResult) {\n this.hasReturnedResult = true;\n process.nextTick(this.listener.onSuccessfulResolution, this.endpoints, null, null, null, {});\n }\n }\n destroy() {\n this.hasReturnedResult = false;\n }\n static getDefaultAuthority(target) {\n return 'localhost';\n }\n}\nfunction setup() {\n (0, resolver_1.registerResolver)('unix', UdsResolver);\n}\n//# sourceMappingURL=resolver-uds.js.map","\"use strict\";\n/*\n * Copyright 2021 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setup = setup;\nconst net_1 = require(\"net\");\nconst constants_1 = require(\"./constants\");\nconst metadata_1 = require(\"./metadata\");\nconst resolver_1 = require(\"./resolver\");\nconst uri_parser_1 = require(\"./uri-parser\");\nconst logging = require(\"./logging\");\nconst TRACER_NAME = 'ip_resolver';\nfunction trace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text);\n}\nconst IPV4_SCHEME = 'ipv4';\nconst IPV6_SCHEME = 'ipv6';\n/**\n * The default TCP port to connect to if not explicitly specified in the target.\n */\nconst DEFAULT_PORT = 443;\nclass IpResolver {\n constructor(target, listener, channelOptions) {\n var _a;\n this.listener = listener;\n this.endpoints = [];\n this.error = null;\n this.hasReturnedResult = false;\n trace('Resolver constructed for target ' + (0, uri_parser_1.uriToString)(target));\n const addresses = [];\n if (!(target.scheme === IPV4_SCHEME || target.scheme === IPV6_SCHEME)) {\n this.error = {\n code: constants_1.Status.UNAVAILABLE,\n details: `Unrecognized scheme ${target.scheme} in IP resolver`,\n metadata: new metadata_1.Metadata(),\n };\n return;\n }\n const pathList = target.path.split(',');\n for (const path of pathList) {\n const hostPort = (0, uri_parser_1.splitHostPort)(path);\n if (hostPort === null) {\n this.error = {\n code: constants_1.Status.UNAVAILABLE,\n details: `Failed to parse ${target.scheme} address ${path}`,\n metadata: new metadata_1.Metadata(),\n };\n return;\n }\n if ((target.scheme === IPV4_SCHEME && !(0, net_1.isIPv4)(hostPort.host)) ||\n (target.scheme === IPV6_SCHEME && !(0, net_1.isIPv6)(hostPort.host))) {\n this.error = {\n code: constants_1.Status.UNAVAILABLE,\n details: `Failed to parse ${target.scheme} address ${path}`,\n metadata: new metadata_1.Metadata(),\n };\n return;\n }\n addresses.push({\n host: hostPort.host,\n port: (_a = hostPort.port) !== null && _a !== void 0 ? _a : DEFAULT_PORT,\n });\n }\n this.endpoints = addresses.map(address => ({ addresses: [address] }));\n trace('Parsed ' + target.scheme + ' address list ' + addresses);\n }\n updateResolution() {\n if (!this.hasReturnedResult) {\n this.hasReturnedResult = true;\n process.nextTick(() => {\n if (this.error) {\n this.listener.onError(this.error);\n }\n else {\n this.listener.onSuccessfulResolution(this.endpoints, null, null, null, {});\n }\n });\n }\n }\n destroy() {\n this.hasReturnedResult = false;\n }\n static getDefaultAuthority(target) {\n return target.path.split(',')[0];\n }\n}\nfunction setup() {\n (0, resolver_1.registerResolver)(IPV4_SCHEME, IpResolver);\n (0, resolver_1.registerResolver)(IPV6_SCHEME, IpResolver);\n}\n//# sourceMappingURL=resolver-ip.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RoundRobinLoadBalancer = void 0;\nexports.setup = setup;\nconst load_balancer_1 = require(\"./load-balancer\");\nconst connectivity_state_1 = require(\"./connectivity-state\");\nconst picker_1 = require(\"./picker\");\nconst logging = require(\"./logging\");\nconst constants_1 = require(\"./constants\");\nconst subchannel_address_1 = require(\"./subchannel-address\");\nconst load_balancer_pick_first_1 = require(\"./load-balancer-pick-first\");\nconst TRACER_NAME = 'round_robin';\nfunction trace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text);\n}\nconst TYPE_NAME = 'round_robin';\nclass RoundRobinLoadBalancingConfig {\n getLoadBalancerName() {\n return TYPE_NAME;\n }\n constructor() { }\n toJsonObject() {\n return {\n [TYPE_NAME]: {},\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static createFromJson(obj) {\n return new RoundRobinLoadBalancingConfig();\n }\n}\nclass RoundRobinPicker {\n constructor(children, nextIndex = 0) {\n this.children = children;\n this.nextIndex = nextIndex;\n }\n pick(pickArgs) {\n const childPicker = this.children[this.nextIndex].picker;\n this.nextIndex = (this.nextIndex + 1) % this.children.length;\n return childPicker.pick(pickArgs);\n }\n /**\n * Check what the next subchannel returned would be. Used by the load\n * balancer implementation to preserve this part of the picker state if\n * possible when a subchannel connects or disconnects.\n */\n peekNextEndpoint() {\n return this.children[this.nextIndex].endpoint;\n }\n}\nclass RoundRobinLoadBalancer {\n constructor(channelControlHelper) {\n this.channelControlHelper = channelControlHelper;\n this.children = [];\n this.currentState = connectivity_state_1.ConnectivityState.IDLE;\n this.currentReadyPicker = null;\n this.updatesPaused = false;\n this.lastError = null;\n this.childChannelControlHelper = (0, load_balancer_1.createChildChannelControlHelper)(channelControlHelper, {\n updateState: (connectivityState, picker, errorMessage) => {\n /* Ensure that name resolution is requested again after active\n * connections are dropped. This is more aggressive than necessary to\n * accomplish that, so we are counting on resolvers to have\n * reasonable rate limits. */\n if (this.currentState === connectivity_state_1.ConnectivityState.READY && connectivityState !== connectivity_state_1.ConnectivityState.READY) {\n this.channelControlHelper.requestReresolution();\n }\n if (errorMessage) {\n this.lastError = errorMessage;\n }\n this.calculateAndUpdateState();\n },\n });\n }\n countChildrenWithState(state) {\n return this.children.filter(child => child.getConnectivityState() === state)\n .length;\n }\n calculateAndUpdateState() {\n if (this.updatesPaused) {\n return;\n }\n if (this.countChildrenWithState(connectivity_state_1.ConnectivityState.READY) > 0) {\n const readyChildren = this.children.filter(child => child.getConnectivityState() === connectivity_state_1.ConnectivityState.READY);\n let index = 0;\n if (this.currentReadyPicker !== null) {\n const nextPickedEndpoint = this.currentReadyPicker.peekNextEndpoint();\n index = readyChildren.findIndex(child => (0, subchannel_address_1.endpointEqual)(child.getEndpoint(), nextPickedEndpoint));\n if (index < 0) {\n index = 0;\n }\n }\n this.updateState(connectivity_state_1.ConnectivityState.READY, new RoundRobinPicker(readyChildren.map(child => ({\n endpoint: child.getEndpoint(),\n picker: child.getPicker(),\n })), index), null);\n }\n else if (this.countChildrenWithState(connectivity_state_1.ConnectivityState.CONNECTING) > 0) {\n this.updateState(connectivity_state_1.ConnectivityState.CONNECTING, new picker_1.QueuePicker(this), null);\n }\n else if (this.countChildrenWithState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) > 0) {\n const errorMessage = `round_robin: No connection established. Last error: ${this.lastError}`;\n this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker({\n details: errorMessage,\n }), errorMessage);\n }\n else {\n this.updateState(connectivity_state_1.ConnectivityState.IDLE, new picker_1.QueuePicker(this), null);\n }\n /* round_robin should keep all children connected, this is how we do that.\n * We can't do this more efficiently in the individual child's updateState\n * callback because that doesn't have a reference to which child the state\n * change is associated with. */\n for (const child of this.children) {\n if (child.getConnectivityState() === connectivity_state_1.ConnectivityState.IDLE) {\n child.exitIdle();\n }\n }\n }\n updateState(newState, picker, errorMessage) {\n trace(connectivity_state_1.ConnectivityState[this.currentState] +\n ' -> ' +\n connectivity_state_1.ConnectivityState[newState]);\n if (newState === connectivity_state_1.ConnectivityState.READY) {\n this.currentReadyPicker = picker;\n }\n else {\n this.currentReadyPicker = null;\n }\n this.currentState = newState;\n this.channelControlHelper.updateState(newState, picker, errorMessage);\n }\n resetSubchannelList() {\n for (const child of this.children) {\n child.destroy();\n }\n }\n updateAddressList(endpointList, lbConfig, options) {\n this.resetSubchannelList();\n trace('Connect to endpoint list ' + endpointList.map(subchannel_address_1.endpointToString));\n this.updatesPaused = true;\n this.children = endpointList.map(endpoint => new load_balancer_pick_first_1.LeafLoadBalancer(endpoint, this.childChannelControlHelper, options));\n for (const child of this.children) {\n child.startConnecting();\n }\n this.updatesPaused = false;\n this.calculateAndUpdateState();\n }\n exitIdle() {\n /* The round_robin LB policy is only in the IDLE state if it has no\n * addresses to try to connect to and it has no picked subchannel.\n * In that case, there is no meaningful action that can be taken here. */\n }\n resetBackoff() {\n // This LB policy has no backoff to reset\n }\n destroy() {\n this.resetSubchannelList();\n }\n getTypeName() {\n return TYPE_NAME;\n }\n}\nexports.RoundRobinLoadBalancer = RoundRobinLoadBalancer;\nfunction setup() {\n (0, load_balancer_1.registerLoadBalancerType)(TYPE_NAME, RoundRobinLoadBalancer, RoundRobinLoadBalancingConfig);\n}\n//# sourceMappingURL=load-balancer-round-robin.js.map","\"use strict\";\n/*\n * Copyright 2022 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OutlierDetectionLoadBalancer = exports.OutlierDetectionLoadBalancingConfig = void 0;\nexports.setup = setup;\nconst connectivity_state_1 = require(\"./connectivity-state\");\nconst constants_1 = require(\"./constants\");\nconst duration_1 = require(\"./duration\");\nconst experimental_1 = require(\"./experimental\");\nconst load_balancer_1 = require(\"./load-balancer\");\nconst load_balancer_child_handler_1 = require(\"./load-balancer-child-handler\");\nconst picker_1 = require(\"./picker\");\nconst subchannel_address_1 = require(\"./subchannel-address\");\nconst subchannel_interface_1 = require(\"./subchannel-interface\");\nconst logging = require(\"./logging\");\nconst TRACER_NAME = 'outlier_detection';\nfunction trace(text) {\n logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text);\n}\nconst TYPE_NAME = 'outlier_detection';\nconst OUTLIER_DETECTION_ENABLED = ((_a = process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION) !== null && _a !== void 0 ? _a : 'true') === 'true';\nconst defaultSuccessRateEjectionConfig = {\n stdev_factor: 1900,\n enforcement_percentage: 100,\n minimum_hosts: 5,\n request_volume: 100,\n};\nconst defaultFailurePercentageEjectionConfig = {\n threshold: 85,\n enforcement_percentage: 100,\n minimum_hosts: 5,\n request_volume: 50,\n};\nfunction validateFieldType(obj, fieldName, expectedType, objectName) {\n if (fieldName in obj &&\n obj[fieldName] !== undefined &&\n typeof obj[fieldName] !== expectedType) {\n const fullFieldName = objectName ? `${objectName}.${fieldName}` : fieldName;\n throw new Error(`outlier detection config ${fullFieldName} parse error: expected ${expectedType}, got ${typeof obj[fieldName]}`);\n }\n}\nfunction validatePositiveDuration(obj, fieldName, objectName) {\n const fullFieldName = objectName ? `${objectName}.${fieldName}` : fieldName;\n if (fieldName in obj && obj[fieldName] !== undefined) {\n if (!(0, duration_1.isDuration)(obj[fieldName])) {\n throw new Error(`outlier detection config ${fullFieldName} parse error: expected Duration, got ${typeof obj[fieldName]}`);\n }\n if (!(obj[fieldName].seconds >= 0 &&\n obj[fieldName].seconds <= 315576000000 &&\n obj[fieldName].nanos >= 0 &&\n obj[fieldName].nanos <= 999999999)) {\n throw new Error(`outlier detection config ${fullFieldName} parse error: values out of range for non-negative Duaration`);\n }\n }\n}\nfunction validatePercentage(obj, fieldName, objectName) {\n const fullFieldName = objectName ? `${objectName}.${fieldName}` : fieldName;\n validateFieldType(obj, fieldName, 'number', objectName);\n if (fieldName in obj &&\n obj[fieldName] !== undefined &&\n !(obj[fieldName] >= 0 && obj[fieldName] <= 100)) {\n throw new Error(`outlier detection config ${fullFieldName} parse error: value out of range for percentage (0-100)`);\n }\n}\nclass OutlierDetectionLoadBalancingConfig {\n constructor(intervalMs, baseEjectionTimeMs, maxEjectionTimeMs, maxEjectionPercent, successRateEjection, failurePercentageEjection, childPolicy) {\n this.childPolicy = childPolicy;\n if (childPolicy.getLoadBalancerName() === 'pick_first') {\n throw new Error('outlier_detection LB policy cannot have a pick_first child policy');\n }\n this.intervalMs = intervalMs !== null && intervalMs !== void 0 ? intervalMs : 10000;\n this.baseEjectionTimeMs = baseEjectionTimeMs !== null && baseEjectionTimeMs !== void 0 ? baseEjectionTimeMs : 30000;\n this.maxEjectionTimeMs = maxEjectionTimeMs !== null && maxEjectionTimeMs !== void 0 ? maxEjectionTimeMs : 300000;\n this.maxEjectionPercent = maxEjectionPercent !== null && maxEjectionPercent !== void 0 ? maxEjectionPercent : 10;\n this.successRateEjection = successRateEjection\n ? Object.assign(Object.assign({}, defaultSuccessRateEjectionConfig), successRateEjection) : null;\n this.failurePercentageEjection = failurePercentageEjection\n ? Object.assign(Object.assign({}, defaultFailurePercentageEjectionConfig), failurePercentageEjection) : null;\n }\n getLoadBalancerName() {\n return TYPE_NAME;\n }\n toJsonObject() {\n var _a, _b;\n return {\n outlier_detection: {\n interval: (0, duration_1.msToDuration)(this.intervalMs),\n base_ejection_time: (0, duration_1.msToDuration)(this.baseEjectionTimeMs),\n max_ejection_time: (0, duration_1.msToDuration)(this.maxEjectionTimeMs),\n max_ejection_percent: this.maxEjectionPercent,\n success_rate_ejection: (_a = this.successRateEjection) !== null && _a !== void 0 ? _a : undefined,\n failure_percentage_ejection: (_b = this.failurePercentageEjection) !== null && _b !== void 0 ? _b : undefined,\n child_policy: [this.childPolicy.toJsonObject()],\n },\n };\n }\n getIntervalMs() {\n return this.intervalMs;\n }\n getBaseEjectionTimeMs() {\n return this.baseEjectionTimeMs;\n }\n getMaxEjectionTimeMs() {\n return this.maxEjectionTimeMs;\n }\n getMaxEjectionPercent() {\n return this.maxEjectionPercent;\n }\n getSuccessRateEjectionConfig() {\n return this.successRateEjection;\n }\n getFailurePercentageEjectionConfig() {\n return this.failurePercentageEjection;\n }\n getChildPolicy() {\n return this.childPolicy;\n }\n static createFromJson(obj) {\n var _a;\n validatePositiveDuration(obj, 'interval');\n validatePositiveDuration(obj, 'base_ejection_time');\n validatePositiveDuration(obj, 'max_ejection_time');\n validatePercentage(obj, 'max_ejection_percent');\n if ('success_rate_ejection' in obj &&\n obj.success_rate_ejection !== undefined) {\n if (typeof obj.success_rate_ejection !== 'object') {\n throw new Error('outlier detection config success_rate_ejection must be an object');\n }\n validateFieldType(obj.success_rate_ejection, 'stdev_factor', 'number', 'success_rate_ejection');\n validatePercentage(obj.success_rate_ejection, 'enforcement_percentage', 'success_rate_ejection');\n validateFieldType(obj.success_rate_ejection, 'minimum_hosts', 'number', 'success_rate_ejection');\n validateFieldType(obj.success_rate_ejection, 'request_volume', 'number', 'success_rate_ejection');\n }\n if ('failure_percentage_ejection' in obj &&\n obj.failure_percentage_ejection !== undefined) {\n if (typeof obj.failure_percentage_ejection !== 'object') {\n throw new Error('outlier detection config failure_percentage_ejection must be an object');\n }\n validatePercentage(obj.failure_percentage_ejection, 'threshold', 'failure_percentage_ejection');\n validatePercentage(obj.failure_percentage_ejection, 'enforcement_percentage', 'failure_percentage_ejection');\n validateFieldType(obj.failure_percentage_ejection, 'minimum_hosts', 'number', 'failure_percentage_ejection');\n validateFieldType(obj.failure_percentage_ejection, 'request_volume', 'number', 'failure_percentage_ejection');\n }\n if (!('child_policy' in obj) || !Array.isArray(obj.child_policy)) {\n throw new Error('outlier detection config child_policy must be an array');\n }\n const childPolicy = (0, load_balancer_1.selectLbConfigFromList)(obj.child_policy);\n if (!childPolicy) {\n throw new Error('outlier detection config child_policy: no valid recognized policy found');\n }\n return new OutlierDetectionLoadBalancingConfig(obj.interval ? (0, duration_1.durationToMs)(obj.interval) : null, obj.base_ejection_time ? (0, duration_1.durationToMs)(obj.base_ejection_time) : null, obj.max_ejection_time ? (0, duration_1.durationToMs)(obj.max_ejection_time) : null, (_a = obj.max_ejection_percent) !== null && _a !== void 0 ? _a : null, obj.success_rate_ejection, obj.failure_percentage_ejection, childPolicy);\n }\n}\nexports.OutlierDetectionLoadBalancingConfig = OutlierDetectionLoadBalancingConfig;\nclass OutlierDetectionSubchannelWrapper extends subchannel_interface_1.BaseSubchannelWrapper {\n constructor(childSubchannel, mapEntry) {\n super(childSubchannel);\n this.mapEntry = mapEntry;\n this.refCount = 0;\n }\n ref() {\n this.child.ref();\n this.refCount += 1;\n }\n unref() {\n this.child.unref();\n this.refCount -= 1;\n if (this.refCount <= 0) {\n if (this.mapEntry) {\n const index = this.mapEntry.subchannelWrappers.indexOf(this);\n if (index >= 0) {\n this.mapEntry.subchannelWrappers.splice(index, 1);\n }\n }\n }\n }\n eject() {\n this.setHealthy(false);\n }\n uneject() {\n this.setHealthy(true);\n }\n getMapEntry() {\n return this.mapEntry;\n }\n getWrappedSubchannel() {\n return this.child;\n }\n}\nfunction createEmptyBucket() {\n return {\n success: 0,\n failure: 0,\n };\n}\nclass CallCounter {\n constructor() {\n this.activeBucket = createEmptyBucket();\n this.inactiveBucket = createEmptyBucket();\n }\n addSuccess() {\n this.activeBucket.success += 1;\n }\n addFailure() {\n this.activeBucket.failure += 1;\n }\n switchBuckets() {\n this.inactiveBucket = this.activeBucket;\n this.activeBucket = createEmptyBucket();\n }\n getLastSuccesses() {\n return this.inactiveBucket.success;\n }\n getLastFailures() {\n return this.inactiveBucket.failure;\n }\n}\nclass OutlierDetectionPicker {\n constructor(wrappedPicker, countCalls) {\n this.wrappedPicker = wrappedPicker;\n this.countCalls = countCalls;\n }\n pick(pickArgs) {\n const wrappedPick = this.wrappedPicker.pick(pickArgs);\n if (wrappedPick.pickResultType === picker_1.PickResultType.COMPLETE) {\n const subchannelWrapper = wrappedPick.subchannel;\n const mapEntry = subchannelWrapper.getMapEntry();\n if (mapEntry) {\n let onCallEnded = wrappedPick.onCallEnded;\n if (this.countCalls) {\n onCallEnded = statusCode => {\n var _a;\n if (statusCode === constants_1.Status.OK) {\n mapEntry.counter.addSuccess();\n }\n else {\n mapEntry.counter.addFailure();\n }\n (_a = wrappedPick.onCallEnded) === null || _a === void 0 ? void 0 : _a.call(wrappedPick, statusCode);\n };\n }\n return Object.assign(Object.assign({}, wrappedPick), { subchannel: subchannelWrapper.getWrappedSubchannel(), onCallEnded: onCallEnded });\n }\n else {\n return Object.assign(Object.assign({}, wrappedPick), { subchannel: subchannelWrapper.getWrappedSubchannel() });\n }\n }\n else {\n return wrappedPick;\n }\n }\n}\nclass OutlierDetectionLoadBalancer {\n constructor(channelControlHelper) {\n this.entryMap = new subchannel_address_1.EndpointMap();\n this.latestConfig = null;\n this.timerStartTime = null;\n this.childBalancer = new load_balancer_child_handler_1.ChildLoadBalancerHandler((0, experimental_1.createChildChannelControlHelper)(channelControlHelper, {\n createSubchannel: (subchannelAddress, subchannelArgs) => {\n const originalSubchannel = channelControlHelper.createSubchannel(subchannelAddress, subchannelArgs);\n const mapEntry = this.entryMap.getForSubchannelAddress(subchannelAddress);\n const subchannelWrapper = new OutlierDetectionSubchannelWrapper(originalSubchannel, mapEntry);\n if ((mapEntry === null || mapEntry === void 0 ? void 0 : mapEntry.currentEjectionTimestamp) !== null) {\n // If the address is ejected, propagate that to the new subchannel wrapper\n subchannelWrapper.eject();\n }\n mapEntry === null || mapEntry === void 0 ? void 0 : mapEntry.subchannelWrappers.push(subchannelWrapper);\n return subchannelWrapper;\n },\n updateState: (connectivityState, picker, errorMessage) => {\n if (connectivityState === connectivity_state_1.ConnectivityState.READY) {\n channelControlHelper.updateState(connectivityState, new OutlierDetectionPicker(picker, this.isCountingEnabled()), errorMessage);\n }\n else {\n channelControlHelper.updateState(connectivityState, picker, errorMessage);\n }\n },\n }));\n this.ejectionTimer = setInterval(() => { }, 0);\n clearInterval(this.ejectionTimer);\n }\n isCountingEnabled() {\n return (this.latestConfig !== null &&\n (this.latestConfig.getSuccessRateEjectionConfig() !== null ||\n this.latestConfig.getFailurePercentageEjectionConfig() !== null));\n }\n getCurrentEjectionPercent() {\n let ejectionCount = 0;\n for (const mapEntry of this.entryMap.values()) {\n if (mapEntry.currentEjectionTimestamp !== null) {\n ejectionCount += 1;\n }\n }\n return (ejectionCount * 100) / this.entryMap.size;\n }\n runSuccessRateCheck(ejectionTimestamp) {\n if (!this.latestConfig) {\n return;\n }\n const successRateConfig = this.latestConfig.getSuccessRateEjectionConfig();\n if (!successRateConfig) {\n return;\n }\n trace('Running success rate check');\n // Step 1\n const targetRequestVolume = successRateConfig.request_volume;\n let addresesWithTargetVolume = 0;\n const successRates = [];\n for (const [endpoint, mapEntry] of this.entryMap.entries()) {\n const successes = mapEntry.counter.getLastSuccesses();\n const failures = mapEntry.counter.getLastFailures();\n trace('Stats for ' +\n (0, subchannel_address_1.endpointToString)(endpoint) +\n ': successes=' +\n successes +\n ' failures=' +\n failures +\n ' targetRequestVolume=' +\n targetRequestVolume);\n if (successes + failures >= targetRequestVolume) {\n addresesWithTargetVolume += 1;\n successRates.push(successes / (successes + failures));\n }\n }\n trace('Found ' +\n addresesWithTargetVolume +\n ' success rate candidates; currentEjectionPercent=' +\n this.getCurrentEjectionPercent() +\n ' successRates=[' +\n successRates +\n ']');\n if (addresesWithTargetVolume < successRateConfig.minimum_hosts) {\n return;\n }\n // Step 2\n const successRateMean = successRates.reduce((a, b) => a + b) / successRates.length;\n let successRateDeviationSum = 0;\n for (const rate of successRates) {\n const deviation = rate - successRateMean;\n successRateDeviationSum += deviation * deviation;\n }\n const successRateVariance = successRateDeviationSum / successRates.length;\n const successRateStdev = Math.sqrt(successRateVariance);\n const ejectionThreshold = successRateMean -\n successRateStdev * (successRateConfig.stdev_factor / 1000);\n trace('stdev=' + successRateStdev + ' ejectionThreshold=' + ejectionThreshold);\n // Step 3\n for (const [address, mapEntry] of this.entryMap.entries()) {\n // Step 3.i\n if (this.getCurrentEjectionPercent() >=\n this.latestConfig.getMaxEjectionPercent()) {\n break;\n }\n // Step 3.ii\n const successes = mapEntry.counter.getLastSuccesses();\n const failures = mapEntry.counter.getLastFailures();\n if (successes + failures < targetRequestVolume) {\n continue;\n }\n // Step 3.iii\n const successRate = successes / (successes + failures);\n trace('Checking candidate ' + address + ' successRate=' + successRate);\n if (successRate < ejectionThreshold) {\n const randomNumber = Math.random() * 100;\n trace('Candidate ' +\n address +\n ' randomNumber=' +\n randomNumber +\n ' enforcement_percentage=' +\n successRateConfig.enforcement_percentage);\n if (randomNumber < successRateConfig.enforcement_percentage) {\n trace('Ejecting candidate ' + address);\n this.eject(mapEntry, ejectionTimestamp);\n }\n }\n }\n }\n runFailurePercentageCheck(ejectionTimestamp) {\n if (!this.latestConfig) {\n return;\n }\n const failurePercentageConfig = this.latestConfig.getFailurePercentageEjectionConfig();\n if (!failurePercentageConfig) {\n return;\n }\n trace('Running failure percentage check. threshold=' +\n failurePercentageConfig.threshold +\n ' request volume threshold=' +\n failurePercentageConfig.request_volume);\n // Step 1\n let addressesWithTargetVolume = 0;\n for (const mapEntry of this.entryMap.values()) {\n const successes = mapEntry.counter.getLastSuccesses();\n const failures = mapEntry.counter.getLastFailures();\n if (successes + failures >= failurePercentageConfig.request_volume) {\n addressesWithTargetVolume += 1;\n }\n }\n if (addressesWithTargetVolume < failurePercentageConfig.minimum_hosts) {\n return;\n }\n // Step 2\n for (const [address, mapEntry] of this.entryMap.entries()) {\n // Step 2.i\n if (this.getCurrentEjectionPercent() >=\n this.latestConfig.getMaxEjectionPercent()) {\n break;\n }\n // Step 2.ii\n const successes = mapEntry.counter.getLastSuccesses();\n const failures = mapEntry.counter.getLastFailures();\n trace('Candidate successes=' + successes + ' failures=' + failures);\n if (successes + failures < failurePercentageConfig.request_volume) {\n continue;\n }\n // Step 2.iii\n const failurePercentage = (failures * 100) / (failures + successes);\n if (failurePercentage > failurePercentageConfig.threshold) {\n const randomNumber = Math.random() * 100;\n trace('Candidate ' +\n address +\n ' randomNumber=' +\n randomNumber +\n ' enforcement_percentage=' +\n failurePercentageConfig.enforcement_percentage);\n if (randomNumber < failurePercentageConfig.enforcement_percentage) {\n trace('Ejecting candidate ' + address);\n this.eject(mapEntry, ejectionTimestamp);\n }\n }\n }\n }\n eject(mapEntry, ejectionTimestamp) {\n mapEntry.currentEjectionTimestamp = new Date();\n mapEntry.ejectionTimeMultiplier += 1;\n for (const subchannelWrapper of mapEntry.subchannelWrappers) {\n subchannelWrapper.eject();\n }\n }\n uneject(mapEntry) {\n mapEntry.currentEjectionTimestamp = null;\n for (const subchannelWrapper of mapEntry.subchannelWrappers) {\n subchannelWrapper.uneject();\n }\n }\n switchAllBuckets() {\n for (const mapEntry of this.entryMap.values()) {\n mapEntry.counter.switchBuckets();\n }\n }\n startTimer(delayMs) {\n var _a, _b;\n this.ejectionTimer = setTimeout(() => this.runChecks(), delayMs);\n (_b = (_a = this.ejectionTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n runChecks() {\n const ejectionTimestamp = new Date();\n trace('Ejection timer running');\n this.switchAllBuckets();\n if (!this.latestConfig) {\n return;\n }\n this.timerStartTime = ejectionTimestamp;\n this.startTimer(this.latestConfig.getIntervalMs());\n this.runSuccessRateCheck(ejectionTimestamp);\n this.runFailurePercentageCheck(ejectionTimestamp);\n for (const [address, mapEntry] of this.entryMap.entries()) {\n if (mapEntry.currentEjectionTimestamp === null) {\n if (mapEntry.ejectionTimeMultiplier > 0) {\n mapEntry.ejectionTimeMultiplier -= 1;\n }\n }\n else {\n const baseEjectionTimeMs = this.latestConfig.getBaseEjectionTimeMs();\n const maxEjectionTimeMs = this.latestConfig.getMaxEjectionTimeMs();\n const returnTime = new Date(mapEntry.currentEjectionTimestamp.getTime());\n returnTime.setMilliseconds(returnTime.getMilliseconds() +\n Math.min(baseEjectionTimeMs * mapEntry.ejectionTimeMultiplier, Math.max(baseEjectionTimeMs, maxEjectionTimeMs)));\n if (returnTime < new Date()) {\n trace('Unejecting ' + address);\n this.uneject(mapEntry);\n }\n }\n }\n }\n updateAddressList(endpointList, lbConfig, options) {\n if (!(lbConfig instanceof OutlierDetectionLoadBalancingConfig)) {\n return;\n }\n trace('Received update with config: ' + JSON.stringify(lbConfig.toJsonObject(), undefined, 2));\n for (const endpoint of endpointList) {\n if (!this.entryMap.has(endpoint)) {\n trace('Adding map entry for ' + (0, subchannel_address_1.endpointToString)(endpoint));\n this.entryMap.set(endpoint, {\n counter: new CallCounter(),\n currentEjectionTimestamp: null,\n ejectionTimeMultiplier: 0,\n subchannelWrappers: [],\n });\n }\n }\n this.entryMap.deleteMissing(endpointList);\n const childPolicy = lbConfig.getChildPolicy();\n this.childBalancer.updateAddressList(endpointList, childPolicy, options);\n if (lbConfig.getSuccessRateEjectionConfig() ||\n lbConfig.getFailurePercentageEjectionConfig()) {\n if (this.timerStartTime) {\n trace('Previous timer existed. Replacing timer');\n clearTimeout(this.ejectionTimer);\n const remainingDelay = lbConfig.getIntervalMs() -\n (new Date().getTime() - this.timerStartTime.getTime());\n this.startTimer(remainingDelay);\n }\n else {\n trace('Starting new timer');\n this.timerStartTime = new Date();\n this.startTimer(lbConfig.getIntervalMs());\n this.switchAllBuckets();\n }\n }\n else {\n trace('Counting disabled. Cancelling timer.');\n this.timerStartTime = null;\n clearTimeout(this.ejectionTimer);\n for (const mapEntry of this.entryMap.values()) {\n this.uneject(mapEntry);\n mapEntry.ejectionTimeMultiplier = 0;\n }\n }\n this.latestConfig = lbConfig;\n }\n exitIdle() {\n this.childBalancer.exitIdle();\n }\n resetBackoff() {\n this.childBalancer.resetBackoff();\n }\n destroy() {\n clearTimeout(this.ejectionTimer);\n this.childBalancer.destroy();\n }\n getTypeName() {\n return TYPE_NAME;\n }\n}\nexports.OutlierDetectionLoadBalancer = OutlierDetectionLoadBalancer;\nfunction setup() {\n if (OUTLIER_DETECTION_ENABLED) {\n (0, experimental_1.registerLoadBalancerType)(TYPE_NAME, OutlierDetectionLoadBalancer, OutlierDetectionLoadBalancingConfig);\n }\n}\n//# sourceMappingURL=load-balancer-outlier-detection.js.map","\"use strict\";\n/*\n * Copyright 2019 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.experimental = exports.ServerInterceptingCall = exports.ResponderBuilder = exports.ServerListenerBuilder = exports.addAdminServicesToServer = exports.getChannelzHandlers = exports.getChannelzServiceDefinition = exports.InterceptorConfigurationError = exports.InterceptingCall = exports.RequesterBuilder = exports.ListenerBuilder = exports.StatusBuilder = exports.getClientChannel = exports.ServerCredentials = exports.Server = exports.setLogVerbosity = exports.setLogger = exports.load = exports.loadObject = exports.CallCredentials = exports.ChannelCredentials = exports.waitForClientReady = exports.closeClient = exports.Channel = exports.makeGenericClientConstructor = exports.makeClientConstructor = exports.loadPackageDefinition = exports.Client = exports.compressionAlgorithms = exports.propagate = exports.connectivityState = exports.status = exports.logVerbosity = exports.Metadata = exports.credentials = void 0;\nconst call_credentials_1 = require(\"./call-credentials\");\nObject.defineProperty(exports, \"CallCredentials\", { enumerable: true, get: function () { return call_credentials_1.CallCredentials; } });\nconst channel_1 = require(\"./channel\");\nObject.defineProperty(exports, \"Channel\", { enumerable: true, get: function () { return channel_1.ChannelImplementation; } });\nconst compression_algorithms_1 = require(\"./compression-algorithms\");\nObject.defineProperty(exports, \"compressionAlgorithms\", { enumerable: true, get: function () { return compression_algorithms_1.CompressionAlgorithms; } });\nconst connectivity_state_1 = require(\"./connectivity-state\");\nObject.defineProperty(exports, \"connectivityState\", { enumerable: true, get: function () { return connectivity_state_1.ConnectivityState; } });\nconst channel_credentials_1 = require(\"./channel-credentials\");\nObject.defineProperty(exports, \"ChannelCredentials\", { enumerable: true, get: function () { return channel_credentials_1.ChannelCredentials; } });\nconst client_1 = require(\"./client\");\nObject.defineProperty(exports, \"Client\", { enumerable: true, get: function () { return client_1.Client; } });\nconst constants_1 = require(\"./constants\");\nObject.defineProperty(exports, \"logVerbosity\", { enumerable: true, get: function () { return constants_1.LogVerbosity; } });\nObject.defineProperty(exports, \"status\", { enumerable: true, get: function () { return constants_1.Status; } });\nObject.defineProperty(exports, \"propagate\", { enumerable: true, get: function () { return constants_1.Propagate; } });\nconst logging = require(\"./logging\");\nconst make_client_1 = require(\"./make-client\");\nObject.defineProperty(exports, \"loadPackageDefinition\", { enumerable: true, get: function () { return make_client_1.loadPackageDefinition; } });\nObject.defineProperty(exports, \"makeClientConstructor\", { enumerable: true, get: function () { return make_client_1.makeClientConstructor; } });\nObject.defineProperty(exports, \"makeGenericClientConstructor\", { enumerable: true, get: function () { return make_client_1.makeClientConstructor; } });\nconst metadata_1 = require(\"./metadata\");\nObject.defineProperty(exports, \"Metadata\", { enumerable: true, get: function () { return metadata_1.Metadata; } });\nconst server_1 = require(\"./server\");\nObject.defineProperty(exports, \"Server\", { enumerable: true, get: function () { return server_1.Server; } });\nconst server_credentials_1 = require(\"./server-credentials\");\nObject.defineProperty(exports, \"ServerCredentials\", { enumerable: true, get: function () { return server_credentials_1.ServerCredentials; } });\nconst status_builder_1 = require(\"./status-builder\");\nObject.defineProperty(exports, \"StatusBuilder\", { enumerable: true, get: function () { return status_builder_1.StatusBuilder; } });\n/**** Client Credentials ****/\n// Using assign only copies enumerable properties, which is what we want\nexports.credentials = {\n /**\n * Combine a ChannelCredentials with any number of CallCredentials into a\n * single ChannelCredentials object.\n * @param channelCredentials The ChannelCredentials object.\n * @param callCredentials Any number of CallCredentials objects.\n * @return The resulting ChannelCredentials object.\n */\n combineChannelCredentials: (channelCredentials, ...callCredentials) => {\n return callCredentials.reduce((acc, other) => acc.compose(other), channelCredentials);\n },\n /**\n * Combine any number of CallCredentials into a single CallCredentials\n * object.\n * @param first The first CallCredentials object.\n * @param additional Any number of additional CallCredentials objects.\n * @return The resulting CallCredentials object.\n */\n combineCallCredentials: (first, ...additional) => {\n return additional.reduce((acc, other) => acc.compose(other), first);\n },\n // from channel-credentials.ts\n createInsecure: channel_credentials_1.ChannelCredentials.createInsecure,\n createSsl: channel_credentials_1.ChannelCredentials.createSsl,\n createFromSecureContext: channel_credentials_1.ChannelCredentials.createFromSecureContext,\n // from call-credentials.ts\n createFromMetadataGenerator: call_credentials_1.CallCredentials.createFromMetadataGenerator,\n createFromGoogleCredential: call_credentials_1.CallCredentials.createFromGoogleCredential,\n createEmpty: call_credentials_1.CallCredentials.createEmpty,\n};\n/**\n * Close a Client object.\n * @param client The client to close.\n */\nconst closeClient = (client) => client.close();\nexports.closeClient = closeClient;\nconst waitForClientReady = (client, deadline, callback) => client.waitForReady(deadline, callback);\nexports.waitForClientReady = waitForClientReady;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n/**** Unimplemented function stubs ****/\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst loadObject = (value, options) => {\n throw new Error('Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead');\n};\nexports.loadObject = loadObject;\nconst load = (filename, format, options) => {\n throw new Error('Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead');\n};\nexports.load = load;\nconst setLogger = (logger) => {\n logging.setLogger(logger);\n};\nexports.setLogger = setLogger;\nconst setLogVerbosity = (verbosity) => {\n logging.setLoggerVerbosity(verbosity);\n};\nexports.setLogVerbosity = setLogVerbosity;\nconst getClientChannel = (client) => {\n return client_1.Client.prototype.getChannel.call(client);\n};\nexports.getClientChannel = getClientChannel;\nvar client_interceptors_1 = require(\"./client-interceptors\");\nObject.defineProperty(exports, \"ListenerBuilder\", { enumerable: true, get: function () { return client_interceptors_1.ListenerBuilder; } });\nObject.defineProperty(exports, \"RequesterBuilder\", { enumerable: true, get: function () { return client_interceptors_1.RequesterBuilder; } });\nObject.defineProperty(exports, \"InterceptingCall\", { enumerable: true, get: function () { return client_interceptors_1.InterceptingCall; } });\nObject.defineProperty(exports, \"InterceptorConfigurationError\", { enumerable: true, get: function () { return client_interceptors_1.InterceptorConfigurationError; } });\nvar channelz_1 = require(\"./channelz\");\nObject.defineProperty(exports, \"getChannelzServiceDefinition\", { enumerable: true, get: function () { return channelz_1.getChannelzServiceDefinition; } });\nObject.defineProperty(exports, \"getChannelzHandlers\", { enumerable: true, get: function () { return channelz_1.getChannelzHandlers; } });\nvar admin_1 = require(\"./admin\");\nObject.defineProperty(exports, \"addAdminServicesToServer\", { enumerable: true, get: function () { return admin_1.addAdminServicesToServer; } });\nvar server_interceptors_1 = require(\"./server-interceptors\");\nObject.defineProperty(exports, \"ServerListenerBuilder\", { enumerable: true, get: function () { return server_interceptors_1.ServerListenerBuilder; } });\nObject.defineProperty(exports, \"ResponderBuilder\", { enumerable: true, get: function () { return server_interceptors_1.ResponderBuilder; } });\nObject.defineProperty(exports, \"ServerInterceptingCall\", { enumerable: true, get: function () { return server_interceptors_1.ServerInterceptingCall; } });\nconst experimental = require(\"./experimental\");\nexports.experimental = experimental;\nconst resolver_dns = require(\"./resolver-dns\");\nconst resolver_uds = require(\"./resolver-uds\");\nconst resolver_ip = require(\"./resolver-ip\");\nconst load_balancer_pick_first = require(\"./load-balancer-pick-first\");\nconst load_balancer_round_robin = require(\"./load-balancer-round-robin\");\nconst load_balancer_outlier_detection = require(\"./load-balancer-outlier-detection\");\nconst channelz = require(\"./channelz\");\n(() => {\n resolver_dns.setup();\n resolver_uds.setup();\n resolver_ip.setup();\n load_balancer_pick_first.setup();\n load_balancer_round_robin.setup();\n load_balancer_outlier_detection.setup();\n channelz.setup();\n})();\n//# sourceMappingURL=index.js.map","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n","\"use strict\";\n// Copyright 2023 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nconst pkg = require('../../../package.json');\nmodule.exports = { pkg };\n//# sourceMappingURL=util.cjs.map","\"use strict\";\n// Copyright 2018 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GaxiosError = exports.GAXIOS_ERROR_SYMBOL = void 0;\nexports.defaultErrorRedactor = defaultErrorRedactor;\nconst extend_1 = __importDefault(require(\"extend\"));\nconst util_cjs_1 = __importDefault(require(\"./util.cjs\"));\nconst pkg = util_cjs_1.default.pkg;\n/**\n * Support `instanceof` operator for `GaxiosError`s in different versions of this library.\n *\n * @see {@link GaxiosError[Symbol.hasInstance]}\n */\nexports.GAXIOS_ERROR_SYMBOL = Symbol.for(`${pkg.name}-gaxios-error`);\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\nclass GaxiosError extends Error {\n config;\n response;\n error;\n /**\n * An error code.\n * Can be a system error code, DOMException error name, or any error's 'code' property where it is a `string`.\n *\n * @see {@link https://nodejs.org/api/errors.html#errorcode error.code}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/DOMException#error_names DOMException#error_names}\n *\n * @example\n * 'ECONNRESET'\n *\n * @example\n * 'TimeoutError'\n */\n code;\n /**\n * An HTTP Status code.\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Response/status Response#status}\n *\n * @example\n * 500\n */\n status;\n /**\n * Support `instanceof` operator for `GaxiosError` across builds/duplicated files.\n *\n * @see {@link GAXIOS_ERROR_SYMBOL}\n * @see {@link GaxiosError[Symbol.hasInstance]}\n * @see {@link https://github.com/microsoft/TypeScript/issues/13965#issuecomment-278570200}\n * @see {@link https://stackoverflow.com/questions/46618852/require-and-instanceof}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/@@hasInstance#reverting_to_default_instanceof_behavior}\n */\n [exports.GAXIOS_ERROR_SYMBOL] = pkg.version;\n /**\n * Support `instanceof` operator for `GaxiosError` across builds/duplicated files.\n *\n * @see {@link GAXIOS_ERROR_SYMBOL}\n * @see {@link GaxiosError[GAXIOS_ERROR_SYMBOL]}\n */\n static [Symbol.hasInstance](instance) {\n if (instance &&\n typeof instance === 'object' &&\n exports.GAXIOS_ERROR_SYMBOL in instance &&\n instance[exports.GAXIOS_ERROR_SYMBOL] === pkg.version) {\n return true;\n }\n // fallback to native\n return Function.prototype[Symbol.hasInstance].call(GaxiosError, instance);\n }\n constructor(message, config, response, error) {\n super(message);\n this.config = config;\n this.response = response;\n this.error = error;\n // deep-copy config as we do not want to mutate\n // the existing config for future retries/use\n this.config = (0, extend_1.default)(true, {}, config);\n if (this.response) {\n this.response.config = (0, extend_1.default)(true, {}, this.response.config);\n }\n if (this.response) {\n try {\n this.response.data = translateData(this.config.responseType, \n // workaround for `node-fetch`'s `.data` deprecation...\n this.response?.bodyUsed ? this.response?.data : undefined);\n }\n catch {\n // best effort - don't throw an error within an error\n // we could set `this.response.config.responseType = 'unknown'`, but\n // that would mutate future calls with this config object.\n }\n this.status = this.response.status;\n }\n if (error && 'code' in error && error.code) {\n this.code = error.code;\n }\n }\n}\nexports.GaxiosError = GaxiosError;\nfunction translateData(responseType, data) {\n switch (responseType) {\n case 'stream':\n return data;\n case 'json':\n return JSON.parse(JSON.stringify(data));\n case 'arraybuffer':\n return JSON.parse(Buffer.from(data).toString('utf8'));\n case 'blob':\n return JSON.parse(data.text());\n default:\n return data;\n }\n}\n/**\n * An experimental error redactor.\n *\n * @param config Config to potentially redact properties of\n * @param response Config to potentially redact properties of\n *\n * @experimental\n */\nfunction defaultErrorRedactor(data) {\n const REDACT = '< - See `errorRedactor` option in `gaxios` for configuration>.';\n function redactHeaders(headers) {\n if (!headers)\n return;\n headers.forEach((_, key) => {\n // any casing of `Authentication`\n // any casing of `Authorization`\n // anything containing secret, such as 'client secret'\n if (/^authentication$/i.test(key) ||\n /^authorization$/i.test(key) ||\n /secret/i.test(key))\n headers.set(key, REDACT);\n });\n }\n function redactString(obj, key) {\n if (typeof obj === 'object' &&\n obj !== null &&\n typeof obj[key] === 'string') {\n const text = obj[key];\n if (/grant_type=/i.test(text) ||\n /assertion=/i.test(text) ||\n /secret/i.test(text)) {\n obj[key] = REDACT;\n }\n }\n }\n function redactObject(obj) {\n if (!obj || typeof obj !== 'object') {\n return;\n }\n else if (obj instanceof FormData ||\n obj instanceof URLSearchParams ||\n // support `node-fetch` FormData/URLSearchParams\n ('forEach' in obj && 'set' in obj)) {\n obj.forEach((_, key) => {\n if (['grant_type', 'assertion'].includes(key) || /secret/.test(key)) {\n obj.set(key, REDACT);\n }\n });\n }\n else {\n if ('grant_type' in obj) {\n obj['grant_type'] = REDACT;\n }\n if ('assertion' in obj) {\n obj['assertion'] = REDACT;\n }\n if ('client_secret' in obj) {\n obj['client_secret'] = REDACT;\n }\n }\n }\n if (data.config) {\n redactHeaders(data.config.headers);\n redactString(data.config, 'data');\n redactObject(data.config.data);\n redactString(data.config, 'body');\n redactObject(data.config.body);\n if (data.config.url.searchParams.has('token')) {\n data.config.url.searchParams.set('token', REDACT);\n }\n if (data.config.url.searchParams.has('client_secret')) {\n data.config.url.searchParams.set('client_secret', REDACT);\n }\n }\n if (data.response) {\n defaultErrorRedactor({ config: data.response.config });\n redactHeaders(data.response.headers);\n // workaround for `node-fetch`'s `.data` deprecation...\n if (data.response.bodyUsed) {\n redactString(data.response, 'data');\n redactObject(data.response.data);\n }\n }\n return data;\n}\n//# sourceMappingURL=common.js.map","\"use strict\";\n// Copyright 2018 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRetryConfig = getRetryConfig;\nasync function getRetryConfig(err) {\n let config = getConfig(err);\n if (!err || !err.config || (!config && !err.config.retry)) {\n return { shouldRetry: false };\n }\n config = config || {};\n config.currentRetryAttempt = config.currentRetryAttempt || 0;\n config.retry =\n config.retry === undefined || config.retry === null ? 3 : config.retry;\n config.httpMethodsToRetry = config.httpMethodsToRetry || [\n 'GET',\n 'HEAD',\n 'PUT',\n 'OPTIONS',\n 'DELETE',\n ];\n config.noResponseRetries =\n config.noResponseRetries === undefined || config.noResponseRetries === null\n ? 2\n : config.noResponseRetries;\n config.retryDelayMultiplier = config.retryDelayMultiplier\n ? config.retryDelayMultiplier\n : 2;\n config.timeOfFirstRequest = config.timeOfFirstRequest\n ? config.timeOfFirstRequest\n : Date.now();\n config.totalTimeout = config.totalTimeout\n ? config.totalTimeout\n : Number.MAX_SAFE_INTEGER;\n config.maxRetryDelay = config.maxRetryDelay\n ? config.maxRetryDelay\n : Number.MAX_SAFE_INTEGER;\n // If this wasn't in the list of status codes where we want\n // to automatically retry, return.\n const retryRanges = [\n // https://en.wikipedia.org/wiki/List_of_HTTP_status_codes\n // 1xx - Retry (Informational, request still processing)\n // 2xx - Do not retry (Success)\n // 3xx - Do not retry (Redirect)\n // 4xx - Do not retry (Client errors)\n // 408 - Retry (\"Request Timeout\")\n // 429 - Retry (\"Too Many Requests\")\n // 5xx - Retry (Server errors)\n [100, 199],\n [408, 408],\n [429, 429],\n [500, 599],\n ];\n config.statusCodesToRetry = config.statusCodesToRetry || retryRanges;\n // Put the config back into the err\n err.config.retryConfig = config;\n // Determine if we should retry the request\n const shouldRetryFn = config.shouldRetry || shouldRetryRequest;\n if (!(await shouldRetryFn(err))) {\n return { shouldRetry: false, config: err.config };\n }\n const delay = getNextRetryDelay(config);\n // We're going to retry! Increment the counter.\n err.config.retryConfig.currentRetryAttempt += 1;\n // Create a promise that invokes the retry after the backOffDelay\n const backoff = config.retryBackoff\n ? config.retryBackoff(err, delay)\n : new Promise(resolve => {\n setTimeout(resolve, delay);\n });\n // Notify the user if they added an `onRetryAttempt` handler\n if (config.onRetryAttempt) {\n await config.onRetryAttempt(err);\n }\n // Return the promise in which recalls Gaxios to retry the request\n await backoff;\n return { shouldRetry: true, config: err.config };\n}\n/**\n * Determine based on config if we should retry the request.\n * @param err The GaxiosError passed to the interceptor.\n */\nfunction shouldRetryRequest(err) {\n const config = getConfig(err);\n if ((err.config.signal?.aborted && err.error?.name !== 'TimeoutError') ||\n err.name === 'AbortError' ||\n err.error?.name === 'AbortError') {\n return false;\n }\n // If there's no config, or retries are disabled, return.\n if (!config || config.retry === 0) {\n return false;\n }\n // Check if this error has no response (ETIMEDOUT, ENOTFOUND, etc)\n if (!err.response &&\n (config.currentRetryAttempt || 0) >= config.noResponseRetries) {\n return false;\n }\n // Only retry with configured HttpMethods.\n if (!config.httpMethodsToRetry ||\n !config.httpMethodsToRetry.includes(err.config.method?.toUpperCase() || 'GET')) {\n return false;\n }\n // If this wasn't in the list of status codes where we want\n // to automatically retry, return.\n if (err.response && err.response.status) {\n let isInRange = false;\n for (const [min, max] of config.statusCodesToRetry) {\n const status = err.response.status;\n if (status >= min && status <= max) {\n isInRange = true;\n break;\n }\n }\n if (!isInRange) {\n return false;\n }\n }\n // If we are out of retry attempts, return\n config.currentRetryAttempt = config.currentRetryAttempt || 0;\n if (config.currentRetryAttempt >= config.retry) {\n return false;\n }\n return true;\n}\n/**\n * Acquire the raxConfig object from an GaxiosError if available.\n * @param err The Gaxios error with a config object.\n */\nfunction getConfig(err) {\n if (err && err.config && err.config.retryConfig) {\n return err.config.retryConfig;\n }\n return;\n}\n/**\n * Gets the delay to wait before the next retry.\n *\n * @param {RetryConfig} config The current set of retry options\n * @returns {number} the amount of ms to wait before the next retry attempt.\n */\nfunction getNextRetryDelay(config) {\n // Calculate time to wait with exponential backoff.\n // If this is the first retry, look for a configured retryDelay.\n const retryDelay = config.currentRetryAttempt\n ? 0\n : (config.retryDelay ?? 100);\n // Formula: retryDelay + ((retryDelayMultiplier^currentRetryAttempt - 1 / 2) * 1000)\n const calculatedDelay = retryDelay +\n ((Math.pow(config.retryDelayMultiplier, config.currentRetryAttempt) - 1) /\n 2) *\n 1000;\n const maxAllowableDelay = config.totalTimeout - (Date.now() - config.timeOfFirstRequest);\n return Math.min(calculatedDelay, maxAllowableDelay, config.maxRetryDelay);\n}\n//# sourceMappingURL=retry.js.map","\"use strict\";\n// Copyright 2024 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GaxiosInterceptorManager = void 0;\n/**\n * Class to manage collections of GaxiosInterceptors for both requests and responses.\n */\nclass GaxiosInterceptorManager extends Set {\n}\nexports.GaxiosInterceptorManager = GaxiosInterceptorManager;\n//# sourceMappingURL=interceptor.js.map","\"use strict\";\n// Copyright 2018 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Gaxios = void 0;\nconst extend_1 = __importDefault(require(\"extend\"));\nconst https_1 = require(\"https\");\nconst url_1 = require(\"url\");\nconst common_js_1 = require(\"./common.js\");\nconst retry_js_1 = require(\"./retry.js\");\nconst stream_1 = require(\"stream\");\nconst interceptor_js_1 = require(\"./interceptor.js\");\nconst randomUUID = async () => globalThis.crypto?.randomUUID() || (await import('crypto')).randomUUID();\nclass Gaxios {\n agentCache = new Map();\n /**\n * Default HTTP options that will be used for every HTTP request.\n */\n defaults;\n /**\n * Interceptors\n */\n interceptors;\n /**\n * The Gaxios class is responsible for making HTTP requests.\n * @param defaults The default set of options to be used for this instance.\n */\n constructor(defaults) {\n this.defaults = defaults || {};\n this.interceptors = {\n request: new interceptor_js_1.GaxiosInterceptorManager(),\n response: new interceptor_js_1.GaxiosInterceptorManager(),\n };\n }\n /**\n * A {@link fetch `fetch`} compliant API for {@link Gaxios}.\n *\n * @remarks\n *\n * This is useful as a drop-in replacement for `fetch` API usage.\n *\n * @example\n *\n * ```ts\n * const gaxios = new Gaxios();\n * const myFetch: typeof fetch = (...args) => gaxios.fetch(...args);\n * await myFetch('https://example.com');\n * ```\n *\n * @param args `fetch` API or `Gaxios#request` parameters\n * @returns the {@link Response} with Gaxios-added properties\n */\n fetch(...args) {\n // Up to 2 parameters in either overload\n const input = args[0];\n const init = args[1];\n let url = undefined;\n const headers = new Headers();\n // prepare URL\n if (typeof input === 'string') {\n url = new url_1.URL(input);\n }\n else if (input instanceof url_1.URL) {\n url = input;\n }\n else if (input && input.url) {\n url = new url_1.URL(input.url);\n }\n // prepare headers\n if (input && typeof input === 'object' && 'headers' in input) {\n _a.mergeHeaders(headers, input.headers);\n }\n if (init) {\n _a.mergeHeaders(headers, new Headers(init.headers));\n }\n // prepare request\n if (typeof input === 'object' && !(input instanceof url_1.URL)) {\n // input must have been a non-URL object\n return this.request({ ...init, ...input, headers, url });\n }\n else {\n // input must have been a string or URL\n return this.request({ ...init, headers, url });\n }\n }\n /**\n * Perform an HTTP request with the given options.\n * @param opts Set of HTTP options that will be used for this HTTP request.\n */\n async request(opts = {}) {\n let prepared = await this.#prepareRequest(opts);\n prepared = await this.#applyRequestInterceptors(prepared);\n return this.#applyResponseInterceptors(this._request(prepared));\n }\n async _defaultAdapter(config) {\n const fetchImpl = config.fetchImplementation ||\n this.defaults.fetchImplementation ||\n (await _a.#getFetch());\n // node-fetch v3 warns when `data` is present\n // https://github.com/node-fetch/node-fetch/issues/1000\n const preparedOpts = { ...config };\n delete preparedOpts.data;\n const res = (await fetchImpl(config.url, preparedOpts));\n const data = await this.getResponseData(config, res);\n if (!Object.getOwnPropertyDescriptor(res, 'data')?.configurable) {\n // Work-around for `node-fetch` v3 as accessing `data` would otherwise throw\n Object.defineProperties(res, {\n data: {\n configurable: true,\n writable: true,\n enumerable: true,\n value: data,\n },\n });\n }\n // Keep object as an instance of `Response`\n return Object.assign(res, { config, data });\n }\n /**\n * Internal, retryable version of the `request` method.\n * @param opts Set of HTTP options that will be used for this HTTP request.\n */\n async _request(opts) {\n try {\n let translatedResponse;\n if (opts.adapter) {\n translatedResponse = await opts.adapter(opts, this._defaultAdapter.bind(this));\n }\n else {\n translatedResponse = await this._defaultAdapter(opts);\n }\n if (!opts.validateStatus(translatedResponse.status)) {\n if (opts.responseType === 'stream') {\n const response = [];\n for await (const chunk of opts.data) {\n response.push(chunk);\n }\n translatedResponse.data = response;\n }\n throw new common_js_1.GaxiosError(`Request failed with status code ${translatedResponse.status}`, opts, translatedResponse);\n }\n return translatedResponse;\n }\n catch (e) {\n const err = e instanceof common_js_1.GaxiosError\n ? e\n : new common_js_1.GaxiosError(e.message, opts, undefined, e);\n const { shouldRetry, config } = await (0, retry_js_1.getRetryConfig)(err);\n if (shouldRetry && config) {\n err.config.retryConfig.currentRetryAttempt =\n config.retryConfig.currentRetryAttempt;\n // The error's config could be redacted - therefore we only want to\n // copy the retry state over to the existing config\n opts.retryConfig = err.config?.retryConfig;\n // re-prepare timeout for the next request\n this.#appendTimeoutToSignal(opts);\n return this._request(opts);\n }\n if (opts.errorRedactor) {\n opts.errorRedactor(err);\n }\n throw err;\n }\n }\n async getResponseData(opts, res) {\n if (opts.maxContentLength &&\n res.headers.has('content-length') &&\n opts.maxContentLength <\n Number.parseInt(res.headers?.get('content-length') || '')) {\n throw new common_js_1.GaxiosError(\"Response's `Content-Length` is over the limit.\", opts, Object.assign(res, { config: opts }));\n }\n switch (opts.responseType) {\n case 'stream':\n return res.body;\n case 'json':\n return res.json();\n case 'arraybuffer':\n return res.arrayBuffer();\n case 'blob':\n return res.blob();\n case 'text':\n return res.text();\n default:\n return this.getResponseDataFromContentType(res);\n }\n }\n #urlMayUseProxy(url, noProxy = []) {\n const candidate = new url_1.URL(url);\n const noProxyList = [...noProxy];\n const noProxyEnvList = (process.env.NO_PROXY ?? process.env.no_proxy)?.split(',') || [];\n for (const rule of noProxyEnvList) {\n noProxyList.push(rule.trim());\n }\n for (const rule of noProxyList) {\n // Match regex\n if (rule instanceof RegExp) {\n if (rule.test(candidate.toString())) {\n return false;\n }\n }\n // Match URL\n else if (rule instanceof url_1.URL) {\n if (rule.origin === candidate.origin) {\n return false;\n }\n }\n // Match string regex\n else if (rule.startsWith('*.') || rule.startsWith('.')) {\n const cleanedRule = rule.replace(/^\\*\\./, '.');\n if (candidate.hostname.endsWith(cleanedRule)) {\n return false;\n }\n }\n // Basic string match\n else if (rule === candidate.origin ||\n rule === candidate.hostname ||\n rule === candidate.href) {\n return false;\n }\n }\n return true;\n }\n /**\n * Applies the request interceptors. The request interceptors are applied after the\n * call to prepareRequest is completed.\n *\n * @param {GaxiosOptionsPrepared} options The current set of options.\n *\n * @returns {Promise} Promise that resolves to the set of options or response after interceptors are applied.\n */\n async #applyRequestInterceptors(options) {\n let promiseChain = Promise.resolve(options);\n for (const interceptor of this.interceptors.request.values()) {\n if (interceptor) {\n promiseChain = promiseChain.then(interceptor.resolved, interceptor.rejected);\n }\n }\n return promiseChain;\n }\n /**\n * Applies the response interceptors. The response interceptors are applied after the\n * call to request is made.\n *\n * @param {GaxiosOptionsPrepared} options The current set of options.\n *\n * @returns {Promise} Promise that resolves to the set of options or response after interceptors are applied.\n */\n async #applyResponseInterceptors(response) {\n let promiseChain = Promise.resolve(response);\n for (const interceptor of this.interceptors.response.values()) {\n if (interceptor) {\n promiseChain = promiseChain.then(interceptor.resolved, interceptor.rejected);\n }\n }\n return promiseChain;\n }\n /**\n * Validates the options, merges them with defaults, and prepare request.\n *\n * @param options The original options passed from the client.\n * @returns Prepared options, ready to make a request\n */\n async #prepareRequest(options) {\n // Prepare Headers - copy in order to not mutate the original objects\n const preparedHeaders = new Headers(this.defaults.headers);\n _a.mergeHeaders(preparedHeaders, options.headers);\n // Merge options\n const opts = (0, extend_1.default)(true, {}, this.defaults, options);\n if (!opts.url) {\n throw new Error('URL is required.');\n }\n if (opts.baseURL) {\n opts.url = new url_1.URL(opts.url, opts.baseURL);\n }\n // don't modify the properties of a default or provided URL\n opts.url = new url_1.URL(opts.url);\n if (opts.params) {\n if (opts.paramsSerializer) {\n let additionalQueryParams = opts.paramsSerializer(opts.params);\n if (additionalQueryParams.startsWith('?')) {\n additionalQueryParams = additionalQueryParams.slice(1);\n }\n const prefix = opts.url.toString().includes('?') ? '&' : '?';\n opts.url = opts.url + prefix + additionalQueryParams;\n }\n else {\n const url = opts.url instanceof url_1.URL ? opts.url : new url_1.URL(opts.url);\n for (const [key, value] of new URLSearchParams(opts.params)) {\n url.searchParams.append(key, value);\n }\n opts.url = url;\n }\n }\n if (typeof options.maxContentLength === 'number') {\n opts.size = options.maxContentLength;\n }\n if (typeof options.maxRedirects === 'number') {\n opts.follow = options.maxRedirects;\n }\n const shouldDirectlyPassData = typeof opts.data === 'string' ||\n opts.data instanceof ArrayBuffer ||\n opts.data instanceof Blob ||\n // Node 18 does not have a global `File` object\n (globalThis.File && opts.data instanceof File) ||\n opts.data instanceof FormData ||\n opts.data instanceof stream_1.Readable ||\n opts.data instanceof ReadableStream ||\n opts.data instanceof String ||\n opts.data instanceof URLSearchParams ||\n ArrayBuffer.isView(opts.data) || // `Buffer` (Node.js), `DataView`, `TypedArray`\n /**\n * @deprecated `node-fetch` or another third-party's request types\n */\n ['Blob', 'File', 'FormData'].includes(opts.data?.constructor?.name || '');\n if (opts.multipart?.length) {\n const boundary = await randomUUID();\n preparedHeaders.set('content-type', `multipart/related; boundary=${boundary}`);\n opts.body = stream_1.Readable.from(this.getMultipartRequest(opts.multipart, boundary));\n }\n else if (shouldDirectlyPassData) {\n opts.body = opts.data;\n }\n else if (typeof opts.data === 'object') {\n if (preparedHeaders.get('Content-Type') ===\n 'application/x-www-form-urlencoded') {\n // If www-form-urlencoded content type has been set, but data is\n // provided as an object, serialize the content\n opts.body = opts.paramsSerializer\n ? opts.paramsSerializer(opts.data)\n : new URLSearchParams(opts.data);\n }\n else {\n if (!preparedHeaders.has('content-type')) {\n preparedHeaders.set('content-type', 'application/json');\n }\n opts.body = JSON.stringify(opts.data);\n }\n }\n else if (opts.data) {\n opts.body = opts.data;\n }\n opts.validateStatus = opts.validateStatus || this.validateStatus;\n opts.responseType = opts.responseType || 'unknown';\n if (!preparedHeaders.has('accept') && opts.responseType === 'json') {\n preparedHeaders.set('accept', 'application/json');\n }\n const proxy = opts.proxy ||\n process?.env?.HTTPS_PROXY ||\n process?.env?.https_proxy ||\n process?.env?.HTTP_PROXY ||\n process?.env?.http_proxy;\n if (opts.agent) {\n // don't do any of the following options - use the user-provided agent.\n }\n else if (proxy && this.#urlMayUseProxy(opts.url, opts.noProxy)) {\n const HttpsProxyAgent = await _a.#getProxyAgent();\n if (this.agentCache.has(proxy)) {\n opts.agent = this.agentCache.get(proxy);\n }\n else {\n opts.agent = new HttpsProxyAgent(proxy, {\n cert: opts.cert,\n key: opts.key,\n });\n this.agentCache.set(proxy, opts.agent);\n }\n }\n else if (opts.cert && opts.key) {\n // Configure client for mTLS\n if (this.agentCache.has(opts.key)) {\n opts.agent = this.agentCache.get(opts.key);\n }\n else {\n opts.agent = new https_1.Agent({\n cert: opts.cert,\n key: opts.key,\n });\n this.agentCache.set(opts.key, opts.agent);\n }\n }\n if (typeof opts.errorRedactor !== 'function' &&\n opts.errorRedactor !== false) {\n opts.errorRedactor = common_js_1.defaultErrorRedactor;\n }\n if (opts.body && !('duplex' in opts)) {\n /**\n * required for Node.js and the type isn't available today\n * @link https://github.com/nodejs/node/issues/46221\n * @link https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1483\n */\n opts.duplex = 'half';\n }\n this.#appendTimeoutToSignal(opts);\n return Object.assign(opts, {\n headers: preparedHeaders,\n url: opts.url instanceof url_1.URL ? opts.url : new url_1.URL(opts.url),\n });\n }\n #appendTimeoutToSignal(opts) {\n if (opts.timeout) {\n const timeoutSignal = AbortSignal.timeout(opts.timeout);\n if (opts.signal && !opts.signal.aborted) {\n opts.signal = AbortSignal.any([opts.signal, timeoutSignal]);\n }\n else {\n opts.signal = timeoutSignal;\n }\n }\n }\n /**\n * By default, throw for any non-2xx status code\n * @param status status code from the HTTP response\n */\n validateStatus(status) {\n return status >= 200 && status < 300;\n }\n /**\n * Attempts to parse a response by looking at the Content-Type header.\n * @param {Response} response the HTTP response.\n * @returns {Promise} a promise that resolves to the response data.\n */\n async getResponseDataFromContentType(response) {\n let contentType = response.headers.get('Content-Type');\n if (contentType === null) {\n // Maintain existing functionality by calling text()\n return response.text();\n }\n contentType = contentType.toLowerCase();\n if (contentType.includes('application/json')) {\n let data = await response.text();\n try {\n data = JSON.parse(data);\n }\n catch {\n // continue\n }\n return data;\n }\n else if (contentType.match(/^text\\//)) {\n return response.text();\n }\n else {\n // If the content type is something not easily handled, just return the raw data (blob)\n return response.blob();\n }\n }\n /**\n * Creates an async generator that yields the pieces of a multipart/related request body.\n * This implementation follows the spec: https://www.ietf.org/rfc/rfc2387.txt. However, recursive\n * multipart/related requests are not currently supported.\n *\n * @param {GaxioMultipartOptions[]} multipartOptions the pieces to turn into a multipart/related body.\n * @param {string} boundary the boundary string to be placed between each part.\n */\n async *getMultipartRequest(multipartOptions, boundary) {\n const finale = `--${boundary}--`;\n for (const currentPart of multipartOptions) {\n const partContentType = currentPart.headers.get('Content-Type') || 'application/octet-stream';\n const preamble = `--${boundary}\\r\\nContent-Type: ${partContentType}\\r\\n\\r\\n`;\n yield preamble;\n if (typeof currentPart.content === 'string') {\n yield currentPart.content;\n }\n else {\n yield* currentPart.content;\n }\n yield '\\r\\n';\n }\n yield finale;\n }\n /**\n * A cache for the lazily-loaded proxy agent.\n *\n * Should use {@link Gaxios[#getProxyAgent]} to retrieve.\n */\n // using `import` to dynamically import the types here\n static #proxyAgent;\n /**\n * A cache for the lazily-loaded fetch library.\n *\n * Should use {@link Gaxios[#getFetch]} to retrieve.\n */\n //\n static #fetch;\n /**\n * Imports, caches, and returns a proxy agent - if not already imported\n *\n * @returns A proxy agent\n */\n static async #getProxyAgent() {\n this.#proxyAgent ||= (await import('https-proxy-agent')).HttpsProxyAgent;\n return this.#proxyAgent;\n }\n static async #getFetch() {\n const hasWindow = typeof window !== 'undefined' && !!window;\n this.#fetch ||= hasWindow\n ? window.fetch\n : (await import('node-fetch')).default;\n return this.#fetch;\n }\n /**\n * Merges headers.\n *\n * @param base headers to append/overwrite to\n * @param append headers to append/overwrite with\n * @returns the base headers instance with merged `Headers`\n */\n static mergeHeaders(base, ...append) {\n base = base instanceof Headers ? base : new Headers(base);\n for (const headers of append) {\n const add = headers instanceof Headers ? headers : new Headers(headers);\n add.forEach((value, key) => {\n // set-cookie is the only header that would repeat.\n // A bit of background: https://developer.mozilla.org/en-US/docs/Web/API/Headers/getSetCookie\n key === 'set-cookie' ? base.append(key, value) : base.set(key, value);\n });\n }\n return base;\n }\n}\nexports.Gaxios = Gaxios;\n_a = Gaxios;\n//# sourceMappingURL=gaxios.js.map","\"use strict\";\n// Copyright 2018 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.instance = exports.Gaxios = exports.GaxiosError = void 0;\nexports.request = request;\nconst gaxios_js_1 = require(\"./gaxios.js\");\nObject.defineProperty(exports, \"Gaxios\", { enumerable: true, get: function () { return gaxios_js_1.Gaxios; } });\nvar common_js_1 = require(\"./common.js\");\nObject.defineProperty(exports, \"GaxiosError\", { enumerable: true, get: function () { return common_js_1.GaxiosError; } });\n__exportStar(require(\"./interceptor.js\"), exports);\n/**\n * The default instance used when the `request` method is directly\n * invoked.\n */\nexports.instance = new gaxios_js_1.Gaxios();\n/**\n * Make an HTTP request using the given options.\n * @param opts Options for the request\n */\nasync function request(opts) {\n return exports.instance.request(opts);\n}\n//# sourceMappingURL=index.js.map",";(function (globalObject) {\r\n 'use strict';\r\n\r\n/*\r\n * bignumber.js v9.3.0\r\n * A JavaScript library for arbitrary-precision arithmetic.\r\n * https://github.com/MikeMcl/bignumber.js\r\n * Copyright (c) 2025 Michael Mclaughlin \r\n * MIT Licensed.\r\n *\r\n * BigNumber.prototype methods | BigNumber methods\r\n * |\r\n * absoluteValue abs | clone\r\n * comparedTo | config set\r\n * decimalPlaces dp | DECIMAL_PLACES\r\n * dividedBy div | ROUNDING_MODE\r\n * dividedToIntegerBy idiv | EXPONENTIAL_AT\r\n * exponentiatedBy pow | RANGE\r\n * integerValue | CRYPTO\r\n * isEqualTo eq | MODULO_MODE\r\n * isFinite | POW_PRECISION\r\n * isGreaterThan gt | FORMAT\r\n * isGreaterThanOrEqualTo gte | ALPHABET\r\n * isInteger | isBigNumber\r\n * isLessThan lt | maximum max\r\n * isLessThanOrEqualTo lte | minimum min\r\n * isNaN | random\r\n * isNegative | sum\r\n * isPositive |\r\n * isZero |\r\n * minus |\r\n * modulo mod |\r\n * multipliedBy times |\r\n * negated |\r\n * plus |\r\n * precision sd |\r\n * shiftedBy |\r\n * squareRoot sqrt |\r\n * toExponential |\r\n * toFixed |\r\n * toFormat |\r\n * toFraction |\r\n * toJSON |\r\n * toNumber |\r\n * toPrecision |\r\n * toString |\r\n * valueOf |\r\n *\r\n */\r\n\r\n\r\n var BigNumber,\r\n isNumeric = /^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?$/i,\r\n mathceil = Math.ceil,\r\n mathfloor = Math.floor,\r\n\r\n bignumberError = '[BigNumber Error] ',\r\n tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ',\r\n\r\n BASE = 1e14,\r\n LOG_BASE = 14,\r\n MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1\r\n // MAX_INT32 = 0x7fffffff, // 2^31 - 1\r\n POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],\r\n SQRT_BASE = 1e7,\r\n\r\n // EDITABLE\r\n // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and\r\n // the arguments to toExponential, toFixed, toFormat, and toPrecision.\r\n MAX = 1E9; // 0 to MAX_INT32\r\n\r\n\r\n /*\r\n * Create and return a BigNumber constructor.\r\n */\r\n function clone(configObject) {\r\n var div, convertBase, parseNumeric,\r\n P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null },\r\n ONE = new BigNumber(1),\r\n\r\n\r\n //----------------------------- EDITABLE CONFIG DEFAULTS -------------------------------\r\n\r\n\r\n // The default values below must be integers within the inclusive ranges stated.\r\n // The values can also be changed at run-time using BigNumber.set.\r\n\r\n // The maximum number of decimal places for operations involving division.\r\n DECIMAL_PLACES = 20, // 0 to MAX\r\n\r\n // The rounding mode used when rounding to the above decimal places, and when using\r\n // toExponential, toFixed, toFormat and toPrecision, and round (default value).\r\n // UP 0 Away from zero.\r\n // DOWN 1 Towards zero.\r\n // CEIL 2 Towards +Infinity.\r\n // FLOOR 3 Towards -Infinity.\r\n // HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n ROUNDING_MODE = 4, // 0 to 8\r\n\r\n // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS]\r\n\r\n // The exponent value at and beneath which toString returns exponential notation.\r\n // Number type: -7\r\n TO_EXP_NEG = -7, // 0 to -MAX\r\n\r\n // The exponent value at and above which toString returns exponential notation.\r\n // Number type: 21\r\n TO_EXP_POS = 21, // 0 to MAX\r\n\r\n // RANGE : [MIN_EXP, MAX_EXP]\r\n\r\n // The minimum exponent value, beneath which underflow to zero occurs.\r\n // Number type: -324 (5e-324)\r\n MIN_EXP = -1e7, // -1 to -MAX\r\n\r\n // The maximum exponent value, above which overflow to Infinity occurs.\r\n // Number type: 308 (1.7976931348623157e+308)\r\n // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow.\r\n MAX_EXP = 1e7, // 1 to MAX\r\n\r\n // Whether to use cryptographically-secure random number generation, if available.\r\n CRYPTO = false, // true or false\r\n\r\n // The modulo mode used when calculating the modulus: a mod n.\r\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n // The remainder (r) is calculated as: r = a - n * q.\r\n //\r\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\r\n // DOWN 1 The remainder has the same sign as the dividend.\r\n // This modulo mode is commonly known as 'truncated division' and is\r\n // equivalent to (a % n) in JavaScript.\r\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\r\n // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function.\r\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)).\r\n // The remainder is always positive.\r\n //\r\n // The truncated division, floored division, Euclidian division and IEEE 754 remainder\r\n // modes are commonly used for the modulus operation.\r\n // Although the other rounding modes can also be used, they may not give useful results.\r\n MODULO_MODE = 1, // 0 to 9\r\n\r\n // The maximum number of significant digits of the result of the exponentiatedBy operation.\r\n // If POW_PRECISION is 0, there will be unlimited significant digits.\r\n POW_PRECISION = 0, // 0 to MAX\r\n\r\n // The format specification used by the BigNumber.prototype.toFormat method.\r\n FORMAT = {\r\n prefix: '',\r\n groupSize: 3,\r\n secondaryGroupSize: 0,\r\n groupSeparator: ',',\r\n decimalSeparator: '.',\r\n fractionGroupSize: 0,\r\n fractionGroupSeparator: '\\xA0', // non-breaking space\r\n suffix: ''\r\n },\r\n\r\n // The alphabet used for base conversion. It must be at least 2 characters long, with no '+',\r\n // '-', '.', whitespace, or repeated character.\r\n // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_'\r\n ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz',\r\n alphabetHasNormalDecimalDigits = true;\r\n\r\n\r\n //------------------------------------------------------------------------------------------\r\n\r\n\r\n // CONSTRUCTOR\r\n\r\n\r\n /*\r\n * The BigNumber constructor and exported function.\r\n * Create and return a new instance of a BigNumber object.\r\n *\r\n * v {number|string|BigNumber} A numeric value.\r\n * [b] {number} The base of v. Integer, 2 to ALPHABET.length inclusive.\r\n */\r\n function BigNumber(v, b) {\r\n var alphabet, c, caseChanged, e, i, isNum, len, str,\r\n x = this;\r\n\r\n // Enable constructor call without `new`.\r\n if (!(x instanceof BigNumber)) return new BigNumber(v, b);\r\n\r\n if (b == null) {\r\n\r\n if (v && v._isBigNumber === true) {\r\n x.s = v.s;\r\n\r\n if (!v.c || v.e > MAX_EXP) {\r\n x.c = x.e = null;\r\n } else if (v.e < MIN_EXP) {\r\n x.c = [x.e = 0];\r\n } else {\r\n x.e = v.e;\r\n x.c = v.c.slice();\r\n }\r\n\r\n return;\r\n }\r\n\r\n if ((isNum = typeof v == 'number') && v * 0 == 0) {\r\n\r\n // Use `1 / n` to handle minus zero also.\r\n x.s = 1 / v < 0 ? (v = -v, -1) : 1;\r\n\r\n // Fast path for integers, where n < 2147483648 (2**31).\r\n if (v === ~~v) {\r\n for (e = 0, i = v; i >= 10; i /= 10, e++);\r\n\r\n if (e > MAX_EXP) {\r\n x.c = x.e = null;\r\n } else {\r\n x.e = e;\r\n x.c = [v];\r\n }\r\n\r\n return;\r\n }\r\n\r\n str = String(v);\r\n } else {\r\n\r\n if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);\r\n\r\n x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;\r\n }\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n } else {\r\n\r\n // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r\n intCheck(b, 2, ALPHABET.length, 'Base');\r\n\r\n // Allow exponential notation to be used with base 10 argument, while\r\n // also rounding to DECIMAL_PLACES as with other bases.\r\n if (b == 10 && alphabetHasNormalDecimalDigits) {\r\n x = new BigNumber(v);\r\n return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);\r\n }\r\n\r\n str = String(v);\r\n\r\n if (isNum = typeof v == 'number') {\r\n\r\n // Avoid potential interpretation of Infinity and NaN as base 44+ values.\r\n if (v * 0 != 0) return parseNumeric(x, str, isNum, b);\r\n\r\n x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;\r\n\r\n // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r\n if (BigNumber.DEBUG && str.replace(/^0\\.0*|\\./, '').length > 15) {\r\n throw Error\r\n (tooManyDigits + v);\r\n }\r\n } else {\r\n x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;\r\n }\r\n\r\n alphabet = ALPHABET.slice(0, b);\r\n e = i = 0;\r\n\r\n // Check that str is a valid base b number.\r\n // Don't use RegExp, so alphabet can contain special characters.\r\n for (len = str.length; i < len; i++) {\r\n if (alphabet.indexOf(c = str.charAt(i)) < 0) {\r\n if (c == '.') {\r\n\r\n // If '.' is not the first character and it has not be found before.\r\n if (i > e) {\r\n e = len;\r\n continue;\r\n }\r\n } else if (!caseChanged) {\r\n\r\n // Allow e.g. hexadecimal 'FF' as well as 'ff'.\r\n if (str == str.toUpperCase() && (str = str.toLowerCase()) ||\r\n str == str.toLowerCase() && (str = str.toUpperCase())) {\r\n caseChanged = true;\r\n i = -1;\r\n e = 0;\r\n continue;\r\n }\r\n }\r\n\r\n return parseNumeric(x, String(v), isNum, b);\r\n }\r\n }\r\n\r\n // Prevent later check for length on converted number.\r\n isNum = false;\r\n str = convertBase(str, b, 10, x.s);\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n else e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(--len) === 48;);\r\n\r\n if (str = str.slice(i, ++len)) {\r\n len -= i;\r\n\r\n // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r\n if (isNum && BigNumber.DEBUG &&\r\n len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {\r\n throw Error\r\n (tooManyDigits + (x.s * v));\r\n }\r\n\r\n // Overflow?\r\n if ((e = e - i - 1) > MAX_EXP) {\r\n\r\n // Infinity.\r\n x.c = x.e = null;\r\n\r\n // Underflow?\r\n } else if (e < MIN_EXP) {\r\n\r\n // Zero.\r\n x.c = [x.e = 0];\r\n } else {\r\n x.e = e;\r\n x.c = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first element of the coefficient array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE; // i < 1\r\n\r\n if (i < len) {\r\n if (i) x.c.push(+str.slice(0, i));\r\n\r\n for (len -= LOG_BASE; i < len;) {\r\n x.c.push(+str.slice(i, i += LOG_BASE));\r\n }\r\n\r\n i = LOG_BASE - (str = str.slice(i)).length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--; str += '0');\r\n x.c.push(+str);\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.c = [x.e = 0];\r\n }\r\n }\r\n\r\n\r\n // CONSTRUCTOR PROPERTIES\r\n\r\n\r\n BigNumber.clone = clone;\r\n\r\n BigNumber.ROUND_UP = 0;\r\n BigNumber.ROUND_DOWN = 1;\r\n BigNumber.ROUND_CEIL = 2;\r\n BigNumber.ROUND_FLOOR = 3;\r\n BigNumber.ROUND_HALF_UP = 4;\r\n BigNumber.ROUND_HALF_DOWN = 5;\r\n BigNumber.ROUND_HALF_EVEN = 6;\r\n BigNumber.ROUND_HALF_CEIL = 7;\r\n BigNumber.ROUND_HALF_FLOOR = 8;\r\n BigNumber.EUCLID = 9;\r\n\r\n\r\n /*\r\n * Configure infrequently-changing library-wide settings.\r\n *\r\n * Accept an object with the following optional properties (if the value of a property is\r\n * a number, it must be an integer within the inclusive range stated):\r\n *\r\n * DECIMAL_PLACES {number} 0 to MAX\r\n * ROUNDING_MODE {number} 0 to 8\r\n * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX]\r\n * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX]\r\n * CRYPTO {boolean} true or false\r\n * MODULO_MODE {number} 0 to 9\r\n * POW_PRECISION {number} 0 to MAX\r\n * ALPHABET {string} A string of two or more unique characters which does\r\n * not contain '.'.\r\n * FORMAT {object} An object with some of the following properties:\r\n * prefix {string}\r\n * groupSize {number}\r\n * secondaryGroupSize {number}\r\n * groupSeparator {string}\r\n * decimalSeparator {string}\r\n * fractionGroupSize {number}\r\n * fractionGroupSeparator {string}\r\n * suffix {string}\r\n *\r\n * (The values assigned to the above FORMAT object properties are not checked for validity.)\r\n *\r\n * E.g.\r\n * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 })\r\n *\r\n * Ignore properties/parameters set to null or undefined, except for ALPHABET.\r\n *\r\n * Return an object with the properties current values.\r\n */\r\n BigNumber.config = BigNumber.set = function (obj) {\r\n var p, v;\r\n\r\n if (obj != null) {\r\n\r\n if (typeof obj == 'object') {\r\n\r\n // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive.\r\n // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) {\r\n v = obj[p];\r\n intCheck(v, 0, MAX, p);\r\n DECIMAL_PLACES = v;\r\n }\r\n\r\n // ROUNDING_MODE {number} Integer, 0 to 8 inclusive.\r\n // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) {\r\n v = obj[p];\r\n intCheck(v, 0, 8, p);\r\n ROUNDING_MODE = v;\r\n }\r\n\r\n // EXPONENTIAL_AT {number|number[]}\r\n // Integer, -MAX to MAX inclusive or\r\n // [integer -MAX to 0 inclusive, 0 to MAX inclusive].\r\n // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) {\r\n v = obj[p];\r\n if (v && v.pop) {\r\n intCheck(v[0], -MAX, 0, p);\r\n intCheck(v[1], 0, MAX, p);\r\n TO_EXP_NEG = v[0];\r\n TO_EXP_POS = v[1];\r\n } else {\r\n intCheck(v, -MAX, MAX, p);\r\n TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);\r\n }\r\n }\r\n\r\n // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or\r\n // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive].\r\n // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}'\r\n if (obj.hasOwnProperty(p = 'RANGE')) {\r\n v = obj[p];\r\n if (v && v.pop) {\r\n intCheck(v[0], -MAX, -1, p);\r\n intCheck(v[1], 1, MAX, p);\r\n MIN_EXP = v[0];\r\n MAX_EXP = v[1];\r\n } else {\r\n intCheck(v, -MAX, MAX, p);\r\n if (v) {\r\n MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' cannot be zero: ' + v);\r\n }\r\n }\r\n }\r\n\r\n // CRYPTO {boolean} true or false.\r\n // '[BigNumber Error] CRYPTO not true or false: {v}'\r\n // '[BigNumber Error] crypto unavailable'\r\n if (obj.hasOwnProperty(p = 'CRYPTO')) {\r\n v = obj[p];\r\n if (v === !!v) {\r\n if (v) {\r\n if (typeof crypto != 'undefined' && crypto &&\r\n (crypto.getRandomValues || crypto.randomBytes)) {\r\n CRYPTO = v;\r\n } else {\r\n CRYPTO = !v;\r\n throw Error\r\n (bignumberError + 'crypto unavailable');\r\n }\r\n } else {\r\n CRYPTO = v;\r\n }\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' not true or false: ' + v);\r\n }\r\n }\r\n\r\n // MODULO_MODE {number} Integer, 0 to 9 inclusive.\r\n // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'MODULO_MODE')) {\r\n v = obj[p];\r\n intCheck(v, 0, 9, p);\r\n MODULO_MODE = v;\r\n }\r\n\r\n // POW_PRECISION {number} Integer, 0 to MAX inclusive.\r\n // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'POW_PRECISION')) {\r\n v = obj[p];\r\n intCheck(v, 0, MAX, p);\r\n POW_PRECISION = v;\r\n }\r\n\r\n // FORMAT {object}\r\n // '[BigNumber Error] FORMAT not an object: {v}'\r\n if (obj.hasOwnProperty(p = 'FORMAT')) {\r\n v = obj[p];\r\n if (typeof v == 'object') FORMAT = v;\r\n else throw Error\r\n (bignumberError + p + ' not an object: ' + v);\r\n }\r\n\r\n // ALPHABET {string}\r\n // '[BigNumber Error] ALPHABET invalid: {v}'\r\n if (obj.hasOwnProperty(p = 'ALPHABET')) {\r\n v = obj[p];\r\n\r\n // Disallow if less than two characters,\r\n // or if it contains '+', '-', '.', whitespace, or a repeated character.\r\n if (typeof v == 'string' && !/^.?$|[+\\-.\\s]|(.).*\\1/.test(v)) {\r\n alphabetHasNormalDecimalDigits = v.slice(0, 10) == '0123456789';\r\n ALPHABET = v;\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' invalid: ' + v);\r\n }\r\n }\r\n\r\n } else {\r\n\r\n // '[BigNumber Error] Object expected: {v}'\r\n throw Error\r\n (bignumberError + 'Object expected: ' + obj);\r\n }\r\n }\r\n\r\n return {\r\n DECIMAL_PLACES: DECIMAL_PLACES,\r\n ROUNDING_MODE: ROUNDING_MODE,\r\n EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],\r\n RANGE: [MIN_EXP, MAX_EXP],\r\n CRYPTO: CRYPTO,\r\n MODULO_MODE: MODULO_MODE,\r\n POW_PRECISION: POW_PRECISION,\r\n FORMAT: FORMAT,\r\n ALPHABET: ALPHABET\r\n };\r\n };\r\n\r\n\r\n /*\r\n * Return true if v is a BigNumber instance, otherwise return false.\r\n *\r\n * If BigNumber.DEBUG is true, throw if a BigNumber instance is not well-formed.\r\n *\r\n * v {any}\r\n *\r\n * '[BigNumber Error] Invalid BigNumber: {v}'\r\n */\r\n BigNumber.isBigNumber = function (v) {\r\n if (!v || v._isBigNumber !== true) return false;\r\n if (!BigNumber.DEBUG) return true;\r\n\r\n var i, n,\r\n c = v.c,\r\n e = v.e,\r\n s = v.s;\r\n\r\n out: if ({}.toString.call(c) == '[object Array]') {\r\n\r\n if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {\r\n\r\n // If the first element is zero, the BigNumber value must be zero.\r\n if (c[0] === 0) {\r\n if (e === 0 && c.length === 1) return true;\r\n break out;\r\n }\r\n\r\n // Calculate number of digits that c[0] should have, based on the exponent.\r\n i = (e + 1) % LOG_BASE;\r\n if (i < 1) i += LOG_BASE;\r\n\r\n // Calculate number of digits of c[0].\r\n //if (Math.ceil(Math.log(c[0] + 1) / Math.LN10) == i) {\r\n if (String(c[0]).length == i) {\r\n\r\n for (i = 0; i < c.length; i++) {\r\n n = c[i];\r\n if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;\r\n }\r\n\r\n // Last element cannot be zero, unless it is the only element.\r\n if (n !== 0) return true;\r\n }\r\n }\r\n\r\n // Infinity/NaN\r\n } else if (c === null && e === null && (s === null || s === 1 || s === -1)) {\r\n return true;\r\n }\r\n\r\n throw Error\r\n (bignumberError + 'Invalid BigNumber: ' + v);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the maximum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.maximum = BigNumber.max = function () {\r\n return maxOrMin(arguments, -1);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the minimum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.minimum = BigNumber.min = function () {\r\n return maxOrMin(arguments, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber with a random value equal to or greater than 0 and less than 1,\r\n * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing\r\n * zeros are produced).\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}'\r\n * '[BigNumber Error] crypto unavailable'\r\n */\r\n BigNumber.random = (function () {\r\n var pow2_53 = 0x20000000000000;\r\n\r\n // Return a 53 bit integer n, where 0 <= n < 9007199254740992.\r\n // Check if Math.random() produces more than 32 bits of randomness.\r\n // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits.\r\n // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1.\r\n var random53bitInt = (Math.random() * pow2_53) & 0x1fffff\r\n ? function () { return mathfloor(Math.random() * pow2_53); }\r\n : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) +\r\n (Math.random() * 0x800000 | 0); };\r\n\r\n return function (dp) {\r\n var a, b, e, k, v,\r\n i = 0,\r\n c = [],\r\n rand = new BigNumber(ONE);\r\n\r\n if (dp == null) dp = DECIMAL_PLACES;\r\n else intCheck(dp, 0, MAX);\r\n\r\n k = mathceil(dp / LOG_BASE);\r\n\r\n if (CRYPTO) {\r\n\r\n // Browsers supporting crypto.getRandomValues.\r\n if (crypto.getRandomValues) {\r\n\r\n a = crypto.getRandomValues(new Uint32Array(k *= 2));\r\n\r\n for (; i < k;) {\r\n\r\n // 53 bits:\r\n // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2)\r\n // 11111 11111111 11111111 11111111 11100000 00000000 00000000\r\n // ((Math.pow(2, 32) - 1) >>> 11).toString(2)\r\n // 11111 11111111 11111111\r\n // 0x20000 is 2^21.\r\n v = a[i] * 0x20000 + (a[i + 1] >>> 11);\r\n\r\n // Rejection sampling:\r\n // 0 <= v < 9007199254740992\r\n // Probability that v >= 9e15, is\r\n // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251\r\n if (v >= 9e15) {\r\n b = crypto.getRandomValues(new Uint32Array(2));\r\n a[i] = b[0];\r\n a[i + 1] = b[1];\r\n } else {\r\n\r\n // 0 <= v <= 8999999999999999\r\n // 0 <= (v % 1e14) <= 99999999999999\r\n c.push(v % 1e14);\r\n i += 2;\r\n }\r\n }\r\n i = k / 2;\r\n\r\n // Node.js supporting crypto.randomBytes.\r\n } else if (crypto.randomBytes) {\r\n\r\n // buffer\r\n a = crypto.randomBytes(k *= 7);\r\n\r\n for (; i < k;) {\r\n\r\n // 0x1000000000000 is 2^48, 0x10000000000 is 2^40\r\n // 0x100000000 is 2^32, 0x1000000 is 2^24\r\n // 11111 11111111 11111111 11111111 11111111 11111111 11111111\r\n // 0 <= v < 9007199254740992\r\n v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) +\r\n (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) +\r\n (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6];\r\n\r\n if (v >= 9e15) {\r\n crypto.randomBytes(7).copy(a, i);\r\n } else {\r\n\r\n // 0 <= (v % 1e14) <= 99999999999999\r\n c.push(v % 1e14);\r\n i += 7;\r\n }\r\n }\r\n i = k / 7;\r\n } else {\r\n CRYPTO = false;\r\n throw Error\r\n (bignumberError + 'crypto unavailable');\r\n }\r\n }\r\n\r\n // Use Math.random.\r\n if (!CRYPTO) {\r\n\r\n for (; i < k;) {\r\n v = random53bitInt();\r\n if (v < 9e15) c[i++] = v % 1e14;\r\n }\r\n }\r\n\r\n k = c[--i];\r\n dp %= LOG_BASE;\r\n\r\n // Convert trailing digits to zeros according to dp.\r\n if (k && dp) {\r\n v = POWS_TEN[LOG_BASE - dp];\r\n c[i] = mathfloor(k / v) * v;\r\n }\r\n\r\n // Remove trailing elements which are zero.\r\n for (; c[i] === 0; c.pop(), i--);\r\n\r\n // Zero?\r\n if (i < 0) {\r\n c = [e = 0];\r\n } else {\r\n\r\n // Remove leading elements which are zero and adjust exponent accordingly.\r\n for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE);\r\n\r\n // Count the digits of the first element of c to determine leading zeros, and...\r\n for (i = 1, v = c[0]; v >= 10; v /= 10, i++);\r\n\r\n // adjust the exponent accordingly.\r\n if (i < LOG_BASE) e -= LOG_BASE - i;\r\n }\r\n\r\n rand.e = e;\r\n rand.c = c;\r\n return rand;\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a BigNumber whose value is the sum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.sum = function () {\r\n var i = 1,\r\n args = arguments,\r\n sum = new BigNumber(args[0]);\r\n for (; i < args.length;) sum = sum.plus(args[i++]);\r\n return sum;\r\n };\r\n\r\n\r\n // PRIVATE FUNCTIONS\r\n\r\n\r\n // Called by BigNumber and BigNumber.prototype.toString.\r\n convertBase = (function () {\r\n var decimal = '0123456789';\r\n\r\n /*\r\n * Convert string of baseIn to an array of numbers of baseOut.\r\n * Eg. toBaseOut('255', 10, 16) returns [15, 15].\r\n * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5].\r\n */\r\n function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }\r\n\r\n // Convert a numeric string of baseIn to a numeric string of baseOut.\r\n // If the caller is toString, we are converting from base 10 to baseOut.\r\n // If the caller is BigNumber, we are converting from baseIn to base 10.\r\n return function (str, baseIn, baseOut, sign, callerIsToString) {\r\n var alphabet, d, e, k, r, x, xc, y,\r\n i = str.indexOf('.'),\r\n dp = DECIMAL_PLACES,\r\n rm = ROUNDING_MODE;\r\n\r\n // Non-integer.\r\n if (i >= 0) {\r\n k = POW_PRECISION;\r\n\r\n // Unlimited precision.\r\n POW_PRECISION = 0;\r\n str = str.replace('.', '');\r\n y = new BigNumber(baseIn);\r\n x = y.pow(str.length - i);\r\n POW_PRECISION = k;\r\n\r\n // Convert str as if an integer, then restore the fraction part by dividing the\r\n // result by its base raised to a power.\r\n\r\n y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'),\r\n 10, baseOut, decimal);\r\n y.e = y.c.length;\r\n }\r\n\r\n // Convert the number as integer.\r\n\r\n xc = toBaseOut(str, baseIn, baseOut, callerIsToString\r\n ? (alphabet = ALPHABET, decimal)\r\n : (alphabet = decimal, ALPHABET));\r\n\r\n // xc now represents str as an integer and converted to baseOut. e is the exponent.\r\n e = k = xc.length;\r\n\r\n // Remove trailing zeros.\r\n for (; xc[--k] == 0; xc.pop());\r\n\r\n // Zero?\r\n if (!xc[0]) return alphabet.charAt(0);\r\n\r\n // Does str represent an integer? If so, no need for the division.\r\n if (i < 0) {\r\n --e;\r\n } else {\r\n x.c = xc;\r\n x.e = e;\r\n\r\n // The sign is needed for correct rounding.\r\n x.s = sign;\r\n x = div(x, y, dp, rm, baseOut);\r\n xc = x.c;\r\n r = x.r;\r\n e = x.e;\r\n }\r\n\r\n // xc now represents str converted to baseOut.\r\n\r\n // The index of the rounding digit.\r\n d = e + dp + 1;\r\n\r\n // The rounding digit: the digit to the right of the digit that may be rounded up.\r\n i = xc[d];\r\n\r\n // Look at the rounding digits and mode to determine whether to round up.\r\n\r\n k = baseOut / 2;\r\n r = r || d < 0 || xc[d + 1] != null;\r\n\r\n r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n // If the index of the rounding digit is not greater than zero, or xc represents\r\n // zero, then the result of the base conversion is zero or, if rounding up, a value\r\n // such as 0.00001.\r\n if (d < 1 || !xc[0]) {\r\n\r\n // 1^-dp or 0\r\n str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);\r\n } else {\r\n\r\n // Truncate xc to the required number of decimal places.\r\n xc.length = d;\r\n\r\n // Round up?\r\n if (r) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for (--baseOut; ++xc[--d] > baseOut;) {\r\n xc[d] = 0;\r\n\r\n if (!d) {\r\n ++e;\r\n xc = [1].concat(xc);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (k = xc.length; !xc[--k];);\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++]));\r\n\r\n // Add leading zeros, decimal point and trailing zeros as required.\r\n str = toFixedPoint(str, e, alphabet.charAt(0));\r\n }\r\n\r\n // The caller will add the sign.\r\n return str;\r\n };\r\n })();\r\n\r\n\r\n // Perform division in the specified base. Called by div and convertBase.\r\n div = (function () {\r\n\r\n // Assume non-zero x and k.\r\n function multiply(x, k, base) {\r\n var m, temp, xlo, xhi,\r\n carry = 0,\r\n i = x.length,\r\n klo = k % SQRT_BASE,\r\n khi = k / SQRT_BASE | 0;\r\n\r\n for (x = x.slice(); i--;) {\r\n xlo = x[i] % SQRT_BASE;\r\n xhi = x[i] / SQRT_BASE | 0;\r\n m = khi * xlo + xhi * klo;\r\n temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry;\r\n carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;\r\n x[i] = temp % base;\r\n }\r\n\r\n if (carry) x = [carry].concat(x);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, cmp;\r\n\r\n if (aL != bL) {\r\n cmp = aL > bL ? 1 : -1;\r\n } else {\r\n\r\n for (i = cmp = 0; i < aL; i++) {\r\n\r\n if (a[i] != b[i]) {\r\n cmp = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return cmp;\r\n }\r\n\r\n function subtract(a, b, aL, base) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * base + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1; a.splice(0, 1));\r\n }\r\n\r\n // x: dividend, y: divisor.\r\n return function (x, y, dp, rm, base) {\r\n var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0,\r\n yL, yz,\r\n s = x.s == y.s ? 1 : -1,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n // Either NaN, Infinity or 0?\r\n if (!xc || !xc[0] || !yc || !yc[0]) {\r\n\r\n return new BigNumber(\r\n\r\n // Return NaN if either NaN, or both Infinity or 0.\r\n !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN :\r\n\r\n // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.\r\n xc && xc[0] == 0 || !yc ? s * 0 : s / 0\r\n );\r\n }\r\n\r\n q = new BigNumber(s);\r\n qc = q.c = [];\r\n e = x.e - y.e;\r\n s = dp + e + 1;\r\n\r\n if (!base) {\r\n base = BASE;\r\n e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);\r\n s = s / LOG_BASE | 0;\r\n }\r\n\r\n // Result exponent may be one less then the current value of e.\r\n // The coefficients of the BigNumbers from convertBase may have trailing zeros.\r\n for (i = 0; yc[i] == (xc[i] || 0); i++);\r\n\r\n if (yc[i] > (xc[i] || 0)) e--;\r\n\r\n if (s < 0) {\r\n qc.push(1);\r\n more = true;\r\n } else {\r\n xL = xc.length;\r\n yL = yc.length;\r\n i = 0;\r\n s += 2;\r\n\r\n // Normalise xc and yc so highest order digit of yc is >= base / 2.\r\n\r\n n = mathfloor(base / (yc[0] + 1));\r\n\r\n // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1.\r\n // if (n > 1 || n++ == 1 && yc[0] < base / 2) {\r\n if (n > 1) {\r\n yc = multiply(yc, n, base);\r\n xc = multiply(xc, n, base);\r\n yL = yc.length;\r\n xL = xc.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xc.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL; rem[remL++] = 0);\r\n yz = yc.slice();\r\n yz = [0].concat(yz);\r\n yc0 = yc[0];\r\n if (yc[1] >= base / 2) yc0++;\r\n // Not necessary, but to prevent trial digit n > base, when using base 3.\r\n // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15;\r\n\r\n do {\r\n n = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yc, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, n.\r\n\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n // n is how many times the divisor goes into the current remainder.\r\n n = mathfloor(rem0 / yc0);\r\n\r\n // Algorithm:\r\n // product = divisor multiplied by trial digit (n).\r\n // Compare product and remainder.\r\n // If product is greater than remainder:\r\n // Subtract divisor from product, decrement trial digit.\r\n // Subtract product from remainder.\r\n // If product was less than remainder at the last compare:\r\n // Compare new remainder and divisor.\r\n // If remainder is greater than divisor:\r\n // Subtract divisor from remainder, increment trial digit.\r\n\r\n if (n > 1) {\r\n\r\n // n may be > base only when base is 3.\r\n if (n >= base) n = base - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiply(yc, n, base);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n // If product > remainder then trial digit n too high.\r\n // n is 1 too high about 5% of the time, and is not known to have\r\n // ever been more than 1 too high.\r\n while (compare(prod, rem, prodL, remL) == 1) {\r\n n--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yc, prodL, base);\r\n prodL = prod.length;\r\n cmp = 1;\r\n }\r\n } else {\r\n\r\n // n is 0 or 1, cmp is -1.\r\n // If n is 0, there is no need to compare yc and rem again below,\r\n // so change cmp to 1 to avoid it.\r\n // If n is 1, leave cmp as -1, so yc and rem are compared again.\r\n if (n == 0) {\r\n\r\n // divisor < remainder, so n must be at least 1.\r\n cmp = n = 1;\r\n }\r\n\r\n // product = divisor\r\n prod = yc.slice();\r\n prodL = prod.length;\r\n }\r\n\r\n if (prodL < remL) prod = [0].concat(prod);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL, base);\r\n remL = rem.length;\r\n\r\n // If product was < remainder.\r\n if (cmp == -1) {\r\n\r\n // Compare divisor and new remainder.\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n // Trial digit n too low.\r\n // n is 1 too low about 5% of the time, and very rarely 2 too low.\r\n while (compare(yc, rem, yL, remL) < 1) {\r\n n++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yc, remL, base);\r\n remL = rem.length;\r\n }\r\n }\r\n } else if (cmp === 0) {\r\n n++;\r\n rem = [0];\r\n } // else cmp === 1 and n will be 0\r\n\r\n // Add the next digit, n, to the result array.\r\n qc[i++] = n;\r\n\r\n // Update the remainder.\r\n if (rem[0]) {\r\n rem[remL++] = xc[xi] || 0;\r\n } else {\r\n rem = [xc[xi]];\r\n remL = 1;\r\n }\r\n } while ((xi++ < xL || rem[0] != null) && s--);\r\n\r\n more = rem[0] != null;\r\n\r\n // Leading zero?\r\n if (!qc[0]) qc.splice(0, 1);\r\n }\r\n\r\n if (base == BASE) {\r\n\r\n // To calculate q.e, first get the number of digits of qc[0].\r\n for (i = 1, s = qc[0]; s >= 10; s /= 10, i++);\r\n\r\n round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);\r\n\r\n // Caller is convertBase.\r\n } else {\r\n q.e = e;\r\n q.r = +more;\r\n }\r\n\r\n return q;\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a string representing the value of BigNumber n in fixed-point or exponential\r\n * notation rounded to the specified decimal places or significant digits.\r\n *\r\n * n: a BigNumber.\r\n * i: the index of the last digit required (i.e. the digit that may be rounded up).\r\n * rm: the rounding mode.\r\n * id: 1 (toExponential) or 2 (toPrecision).\r\n */\r\n function format(n, i, rm, id) {\r\n var c0, e, ne, len, str;\r\n\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n if (!n.c) return n.toString();\r\n\r\n c0 = n.c[0];\r\n ne = n.e;\r\n\r\n if (i == null) {\r\n str = coeffToString(n.c);\r\n str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS)\r\n ? toExponential(str, ne)\r\n : toFixedPoint(str, ne, '0');\r\n } else {\r\n n = round(new BigNumber(n), i, rm);\r\n\r\n // n.e may have changed if the value was rounded up.\r\n e = n.e;\r\n\r\n str = coeffToString(n.c);\r\n len = str.length;\r\n\r\n // toPrecision returns exponential notation if the number of significant digits\r\n // specified is less than the number of digits necessary to represent the integer\r\n // part of the value in fixed-point notation.\r\n\r\n // Exponential notation.\r\n if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {\r\n\r\n // Append zeros?\r\n for (; len < i; str += '0', len++);\r\n str = toExponential(str, e);\r\n\r\n // Fixed-point notation.\r\n } else {\r\n i -= ne;\r\n str = toFixedPoint(str, e, '0');\r\n\r\n // Append zeros?\r\n if (e + 1 > len) {\r\n if (--i > 0) for (str += '.'; i--; str += '0');\r\n } else {\r\n i += e - len;\r\n if (i > 0) {\r\n if (e + 1 == len) str += '.';\r\n for (; i--; str += '0');\r\n }\r\n }\r\n }\r\n }\r\n\r\n return n.s < 0 && c0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // Handle BigNumber.max and BigNumber.min.\r\n // If any number is NaN, return NaN.\r\n function maxOrMin(args, n) {\r\n var k, y,\r\n i = 1,\r\n x = new BigNumber(args[0]);\r\n\r\n for (; i < args.length; i++) {\r\n y = new BigNumber(args[i]);\r\n if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {\r\n x = y;\r\n }\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n /*\r\n * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP.\r\n * Called by minus, plus and times.\r\n */\r\n function normalise(n, c, e) {\r\n var i = 1,\r\n j = c.length;\r\n\r\n // Remove trailing zeros.\r\n for (; !c[--j]; c.pop());\r\n\r\n // Calculate the base 10 exponent. First get the number of digits of c[0].\r\n for (j = c[0]; j >= 10; j /= 10, i++);\r\n\r\n // Overflow?\r\n if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {\r\n\r\n // Infinity.\r\n n.c = n.e = null;\r\n\r\n // Underflow?\r\n } else if (e < MIN_EXP) {\r\n\r\n // Zero.\r\n n.c = [n.e = 0];\r\n } else {\r\n n.e = e;\r\n n.c = c;\r\n }\r\n\r\n return n;\r\n }\r\n\r\n\r\n // Handle values that fail the validity test in BigNumber.\r\n parseNumeric = (function () {\r\n var basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i,\r\n dotAfter = /^([^.]+)\\.$/,\r\n dotBefore = /^\\.([^.]+)$/,\r\n isInfinityOrNaN = /^-?(Infinity|NaN)$/,\r\n whitespaceOrPlus = /^\\s*\\+(?=[\\w.])|^\\s+|\\s+$/g;\r\n\r\n return function (x, str, isNum, b) {\r\n var base,\r\n s = isNum ? str : str.replace(whitespaceOrPlus, '');\r\n\r\n // No exception on ±Infinity or NaN.\r\n if (isInfinityOrNaN.test(s)) {\r\n x.s = isNaN(s) ? null : s < 0 ? -1 : 1;\r\n } else {\r\n if (!isNum) {\r\n\r\n // basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i\r\n s = s.replace(basePrefix, function (m, p1, p2) {\r\n base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8;\r\n return !b || b == base ? p1 : m;\r\n });\r\n\r\n if (b) {\r\n base = b;\r\n\r\n // E.g. '1.' to '1', '.1' to '0.1'\r\n s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1');\r\n }\r\n\r\n if (str != s) return new BigNumber(s, base);\r\n }\r\n\r\n // '[BigNumber Error] Not a number: {n}'\r\n // '[BigNumber Error] Not a base {b} number: {n}'\r\n if (BigNumber.DEBUG) {\r\n throw Error\r\n (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str);\r\n }\r\n\r\n // NaN\r\n x.s = null;\r\n }\r\n\r\n x.c = x.e = null;\r\n }\r\n })();\r\n\r\n\r\n /*\r\n * Round x to sd significant digits using rounding mode rm. Check for over/under-flow.\r\n * If r is truthy, it is known that there are more digits after the rounding digit.\r\n */\r\n function round(x, sd, rm, r) {\r\n var d, i, j, k, n, ni, rd,\r\n xc = x.c,\r\n pows10 = POWS_TEN;\r\n\r\n // if x is not Infinity or NaN...\r\n if (xc) {\r\n\r\n // rd is the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // n is a base 1e14 number, the value of the element of array x.c containing rd.\r\n // ni is the index of n within x.c.\r\n // d is the number of digits of n.\r\n // i is the index of rd within n including leading zeros.\r\n // j is the actual index of rd within n (if < 0, rd is a leading zero).\r\n out: {\r\n\r\n // Get the number of digits of the first element of xc.\r\n for (d = 1, k = xc[0]; k >= 10; k /= 10, d++);\r\n i = sd - d;\r\n\r\n // If the rounding digit is in the first element of xc...\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n n = xc[ni = 0];\r\n\r\n // Get the rounding digit at index j of n.\r\n rd = mathfloor(n / pows10[d - j - 1] % 10);\r\n } else {\r\n ni = mathceil((i + 1) / LOG_BASE);\r\n\r\n if (ni >= xc.length) {\r\n\r\n if (r) {\r\n\r\n // Needed by sqrt.\r\n for (; xc.length <= ni; xc.push(0));\r\n n = rd = 0;\r\n d = 1;\r\n i %= LOG_BASE;\r\n j = i - LOG_BASE + 1;\r\n } else {\r\n break out;\r\n }\r\n } else {\r\n n = k = xc[ni];\r\n\r\n // Get the number of digits of n.\r\n for (d = 1; k >= 10; k /= 10, d++);\r\n\r\n // Get the index of rd within n.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within n, adjusted for leading zeros.\r\n // The number of leading zeros of n is given by LOG_BASE - d.\r\n j = i - LOG_BASE + d;\r\n\r\n // Get the rounding digit at index j of n.\r\n rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);\r\n }\r\n }\r\n\r\n r = r || sd < 0 ||\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n // The expression n % pows10[d - j - 1] returns all digits of n to the right\r\n // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.\r\n xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);\r\n\r\n r = rm < 4\r\n ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n if (sd < 1 || !xc[0]) {\r\n xc.length = 0;\r\n\r\n if (r) {\r\n\r\n // Convert sd to decimal places.\r\n sd -= x.e + 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];\r\n x.e = -sd || 0;\r\n } else {\r\n\r\n // Zero.\r\n xc[0] = x.e = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xc.length = ni;\r\n k = 1;\r\n ni--;\r\n } else {\r\n xc.length = ni + 1;\r\n k = pows10[LOG_BASE - i];\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of n.\r\n xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;\r\n }\r\n\r\n // Round up?\r\n if (r) {\r\n\r\n for (; ;) {\r\n\r\n // If the digit to be rounded up is in the first element of xc...\r\n if (ni == 0) {\r\n\r\n // i will be the length of xc[0] before k is added.\r\n for (i = 1, j = xc[0]; j >= 10; j /= 10, i++);\r\n j = xc[0] += k;\r\n for (k = 1; j >= 10; j /= 10, k++);\r\n\r\n // if i != k the length has increased.\r\n if (i != k) {\r\n x.e++;\r\n if (xc[0] == BASE) xc[0] = 1;\r\n }\r\n\r\n break;\r\n } else {\r\n xc[ni] += k;\r\n if (xc[ni] != BASE) break;\r\n xc[ni--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xc.length; xc[--i] === 0; xc.pop());\r\n }\r\n\r\n // Overflow? Infinity.\r\n if (x.e > MAX_EXP) {\r\n x.c = x.e = null;\r\n\r\n // Underflow? Zero.\r\n } else if (x.e < MIN_EXP) {\r\n x.c = [x.e = 0];\r\n }\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n function valueOf(n) {\r\n var str,\r\n e = n.e;\r\n\r\n if (e === null) return n.toString();\r\n\r\n str = coeffToString(n.c);\r\n\r\n str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r\n ? toExponential(str, e)\r\n : toFixedPoint(str, e, '0');\r\n\r\n return n.s < 0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // PROTOTYPE/INSTANCE METHODS\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the absolute value of this BigNumber.\r\n */\r\n P.absoluteValue = P.abs = function () {\r\n var x = new BigNumber(this);\r\n if (x.s < 0) x.s = 1;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return\r\n * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b),\r\n * -1 if the value of this BigNumber is less than the value of BigNumber(y, b),\r\n * 0 if they have the same value,\r\n * or null if the value of either is NaN.\r\n */\r\n P.comparedTo = function (y, b) {\r\n return compare(this, new BigNumber(y, b));\r\n };\r\n\r\n\r\n /*\r\n * If dp is undefined or null or true or false, return the number of decimal places of the\r\n * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r\n *\r\n * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this\r\n * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or\r\n * ROUNDING_MODE if rm is omitted.\r\n *\r\n * [dp] {number} Decimal places: integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.decimalPlaces = P.dp = function (dp, rm) {\r\n var c, n, v,\r\n x = this;\r\n\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n return round(new BigNumber(x), dp + x.e + 1, rm);\r\n }\r\n\r\n if (!(c = x.c)) return null;\r\n n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last number.\r\n if (v = c[v]) for (; v % 10 == 0; v /= 10, n--);\r\n if (n < 0) n = 0;\r\n\r\n return n;\r\n };\r\n\r\n\r\n /*\r\n * n / 0 = I\r\n * n / N = N\r\n * n / I = 0\r\n * 0 / n = 0\r\n * 0 / 0 = N\r\n * 0 / N = N\r\n * 0 / I = 0\r\n * N / n = N\r\n * N / 0 = N\r\n * N / N = N\r\n * N / I = N\r\n * I / n = I\r\n * I / 0 = I\r\n * I / N = N\r\n * I / I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber divided by the value of\r\n * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r\n */\r\n P.dividedBy = P.div = function (y, b) {\r\n return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the integer part of dividing the value of this\r\n * BigNumber by the value of BigNumber(y, b).\r\n */\r\n P.dividedToIntegerBy = P.idiv = function (y, b) {\r\n return div(this, new BigNumber(y, b), 0, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a BigNumber whose value is the value of this BigNumber exponentiated by n.\r\n *\r\n * If m is present, return the result modulo m.\r\n * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE.\r\n * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE.\r\n *\r\n * The modular power operation works efficiently when x, n, and m are integers, otherwise it\r\n * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0.\r\n *\r\n * n {number|string|BigNumber} The exponent. An integer.\r\n * [m] {number|string|BigNumber} The modulus.\r\n *\r\n * '[BigNumber Error] Exponent not an integer: {n}'\r\n */\r\n P.exponentiatedBy = P.pow = function (n, m) {\r\n var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y,\r\n x = this;\r\n\r\n n = new BigNumber(n);\r\n\r\n // Allow NaN and ±Infinity, but not other non-integers.\r\n if (n.c && !n.isInteger()) {\r\n throw Error\r\n (bignumberError + 'Exponent not an integer: ' + valueOf(n));\r\n }\r\n\r\n if (m != null) m = new BigNumber(m);\r\n\r\n // Exponent of MAX_SAFE_INTEGER is 15.\r\n nIsBig = n.e > 14;\r\n\r\n // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0.\r\n if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {\r\n\r\n // The sign of the result of pow when x is negative depends on the evenness of n.\r\n // If +n overflows to ±Infinity, the evenness of n would be not be known.\r\n y = new BigNumber(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));\r\n return m ? y.mod(m) : y;\r\n }\r\n\r\n nIsNeg = n.s < 0;\r\n\r\n if (m) {\r\n\r\n // x % m returns NaN if abs(m) is zero, or m is NaN.\r\n if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN);\r\n\r\n isModExp = !nIsNeg && x.isInteger() && m.isInteger();\r\n\r\n if (isModExp) x = x.mod(m);\r\n\r\n // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15.\r\n // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15.\r\n } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0\r\n // [1, 240000000]\r\n ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7\r\n // [80000000000000] [99999750000000]\r\n : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {\r\n\r\n // If x is negative and n is odd, k = -0, else k = 0.\r\n k = x.s < 0 && isOdd(n) ? -0 : 0;\r\n\r\n // If x >= 1, k = ±Infinity.\r\n if (x.e > -1) k = 1 / k;\r\n\r\n // If n is negative return ±0, else return ±Infinity.\r\n return new BigNumber(nIsNeg ? 1 / k : k);\r\n\r\n } else if (POW_PRECISION) {\r\n\r\n // Truncating each coefficient array to a length of k after each multiplication\r\n // equates to truncating significant digits to POW_PRECISION + [28, 41],\r\n // i.e. there will be a minimum of 28 guard digits retained.\r\n k = mathceil(POW_PRECISION / LOG_BASE + 2);\r\n }\r\n\r\n if (nIsBig) {\r\n half = new BigNumber(0.5);\r\n if (nIsNeg) n.s = 1;\r\n nIsOdd = isOdd(n);\r\n } else {\r\n i = Math.abs(+valueOf(n));\r\n nIsOdd = i % 2;\r\n }\r\n\r\n y = new BigNumber(ONE);\r\n\r\n // Performs 54 loop iterations for n of 9007199254740991.\r\n for (; ;) {\r\n\r\n if (nIsOdd) {\r\n y = y.times(x);\r\n if (!y.c) break;\r\n\r\n if (k) {\r\n if (y.c.length > k) y.c.length = k;\r\n } else if (isModExp) {\r\n y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m));\r\n }\r\n }\r\n\r\n if (i) {\r\n i = mathfloor(i / 2);\r\n if (i === 0) break;\r\n nIsOdd = i % 2;\r\n } else {\r\n n = n.times(half);\r\n round(n, n.e + 1, 1);\r\n\r\n if (n.e > 14) {\r\n nIsOdd = isOdd(n);\r\n } else {\r\n i = +valueOf(n);\r\n if (i === 0) break;\r\n nIsOdd = i % 2;\r\n }\r\n }\r\n\r\n x = x.times(x);\r\n\r\n if (k) {\r\n if (x.c && x.c.length > k) x.c.length = k;\r\n } else if (isModExp) {\r\n x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m));\r\n }\r\n }\r\n\r\n if (isModExp) return y;\r\n if (nIsNeg) y = ONE.div(y);\r\n\r\n return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer\r\n * using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r\n *\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}'\r\n */\r\n P.integerValue = function (rm) {\r\n var n = new BigNumber(this);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n return round(n, n.e + 1, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isEqualTo = P.eq = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is a finite number, otherwise return false.\r\n */\r\n P.isFinite = function () {\r\n return !!this.c;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isGreaterThan = P.gt = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is greater than or equal to the value of\r\n * BigNumber(y, b), otherwise return false.\r\n */\r\n P.isGreaterThanOrEqualTo = P.gte = function (y, b) {\r\n return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0;\r\n\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is an integer, otherwise return false.\r\n */\r\n P.isInteger = function () {\r\n return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is less than the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isLessThan = P.lt = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is less than or equal to the value of\r\n * BigNumber(y, b), otherwise return false.\r\n */\r\n P.isLessThanOrEqualTo = P.lte = function (y, b) {\r\n return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is NaN, otherwise return false.\r\n */\r\n P.isNaN = function () {\r\n return !this.s;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is negative, otherwise return false.\r\n */\r\n P.isNegative = function () {\r\n return this.s < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is positive, otherwise return false.\r\n */\r\n P.isPositive = function () {\r\n return this.s > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is 0 or -0, otherwise return false.\r\n */\r\n P.isZero = function () {\r\n return !!this.c && this.c[0] == 0;\r\n };\r\n\r\n\r\n /*\r\n * n - 0 = n\r\n * n - N = N\r\n * n - I = -I\r\n * 0 - n = -n\r\n * 0 - 0 = 0\r\n * 0 - N = N\r\n * 0 - I = -I\r\n * N - n = N\r\n * N - 0 = N\r\n * N - N = N\r\n * N - I = N\r\n * I - n = I\r\n * I - 0 = I\r\n * I - N = N\r\n * I - I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber minus the value of\r\n * BigNumber(y, b).\r\n */\r\n P.minus = function (y, b) {\r\n var i, j, t, xLTy,\r\n x = this,\r\n a = x.s;\r\n\r\n y = new BigNumber(y, b);\r\n b = y.s;\r\n\r\n // Either NaN?\r\n if (!a || !b) return new BigNumber(NaN);\r\n\r\n // Signs differ?\r\n if (a != b) {\r\n y.s = -b;\r\n return x.plus(y);\r\n }\r\n\r\n var xe = x.e / LOG_BASE,\r\n ye = y.e / LOG_BASE,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n if (!xe || !ye) {\r\n\r\n // Either Infinity?\r\n if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN);\r\n\r\n // Either zero?\r\n if (!xc[0] || !yc[0]) {\r\n\r\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r\n return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x :\r\n\r\n // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity\r\n ROUNDING_MODE == 3 ? -0 : 0);\r\n }\r\n }\r\n\r\n xe = bitFloor(xe);\r\n ye = bitFloor(ye);\r\n xc = xc.slice();\r\n\r\n // Determine which is the bigger number.\r\n if (a = xe - ye) {\r\n\r\n if (xLTy = a < 0) {\r\n a = -a;\r\n t = xc;\r\n } else {\r\n ye = xe;\r\n t = yc;\r\n }\r\n\r\n t.reverse();\r\n\r\n // Prepend zeros to equalise exponents.\r\n for (b = a; b--; t.push(0));\r\n t.reverse();\r\n } else {\r\n\r\n // Exponents equal. Check digit by digit.\r\n j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;\r\n\r\n for (a = b = 0; b < j; b++) {\r\n\r\n if (xc[b] != yc[b]) {\r\n xLTy = xc[b] < yc[b];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // x < y? Point xc to the array of the bigger number.\r\n if (xLTy) {\r\n t = xc;\r\n xc = yc;\r\n yc = t;\r\n y.s = -y.s;\r\n }\r\n\r\n b = (j = yc.length) - (i = xc.length);\r\n\r\n // Append zeros to xc if shorter.\r\n // No need to add zeros to yc if shorter as subtract only needs to start at yc.length.\r\n if (b > 0) for (; b--; xc[i++] = 0);\r\n b = BASE - 1;\r\n\r\n // Subtract yc from xc.\r\n for (; j > a;) {\r\n\r\n if (xc[--j] < yc[j]) {\r\n for (i = j; i && !xc[--i]; xc[i] = b);\r\n --xc[i];\r\n xc[j] += BASE;\r\n }\r\n\r\n xc[j] -= yc[j];\r\n }\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xc[0] == 0; xc.splice(0, 1), --ye);\r\n\r\n // Zero?\r\n if (!xc[0]) {\r\n\r\n // Following IEEE 754 (2008) 6.3,\r\n // n - n = +0 but n - n = -0 when rounding towards -Infinity.\r\n y.s = ROUNDING_MODE == 3 ? -1 : 1;\r\n y.c = [y.e = 0];\r\n return y;\r\n }\r\n\r\n // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity\r\n // for finite x and y.\r\n return normalise(y, xc, ye);\r\n };\r\n\r\n\r\n /*\r\n * n % 0 = N\r\n * n % N = N\r\n * n % I = n\r\n * 0 % n = 0\r\n * -0 % n = -0\r\n * 0 % 0 = N\r\n * 0 % N = N\r\n * 0 % I = 0\r\n * N % n = N\r\n * N % 0 = N\r\n * N % N = N\r\n * N % I = N\r\n * I % n = N\r\n * I % 0 = N\r\n * I % N = N\r\n * I % I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber modulo the value of\r\n * BigNumber(y, b). The result depends on the value of MODULO_MODE.\r\n */\r\n P.modulo = P.mod = function (y, b) {\r\n var q, s,\r\n x = this;\r\n\r\n y = new BigNumber(y, b);\r\n\r\n // Return NaN if x is Infinity or NaN, or y is NaN or zero.\r\n if (!x.c || !y.s || y.c && !y.c[0]) {\r\n return new BigNumber(NaN);\r\n\r\n // Return x if y is Infinity or x is zero.\r\n } else if (!y.c || x.c && !x.c[0]) {\r\n return new BigNumber(x);\r\n }\r\n\r\n if (MODULO_MODE == 9) {\r\n\r\n // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n // r = x - qy where 0 <= r < abs(y)\r\n s = y.s;\r\n y.s = 1;\r\n q = div(x, y, 0, 3);\r\n y.s = s;\r\n q.s *= s;\r\n } else {\r\n q = div(x, y, 0, MODULO_MODE);\r\n }\r\n\r\n y = x.minus(q.times(y));\r\n\r\n // To match JavaScript %, ensure sign of zero is sign of dividend.\r\n if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;\r\n\r\n return y;\r\n };\r\n\r\n\r\n /*\r\n * n * 0 = 0\r\n * n * N = N\r\n * n * I = I\r\n * 0 * n = 0\r\n * 0 * 0 = 0\r\n * 0 * N = N\r\n * 0 * I = N\r\n * N * n = N\r\n * N * 0 = N\r\n * N * N = N\r\n * N * I = N\r\n * I * n = I\r\n * I * 0 = N\r\n * I * N = N\r\n * I * I = I\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value\r\n * of BigNumber(y, b).\r\n */\r\n P.multipliedBy = P.times = function (y, b) {\r\n var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc,\r\n base, sqrtBase,\r\n x = this,\r\n xc = x.c,\r\n yc = (y = new BigNumber(y, b)).c;\r\n\r\n // Either NaN, ±Infinity or ±0?\r\n if (!xc || !yc || !xc[0] || !yc[0]) {\r\n\r\n // Return NaN if either is NaN, or one is 0 and the other is Infinity.\r\n if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {\r\n y.c = y.e = y.s = null;\r\n } else {\r\n y.s *= x.s;\r\n\r\n // Return ±Infinity if either is ±Infinity.\r\n if (!xc || !yc) {\r\n y.c = y.e = null;\r\n\r\n // Return ±0 if either is ±0.\r\n } else {\r\n y.c = [0];\r\n y.e = 0;\r\n }\r\n }\r\n\r\n return y;\r\n }\r\n\r\n e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);\r\n y.s *= x.s;\r\n xcL = xc.length;\r\n ycL = yc.length;\r\n\r\n // Ensure xc points to longer array and xcL to its length.\r\n if (xcL < ycL) {\r\n zc = xc;\r\n xc = yc;\r\n yc = zc;\r\n i = xcL;\r\n xcL = ycL;\r\n ycL = i;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n for (i = xcL + ycL, zc = []; i--; zc.push(0));\r\n\r\n base = BASE;\r\n sqrtBase = SQRT_BASE;\r\n\r\n for (i = ycL; --i >= 0;) {\r\n c = 0;\r\n ylo = yc[i] % sqrtBase;\r\n yhi = yc[i] / sqrtBase | 0;\r\n\r\n for (k = xcL, j = i + k; j > i;) {\r\n xlo = xc[--k] % sqrtBase;\r\n xhi = xc[k] / sqrtBase | 0;\r\n m = yhi * xlo + xhi * ylo;\r\n xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c;\r\n c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;\r\n zc[j--] = xlo % base;\r\n }\r\n\r\n zc[j] = c;\r\n }\r\n\r\n if (c) {\r\n ++e;\r\n } else {\r\n zc.splice(0, 1);\r\n }\r\n\r\n return normalise(y, zc, e);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber negated,\r\n * i.e. multiplied by -1.\r\n */\r\n P.negated = function () {\r\n var x = new BigNumber(this);\r\n x.s = -x.s || null;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * n + 0 = n\r\n * n + N = N\r\n * n + I = I\r\n * 0 + n = n\r\n * 0 + 0 = 0\r\n * 0 + N = N\r\n * 0 + I = I\r\n * N + n = N\r\n * N + 0 = N\r\n * N + N = N\r\n * N + I = N\r\n * I + n = I\r\n * I + 0 = I\r\n * I + N = N\r\n * I + I = I\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber plus the value of\r\n * BigNumber(y, b).\r\n */\r\n P.plus = function (y, b) {\r\n var t,\r\n x = this,\r\n a = x.s;\r\n\r\n y = new BigNumber(y, b);\r\n b = y.s;\r\n\r\n // Either NaN?\r\n if (!a || !b) return new BigNumber(NaN);\r\n\r\n // Signs differ?\r\n if (a != b) {\r\n y.s = -b;\r\n return x.minus(y);\r\n }\r\n\r\n var xe = x.e / LOG_BASE,\r\n ye = y.e / LOG_BASE,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n if (!xe || !ye) {\r\n\r\n // Return ±Infinity if either ±Infinity.\r\n if (!xc || !yc) return new BigNumber(a / 0);\r\n\r\n // Either zero?\r\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r\n if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0);\r\n }\r\n\r\n xe = bitFloor(xe);\r\n ye = bitFloor(ye);\r\n xc = xc.slice();\r\n\r\n // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts.\r\n if (a = xe - ye) {\r\n if (a > 0) {\r\n ye = xe;\r\n t = yc;\r\n } else {\r\n a = -a;\r\n t = xc;\r\n }\r\n\r\n t.reverse();\r\n for (; a--; t.push(0));\r\n t.reverse();\r\n }\r\n\r\n a = xc.length;\r\n b = yc.length;\r\n\r\n // Point xc to the longer array, and b to the shorter length.\r\n if (a - b < 0) {\r\n t = yc;\r\n yc = xc;\r\n xc = t;\r\n b = a;\r\n }\r\n\r\n // Only start adding at yc.length - 1 as the further digits of xc can be ignored.\r\n for (a = 0; b;) {\r\n a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;\r\n xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;\r\n }\r\n\r\n if (a) {\r\n xc = [a].concat(xc);\r\n ++ye;\r\n }\r\n\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n // ye = MAX_EXP + 1 possible\r\n return normalise(y, xc, ye);\r\n };\r\n\r\n\r\n /*\r\n * If sd is undefined or null or true or false, return the number of significant digits of\r\n * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r\n * If sd is true include integer-part trailing zeros in the count.\r\n *\r\n * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this\r\n * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or\r\n * ROUNDING_MODE if rm is omitted.\r\n *\r\n * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive.\r\n * boolean: whether to count integer-part trailing zeros: true or false.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r\n */\r\n P.precision = P.sd = function (sd, rm) {\r\n var c, n, v,\r\n x = this;\r\n\r\n if (sd != null && sd !== !!sd) {\r\n intCheck(sd, 1, MAX);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n return round(new BigNumber(x), sd, rm);\r\n }\r\n\r\n if (!(c = x.c)) return null;\r\n v = c.length - 1;\r\n n = v * LOG_BASE + 1;\r\n\r\n if (v = c[v]) {\r\n\r\n // Subtract the number of trailing zeros of the last element.\r\n for (; v % 10 == 0; v /= 10, n--);\r\n\r\n // Add the number of digits of the first element.\r\n for (v = c[0]; v >= 10; v /= 10, n++);\r\n }\r\n\r\n if (sd && x.e + 1 > n) n = x.e + 1;\r\n\r\n return n;\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber shifted by k places\r\n * (powers of 10). Shift to the right if n > 0, and to the left if n < 0.\r\n *\r\n * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}'\r\n */\r\n P.shiftedBy = function (k) {\r\n intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);\r\n return this.times('1e' + k);\r\n };\r\n\r\n\r\n /*\r\n * sqrt(-n) = N\r\n * sqrt(N) = N\r\n * sqrt(-I) = N\r\n * sqrt(I) = I\r\n * sqrt(0) = 0\r\n * sqrt(-0) = -0\r\n *\r\n * Return a new BigNumber whose value is the square root of the value of this BigNumber,\r\n * rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r\n */\r\n P.squareRoot = P.sqrt = function () {\r\n var m, n, r, rep, t,\r\n x = this,\r\n c = x.c,\r\n s = x.s,\r\n e = x.e,\r\n dp = DECIMAL_PLACES + 4,\r\n half = new BigNumber('0.5');\r\n\r\n // Negative/NaN/Infinity/zero?\r\n if (s !== 1 || !c || !c[0]) {\r\n return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);\r\n }\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+valueOf(x));\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = coeffToString(c);\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(+n);\r\n e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new BigNumber(n);\r\n } else {\r\n r = new BigNumber(s + '');\r\n }\r\n\r\n // Check for zero.\r\n // r could be zero if MIN_EXP is changed after the this value was created.\r\n // This would cause a division by zero (x/t) and hence Infinity below, which would cause\r\n // coeffToString to throw.\r\n if (r.c[0]) {\r\n e = r.e;\r\n s = e + dp;\r\n if (s < 3) s = 0;\r\n\r\n // Newton-Raphson iteration.\r\n for (; ;) {\r\n t = r;\r\n r = half.times(t.plus(div(x, t, dp, 1)));\r\n\r\n if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {\r\n\r\n // The exponent of r may here be one less than the final result exponent,\r\n // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits\r\n // are indexed correctly.\r\n if (r.e < e) --s;\r\n n = n.slice(s - 3, s + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits\r\n // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the\r\n // iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the\r\n // exact result as the nines may infinitely repeat.\r\n if (!rep) {\r\n round(t, t.e + DECIMAL_PLACES + 2, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n dp += 4;\r\n s += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact\r\n // result. If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n round(r, r.e + DECIMAL_PLACES + 2, 1);\r\n m = !r.times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in exponential notation and\r\n * rounded using ROUNDING_MODE to dp fixed decimal places.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.toExponential = function (dp, rm) {\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n dp++;\r\n }\r\n return format(this, dp, rm, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in fixed-point notation rounding\r\n * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r\n *\r\n * Note: as with JavaScript's number type, (-0).toFixed(0) is '0',\r\n * but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.toFixed = function (dp, rm) {\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n dp = dp + this.e + 1;\r\n }\r\n return format(this, dp, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in fixed-point notation rounded\r\n * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties\r\n * of the format or FORMAT object (see BigNumber.set).\r\n *\r\n * The formatting object may contain some or all of the properties shown below.\r\n *\r\n * FORMAT = {\r\n * prefix: '',\r\n * groupSize: 3,\r\n * secondaryGroupSize: 0,\r\n * groupSeparator: ',',\r\n * decimalSeparator: '.',\r\n * fractionGroupSize: 0,\r\n * fractionGroupSeparator: '\\xA0', // non-breaking space\r\n * suffix: ''\r\n * };\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n * [format] {object} Formatting options. See FORMAT pbject above.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n * '[BigNumber Error] Argument not an object: {format}'\r\n */\r\n P.toFormat = function (dp, rm, format) {\r\n var str,\r\n x = this;\r\n\r\n if (format == null) {\r\n if (dp != null && rm && typeof rm == 'object') {\r\n format = rm;\r\n rm = null;\r\n } else if (dp && typeof dp == 'object') {\r\n format = dp;\r\n dp = rm = null;\r\n } else {\r\n format = FORMAT;\r\n }\r\n } else if (typeof format != 'object') {\r\n throw Error\r\n (bignumberError + 'Argument not an object: ' + format);\r\n }\r\n\r\n str = x.toFixed(dp, rm);\r\n\r\n if (x.c) {\r\n var i,\r\n arr = str.split('.'),\r\n g1 = +format.groupSize,\r\n g2 = +format.secondaryGroupSize,\r\n groupSeparator = format.groupSeparator || '',\r\n intPart = arr[0],\r\n fractionPart = arr[1],\r\n isNeg = x.s < 0,\r\n intDigits = isNeg ? intPart.slice(1) : intPart,\r\n len = intDigits.length;\r\n\r\n if (g2) {\r\n i = g1;\r\n g1 = g2;\r\n g2 = i;\r\n len -= i;\r\n }\r\n\r\n if (g1 > 0 && len > 0) {\r\n i = len % g1 || g1;\r\n intPart = intDigits.substr(0, i);\r\n for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);\r\n if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);\r\n if (isNeg) intPart = '-' + intPart;\r\n }\r\n\r\n str = fractionPart\r\n ? intPart + (format.decimalSeparator || '') + ((g2 = +format.fractionGroupSize)\r\n ? fractionPart.replace(new RegExp('\\\\d{' + g2 + '}\\\\B', 'g'),\r\n '$&' + (format.fractionGroupSeparator || ''))\r\n : fractionPart)\r\n : intPart;\r\n }\r\n\r\n return (format.prefix || '') + str + (format.suffix || '');\r\n };\r\n\r\n\r\n /*\r\n * Return an array of two BigNumbers representing the value of this BigNumber as a simple\r\n * fraction with an integer numerator and an integer denominator.\r\n * The denominator will be a positive non-zero value less than or equal to the specified\r\n * maximum denominator. If a maximum denominator is not specified, the denominator will be\r\n * the lowest value necessary to represent the number exactly.\r\n *\r\n * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator.\r\n *\r\n * '[BigNumber Error] Argument {not an integer|out of range} : {md}'\r\n */\r\n P.toFraction = function (md) {\r\n var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s,\r\n x = this,\r\n xc = x.c;\r\n\r\n if (md != null) {\r\n n = new BigNumber(md);\r\n\r\n // Throw if md is less than one or is not an integer, unless it is Infinity.\r\n if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {\r\n throw Error\r\n (bignumberError + 'Argument ' +\r\n (n.isInteger() ? 'out of range: ' : 'not an integer: ') + valueOf(n));\r\n }\r\n }\r\n\r\n if (!xc) return new BigNumber(x);\r\n\r\n d = new BigNumber(ONE);\r\n n1 = d0 = new BigNumber(ONE);\r\n d1 = n0 = new BigNumber(ONE);\r\n s = coeffToString(xc);\r\n\r\n // Determine initial denominator.\r\n // d is a power of 10 and the minimum max denominator that specifies the value exactly.\r\n e = d.e = s.length - x.e - 1;\r\n d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];\r\n md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n;\r\n\r\n exp = MAX_EXP;\r\n MAX_EXP = 1 / 0;\r\n n = new BigNumber(s);\r\n\r\n // n0 = d1 = 0\r\n n0.c[0] = 0;\r\n\r\n for (; ;) {\r\n q = div(n, d, 0, 1);\r\n d2 = d0.plus(q.times(d1));\r\n if (d2.comparedTo(md) == 1) break;\r\n d0 = d1;\r\n d1 = d2;\r\n n1 = n0.plus(q.times(d2 = n1));\r\n n0 = d2;\r\n d = n.minus(q.times(d2 = d));\r\n n = d2;\r\n }\r\n\r\n d2 = div(md.minus(d0), d1, 0, 1);\r\n n0 = n0.plus(d2.times(n1));\r\n d0 = d0.plus(d2.times(d1));\r\n n0.s = n1.s = x.s;\r\n e = e * 2;\r\n\r\n // Determine which fraction is closer to x, n0/d0 or n1/d1\r\n r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(\r\n div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0];\r\n\r\n MAX_EXP = exp;\r\n\r\n return r;\r\n };\r\n\r\n\r\n /*\r\n * Return the value of this BigNumber converted to a number primitive.\r\n */\r\n P.toNumber = function () {\r\n return +valueOf(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber rounded to sd significant digits\r\n * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits\r\n * necessary to represent the integer part of the value in fixed-point notation, then use\r\n * exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r\n */\r\n P.toPrecision = function (sd, rm) {\r\n if (sd != null) intCheck(sd, 1, MAX);\r\n return format(this, sd, rm, 2);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in base b, or base 10 if b is\r\n * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and\r\n * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent\r\n * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than\r\n * TO_EXP_NEG, return exponential notation.\r\n *\r\n * [b] {number} Integer, 2 to ALPHABET.length inclusive.\r\n *\r\n * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r\n */\r\n P.toString = function (b) {\r\n var str,\r\n n = this,\r\n s = n.s,\r\n e = n.e;\r\n\r\n // Infinity or NaN?\r\n if (e === null) {\r\n if (s) {\r\n str = 'Infinity';\r\n if (s < 0) str = '-' + str;\r\n } else {\r\n str = 'NaN';\r\n }\r\n } else {\r\n if (b == null) {\r\n str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r\n ? toExponential(coeffToString(n.c), e)\r\n : toFixedPoint(coeffToString(n.c), e, '0');\r\n } else if (b === 10 && alphabetHasNormalDecimalDigits) {\r\n n = round(new BigNumber(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);\r\n str = toFixedPoint(coeffToString(n.c), n.e, '0');\r\n } else {\r\n intCheck(b, 2, ALPHABET.length, 'Base');\r\n str = convertBase(toFixedPoint(coeffToString(n.c), e, '0'), 10, b, s, true);\r\n }\r\n\r\n if (s < 0 && n.c[0]) str = '-' + str;\r\n }\r\n\r\n return str;\r\n };\r\n\r\n\r\n /*\r\n * Return as toString, but do not accept a base argument, and include the minus sign for\r\n * negative zero.\r\n */\r\n P.valueOf = P.toJSON = function () {\r\n return valueOf(this);\r\n };\r\n\r\n\r\n P._isBigNumber = true;\r\n\r\n if (configObject != null) BigNumber.set(configObject);\r\n\r\n return BigNumber;\r\n }\r\n\r\n\r\n // PRIVATE HELPER FUNCTIONS\r\n\r\n // These functions don't need access to variables,\r\n // e.g. DECIMAL_PLACES, in the scope of the `clone` function above.\r\n\r\n\r\n function bitFloor(n) {\r\n var i = n | 0;\r\n return n > 0 || n === i ? i : i - 1;\r\n }\r\n\r\n\r\n // Return a coefficient array as a string of base 10 digits.\r\n function coeffToString(a) {\r\n var s, z,\r\n i = 1,\r\n j = a.length,\r\n r = a[0] + '';\r\n\r\n for (; i < j;) {\r\n s = a[i++] + '';\r\n z = LOG_BASE - s.length;\r\n for (; z--; s = '0' + s);\r\n r += s;\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (j = r.length; r.charCodeAt(--j) === 48;);\r\n\r\n return r.slice(0, j + 1 || 1);\r\n }\r\n\r\n\r\n // Compare the value of BigNumbers x and y.\r\n function compare(x, y) {\r\n var a, b,\r\n xc = x.c,\r\n yc = y.c,\r\n i = x.s,\r\n j = y.s,\r\n k = x.e,\r\n l = y.e;\r\n\r\n // Either NaN?\r\n if (!i || !j) return null;\r\n\r\n a = xc && !xc[0];\r\n b = yc && !yc[0];\r\n\r\n // Either zero?\r\n if (a || b) return a ? b ? 0 : -j : i;\r\n\r\n // Signs differ?\r\n if (i != j) return i;\r\n\r\n a = i < 0;\r\n b = k == l;\r\n\r\n // Either Infinity?\r\n if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;\r\n\r\n // Compare exponents.\r\n if (!b) return k > l ^ a ? 1 : -1;\r\n\r\n j = (k = xc.length) < (l = yc.length) ? k : l;\r\n\r\n // Compare digit by digit.\r\n for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;\r\n\r\n // Compare lengths.\r\n return k == l ? 0 : k > l ^ a ? 1 : -1;\r\n }\r\n\r\n\r\n /*\r\n * Check that n is a primitive number, an integer, and in range, otherwise throw.\r\n */\r\n function intCheck(n, min, max, name) {\r\n if (n < min || n > max || n !== mathfloor(n)) {\r\n throw Error\r\n (bignumberError + (name || 'Argument') + (typeof n == 'number'\r\n ? n < min || n > max ? ' out of range: ' : ' not an integer: '\r\n : ' not a primitive number: ') + String(n));\r\n }\r\n }\r\n\r\n\r\n // Assumes finite n.\r\n function isOdd(n) {\r\n var k = n.c.length - 1;\r\n return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;\r\n }\r\n\r\n\r\n function toExponential(str, e) {\r\n return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) +\r\n (e < 0 ? 'e' : 'e+') + e;\r\n }\r\n\r\n\r\n function toFixedPoint(str, e, z) {\r\n var len, zs;\r\n\r\n // Negative exponent?\r\n if (e < 0) {\r\n\r\n // Prepend zeros.\r\n for (zs = z + '.'; ++e; zs += z);\r\n str = zs + str;\r\n\r\n // Positive exponent\r\n } else {\r\n len = str.length;\r\n\r\n // Append zeros.\r\n if (++e > len) {\r\n for (zs = z, e -= len; --e; zs += z);\r\n str += zs;\r\n } else if (e < len) {\r\n str = str.slice(0, e) + '.' + str.slice(e);\r\n }\r\n }\r\n\r\n return str;\r\n }\r\n\r\n\r\n // EXPORT\r\n\r\n\r\n BigNumber = clone();\r\n BigNumber['default'] = BigNumber.BigNumber = BigNumber;\r\n\r\n // AMD.\r\n if (typeof define == 'function' && define.amd) {\r\n define(function () { return BigNumber; });\r\n\r\n // Node.js and other environments that support module.exports.\r\n } else if (typeof module != 'undefined' && module.exports) {\r\n module.exports = BigNumber;\r\n\r\n // Browser.\r\n } else {\r\n if (!globalObject) {\r\n globalObject = typeof self != 'undefined' && self ? self : window;\r\n }\r\n\r\n globalObject.BigNumber = BigNumber;\r\n }\r\n})(this);\r\n","var BigNumber = require('bignumber.js');\n\n/*\n json2.js\n 2013-05-26\n\n Public Domain.\n\n NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n\n See http://www.JSON.org/js.html\n\n\n This code should be minified before deployment.\n See http://javascript.crockford.com/jsmin.html\n\n USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n NOT CONTROL.\n\n\n This file creates a global JSON object containing two methods: stringify\n and parse.\n\n JSON.stringify(value, replacer, space)\n value any JavaScript value, usually an object or array.\n\n replacer an optional parameter that determines how object\n values are stringified for objects. It can be a\n function or an array of strings.\n\n space an optional parameter that specifies the indentation\n of nested structures. If it is omitted, the text will\n be packed without extra whitespace. If it is a number,\n it will specify the number of spaces to indent at each\n level. If it is a string (such as '\\t' or ' '),\n it contains the characters used to indent at each level.\n\n This method produces a JSON text from a JavaScript value.\n\n When an object value is found, if the object contains a toJSON\n method, its toJSON method will be called and the result will be\n stringified. A toJSON method does not serialize: it returns the\n value represented by the name/value pair that should be serialized,\n or undefined if nothing should be serialized. The toJSON method\n will be passed the key associated with the value, and this will be\n bound to the value\n\n For example, this would serialize Dates as ISO strings.\n\n Date.prototype.toJSON = function (key) {\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10 ? '0' + n : n;\n }\n\n return this.getUTCFullYear() + '-' +\n f(this.getUTCMonth() + 1) + '-' +\n f(this.getUTCDate()) + 'T' +\n f(this.getUTCHours()) + ':' +\n f(this.getUTCMinutes()) + ':' +\n f(this.getUTCSeconds()) + 'Z';\n };\n\n You can provide an optional replacer method. It will be passed the\n key and value of each member, with this bound to the containing\n object. The value that is returned from your method will be\n serialized. If your method returns undefined, then the member will\n be excluded from the serialization.\n\n If the replacer parameter is an array of strings, then it will be\n used to select the members to be serialized. It filters the results\n such that only members with keys listed in the replacer array are\n stringified.\n\n Values that do not have JSON representations, such as undefined or\n functions, will not be serialized. Such values in objects will be\n dropped; in arrays they will be replaced with null. You can use\n a replacer function to replace those with JSON values.\n JSON.stringify(undefined) returns undefined.\n\n The optional space parameter produces a stringification of the\n value that is filled with line breaks and indentation to make it\n easier to read.\n\n If the space parameter is a non-empty string, then that string will\n be used for indentation. If the space parameter is a number, then\n the indentation will be that many spaces.\n\n Example:\n\n text = JSON.stringify(['e', {pluribus: 'unum'}]);\n // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n\n text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\\t');\n // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n text = JSON.stringify([new Date()], function (key, value) {\n return this[key] instanceof Date ?\n 'Date(' + this[key] + ')' : value;\n });\n // text is '[\"Date(---current time---)\"]'\n\n\n JSON.parse(text, reviver)\n This method parses a JSON text to produce an object or array.\n It can throw a SyntaxError exception.\n\n The optional reviver parameter is a function that can filter and\n transform the results. It receives each of the keys and values,\n and its return value is used instead of the original value.\n If it returns what it received, then the structure is not modified.\n If it returns undefined then the member is deleted.\n\n Example:\n\n // Parse the text. Values that look like ISO date strings will\n // be converted to Date objects.\n\n myData = JSON.parse(text, function (key, value) {\n var a;\n if (typeof value === 'string') {\n a =\n/^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n if (a) {\n return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n +a[5], +a[6]));\n }\n }\n return value;\n });\n\n myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n var d;\n if (typeof value === 'string' &&\n value.slice(0, 5) === 'Date(' &&\n value.slice(-1) === ')') {\n d = new Date(value.slice(5, -1));\n if (d) {\n return d;\n }\n }\n return value;\n });\n\n\n This is a reference implementation. You are free to copy, modify, or\n redistribute.\n*/\n\n/*jslint evil: true, regexp: true */\n\n/*members \"\", \"\\b\", \"\\t\", \"\\n\", \"\\f\", \"\\r\", \"\\\"\", JSON, \"\\\\\", apply,\n call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n*/\n\n\n// Create a JSON object only if one does not already exist. We create the\n// methods in a closure to avoid creating global variables.\n\nvar JSON = module.exports;\n\n(function () {\n 'use strict';\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10 ? '0' + n : n;\n }\n\n var cx = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\n escapable = /[\\\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\n gap,\n indent,\n meta = { // table of character substitutions\n '\\b': '\\\\b',\n '\\t': '\\\\t',\n '\\n': '\\\\n',\n '\\f': '\\\\f',\n '\\r': '\\\\r',\n '\"' : '\\\\\"',\n '\\\\': '\\\\\\\\'\n },\n rep;\n\n\n function quote(string) {\n\n// If the string contains no control characters, no quote characters, and no\n// backslash characters, then we can safely slap some quotes around it.\n// Otherwise we must also replace the offending characters with safe escape\n// sequences.\n\n escapable.lastIndex = 0;\n return escapable.test(string) ? '\"' + string.replace(escapable, function (a) {\n var c = meta[a];\n return typeof c === 'string'\n ? c\n : '\\\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n }) + '\"' : '\"' + string + '\"';\n }\n\n\n function str(key, holder) {\n\n// Produce a string from holder[key].\n\n var i, // The loop counter.\n k, // The member key.\n v, // The member value.\n length,\n mind = gap,\n partial,\n value = holder[key],\n isBigNumber = value != null && (value instanceof BigNumber || BigNumber.isBigNumber(value));\n\n// If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === 'object' &&\n typeof value.toJSON === 'function') {\n value = value.toJSON(key);\n }\n\n// If we were called with a replacer function, then call the replacer to\n// obtain a replacement value.\n\n if (typeof rep === 'function') {\n value = rep.call(holder, key, value);\n }\n\n// What happens next depends on the value's type.\n\n switch (typeof value) {\n case 'string':\n if (isBigNumber) {\n return value;\n } else {\n return quote(value);\n }\n\n case 'number':\n\n// JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value) ? String(value) : 'null';\n\n case 'boolean':\n case 'null':\n case 'bigint':\n\n// If the value is a boolean or null, convert it to a string. Note:\n// typeof null does not produce 'null'. The case is included here in\n// the remote chance that this gets fixed someday.\n\n return String(value);\n\n// If the type is 'object', we might be dealing with an object or an array or\n// null.\n\n case 'object':\n\n// Due to a specification blunder in ECMAScript, typeof null is 'object',\n// so watch out for that case.\n\n if (!value) {\n return 'null';\n }\n\n// Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n// Is the value an array?\n\n if (Object.prototype.toString.apply(value) === '[object Array]') {\n\n// The value is an array. Stringify every element. Use null as a placeholder\n// for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || 'null';\n }\n\n// Join all of the elements together, separated with commas, and wrap them in\n// brackets.\n\n v = partial.length === 0\n ? '[]'\n : gap\n ? '[\\n' + gap + partial.join(',\\n' + gap) + '\\n' + mind + ']'\n : '[' + partial.join(',') + ']';\n gap = mind;\n return v;\n }\n\n// If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === 'object') {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === 'string') {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n }\n }\n } else {\n\n// Otherwise, iterate through all of the keys in the object.\n\n Object.keys(value).forEach(function(k) {\n var v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n });\n }\n\n// Join all of the member texts together, separated with commas,\n// and wrap them in braces.\n\n v = partial.length === 0\n ? '{}'\n : gap\n ? '{\\n' + gap + partial.join(',\\n' + gap) + '\\n' + mind + '}'\n : '{' + partial.join(',') + '}';\n gap = mind;\n return v;\n }\n }\n\n// If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== 'function') {\n JSON.stringify = function (value, replacer, space) {\n\n// The stringify method takes a value and an optional replacer, and an optional\n// space parameter, and returns a JSON text. The replacer can be a function\n// that can replace values, or an array of strings that will select the keys.\n// A default replacer method can be provided. Use of the space parameter can\n// produce text that is more easily readable.\n\n var i;\n gap = '';\n indent = '';\n\n// If the space parameter is a number, make an indent string containing that\n// many spaces.\n\n if (typeof space === 'number') {\n for (i = 0; i < space; i += 1) {\n indent += ' ';\n }\n\n// If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === 'string') {\n indent = space;\n }\n\n// If there is a replacer, it must be a function or an array.\n// Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== 'function' &&\n (typeof replacer !== 'object' ||\n typeof replacer.length !== 'number')) {\n throw new Error('JSON.stringify');\n }\n\n// Make a fake root object containing our value under the key of ''.\n// Return the result of stringifying the value.\n\n return str('', {'': value});\n };\n }\n}());\n","var BigNumber = null;\n\n// regexpxs extracted from\n// (c) BSD-3-Clause\n// https://github.com/fastify/secure-json-parse/graphs/contributors and https://github.com/hapijs/bourne/graphs/contributors\n\nconst suspectProtoRx = /(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])(?:p|\\\\u0070)(?:r|\\\\u0072)(?:o|\\\\u006[Ff])(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])/;\nconst suspectConstructorRx = /(?:c|\\\\u0063)(?:o|\\\\u006[Ff])(?:n|\\\\u006[Ee])(?:s|\\\\u0073)(?:t|\\\\u0074)(?:r|\\\\u0072)(?:u|\\\\u0075)(?:c|\\\\u0063)(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:r|\\\\u0072)/;\n\n/*\n json_parse.js\n 2012-06-20\n\n Public Domain.\n\n NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n\n This file creates a json_parse function.\n During create you can (optionally) specify some behavioural switches\n\n require('json-bigint')(options)\n\n The optional options parameter holds switches that drive certain\n aspects of the parsing process:\n * options.strict = true will warn about duplicate-key usage in the json.\n The default (strict = false) will silently ignore those and overwrite\n values for keys that are in duplicate use.\n\n The resulting function follows this signature:\n json_parse(text, reviver)\n This method parses a JSON text to produce an object or array.\n It can throw a SyntaxError exception.\n\n The optional reviver parameter is a function that can filter and\n transform the results. It receives each of the keys and values,\n and its return value is used instead of the original value.\n If it returns what it received, then the structure is not modified.\n If it returns undefined then the member is deleted.\n\n Example:\n\n // Parse the text. Values that look like ISO date strings will\n // be converted to Date objects.\n\n myData = json_parse(text, function (key, value) {\n var a;\n if (typeof value === 'string') {\n a =\n/^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n if (a) {\n return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n +a[5], +a[6]));\n }\n }\n return value;\n });\n\n This is a reference implementation. You are free to copy, modify, or\n redistribute.\n\n This code should be minified before deployment.\n See http://javascript.crockford.com/jsmin.html\n\n USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n NOT CONTROL.\n*/\n\n/*members \"\", \"\\\"\", \"\\/\", \"\\\\\", at, b, call, charAt, f, fromCharCode,\n hasOwnProperty, message, n, name, prototype, push, r, t, text\n*/\n\nvar json_parse = function (options) {\n 'use strict';\n\n // This is a function that can parse a JSON text, producing a JavaScript\n // data structure. It is a simple, recursive descent parser. It does not use\n // eval or regular expressions, so it can be used as a model for implementing\n // a JSON parser in other languages.\n\n // We are defining the function inside of another function to avoid creating\n // global variables.\n\n // Default options one can override by passing options to the parse()\n var _options = {\n strict: false, // not being strict means do not generate syntax errors for \"duplicate key\"\n storeAsString: false, // toggles whether the values should be stored as BigNumber (default) or a string\n alwaysParseAsBig: false, // toggles whether all numbers should be Big\n useNativeBigInt: false, // toggles whether to use native BigInt instead of bignumber.js\n protoAction: 'error',\n constructorAction: 'error',\n };\n\n // If there are options, then use them to override the default _options\n if (options !== undefined && options !== null) {\n if (options.strict === true) {\n _options.strict = true;\n }\n if (options.storeAsString === true) {\n _options.storeAsString = true;\n }\n _options.alwaysParseAsBig =\n options.alwaysParseAsBig === true ? options.alwaysParseAsBig : false;\n _options.useNativeBigInt =\n options.useNativeBigInt === true ? options.useNativeBigInt : false;\n\n if (typeof options.constructorAction !== 'undefined') {\n if (\n options.constructorAction === 'error' ||\n options.constructorAction === 'ignore' ||\n options.constructorAction === 'preserve'\n ) {\n _options.constructorAction = options.constructorAction;\n } else {\n throw new Error(\n `Incorrect value for constructorAction option, must be \"error\", \"ignore\" or undefined but passed ${options.constructorAction}`\n );\n }\n }\n\n if (typeof options.protoAction !== 'undefined') {\n if (\n options.protoAction === 'error' ||\n options.protoAction === 'ignore' ||\n options.protoAction === 'preserve'\n ) {\n _options.protoAction = options.protoAction;\n } else {\n throw new Error(\n `Incorrect value for protoAction option, must be \"error\", \"ignore\" or undefined but passed ${options.protoAction}`\n );\n }\n }\n }\n\n var at, // The index of the current character\n ch, // The current character\n escapee = {\n '\"': '\"',\n '\\\\': '\\\\',\n '/': '/',\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t',\n },\n text,\n error = function (m) {\n // Call error when something is wrong.\n\n throw {\n name: 'SyntaxError',\n message: m,\n at: at,\n text: text,\n };\n },\n next = function (c) {\n // If a c parameter is provided, verify that it matches the current character.\n\n if (c && c !== ch) {\n error(\"Expected '\" + c + \"' instead of '\" + ch + \"'\");\n }\n\n // Get the next character. When there are no more characters,\n // return the empty string.\n\n ch = text.charAt(at);\n at += 1;\n return ch;\n },\n number = function () {\n // Parse a number value.\n\n var number,\n string = '';\n\n if (ch === '-') {\n string = '-';\n next('-');\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n if (ch === '.') {\n string += '.';\n while (next() && ch >= '0' && ch <= '9') {\n string += ch;\n }\n }\n if (ch === 'e' || ch === 'E') {\n string += ch;\n next();\n if (ch === '-' || ch === '+') {\n string += ch;\n next();\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n }\n number = +string;\n if (!isFinite(number)) {\n error('Bad number');\n } else {\n if (BigNumber == null) BigNumber = require('bignumber.js');\n //if (number > 9007199254740992 || number < -9007199254740992)\n // Bignumber has stricter check: everything with length > 15 digits disallowed\n if (string.length > 15)\n return _options.storeAsString\n ? string\n : _options.useNativeBigInt\n ? BigInt(string)\n : new BigNumber(string);\n else\n return !_options.alwaysParseAsBig\n ? number\n : _options.useNativeBigInt\n ? BigInt(number)\n : new BigNumber(number);\n }\n },\n string = function () {\n // Parse a string value.\n\n var hex,\n i,\n string = '',\n uffff;\n\n // When parsing for string values, we must look for \" and \\ characters.\n\n if (ch === '\"') {\n var startAt = at;\n while (next()) {\n if (ch === '\"') {\n if (at - 1 > startAt) string += text.substring(startAt, at - 1);\n next();\n return string;\n }\n if (ch === '\\\\') {\n if (at - 1 > startAt) string += text.substring(startAt, at - 1);\n next();\n if (ch === 'u') {\n uffff = 0;\n for (i = 0; i < 4; i += 1) {\n hex = parseInt(next(), 16);\n if (!isFinite(hex)) {\n break;\n }\n uffff = uffff * 16 + hex;\n }\n string += String.fromCharCode(uffff);\n } else if (typeof escapee[ch] === 'string') {\n string += escapee[ch];\n } else {\n break;\n }\n startAt = at;\n }\n }\n }\n error('Bad string');\n },\n white = function () {\n // Skip whitespace.\n\n while (ch && ch <= ' ') {\n next();\n }\n },\n word = function () {\n // true, false, or null.\n\n switch (ch) {\n case 't':\n next('t');\n next('r');\n next('u');\n next('e');\n return true;\n case 'f':\n next('f');\n next('a');\n next('l');\n next('s');\n next('e');\n return false;\n case 'n':\n next('n');\n next('u');\n next('l');\n next('l');\n return null;\n }\n error(\"Unexpected '\" + ch + \"'\");\n },\n value, // Place holder for the value function.\n array = function () {\n // Parse an array value.\n\n var array = [];\n\n if (ch === '[') {\n next('[');\n white();\n if (ch === ']') {\n next(']');\n return array; // empty array\n }\n while (ch) {\n array.push(value());\n white();\n if (ch === ']') {\n next(']');\n return array;\n }\n next(',');\n white();\n }\n }\n error('Bad array');\n },\n object = function () {\n // Parse an object value.\n\n var key,\n object = Object.create(null);\n\n if (ch === '{') {\n next('{');\n white();\n if (ch === '}') {\n next('}');\n return object; // empty object\n }\n while (ch) {\n key = string();\n white();\n next(':');\n if (\n _options.strict === true &&\n Object.hasOwnProperty.call(object, key)\n ) {\n error('Duplicate key \"' + key + '\"');\n }\n\n if (suspectProtoRx.test(key) === true) {\n if (_options.protoAction === 'error') {\n error('Object contains forbidden prototype property');\n } else if (_options.protoAction === 'ignore') {\n value();\n } else {\n object[key] = value();\n }\n } else if (suspectConstructorRx.test(key) === true) {\n if (_options.constructorAction === 'error') {\n error('Object contains forbidden constructor property');\n } else if (_options.constructorAction === 'ignore') {\n value();\n } else {\n object[key] = value();\n }\n } else {\n object[key] = value();\n }\n\n white();\n if (ch === '}') {\n next('}');\n return object;\n }\n next(',');\n white();\n }\n }\n error('Bad object');\n };\n\n value = function () {\n // Parse a JSON value. It could be an object, an array, a string, a number,\n // or a word.\n\n white();\n switch (ch) {\n case '{':\n return object();\n case '[':\n return array();\n case '\"':\n return string();\n case '-':\n return number();\n default:\n return ch >= '0' && ch <= '9' ? number() : word();\n }\n };\n\n // Return the json_parse function. It will have access to all of the above\n // functions and variables.\n\n return function (source, reviver) {\n var result;\n\n text = source + '';\n at = 0;\n ch = ' ';\n result = value();\n white();\n if (ch) {\n error('Syntax error');\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the result\n // in an empty key. If there is not a reviver function, we simply return the\n // result.\n\n return typeof reviver === 'function'\n ? (function walk(holder, key) {\n var k,\n v,\n value = holder[key];\n if (value && typeof value === 'object') {\n Object.keys(value).forEach(function (k) {\n v = walk(value, k);\n if (v !== undefined) {\n value[k] = v;\n } else {\n delete value[k];\n }\n });\n }\n return reviver.call(holder, key, value);\n })({ '': result }, '')\n : result;\n };\n};\n\nmodule.exports = json_parse;\n","var json_stringify = require('./lib/stringify.js').stringify;\nvar json_parse = require('./lib/parse.js');\n\nmodule.exports = function(options) {\n return {\n parse: json_parse(options),\n stringify: json_stringify\n }\n};\n//create the default method members with no options applied for backwards compatibility\nmodule.exports.parse = json_parse();\nmodule.exports.stringify = json_stringify;\n","\"use strict\";\n/**\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GCE_LINUX_BIOS_PATHS = void 0;\nexports.isGoogleCloudServerless = isGoogleCloudServerless;\nexports.isGoogleComputeEngineLinux = isGoogleComputeEngineLinux;\nexports.isGoogleComputeEngineMACAddress = isGoogleComputeEngineMACAddress;\nexports.isGoogleComputeEngine = isGoogleComputeEngine;\nexports.detectGCPResidency = detectGCPResidency;\nconst fs_1 = require(\"fs\");\nconst os_1 = require(\"os\");\n/**\n * Known paths unique to Google Compute Engine Linux instances\n */\nexports.GCE_LINUX_BIOS_PATHS = {\n BIOS_DATE: '/sys/class/dmi/id/bios_date',\n BIOS_VENDOR: '/sys/class/dmi/id/bios_vendor',\n};\nconst GCE_MAC_ADDRESS_REGEX = /^42:01/;\n/**\n * Determines if the process is running on a Google Cloud Serverless environment (Cloud Run or Cloud Functions instance).\n *\n * Uses the:\n * - {@link https://cloud.google.com/run/docs/container-contract#env-vars Cloud Run environment variables}.\n * - {@link https://cloud.google.com/functions/docs/env-var Cloud Functions environment variables}.\n *\n * @returns {boolean} `true` if the process is running on GCP serverless, `false` otherwise.\n */\nfunction isGoogleCloudServerless() {\n /**\n * `CLOUD_RUN_JOB` is used for Cloud Run Jobs\n * - See {@link https://cloud.google.com/run/docs/container-contract#env-vars Cloud Run environment variables}.\n *\n * `FUNCTION_NAME` is used in older Cloud Functions environments:\n * - See {@link https://cloud.google.com/functions/docs/env-var Python 3.7 and Go 1.11}.\n *\n * `K_SERVICE` is used in Cloud Run and newer Cloud Functions environments:\n * - See {@link https://cloud.google.com/run/docs/container-contract#env-vars Cloud Run environment variables}.\n * - See {@link https://cloud.google.com/functions/docs/env-var Cloud Functions newer runtimes}.\n */\n const isGFEnvironment = process.env.CLOUD_RUN_JOB ||\n process.env.FUNCTION_NAME ||\n process.env.K_SERVICE;\n return !!isGFEnvironment;\n}\n/**\n * Determines if the process is running on a Linux Google Compute Engine instance.\n *\n * @returns {boolean} `true` if the process is running on Linux GCE, `false` otherwise.\n */\nfunction isGoogleComputeEngineLinux() {\n if ((0, os_1.platform)() !== 'linux')\n return false;\n try {\n // ensure this file exist\n (0, fs_1.statSync)(exports.GCE_LINUX_BIOS_PATHS.BIOS_DATE);\n // ensure this file exist and matches\n const biosVendor = (0, fs_1.readFileSync)(exports.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR, 'utf8');\n return /Google/.test(biosVendor);\n }\n catch {\n return false;\n }\n}\n/**\n * Determines if the process is running on a Google Compute Engine instance with a known\n * MAC address.\n *\n * @returns {boolean} `true` if the process is running on GCE (as determined by MAC address), `false` otherwise.\n */\nfunction isGoogleComputeEngineMACAddress() {\n const interfaces = (0, os_1.networkInterfaces)();\n for (const item of Object.values(interfaces)) {\n if (!item)\n continue;\n for (const { mac } of item) {\n if (GCE_MAC_ADDRESS_REGEX.test(mac)) {\n return true;\n }\n }\n }\n return false;\n}\n/**\n * Determines if the process is running on a Google Compute Engine instance.\n *\n * @returns {boolean} `true` if the process is running on GCE, `false` otherwise.\n */\nfunction isGoogleComputeEngine() {\n return isGoogleComputeEngineLinux() || isGoogleComputeEngineMACAddress();\n}\n/**\n * Determines if the process is running on Google Cloud Platform.\n *\n * @returns {boolean} `true` if the process is running on GCP, `false` otherwise.\n */\nfunction detectGCPResidency() {\n return isGoogleCloudServerless() || isGoogleComputeEngine();\n}\n//# sourceMappingURL=gcp-residency.js.map","\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Colours = void 0;\n/**\n * Handles figuring out if we can use ANSI colours and handing out the escape codes.\n *\n * This is for package-internal use only, and may change at any time.\n *\n * @private\n * @internal\n */\nclass Colours {\n /**\n * @param stream The stream (e.g. process.stderr)\n * @returns true if the stream should have colourization enabled\n */\n static isEnabled(stream) {\n return (stream && // May happen in browsers.\n stream.isTTY &&\n (typeof stream.getColorDepth === 'function'\n ? stream.getColorDepth() > 2\n : true));\n }\n static refresh() {\n Colours.enabled = Colours.isEnabled(process === null || process === void 0 ? void 0 : process.stderr);\n if (!this.enabled) {\n Colours.reset = '';\n Colours.bright = '';\n Colours.dim = '';\n Colours.red = '';\n Colours.green = '';\n Colours.yellow = '';\n Colours.blue = '';\n Colours.magenta = '';\n Colours.cyan = '';\n Colours.white = '';\n Colours.grey = '';\n }\n else {\n Colours.reset = '\\u001b[0m';\n Colours.bright = '\\u001b[1m';\n Colours.dim = '\\u001b[2m';\n Colours.red = '\\u001b[31m';\n Colours.green = '\\u001b[32m';\n Colours.yellow = '\\u001b[33m';\n Colours.blue = '\\u001b[34m';\n Colours.magenta = '\\u001b[35m';\n Colours.cyan = '\\u001b[36m';\n Colours.white = '\\u001b[37m';\n Colours.grey = '\\u001b[90m';\n }\n }\n}\nexports.Colours = Colours;\nColours.enabled = false;\nColours.reset = '';\nColours.bright = '';\nColours.dim = '';\nColours.red = '';\nColours.green = '';\nColours.yellow = '';\nColours.blue = '';\nColours.magenta = '';\nColours.cyan = '';\nColours.white = '';\nColours.grey = '';\nColours.refresh();\n//# sourceMappingURL=colours.js.map","\"use strict\";\n// Copyright 2021-2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.env = exports.DebugLogBackendBase = exports.placeholder = exports.AdhocDebugLogger = exports.LogSeverity = void 0;\nexports.getNodeBackend = getNodeBackend;\nexports.getDebugBackend = getDebugBackend;\nexports.getStructuredBackend = getStructuredBackend;\nexports.setBackend = setBackend;\nexports.log = log;\nconst events_1 = require(\"events\");\nconst process = __importStar(require(\"process\"));\nconst util = __importStar(require(\"util\"));\nconst colours_1 = require(\"./colours\");\n// Some functions (as noted) are based on the Node standard library, from\n// the following file:\n//\n// https://github.com/nodejs/node/blob/main/lib/internal/util/debuglog.js\n/**\n * This module defines an ad-hoc debug logger for Google Cloud Platform\n * client libraries in Node. An ad-hoc debug logger is a tool which lets\n * users use an external, unified interface (in this case, environment\n * variables) to determine what logging they want to see at runtime. This\n * isn't necessarily fed into the console, but is meant to be under the\n * control of the user. The kind of logging that will be produced by this\n * is more like \"call retry happened\", not \"events you'd want to record\n * in Cloud Logger\".\n *\n * More for Googlers implementing libraries with it:\n * go/cloud-client-logging-design\n */\n/**\n * Possible log levels. These are a subset of Cloud Observability levels.\n * https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#LogSeverity\n */\nvar LogSeverity;\n(function (LogSeverity) {\n LogSeverity[\"DEFAULT\"] = \"DEFAULT\";\n LogSeverity[\"DEBUG\"] = \"DEBUG\";\n LogSeverity[\"INFO\"] = \"INFO\";\n LogSeverity[\"WARNING\"] = \"WARNING\";\n LogSeverity[\"ERROR\"] = \"ERROR\";\n})(LogSeverity || (exports.LogSeverity = LogSeverity = {}));\n/**\n * Our logger instance. This actually contains the meat of dealing\n * with log lines, including EventEmitter. This contains the function\n * that will be passed back to users of the package.\n */\nclass AdhocDebugLogger extends events_1.EventEmitter {\n /**\n * @param upstream The backend will pass a function that will be\n * called whenever our logger function is invoked.\n */\n constructor(namespace, upstream) {\n super();\n this.namespace = namespace;\n this.upstream = upstream;\n this.func = Object.assign(this.invoke.bind(this), {\n // Also add an instance pointer back to us.\n instance: this,\n // And pull over the EventEmitter functionality.\n on: (event, listener) => this.on(event, listener),\n });\n // Convenience methods for log levels.\n this.func.debug = (...args) => this.invokeSeverity(LogSeverity.DEBUG, ...args);\n this.func.info = (...args) => this.invokeSeverity(LogSeverity.INFO, ...args);\n this.func.warn = (...args) => this.invokeSeverity(LogSeverity.WARNING, ...args);\n this.func.error = (...args) => this.invokeSeverity(LogSeverity.ERROR, ...args);\n this.func.sublog = (namespace) => log(namespace, this.func);\n }\n invoke(fields, ...args) {\n // Push out any upstream logger first.\n if (this.upstream) {\n try {\n this.upstream(fields, ...args);\n }\n catch (e) {\n // Swallow exceptions to avoid interfering with other logging.\n }\n }\n // Emit sink events.\n try {\n this.emit('log', fields, args);\n }\n catch (e) {\n // Swallow exceptions to avoid interfering with other logging.\n }\n }\n invokeSeverity(severity, ...args) {\n this.invoke({ severity }, ...args);\n }\n}\nexports.AdhocDebugLogger = AdhocDebugLogger;\n/**\n * This can be used in place of a real logger while waiting for Promises or disabling logging.\n */\nexports.placeholder = new AdhocDebugLogger('', () => { }).func;\n/**\n * The base class for debug logging backends. It's possible to use this, but the\n * same non-guarantees above still apply (unstable interface, etc).\n *\n * @private\n * @internal\n */\nclass DebugLogBackendBase {\n constructor() {\n var _a;\n this.cached = new Map();\n this.filters = [];\n this.filtersSet = false;\n // Look for the Node config variable for what systems to enable. We'll store\n // these for the log method below, which will call setFilters() once.\n let nodeFlag = (_a = process.env[exports.env.nodeEnables]) !== null && _a !== void 0 ? _a : '*';\n if (nodeFlag === 'all') {\n nodeFlag = '*';\n }\n this.filters = nodeFlag.split(',');\n }\n log(namespace, fields, ...args) {\n try {\n if (!this.filtersSet) {\n this.setFilters();\n this.filtersSet = true;\n }\n let logger = this.cached.get(namespace);\n if (!logger) {\n logger = this.makeLogger(namespace);\n this.cached.set(namespace, logger);\n }\n logger(fields, ...args);\n }\n catch (e) {\n // Silently ignore all errors; we don't want them to interfere with\n // the user's running app.\n // e;\n console.error(e);\n }\n }\n}\nexports.DebugLogBackendBase = DebugLogBackendBase;\n// The basic backend. This one definitely works, but it's less feature-filled.\n//\n// Rather than using util.debuglog, this implements the same basic logic directly.\n// The reason for this decision is that debuglog checks the value of the\n// NODE_DEBUG environment variable before any user code runs; we therefore\n// can't pipe our own enables into it (and util.debuglog will never print unless\n// the user duplicates it into NODE_DEBUG, which isn't reasonable).\n//\nclass NodeBackend extends DebugLogBackendBase {\n constructor() {\n super(...arguments);\n // Default to allowing all systems, since we gate earlier based on whether the\n // variable is empty.\n this.enabledRegexp = /.*/g;\n }\n isEnabled(namespace) {\n return this.enabledRegexp.test(namespace);\n }\n makeLogger(namespace) {\n if (!this.enabledRegexp.test(namespace)) {\n return () => { };\n }\n return (fields, ...args) => {\n var _a;\n // TODO: `fields` needs to be turned into a string here, one way or another.\n const nscolour = `${colours_1.Colours.green}${namespace}${colours_1.Colours.reset}`;\n const pid = `${colours_1.Colours.yellow}${process.pid}${colours_1.Colours.reset}`;\n let level;\n switch (fields.severity) {\n case LogSeverity.ERROR:\n level = `${colours_1.Colours.red}${fields.severity}${colours_1.Colours.reset}`;\n break;\n case LogSeverity.INFO:\n level = `${colours_1.Colours.magenta}${fields.severity}${colours_1.Colours.reset}`;\n break;\n case LogSeverity.WARNING:\n level = `${colours_1.Colours.yellow}${fields.severity}${colours_1.Colours.reset}`;\n break;\n default:\n level = (_a = fields.severity) !== null && _a !== void 0 ? _a : LogSeverity.DEFAULT;\n break;\n }\n const msg = util.formatWithOptions({ colors: colours_1.Colours.enabled }, ...args);\n const filteredFields = Object.assign({}, fields);\n delete filteredFields.severity;\n const fieldsJson = Object.getOwnPropertyNames(filteredFields).length\n ? JSON.stringify(filteredFields)\n : '';\n const fieldsColour = fieldsJson\n ? `${colours_1.Colours.grey}${fieldsJson}${colours_1.Colours.reset}`\n : '';\n console.error('%s [%s|%s] %s%s', pid, nscolour, level, msg, fieldsJson ? ` ${fieldsColour}` : '');\n };\n }\n // Regexp patterns below are from here:\n // https://github.com/nodejs/node/blob/c0aebed4b3395bd65d54b18d1fd00f071002ac20/lib/internal/util/debuglog.js#L36\n setFilters() {\n const totalFilters = this.filters.join(',');\n const regexp = totalFilters\n .replace(/[|\\\\{}()[\\]^$+?.]/g, '\\\\$&')\n .replace(/\\*/g, '.*')\n .replace(/,/g, '$|^');\n this.enabledRegexp = new RegExp(`^${regexp}$`, 'i');\n }\n}\n/**\n * @returns A backend based on Node util.debuglog; this is the default.\n */\nfunction getNodeBackend() {\n return new NodeBackend();\n}\nclass DebugBackend extends DebugLogBackendBase {\n constructor(pkg) {\n super();\n this.debugPkg = pkg;\n }\n makeLogger(namespace) {\n const debugLogger = this.debugPkg(namespace);\n return (fields, ...args) => {\n // TODO: `fields` needs to be turned into a string here.\n debugLogger(args[0], ...args.slice(1));\n };\n }\n setFilters() {\n var _a;\n const existingFilters = (_a = process.env['NODE_DEBUG']) !== null && _a !== void 0 ? _a : '';\n process.env['NODE_DEBUG'] = `${existingFilters}${existingFilters ? ',' : ''}${this.filters.join(',')}`;\n }\n}\n/**\n * Creates a \"debug\" package backend. The user must call require('debug') and pass\n * the resulting object to this function.\n *\n * ```\n * setBackend(getDebugBackend(require('debug')))\n * ```\n *\n * https://www.npmjs.com/package/debug\n *\n * Note: Google does not explicitly endorse or recommend this package; it's just\n * being provided as an option.\n *\n * @returns A backend based on the npm \"debug\" package.\n */\nfunction getDebugBackend(debugPkg) {\n return new DebugBackend(debugPkg);\n}\n/**\n * This pretty much works like the Node logger, but it outputs structured\n * logging JSON matching Google Cloud's ingestion specs. Rather than handling\n * its own output, it wraps another backend. The passed backend must be a subclass\n * of `DebugLogBackendBase` (any of the backends exposed by this package will work).\n */\nclass StructuredBackend extends DebugLogBackendBase {\n constructor(upstream) {\n var _a;\n super();\n this.upstream = (_a = upstream) !== null && _a !== void 0 ? _a : undefined;\n }\n makeLogger(namespace) {\n var _a;\n const debugLogger = (_a = this.upstream) === null || _a === void 0 ? void 0 : _a.makeLogger(namespace);\n return (fields, ...args) => {\n var _a;\n const severity = (_a = fields.severity) !== null && _a !== void 0 ? _a : LogSeverity.INFO;\n const json = Object.assign({\n severity,\n message: util.format(...args),\n }, fields);\n const jsonString = JSON.stringify(json);\n if (debugLogger) {\n debugLogger(fields, jsonString);\n }\n else {\n console.log('%s', jsonString);\n }\n };\n }\n setFilters() {\n var _a;\n (_a = this.upstream) === null || _a === void 0 ? void 0 : _a.setFilters();\n }\n}\n/**\n * Creates a \"structured logging\" backend. This pretty much works like the\n * Node logger, but it outputs structured logging JSON matching Google\n * Cloud's ingestion specs instead of plain text.\n *\n * ```\n * setBackend(getStructuredBackend())\n * ```\n *\n * @param upstream If you want to use something besides the Node backend to\n * write the actual log lines into, pass that here.\n * @returns A backend based on Google Cloud structured logging.\n */\nfunction getStructuredBackend(upstream) {\n return new StructuredBackend(upstream);\n}\n/**\n * The environment variables that we standardized on, for all ad-hoc logging.\n */\nexports.env = {\n /**\n * Filter wildcards specific to the Node syntax, and similar to the built-in\n * utils.debuglog() environment variable. If missing, disables logging.\n */\n nodeEnables: 'GOOGLE_SDK_NODE_LOGGING',\n};\n// Keep a copy of all namespaced loggers so users can reliably .on() them.\n// Note that these cached functions will need to deal with changes in the backend.\nconst loggerCache = new Map();\n// Our current global backend. This might be:\nlet cachedBackend = undefined;\n/**\n * Set the backend to use for our log output.\n * - A backend object\n * - null to disable logging\n * - undefined for \"nothing yet\", defaults to the Node backend\n *\n * @param backend Results from one of the get*Backend() functions.\n */\nfunction setBackend(backend) {\n cachedBackend = backend;\n loggerCache.clear();\n}\n/**\n * Creates a logging function. Multiple calls to this with the same namespace\n * will produce the same logger, with the same event emitter hooks.\n *\n * Namespaces can be a simple string (\"system\" name), or a qualified string\n * (system:subsystem), which can be used for filtering, or for \"system:*\".\n *\n * @param namespace The namespace, a descriptive text string.\n * @returns A function you can call that works similar to console.log().\n */\nfunction log(namespace, parent) {\n // If the enable environment variable isn't set, do nothing. The user\n // can still choose to set a backend of their choice using the manual\n // `setBackend()`.\n if (!cachedBackend) {\n const enablesFlag = process.env[exports.env.nodeEnables];\n if (!enablesFlag) {\n return exports.placeholder;\n }\n }\n // This might happen mostly if the typings are dropped in a user's code,\n // or if they're calling from JavaScript.\n if (!namespace) {\n return exports.placeholder;\n }\n // Handle sub-loggers.\n if (parent) {\n namespace = `${parent.instance.namespace}:${namespace}`;\n }\n // Reuse loggers so things like event sinks are persistent.\n const existing = loggerCache.get(namespace);\n if (existing) {\n return existing.func;\n }\n // Do we have a backend yet?\n if (cachedBackend === null) {\n // Explicitly disabled.\n return exports.placeholder;\n }\n else if (cachedBackend === undefined) {\n // One hasn't been made yet, so default to Node.\n cachedBackend = getNodeBackend();\n }\n // The logger is further wrapped so we can handle the backend changing out.\n const logger = (() => {\n let previousBackend = undefined;\n const newLogger = new AdhocDebugLogger(namespace, (fields, ...args) => {\n if (previousBackend !== cachedBackend) {\n // Did the user pass a custom backend?\n if (cachedBackend === null) {\n // Explicitly disabled.\n return;\n }\n else if (cachedBackend === undefined) {\n // One hasn't been made yet, so default to Node.\n cachedBackend = getNodeBackend();\n }\n previousBackend = cachedBackend;\n }\n cachedBackend === null || cachedBackend === void 0 ? void 0 : cachedBackend.log(namespace, fields, ...args);\n });\n return newLogger;\n })();\n loggerCache.set(namespace, logger);\n return logger.func;\n}\n//# sourceMappingURL=logging-utils.js.map","\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./logging-utils\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/**\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.gcpResidencyCache = exports.METADATA_SERVER_DETECTION = exports.HEADERS = exports.HEADER_VALUE = exports.HEADER_NAME = exports.SECONDARY_HOST_ADDRESS = exports.HOST_ADDRESS = exports.BASE_PATH = void 0;\nexports.instance = instance;\nexports.project = project;\nexports.universe = universe;\nexports.bulk = bulk;\nexports.isAvailable = isAvailable;\nexports.resetIsAvailableCache = resetIsAvailableCache;\nexports.getGCPResidency = getGCPResidency;\nexports.setGCPResidency = setGCPResidency;\nexports.requestTimeout = requestTimeout;\nconst gaxios_1 = require(\"gaxios\");\nconst jsonBigint = require(\"json-bigint\");\nconst gcp_residency_1 = require(\"./gcp-residency\");\nconst logger = require(\"google-logging-utils\");\nexports.BASE_PATH = '/computeMetadata/v1';\nexports.HOST_ADDRESS = 'http://169.254.169.254';\nexports.SECONDARY_HOST_ADDRESS = 'http://metadata.google.internal.';\nexports.HEADER_NAME = 'Metadata-Flavor';\nexports.HEADER_VALUE = 'Google';\nexports.HEADERS = Object.freeze({ [exports.HEADER_NAME]: exports.HEADER_VALUE });\nconst log = logger.log('gcp metadata');\n/**\n * Metadata server detection override options.\n *\n * Available via `process.env.METADATA_SERVER_DETECTION`.\n */\nexports.METADATA_SERVER_DETECTION = Object.freeze({\n 'assume-present': \"don't try to ping the metadata server, but assume it's present\",\n none: \"don't try to ping the metadata server, but don't try to use it either\",\n 'bios-only': \"treat the result of a BIOS probe as canonical (don't fall back to pinging)\",\n 'ping-only': 'skip the BIOS probe, and go straight to pinging',\n});\n/**\n * Returns the base URL while taking into account the GCE_METADATA_HOST\n * environment variable if it exists.\n *\n * @returns The base URL, e.g., http://169.254.169.254/computeMetadata/v1.\n */\nfunction getBaseUrl(baseUrl) {\n if (!baseUrl) {\n baseUrl =\n process.env.GCE_METADATA_IP ||\n process.env.GCE_METADATA_HOST ||\n exports.HOST_ADDRESS;\n }\n // If no scheme is provided default to HTTP:\n if (!/^https?:\\/\\//.test(baseUrl)) {\n baseUrl = `http://${baseUrl}`;\n }\n return new URL(exports.BASE_PATH, baseUrl).href;\n}\n// Accepts an options object passed from the user to the API. In previous\n// versions of the API, it referred to a `Request` or an `Axios` request\n// options object. Now it refers to an object with very limited property\n// names. This is here to help ensure users don't pass invalid options when\n// they upgrade from 0.4 to 0.5 to 0.8.\nfunction validate(options) {\n Object.keys(options).forEach(key => {\n switch (key) {\n case 'params':\n case 'property':\n case 'headers':\n break;\n case 'qs':\n throw new Error(\"'qs' is not a valid configuration option. Please use 'params' instead.\");\n default:\n throw new Error(`'${key}' is not a valid configuration option.`);\n }\n });\n}\nasync function metadataAccessor(type, options = {}, noResponseRetries = 3, fastFail = false) {\n const headers = new Headers(exports.HEADERS);\n let metadataKey = '';\n let params = {};\n if (typeof type === 'object') {\n const metadataAccessor = type;\n new Headers(metadataAccessor.headers).forEach((value, key) => headers.set(key, value));\n metadataKey = metadataAccessor.metadataKey;\n params = metadataAccessor.params || params;\n noResponseRetries = metadataAccessor.noResponseRetries || noResponseRetries;\n fastFail = metadataAccessor.fastFail || fastFail;\n }\n else {\n metadataKey = type;\n }\n if (typeof options === 'string') {\n metadataKey += `/${options}`;\n }\n else {\n validate(options);\n if (options.property) {\n metadataKey += `/${options.property}`;\n }\n new Headers(options.headers).forEach((value, key) => headers.set(key, value));\n params = options.params || params;\n }\n const requestMethod = fastFail ? fastFailMetadataRequest : gaxios_1.request;\n const req = {\n url: `${getBaseUrl()}/${metadataKey}`,\n headers,\n retryConfig: { noResponseRetries },\n params,\n responseType: 'text',\n timeout: requestTimeout(),\n };\n log.info('instance request %j', req);\n const res = await requestMethod(req);\n log.info('instance metadata is %s', res.data);\n const metadataFlavor = res.headers.get(exports.HEADER_NAME);\n if (metadataFlavor !== exports.HEADER_VALUE) {\n throw new RangeError(`Invalid response from metadata service: incorrect ${exports.HEADER_NAME} header. Expected '${exports.HEADER_VALUE}', got ${metadataFlavor ? `'${metadataFlavor}'` : 'no header'}`);\n }\n if (typeof res.data === 'string') {\n try {\n return jsonBigint.parse(res.data);\n }\n catch {\n /* ignore */\n }\n }\n return res.data;\n}\nasync function fastFailMetadataRequest(options) {\n const secondaryOptions = {\n ...options,\n url: options.url\n ?.toString()\n .replace(getBaseUrl(), getBaseUrl(exports.SECONDARY_HOST_ADDRESS)),\n };\n // We race a connection between DNS/IP to metadata server. There are a couple\n // reasons for this:\n //\n // 1. the DNS is slow in some GCP environments; by checking both, we might\n // detect the runtime environment significantly faster.\n // 2. we can't just check the IP, which is tarpitted and slow to respond\n // on a user's local machine.\n //\n // Returns first resolved promise or if all promises get rejected we return an AggregateError.\n //\n // Note, however, if a failure happens prior to a success, a rejection should\n // occur, this is for folks running locally.\n //\n const r1 = (0, gaxios_1.request)(options);\n const r2 = (0, gaxios_1.request)(secondaryOptions);\n return Promise.any([r1, r2]);\n}\n/**\n * Obtain metadata for the current GCE instance.\n *\n * @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}\n *\n * @example\n * ```\n * const serviceAccount: {} = await instance('service-accounts/');\n * const serviceAccountEmail: string = await instance('service-accounts/default/email');\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction instance(options) {\n return metadataAccessor('instance', options);\n}\n/**\n * Obtain metadata for the current GCP project.\n *\n * @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}\n *\n * @example\n * ```\n * const projectId: string = await project('project-id');\n * const numericProjectId: number = await project('numeric-project-id');\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction project(options) {\n return metadataAccessor('project', options);\n}\n/**\n * Obtain metadata for the current universe.\n *\n * @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}\n *\n * @example\n * ```\n * const universeDomain: string = await universe('universe-domain');\n * ```\n */\nfunction universe(options) {\n return metadataAccessor('universe', options);\n}\n/**\n * Retrieve metadata items in parallel.\n *\n * @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}\n *\n * @example\n * ```\n * const data = await bulk([\n * {\n * metadataKey: 'instance',\n * },\n * {\n * metadataKey: 'project/project-id',\n * },\n * ] as const);\n *\n * // data.instance;\n * // data['project/project-id'];\n * ```\n *\n * @param properties The metadata properties to retrieve\n * @returns The metadata in `metadatakey:value` format\n */\nasync function bulk(properties) {\n const r = {};\n await Promise.all(properties.map(item => {\n return (async () => {\n const res = await metadataAccessor(item);\n const key = item.metadataKey;\n r[key] = res;\n })();\n }));\n return r;\n}\n/*\n * How many times should we retry detecting GCP environment.\n */\nfunction detectGCPAvailableRetries() {\n return process.env.DETECT_GCP_RETRIES\n ? Number(process.env.DETECT_GCP_RETRIES)\n : 0;\n}\nlet cachedIsAvailableResponse;\n/**\n * Determine if the metadata server is currently available.\n */\nasync function isAvailable() {\n if (process.env.METADATA_SERVER_DETECTION) {\n const value = process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();\n if (!(value in exports.METADATA_SERVER_DETECTION)) {\n throw new RangeError(`Unknown \\`METADATA_SERVER_DETECTION\\` env variable. Got \\`${value}\\`, but it should be \\`${Object.keys(exports.METADATA_SERVER_DETECTION).join('`, `')}\\`, or unset`);\n }\n switch (value) {\n case 'assume-present':\n return true;\n case 'none':\n return false;\n case 'bios-only':\n return getGCPResidency();\n case 'ping-only':\n // continue, we want to ping the server\n }\n }\n try {\n // If a user is instantiating several GCP libraries at the same time,\n // this may result in multiple calls to isAvailable(), to detect the\n // runtime environment. We use the same promise for each of these calls\n // to reduce the network load.\n if (cachedIsAvailableResponse === undefined) {\n cachedIsAvailableResponse = metadataAccessor('instance', undefined, detectGCPAvailableRetries(), \n // If the default HOST_ADDRESS has been overridden, we should not\n // make an effort to try SECONDARY_HOST_ADDRESS (as we are likely in\n // a non-GCP environment):\n !(process.env.GCE_METADATA_IP || process.env.GCE_METADATA_HOST));\n }\n await cachedIsAvailableResponse;\n return true;\n }\n catch (e) {\n const err = e;\n if (process.env.DEBUG_AUTH) {\n console.info(err);\n }\n if (err.type === 'request-timeout') {\n // If running in a GCP environment, metadata endpoint should return\n // within ms.\n return false;\n }\n if (err.response && err.response.status === 404) {\n return false;\n }\n else {\n if (!(err.response && err.response.status === 404) &&\n // A warning is emitted if we see an unexpected err.code, or err.code\n // is not populated:\n (!err.code ||\n ![\n 'EHOSTDOWN',\n 'EHOSTUNREACH',\n 'ENETUNREACH',\n 'ENOENT',\n 'ENOTFOUND',\n 'ECONNREFUSED',\n ].includes(err.code))) {\n let code = 'UNKNOWN';\n if (err.code)\n code = err.code;\n process.emitWarning(`received unexpected error = ${err.message} code = ${code}`, 'MetadataLookupWarning');\n }\n // Failure to resolve the metadata service means that it is not available.\n return false;\n }\n }\n}\n/**\n * reset the memoized isAvailable() lookup.\n */\nfunction resetIsAvailableCache() {\n cachedIsAvailableResponse = undefined;\n}\n/**\n * A cache for the detected GCP Residency.\n */\nexports.gcpResidencyCache = null;\n/**\n * Detects GCP Residency.\n * Caches results to reduce costs for subsequent calls.\n *\n * @see setGCPResidency for setting\n */\nfunction getGCPResidency() {\n if (exports.gcpResidencyCache === null) {\n setGCPResidency();\n }\n return exports.gcpResidencyCache;\n}\n/**\n * Sets the detected GCP Residency.\n * Useful for forcing metadata server detection behavior.\n *\n * Set `null` to autodetect the environment (default behavior).\n * @see getGCPResidency for getting\n */\nfunction setGCPResidency(value = null) {\n exports.gcpResidencyCache = value !== null ? value : (0, gcp_residency_1.detectGCPResidency)();\n}\n/**\n * Obtain the timeout for requests to the metadata server.\n *\n * In certain environments and conditions requests can take longer than\n * the default timeout to complete. This function will determine the\n * appropriate timeout based on the environment.\n *\n * @returns {number} a request timeout duration in milliseconds.\n */\nfunction requestTimeout() {\n return getGCPResidency() ? 0 : 3000;\n}\n__exportStar(require(\"./gcp-residency\"), exports);\n//# sourceMappingURL=index.js.map","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","\"use strict\";\n// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromArrayBufferToHex = fromArrayBufferToHex;\n/**\n * Converts an ArrayBuffer to a hexadecimal string.\n * @param arrayBuffer The ArrayBuffer to convert to hexadecimal string.\n * @return The hexadecimal encoding of the ArrayBuffer.\n */\nfunction fromArrayBufferToHex(arrayBuffer) {\n // Convert buffer to byte array.\n const byteArray = Array.from(new Uint8Array(arrayBuffer));\n // Convert bytes to hex string.\n return byteArray\n .map(byte => {\n return byte.toString(16).padStart(2, '0');\n })\n .join('');\n}\n//# sourceMappingURL=shared.js.map","\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n/* global window */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BrowserCrypto = void 0;\n// This file implements crypto functions we need using in-browser\n// SubtleCrypto interface `window.crypto.subtle`.\nconst base64js = require(\"base64-js\");\nconst shared_1 = require(\"../shared\");\nclass BrowserCrypto {\n constructor() {\n if (typeof window === 'undefined' ||\n window.crypto === undefined ||\n window.crypto.subtle === undefined) {\n throw new Error(\"SubtleCrypto not found. Make sure it's an https:// website.\");\n }\n }\n async sha256DigestBase64(str) {\n // SubtleCrypto digest() method is async, so we must make\n // this method async as well.\n // To calculate SHA256 digest using SubtleCrypto, we first\n // need to convert an input string to an ArrayBuffer:\n const inputBuffer = new TextEncoder().encode(str);\n // Result is ArrayBuffer as well.\n const outputBuffer = await window.crypto.subtle.digest('SHA-256', inputBuffer);\n return base64js.fromByteArray(new Uint8Array(outputBuffer));\n }\n randomBytesBase64(count) {\n const array = new Uint8Array(count);\n window.crypto.getRandomValues(array);\n return base64js.fromByteArray(array);\n }\n static padBase64(base64) {\n // base64js requires padding, so let's add some '='\n while (base64.length % 4 !== 0) {\n base64 += '=';\n }\n return base64;\n }\n async verify(pubkey, data, signature) {\n const algo = {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' },\n };\n const dataArray = new TextEncoder().encode(data);\n const signatureArray = base64js.toByteArray(BrowserCrypto.padBase64(signature));\n const cryptoKey = await window.crypto.subtle.importKey('jwk', pubkey, algo, true, ['verify']);\n // SubtleCrypto's verify method is async so we must make\n // this method async as well.\n const result = await window.crypto.subtle.verify(algo, cryptoKey, signatureArray, dataArray);\n return result;\n }\n async sign(privateKey, data) {\n const algo = {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' },\n };\n const dataArray = new TextEncoder().encode(data);\n const cryptoKey = await window.crypto.subtle.importKey('jwk', privateKey, algo, true, ['sign']);\n // SubtleCrypto's sign method is async so we must make\n // this method async as well.\n const result = await window.crypto.subtle.sign(algo, cryptoKey, dataArray);\n return base64js.fromByteArray(new Uint8Array(result));\n }\n decodeBase64StringUtf8(base64) {\n const uint8array = base64js.toByteArray(BrowserCrypto.padBase64(base64));\n const result = new TextDecoder().decode(uint8array);\n return result;\n }\n encodeBase64StringUtf8(text) {\n const uint8array = new TextEncoder().encode(text);\n const result = base64js.fromByteArray(uint8array);\n return result;\n }\n /**\n * Computes the SHA-256 hash of the provided string.\n * @param str The plain text string to hash.\n * @return A promise that resolves with the SHA-256 hash of the provided\n * string in hexadecimal encoding.\n */\n async sha256DigestHex(str) {\n // SubtleCrypto digest() method is async, so we must make\n // this method async as well.\n // To calculate SHA256 digest using SubtleCrypto, we first\n // need to convert an input string to an ArrayBuffer:\n const inputBuffer = new TextEncoder().encode(str);\n // Result is ArrayBuffer as well.\n const outputBuffer = await window.crypto.subtle.digest('SHA-256', inputBuffer);\n return (0, shared_1.fromArrayBufferToHex)(outputBuffer);\n }\n /**\n * Computes the HMAC hash of a message using the provided crypto key and the\n * SHA-256 algorithm.\n * @param key The secret crypto key in utf-8 or ArrayBuffer format.\n * @param msg The plain text message.\n * @return A promise that resolves with the HMAC-SHA256 hash in ArrayBuffer\n * format.\n */\n async signWithHmacSha256(key, msg) {\n // Convert key, if provided in ArrayBuffer format, to string.\n const rawKey = typeof key === 'string'\n ? key\n : String.fromCharCode(...new Uint16Array(key));\n const enc = new TextEncoder();\n const cryptoKey = await window.crypto.subtle.importKey('raw', enc.encode(rawKey), {\n name: 'HMAC',\n hash: {\n name: 'SHA-256',\n },\n }, false, ['sign']);\n return window.crypto.subtle.sign('HMAC', cryptoKey, enc.encode(msg));\n }\n}\nexports.BrowserCrypto = BrowserCrypto;\n//# sourceMappingURL=crypto.js.map","\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NodeCrypto = void 0;\nconst crypto = require(\"crypto\");\nclass NodeCrypto {\n async sha256DigestBase64(str) {\n return crypto.createHash('sha256').update(str).digest('base64');\n }\n randomBytesBase64(count) {\n return crypto.randomBytes(count).toString('base64');\n }\n async verify(pubkey, data, signature) {\n const verifier = crypto.createVerify('RSA-SHA256');\n verifier.update(data);\n verifier.end();\n return verifier.verify(pubkey, signature, 'base64');\n }\n async sign(privateKey, data) {\n const signer = crypto.createSign('RSA-SHA256');\n signer.update(data);\n signer.end();\n return signer.sign(privateKey, 'base64');\n }\n decodeBase64StringUtf8(base64) {\n return Buffer.from(base64, 'base64').toString('utf-8');\n }\n encodeBase64StringUtf8(text) {\n return Buffer.from(text, 'utf-8').toString('base64');\n }\n /**\n * Computes the SHA-256 hash of the provided string.\n * @param str The plain text string to hash.\n * @return A promise that resolves with the SHA-256 hash of the provided\n * string in hexadecimal encoding.\n */\n async sha256DigestHex(str) {\n return crypto.createHash('sha256').update(str).digest('hex');\n }\n /**\n * Computes the HMAC hash of a message using the provided crypto key and the\n * SHA-256 algorithm.\n * @param key The secret crypto key in utf-8 or ArrayBuffer format.\n * @param msg The plain text message.\n * @return A promise that resolves with the HMAC-SHA256 hash in ArrayBuffer\n * format.\n */\n async signWithHmacSha256(key, msg) {\n const cryptoKey = typeof key === 'string' ? key : toBuffer(key);\n return toArrayBuffer(crypto.createHmac('sha256', cryptoKey).update(msg).digest());\n }\n}\nexports.NodeCrypto = NodeCrypto;\n/**\n * Converts a Node.js Buffer to an ArrayBuffer.\n * https://stackoverflow.com/questions/8609289/convert-a-binary-nodejs-buffer-to-javascript-arraybuffer\n * @param buffer The Buffer input to covert.\n * @return The ArrayBuffer representation of the input.\n */\nfunction toArrayBuffer(buffer) {\n return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);\n}\n/**\n * Converts an ArrayBuffer to a Node.js Buffer.\n * @param arrayBuffer The ArrayBuffer input to covert.\n * @return The Buffer representation of the input.\n */\nfunction toBuffer(arrayBuffer) {\n return Buffer.from(arrayBuffer);\n}\n//# sourceMappingURL=crypto.js.map","\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n/* global window */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createCrypto = createCrypto;\nexports.hasBrowserCrypto = hasBrowserCrypto;\nconst crypto_1 = require(\"./browser/crypto\");\nconst crypto_2 = require(\"./node/crypto\");\n__exportStar(require(\"./shared\"), exports);\n// Crypto interface will provide required crypto functions.\n// Use `createCrypto()` factory function to create an instance\n// of Crypto. It will either use Node.js `crypto` module, or\n// use browser's SubtleCrypto interface. Since most of the\n// SubtleCrypto methods return promises, we must make those\n// methods return promises here as well, even though in Node.js\n// they are synchronous.\nfunction createCrypto() {\n if (hasBrowserCrypto()) {\n return new crypto_1.BrowserCrypto();\n }\n return new crypto_2.NodeCrypto();\n}\nfunction hasBrowserCrypto() {\n return (typeof window !== 'undefined' &&\n typeof window.crypto !== 'undefined' &&\n typeof window.crypto.subtle !== 'undefined');\n}\n//# sourceMappingURL=crypto.js.map","/*! safe-buffer. MIT License. Feross Aboukhadijeh */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","'use strict';\n\nfunction getParamSize(keySize) {\n\tvar result = ((keySize / 8) | 0) + (keySize % 8 === 0 ? 0 : 1);\n\treturn result;\n}\n\nvar paramBytesForAlg = {\n\tES256: getParamSize(256),\n\tES384: getParamSize(384),\n\tES512: getParamSize(521)\n};\n\nfunction getParamBytesForAlg(alg) {\n\tvar paramBytes = paramBytesForAlg[alg];\n\tif (paramBytes) {\n\t\treturn paramBytes;\n\t}\n\n\tthrow new Error('Unknown algorithm \"' + alg + '\"');\n}\n\nmodule.exports = getParamBytesForAlg;\n","'use strict';\n\nvar Buffer = require('safe-buffer').Buffer;\n\nvar getParamBytesForAlg = require('./param-bytes-for-alg');\n\nvar MAX_OCTET = 0x80,\n\tCLASS_UNIVERSAL = 0,\n\tPRIMITIVE_BIT = 0x20,\n\tTAG_SEQ = 0x10,\n\tTAG_INT = 0x02,\n\tENCODED_TAG_SEQ = (TAG_SEQ | PRIMITIVE_BIT) | (CLASS_UNIVERSAL << 6),\n\tENCODED_TAG_INT = TAG_INT | (CLASS_UNIVERSAL << 6);\n\nfunction base64Url(base64) {\n\treturn base64\n\t\t.replace(/=/g, '')\n\t\t.replace(/\\+/g, '-')\n\t\t.replace(/\\//g, '_');\n}\n\nfunction signatureAsBuffer(signature) {\n\tif (Buffer.isBuffer(signature)) {\n\t\treturn signature;\n\t} else if ('string' === typeof signature) {\n\t\treturn Buffer.from(signature, 'base64');\n\t}\n\n\tthrow new TypeError('ECDSA signature must be a Base64 string or a Buffer');\n}\n\nfunction derToJose(signature, alg) {\n\tsignature = signatureAsBuffer(signature);\n\tvar paramBytes = getParamBytesForAlg(alg);\n\n\t// the DER encoded param should at most be the param size, plus a padding\n\t// zero, since due to being a signed integer\n\tvar maxEncodedParamLength = paramBytes + 1;\n\n\tvar inputLength = signature.length;\n\n\tvar offset = 0;\n\tif (signature[offset++] !== ENCODED_TAG_SEQ) {\n\t\tthrow new Error('Could not find expected \"seq\"');\n\t}\n\n\tvar seqLength = signature[offset++];\n\tif (seqLength === (MAX_OCTET | 1)) {\n\t\tseqLength = signature[offset++];\n\t}\n\n\tif (inputLength - offset < seqLength) {\n\t\tthrow new Error('\"seq\" specified length of \"' + seqLength + '\", only \"' + (inputLength - offset) + '\" remaining');\n\t}\n\n\tif (signature[offset++] !== ENCODED_TAG_INT) {\n\t\tthrow new Error('Could not find expected \"int\" for \"r\"');\n\t}\n\n\tvar rLength = signature[offset++];\n\n\tif (inputLength - offset - 2 < rLength) {\n\t\tthrow new Error('\"r\" specified length of \"' + rLength + '\", only \"' + (inputLength - offset - 2) + '\" available');\n\t}\n\n\tif (maxEncodedParamLength < rLength) {\n\t\tthrow new Error('\"r\" specified length of \"' + rLength + '\", max of \"' + maxEncodedParamLength + '\" is acceptable');\n\t}\n\n\tvar rOffset = offset;\n\toffset += rLength;\n\n\tif (signature[offset++] !== ENCODED_TAG_INT) {\n\t\tthrow new Error('Could not find expected \"int\" for \"s\"');\n\t}\n\n\tvar sLength = signature[offset++];\n\n\tif (inputLength - offset !== sLength) {\n\t\tthrow new Error('\"s\" specified length of \"' + sLength + '\", expected \"' + (inputLength - offset) + '\"');\n\t}\n\n\tif (maxEncodedParamLength < sLength) {\n\t\tthrow new Error('\"s\" specified length of \"' + sLength + '\", max of \"' + maxEncodedParamLength + '\" is acceptable');\n\t}\n\n\tvar sOffset = offset;\n\toffset += sLength;\n\n\tif (offset !== inputLength) {\n\t\tthrow new Error('Expected to consume entire buffer, but \"' + (inputLength - offset) + '\" bytes remain');\n\t}\n\n\tvar rPadding = paramBytes - rLength,\n\t\tsPadding = paramBytes - sLength;\n\n\tvar dst = Buffer.allocUnsafe(rPadding + rLength + sPadding + sLength);\n\n\tfor (offset = 0; offset < rPadding; ++offset) {\n\t\tdst[offset] = 0;\n\t}\n\tsignature.copy(dst, offset, rOffset + Math.max(-rPadding, 0), rOffset + rLength);\n\n\toffset = paramBytes;\n\n\tfor (var o = offset; offset < o + sPadding; ++offset) {\n\t\tdst[offset] = 0;\n\t}\n\tsignature.copy(dst, offset, sOffset + Math.max(-sPadding, 0), sOffset + sLength);\n\n\tdst = dst.toString('base64');\n\tdst = base64Url(dst);\n\n\treturn dst;\n}\n\nfunction countPadding(buf, start, stop) {\n\tvar padding = 0;\n\twhile (start + padding < stop && buf[start + padding] === 0) {\n\t\t++padding;\n\t}\n\n\tvar needsSign = buf[start + padding] >= MAX_OCTET;\n\tif (needsSign) {\n\t\t--padding;\n\t}\n\n\treturn padding;\n}\n\nfunction joseToDer(signature, alg) {\n\tsignature = signatureAsBuffer(signature);\n\tvar paramBytes = getParamBytesForAlg(alg);\n\n\tvar signatureBytes = signature.length;\n\tif (signatureBytes !== paramBytes * 2) {\n\t\tthrow new TypeError('\"' + alg + '\" signatures must be \"' + paramBytes * 2 + '\" bytes, saw \"' + signatureBytes + '\"');\n\t}\n\n\tvar rPadding = countPadding(signature, 0, paramBytes);\n\tvar sPadding = countPadding(signature, paramBytes, signature.length);\n\tvar rLength = paramBytes - rPadding;\n\tvar sLength = paramBytes - sPadding;\n\n\tvar rsBytes = 1 + 1 + rLength + 1 + 1 + sLength;\n\n\tvar shortLength = rsBytes < MAX_OCTET;\n\n\tvar dst = Buffer.allocUnsafe((shortLength ? 2 : 3) + rsBytes);\n\n\tvar offset = 0;\n\tdst[offset++] = ENCODED_TAG_SEQ;\n\tif (shortLength) {\n\t\t// Bit 8 has value \"0\"\n\t\t// bits 7-1 give the length.\n\t\tdst[offset++] = rsBytes;\n\t} else {\n\t\t// Bit 8 of first octet has value \"1\"\n\t\t// bits 7-1 give the number of additional length octets.\n\t\tdst[offset++] = MAX_OCTET\t| 1;\n\t\t// length, base 256\n\t\tdst[offset++] = rsBytes & 0xff;\n\t}\n\tdst[offset++] = ENCODED_TAG_INT;\n\tdst[offset++] = rLength;\n\tif (rPadding < 0) {\n\t\tdst[offset++] = 0;\n\t\toffset += signature.copy(dst, offset, 0, paramBytes);\n\t} else {\n\t\toffset += signature.copy(dst, offset, rPadding, paramBytes);\n\t}\n\tdst[offset++] = ENCODED_TAG_INT;\n\tdst[offset++] = sLength;\n\tif (sPadding < 0) {\n\t\tdst[offset++] = 0;\n\t\tsignature.copy(dst, offset, paramBytes);\n\t} else {\n\t\tsignature.copy(dst, offset, paramBytes + sPadding);\n\t}\n\n\treturn dst;\n}\n\nmodule.exports = {\n\tderToJose: derToJose,\n\tjoseToDer: joseToDer\n};\n","\"use strict\";\n// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LRUCache = void 0;\nexports.snakeToCamel = snakeToCamel;\nexports.originalOrCamelOptions = originalOrCamelOptions;\n/**\n * Returns the camel case of a provided string.\n *\n * @remarks\n *\n * Match any `_` and not `_` pair, then return the uppercase of the not `_`\n * character.\n *\n * @param str the string to convert\n * @returns the camelCase'd string\n */\nfunction snakeToCamel(str) {\n return str.replace(/([_][^_])/g, match => match.slice(1).toUpperCase());\n}\n/**\n * Get the value of `obj[key]` or `obj[camelCaseKey]`, with a preference\n * for original, non-camelCase key.\n *\n * @param obj object to lookup a value in\n * @returns a `get` function for getting `obj[key || snakeKey]`, if available\n */\nfunction originalOrCamelOptions(obj) {\n /**\n *\n * @param key an index of object, preferably snake_case\n * @returns the value `obj[key || snakeKey]`, if available\n */\n function get(key) {\n const o = (obj || {});\n return o[key] ?? o[snakeToCamel(key)];\n }\n return { get };\n}\n/**\n * A simple LRU cache utility.\n * Not meant for external usage.\n *\n * @experimental\n */\nclass LRUCache {\n capacity;\n /**\n * Maps are in order. Thus, the older item is the first item.\n *\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map}\n */\n #cache = new Map();\n maxAge;\n constructor(options) {\n this.capacity = options.capacity;\n this.maxAge = options.maxAge;\n }\n /**\n * Moves the key to the end of the cache.\n *\n * @param key the key to move\n * @param value the value of the key\n */\n #moveToEnd(key, value) {\n this.#cache.delete(key);\n this.#cache.set(key, {\n value,\n lastAccessed: Date.now(),\n });\n }\n /**\n * Add an item to the cache.\n *\n * @param key the key to upsert\n * @param value the value of the key\n */\n set(key, value) {\n this.#moveToEnd(key, value);\n this.#evict();\n }\n /**\n * Get an item from the cache.\n *\n * @param key the key to retrieve\n */\n get(key) {\n const item = this.#cache.get(key);\n if (!item)\n return;\n this.#moveToEnd(key, item.value);\n this.#evict();\n return item.value;\n }\n /**\n * Maintain the cache based on capacity and TTL.\n */\n #evict() {\n const cutoffDate = this.maxAge ? Date.now() - this.maxAge : 0;\n /**\n * Because we know Maps are in order, this item is both the\n * last item in the list (capacity) and oldest (maxAge).\n */\n let oldestItem = this.#cache.entries().next();\n while (!oldestItem.done &&\n (this.#cache.size > this.capacity || // too many\n oldestItem.value[1].lastAccessed < cutoffDate) // too old\n ) {\n this.#cache.delete(oldestItem.value[0]);\n oldestItem = this.#cache.entries().next();\n }\n }\n}\nexports.LRUCache = LRUCache;\n//# sourceMappingURL=util.js.map","\"use strict\";\n// Copyright 2023 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.USER_AGENT = exports.PRODUCT_NAME = exports.pkg = void 0;\nconst pkg = require('../../package.json');\nexports.pkg = pkg;\nconst PRODUCT_NAME = 'google-api-nodejs-client';\nexports.PRODUCT_NAME = PRODUCT_NAME;\nconst USER_AGENT = `${PRODUCT_NAME}/${pkg.version}`;\nexports.USER_AGENT = USER_AGENT;\n//# sourceMappingURL=shared.cjs.map","\"use strict\";\n// Copyright 2012 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AuthClient = exports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS = exports.DEFAULT_UNIVERSE = void 0;\nconst events_1 = require(\"events\");\nconst gaxios_1 = require(\"gaxios\");\nconst util_1 = require(\"../util\");\nconst shared_cjs_1 = require(\"../shared.cjs\");\n/**\n * The default cloud universe\n *\n * @see {@link AuthJSONOptions.universe_domain}\n */\nexports.DEFAULT_UNIVERSE = 'googleapis.com';\n/**\n * The default {@link AuthClientOptions.eagerRefreshThresholdMillis}\n */\nexports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS = 5 * 60 * 1000;\nclass AuthClient extends events_1.EventEmitter {\n apiKey;\n projectId;\n /**\n * The quota project ID. The quota project can be used by client libraries for the billing purpose.\n * See {@link https://cloud.google.com/docs/quota Working with quotas}\n */\n quotaProjectId;\n /**\n * The {@link Gaxios `Gaxios`} instance used for making requests.\n */\n transporter;\n credentials = {};\n eagerRefreshThresholdMillis = exports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;\n forceRefreshOnFailure = false;\n universeDomain = exports.DEFAULT_UNIVERSE;\n constructor(opts = {}) {\n super();\n const options = (0, util_1.originalOrCamelOptions)(opts);\n // Shared auth options\n this.apiKey = opts.apiKey;\n this.projectId = options.get('project_id') ?? null;\n this.quotaProjectId = options.get('quota_project_id');\n this.credentials = options.get('credentials') ?? {};\n this.universeDomain = options.get('universe_domain') ?? exports.DEFAULT_UNIVERSE;\n // Shared client options\n this.transporter = opts.transporter ?? new gaxios_1.Gaxios(opts.transporterOptions);\n if (options.get('useAuthRequestParameters') !== false) {\n this.transporter.interceptors.request.add(AuthClient.DEFAULT_REQUEST_INTERCEPTOR);\n }\n if (opts.eagerRefreshThresholdMillis) {\n this.eagerRefreshThresholdMillis = opts.eagerRefreshThresholdMillis;\n }\n this.forceRefreshOnFailure = opts.forceRefreshOnFailure ?? false;\n }\n /**\n * Sets the auth credentials.\n */\n setCredentials(credentials) {\n this.credentials = credentials;\n }\n /**\n * Append additional headers, e.g., x-goog-user-project, shared across the\n * classes inheriting AuthClient. This method should be used by any method\n * that overrides getRequestMetadataAsync(), which is a shared helper for\n * setting request information in both gRPC and HTTP API calls.\n *\n * @param headers object to append additional headers to.\n */\n addSharedMetadataHeaders(headers) {\n // quota_project_id, stored in application_default_credentials.json, is set in\n // the x-goog-user-project header, to indicate an alternate account for\n // billing and quota:\n if (!headers.has('x-goog-user-project') && // don't override a value the user sets.\n this.quotaProjectId) {\n headers.set('x-goog-user-project', this.quotaProjectId);\n }\n return headers;\n }\n /**\n * Adds the `x-goog-user-project` and `authorization` headers to the target Headers\n * object, if they exist on the source.\n *\n * @param target the headers to target\n * @param source the headers to source from\n * @returns the target headers\n */\n addUserProjectAndAuthHeaders(target, source) {\n const xGoogUserProject = source.get('x-goog-user-project');\n const authorizationHeader = source.get('authorization');\n if (xGoogUserProject) {\n target.set('x-goog-user-project', xGoogUserProject);\n }\n if (authorizationHeader) {\n target.set('authorization', authorizationHeader);\n }\n return target;\n }\n static DEFAULT_REQUEST_INTERCEPTOR = {\n resolved: async (config) => {\n // Set `x-goog-api-client`, if not already set\n if (!config.headers.has('x-goog-api-client')) {\n const nodeVersion = process.version.replace(/^v/, '');\n config.headers.set('x-goog-api-client', `gl-node/${nodeVersion}`);\n }\n // Set `User-Agent`\n const userAgent = config.headers.get('User-Agent');\n if (!userAgent) {\n config.headers.set('User-Agent', shared_cjs_1.USER_AGENT);\n }\n else if (!userAgent.includes(`${shared_cjs_1.PRODUCT_NAME}/`)) {\n config.headers.set('User-Agent', `${userAgent} ${shared_cjs_1.USER_AGENT}`);\n }\n return config;\n },\n };\n /**\n * Retry config for Auth-related requests.\n *\n * @remarks\n *\n * This is not a part of the default {@link AuthClient.transporter transporter/gaxios}\n * config as some downstream APIs would prefer if customers explicitly enable retries,\n * such as GCS.\n */\n static get RETRY_CONFIG() {\n return {\n retry: true,\n retryConfig: {\n httpMethodsToRetry: ['GET', 'PUT', 'POST', 'HEAD', 'OPTIONS', 'DELETE'],\n },\n };\n }\n}\nexports.AuthClient = AuthClient;\n//# sourceMappingURL=authclient.js.map","\"use strict\";\n// Copyright 2014 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LoginTicket = void 0;\nclass LoginTicket {\n envelope;\n payload;\n /**\n * Create a simple class to extract user ID from an ID Token\n *\n * @param {string} env Envelope of the jwt\n * @param {TokenPayload} pay Payload of the jwt\n * @constructor\n */\n constructor(env, pay) {\n this.envelope = env;\n this.payload = pay;\n }\n getEnvelope() {\n return this.envelope;\n }\n getPayload() {\n return this.payload;\n }\n /**\n * Create a simple class to extract user ID from an ID Token\n *\n * @return The user ID\n */\n getUserId() {\n const payload = this.getPayload();\n if (payload && payload.sub) {\n return payload.sub;\n }\n return null;\n }\n /**\n * Returns attributes from the login ticket. This can contain\n * various information about the user session.\n *\n * @return The envelope and payload\n */\n getAttributes() {\n return { envelope: this.getEnvelope(), payload: this.getPayload() };\n }\n}\nexports.LoginTicket = LoginTicket;\n//# sourceMappingURL=loginticket.js.map","\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OAuth2Client = exports.ClientAuthentication = exports.CertificateFormat = exports.CodeChallengeMethod = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst querystring = require(\"querystring\");\nconst stream = require(\"stream\");\nconst formatEcdsa = require(\"ecdsa-sig-formatter\");\nconst crypto_1 = require(\"../crypto/crypto\");\nconst authclient_1 = require(\"./authclient\");\nconst loginticket_1 = require(\"./loginticket\");\nvar CodeChallengeMethod;\n(function (CodeChallengeMethod) {\n CodeChallengeMethod[\"Plain\"] = \"plain\";\n CodeChallengeMethod[\"S256\"] = \"S256\";\n})(CodeChallengeMethod || (exports.CodeChallengeMethod = CodeChallengeMethod = {}));\nvar CertificateFormat;\n(function (CertificateFormat) {\n CertificateFormat[\"PEM\"] = \"PEM\";\n CertificateFormat[\"JWK\"] = \"JWK\";\n})(CertificateFormat || (exports.CertificateFormat = CertificateFormat = {}));\n/**\n * The client authentication type. Supported values are basic, post, and none.\n * https://datatracker.ietf.org/doc/html/rfc7591#section-2\n */\nvar ClientAuthentication;\n(function (ClientAuthentication) {\n ClientAuthentication[\"ClientSecretPost\"] = \"ClientSecretPost\";\n ClientAuthentication[\"ClientSecretBasic\"] = \"ClientSecretBasic\";\n ClientAuthentication[\"None\"] = \"None\";\n})(ClientAuthentication || (exports.ClientAuthentication = ClientAuthentication = {}));\nclass OAuth2Client extends authclient_1.AuthClient {\n redirectUri;\n certificateCache = {};\n certificateExpiry = null;\n certificateCacheFormat = CertificateFormat.PEM;\n refreshTokenPromises = new Map();\n endpoints;\n issuers;\n clientAuthentication;\n // TODO: refactor tests to make this private\n _clientId;\n // TODO: refactor tests to make this private\n _clientSecret;\n refreshHandler;\n /**\n * An OAuth2 Client for Google APIs.\n *\n * @param options The OAuth2 Client Options. Passing an `clientId` directly is **@DEPRECATED**.\n * @param clientSecret **@DEPRECATED**. Provide a {@link OAuth2ClientOptions `OAuth2ClientOptions`} object in the first parameter instead.\n * @param redirectUri **@DEPRECATED**. Provide a {@link OAuth2ClientOptions `OAuth2ClientOptions`} object in the first parameter instead.\n */\n constructor(options = {}, \n /**\n * @deprecated - provide a {@link OAuth2ClientOptions `OAuth2ClientOptions`} object in the first parameter instead\n */\n clientSecret, \n /**\n * @deprecated - provide a {@link OAuth2ClientOptions `OAuth2ClientOptions`} object in the first parameter instead\n */\n redirectUri) {\n super(typeof options === 'object' ? options : {});\n if (typeof options !== 'object') {\n options = {\n clientId: options,\n clientSecret,\n redirectUri,\n };\n }\n this._clientId = options.clientId || options.client_id;\n this._clientSecret = options.clientSecret || options.client_secret;\n this.redirectUri = options.redirectUri || options.redirect_uris?.[0];\n this.endpoints = {\n tokenInfoUrl: 'https://oauth2.googleapis.com/tokeninfo',\n oauth2AuthBaseUrl: 'https://accounts.google.com/o/oauth2/v2/auth',\n oauth2TokenUrl: 'https://oauth2.googleapis.com/token',\n oauth2RevokeUrl: 'https://oauth2.googleapis.com/revoke',\n oauth2FederatedSignonPemCertsUrl: 'https://www.googleapis.com/oauth2/v1/certs',\n oauth2FederatedSignonJwkCertsUrl: 'https://www.googleapis.com/oauth2/v3/certs',\n oauth2IapPublicKeyUrl: 'https://www.gstatic.com/iap/verify/public_key',\n ...options.endpoints,\n };\n this.clientAuthentication =\n options.clientAuthentication || ClientAuthentication.ClientSecretPost;\n this.issuers = options.issuers || [\n 'accounts.google.com',\n 'https://accounts.google.com',\n this.universeDomain,\n ];\n }\n /**\n * @deprecated use instance's {@link OAuth2Client.endpoints}\n */\n static GOOGLE_TOKEN_INFO_URL = 'https://oauth2.googleapis.com/tokeninfo';\n /**\n * Clock skew - five minutes in seconds\n */\n static CLOCK_SKEW_SECS_ = 300;\n /**\n * The default max Token Lifetime is one day in seconds\n */\n static DEFAULT_MAX_TOKEN_LIFETIME_SECS_ = 86400;\n /**\n * Generates URL for consent page landing.\n * @param opts Options.\n * @return URL to consent page.\n */\n generateAuthUrl(opts = {}) {\n if (opts.code_challenge_method && !opts.code_challenge) {\n throw new Error('If a code_challenge_method is provided, code_challenge must be included.');\n }\n opts.response_type = opts.response_type || 'code';\n opts.client_id = opts.client_id || this._clientId;\n opts.redirect_uri = opts.redirect_uri || this.redirectUri;\n // Allow scopes to be passed either as array or a string\n if (Array.isArray(opts.scope)) {\n opts.scope = opts.scope.join(' ');\n }\n const rootUrl = this.endpoints.oauth2AuthBaseUrl.toString();\n return (rootUrl +\n '?' +\n querystring.stringify(opts));\n }\n generateCodeVerifier() {\n // To make the code compatible with browser SubtleCrypto we need to make\n // this method async.\n throw new Error('generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.');\n }\n /**\n * Convenience method to automatically generate a code_verifier, and its\n * resulting SHA256. If used, this must be paired with a S256\n * code_challenge_method.\n *\n * For a full example see:\n * https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/oauth2-codeVerifier.js\n */\n async generateCodeVerifierAsync() {\n // base64 encoding uses 6 bits per character, and we want to generate128\n // characters. 6*128/8 = 96.\n const crypto = (0, crypto_1.createCrypto)();\n const randomString = crypto.randomBytesBase64(96);\n // The valid characters in the code_verifier are [A-Z]/[a-z]/[0-9]/\n // \"-\"/\".\"/\"_\"/\"~\". Base64 encoded strings are pretty close, so we're just\n // swapping out a few chars.\n const codeVerifier = randomString\n .replace(/\\+/g, '~')\n .replace(/=/g, '_')\n .replace(/\\//g, '-');\n // Generate the base64 encoded SHA256\n const unencodedCodeChallenge = await crypto.sha256DigestBase64(codeVerifier);\n // We need to use base64UrlEncoding instead of standard base64\n const codeChallenge = unencodedCodeChallenge\n .split('=')[0]\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n return { codeVerifier, codeChallenge };\n }\n getToken(codeOrOptions, callback) {\n const options = typeof codeOrOptions === 'string' ? { code: codeOrOptions } : codeOrOptions;\n if (callback) {\n this.getTokenAsync(options).then(r => callback(null, r.tokens, r.res), e => callback(e, null, e.response));\n }\n else {\n return this.getTokenAsync(options);\n }\n }\n async getTokenAsync(options) {\n const url = this.endpoints.oauth2TokenUrl.toString();\n const headers = new Headers();\n const values = {\n client_id: options.client_id || this._clientId,\n code_verifier: options.codeVerifier,\n code: options.code,\n grant_type: 'authorization_code',\n redirect_uri: options.redirect_uri || this.redirectUri,\n };\n if (this.clientAuthentication === ClientAuthentication.ClientSecretBasic) {\n const basic = Buffer.from(`${this._clientId}:${this._clientSecret}`);\n headers.set('authorization', `Basic ${basic.toString('base64')}`);\n }\n if (this.clientAuthentication === ClientAuthentication.ClientSecretPost) {\n values.client_secret = this._clientSecret;\n }\n const res = await this.transporter.request({\n ...OAuth2Client.RETRY_CONFIG,\n method: 'POST',\n url,\n data: new URLSearchParams(values),\n headers,\n });\n const tokens = res.data;\n if (res.data && res.data.expires_in) {\n tokens.expiry_date = new Date().getTime() + res.data.expires_in * 1000;\n delete tokens.expires_in;\n }\n this.emit('tokens', tokens);\n return { tokens, res };\n }\n /**\n * Refreshes the access token.\n * @param refresh_token Existing refresh token.\n * @private\n */\n async refreshToken(refreshToken) {\n if (!refreshToken) {\n return this.refreshTokenNoCache(refreshToken);\n }\n // If a request to refresh using the same token has started,\n // return the same promise.\n if (this.refreshTokenPromises.has(refreshToken)) {\n return this.refreshTokenPromises.get(refreshToken);\n }\n const p = this.refreshTokenNoCache(refreshToken).then(r => {\n this.refreshTokenPromises.delete(refreshToken);\n return r;\n }, e => {\n this.refreshTokenPromises.delete(refreshToken);\n throw e;\n });\n this.refreshTokenPromises.set(refreshToken, p);\n return p;\n }\n async refreshTokenNoCache(refreshToken) {\n if (!refreshToken) {\n throw new Error('No refresh token is set.');\n }\n const url = this.endpoints.oauth2TokenUrl.toString();\n const data = {\n refresh_token: refreshToken,\n client_id: this._clientId,\n client_secret: this._clientSecret,\n grant_type: 'refresh_token',\n };\n let res;\n try {\n // request for new token\n res = await this.transporter.request({\n ...OAuth2Client.RETRY_CONFIG,\n method: 'POST',\n url,\n data: new URLSearchParams(data),\n });\n }\n catch (e) {\n if (e instanceof gaxios_1.GaxiosError &&\n e.message === 'invalid_grant' &&\n e.response?.data &&\n /ReAuth/i.test(e.response.data.error_description)) {\n e.message = JSON.stringify(e.response.data);\n }\n throw e;\n }\n const tokens = res.data;\n // TODO: de-duplicate this code from a few spots\n if (res.data && res.data.expires_in) {\n tokens.expiry_date = new Date().getTime() + res.data.expires_in * 1000;\n delete tokens.expires_in;\n }\n this.emit('tokens', tokens);\n return { tokens, res };\n }\n refreshAccessToken(callback) {\n if (callback) {\n this.refreshAccessTokenAsync().then(r => callback(null, r.credentials, r.res), callback);\n }\n else {\n return this.refreshAccessTokenAsync();\n }\n }\n async refreshAccessTokenAsync() {\n const r = await this.refreshToken(this.credentials.refresh_token);\n const tokens = r.tokens;\n tokens.refresh_token = this.credentials.refresh_token;\n this.credentials = tokens;\n return { credentials: this.credentials, res: r.res };\n }\n getAccessToken(callback) {\n if (callback) {\n this.getAccessTokenAsync().then(r => callback(null, r.token, r.res), callback);\n }\n else {\n return this.getAccessTokenAsync();\n }\n }\n async getAccessTokenAsync() {\n const shouldRefresh = !this.credentials.access_token || this.isTokenExpiring();\n if (shouldRefresh) {\n if (!this.credentials.refresh_token) {\n if (this.refreshHandler) {\n const refreshedAccessToken = await this.processAndValidateRefreshHandler();\n if (refreshedAccessToken?.access_token) {\n this.setCredentials(refreshedAccessToken);\n return { token: this.credentials.access_token };\n }\n }\n else {\n throw new Error('No refresh token or refresh handler callback is set.');\n }\n }\n const r = await this.refreshAccessTokenAsync();\n if (!r.credentials || (r.credentials && !r.credentials.access_token)) {\n throw new Error('Could not refresh access token.');\n }\n return { token: r.credentials.access_token, res: r.res };\n }\n else {\n return { token: this.credentials.access_token };\n }\n }\n /**\n * The main authentication interface. It takes an optional url which when\n * present is the endpoint being accessed, and returns a Promise which\n * resolves with authorization header fields.\n *\n * In OAuth2Client, the result has the form:\n * { authorization: 'Bearer ' }\n */\n async getRequestHeaders(url) {\n const headers = (await this.getRequestMetadataAsync(url)).headers;\n return headers;\n }\n async getRequestMetadataAsync(url) {\n url;\n const thisCreds = this.credentials;\n if (!thisCreds.access_token &&\n !thisCreds.refresh_token &&\n !this.apiKey &&\n !this.refreshHandler) {\n throw new Error('No access, refresh token, API key or refresh handler callback is set.');\n }\n if (thisCreds.access_token && !this.isTokenExpiring()) {\n thisCreds.token_type = thisCreds.token_type || 'Bearer';\n const headers = new Headers({\n authorization: thisCreds.token_type + ' ' + thisCreds.access_token,\n });\n return { headers: this.addSharedMetadataHeaders(headers) };\n }\n // If refreshHandler exists, call processAndValidateRefreshHandler().\n if (this.refreshHandler) {\n const refreshedAccessToken = await this.processAndValidateRefreshHandler();\n if (refreshedAccessToken?.access_token) {\n this.setCredentials(refreshedAccessToken);\n const headers = new Headers({\n authorization: 'Bearer ' + this.credentials.access_token,\n });\n return { headers: this.addSharedMetadataHeaders(headers) };\n }\n }\n if (this.apiKey) {\n return { headers: new Headers({ 'X-Goog-Api-Key': this.apiKey }) };\n }\n let r = null;\n let tokens = null;\n try {\n r = await this.refreshToken(thisCreds.refresh_token);\n tokens = r.tokens;\n }\n catch (err) {\n const e = err;\n if (e.response &&\n (e.response.status === 403 || e.response.status === 404)) {\n e.message = `Could not refresh access token: ${e.message}`;\n }\n throw e;\n }\n const credentials = this.credentials;\n credentials.token_type = credentials.token_type || 'Bearer';\n tokens.refresh_token = credentials.refresh_token;\n this.credentials = tokens;\n const headers = new Headers({\n authorization: credentials.token_type + ' ' + tokens.access_token,\n });\n return { headers: this.addSharedMetadataHeaders(headers), res: r.res };\n }\n /**\n * Generates an URL to revoke the given token.\n * @param token The existing token to be revoked.\n *\n * @deprecated use instance method {@link OAuth2Client.getRevokeTokenURL}\n */\n static getRevokeTokenUrl(token) {\n return new OAuth2Client().getRevokeTokenURL(token).toString();\n }\n /**\n * Generates a URL to revoke the given token.\n *\n * @param token The existing token to be revoked.\n */\n getRevokeTokenURL(token) {\n const url = new URL(this.endpoints.oauth2RevokeUrl);\n url.searchParams.append('token', token);\n return url;\n }\n revokeToken(token, callback) {\n const opts = {\n ...OAuth2Client.RETRY_CONFIG,\n url: this.getRevokeTokenURL(token).toString(),\n method: 'POST',\n };\n if (callback) {\n this.transporter\n .request(opts)\n .then(r => callback(null, r), callback);\n }\n else {\n return this.transporter.request(opts);\n }\n }\n revokeCredentials(callback) {\n if (callback) {\n this.revokeCredentialsAsync().then(res => callback(null, res), callback);\n }\n else {\n return this.revokeCredentialsAsync();\n }\n }\n async revokeCredentialsAsync() {\n const token = this.credentials.access_token;\n this.credentials = {};\n if (token) {\n return this.revokeToken(token);\n }\n else {\n throw new Error('No access token to revoke.');\n }\n }\n request(opts, callback) {\n if (callback) {\n this.requestAsync(opts).then(r => callback(null, r), e => {\n return callback(e, e.response);\n });\n }\n else {\n return this.requestAsync(opts);\n }\n }\n async requestAsync(opts, reAuthRetried = false) {\n try {\n const r = await this.getRequestMetadataAsync();\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers);\n this.addUserProjectAndAuthHeaders(opts.headers, r.headers);\n if (this.apiKey) {\n opts.headers.set('X-Goog-Api-Key', this.apiKey);\n }\n return await this.transporter.request(opts);\n }\n catch (e) {\n const res = e.response;\n if (res) {\n const statusCode = res.status;\n // Retry the request for metadata if the following criteria are true:\n // - We haven't already retried. It only makes sense to retry once.\n // - The response was a 401 or a 403\n // - The request didn't send a readableStream\n // - An access_token and refresh_token were available, but either no\n // expiry_date was available or the forceRefreshOnFailure flag is set.\n // The absent expiry_date case can happen when developers stash the\n // access_token and refresh_token for later use, but the access_token\n // fails on the first try because it's expired. Some developers may\n // choose to enable forceRefreshOnFailure to mitigate time-related\n // errors.\n // Or the following criteria are true:\n // - We haven't already retried. It only makes sense to retry once.\n // - The response was a 401 or a 403\n // - The request didn't send a readableStream\n // - No refresh_token was available\n // - An access_token and a refreshHandler callback were available, but\n // either no expiry_date was available or the forceRefreshOnFailure\n // flag is set. The access_token fails on the first try because it's\n // expired. Some developers may choose to enable forceRefreshOnFailure\n // to mitigate time-related errors.\n const mayRequireRefresh = this.credentials &&\n this.credentials.access_token &&\n this.credentials.refresh_token &&\n (!this.credentials.expiry_date || this.forceRefreshOnFailure);\n const mayRequireRefreshWithNoRefreshToken = this.credentials &&\n this.credentials.access_token &&\n !this.credentials.refresh_token &&\n (!this.credentials.expiry_date || this.forceRefreshOnFailure) &&\n this.refreshHandler;\n const isReadableStream = res.config.data instanceof stream.Readable;\n const isAuthErr = statusCode === 401 || statusCode === 403;\n if (!reAuthRetried &&\n isAuthErr &&\n !isReadableStream &&\n mayRequireRefresh) {\n await this.refreshAccessTokenAsync();\n return this.requestAsync(opts, true);\n }\n else if (!reAuthRetried &&\n isAuthErr &&\n !isReadableStream &&\n mayRequireRefreshWithNoRefreshToken) {\n const refreshedAccessToken = await this.processAndValidateRefreshHandler();\n if (refreshedAccessToken?.access_token) {\n this.setCredentials(refreshedAccessToken);\n }\n return this.requestAsync(opts, true);\n }\n }\n throw e;\n }\n }\n verifyIdToken(options, callback) {\n // This function used to accept two arguments instead of an options object.\n // Check the types to help users upgrade with less pain.\n // This check can be removed after a 2.0 release.\n if (callback && typeof callback !== 'function') {\n throw new Error('This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.');\n }\n if (callback) {\n this.verifyIdTokenAsync(options).then(r => callback(null, r), callback);\n }\n else {\n return this.verifyIdTokenAsync(options);\n }\n }\n async verifyIdTokenAsync(options) {\n if (!options.idToken) {\n throw new Error('The verifyIdToken method requires an ID Token');\n }\n const response = await this.getFederatedSignonCertsAsync();\n const login = await this.verifySignedJwtWithCertsAsync(options.idToken, response.certs, options.audience, this.issuers, options.maxExpiry);\n return login;\n }\n /**\n * Obtains information about the provisioned access token. Especially useful\n * if you want to check the scopes that were provisioned to a given token.\n *\n * @param accessToken Required. The Access Token for which you want to get\n * user info.\n */\n async getTokenInfo(accessToken) {\n const { data } = await this.transporter.request({\n ...OAuth2Client.RETRY_CONFIG,\n method: 'POST',\n headers: {\n 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8',\n authorization: `Bearer ${accessToken}`,\n },\n url: this.endpoints.tokenInfoUrl.toString(),\n });\n const info = Object.assign({\n expiry_date: new Date().getTime() + data.expires_in * 1000,\n scopes: data.scope.split(' '),\n }, data);\n delete info.expires_in;\n delete info.scope;\n return info;\n }\n getFederatedSignonCerts(callback) {\n if (callback) {\n this.getFederatedSignonCertsAsync().then(r => callback(null, r.certs, r.res), callback);\n }\n else {\n return this.getFederatedSignonCertsAsync();\n }\n }\n async getFederatedSignonCertsAsync() {\n const nowTime = new Date().getTime();\n const format = (0, crypto_1.hasBrowserCrypto)()\n ? CertificateFormat.JWK\n : CertificateFormat.PEM;\n if (this.certificateExpiry &&\n nowTime < this.certificateExpiry.getTime() &&\n this.certificateCacheFormat === format) {\n return { certs: this.certificateCache, format };\n }\n let res;\n let url;\n switch (format) {\n case CertificateFormat.PEM:\n url = this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();\n break;\n case CertificateFormat.JWK:\n url = this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();\n break;\n default:\n throw new Error(`Unsupported certificate format ${format}`);\n }\n try {\n res = await this.transporter.request({\n ...OAuth2Client.RETRY_CONFIG,\n url,\n });\n }\n catch (e) {\n if (e instanceof Error) {\n e.message = `Failed to retrieve verification certificates: ${e.message}`;\n }\n throw e;\n }\n const cacheControl = res?.headers.get('cache-control');\n let cacheAge = -1;\n if (cacheControl) {\n const maxAge = /max-age=(?[0-9]+)/.exec(cacheControl)?.groups\n ?.maxAge;\n if (maxAge) {\n // Cache results with max-age (in seconds)\n cacheAge = Number(maxAge) * 1000; // milliseconds\n }\n }\n let certificates = {};\n switch (format) {\n case CertificateFormat.PEM:\n certificates = res.data;\n break;\n case CertificateFormat.JWK:\n for (const key of res.data.keys) {\n certificates[key.kid] = key;\n }\n break;\n default:\n throw new Error(`Unsupported certificate format ${format}`);\n }\n const now = new Date();\n this.certificateExpiry =\n cacheAge === -1 ? null : new Date(now.getTime() + cacheAge);\n this.certificateCache = certificates;\n this.certificateCacheFormat = format;\n return { certs: certificates, format, res };\n }\n getIapPublicKeys(callback) {\n if (callback) {\n this.getIapPublicKeysAsync().then(r => callback(null, r.pubkeys, r.res), callback);\n }\n else {\n return this.getIapPublicKeysAsync();\n }\n }\n async getIapPublicKeysAsync() {\n let res;\n const url = this.endpoints.oauth2IapPublicKeyUrl.toString();\n try {\n res = await this.transporter.request({\n ...OAuth2Client.RETRY_CONFIG,\n url,\n });\n }\n catch (e) {\n if (e instanceof Error) {\n e.message = `Failed to retrieve verification certificates: ${e.message}`;\n }\n throw e;\n }\n return { pubkeys: res.data, res };\n }\n verifySignedJwtWithCerts() {\n // To make the code compatible with browser SubtleCrypto we need to make\n // this method async.\n throw new Error('verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.');\n }\n /**\n * Verify the id token is signed with the correct certificate\n * and is from the correct audience.\n * @param jwt The jwt to verify (The ID Token in this case).\n * @param certs The array of certs to test the jwt against.\n * @param requiredAudience The audience to test the jwt against.\n * @param issuers The allowed issuers of the jwt (Optional).\n * @param maxExpiry The max expiry the certificate can be (Optional).\n * @return Returns a promise resolving to LoginTicket on verification.\n */\n async verifySignedJwtWithCertsAsync(jwt, certs, requiredAudience, issuers, maxExpiry) {\n const crypto = (0, crypto_1.createCrypto)();\n if (!maxExpiry) {\n maxExpiry = OAuth2Client.DEFAULT_MAX_TOKEN_LIFETIME_SECS_;\n }\n const segments = jwt.split('.');\n if (segments.length !== 3) {\n throw new Error('Wrong number of segments in token: ' + jwt);\n }\n const signed = segments[0] + '.' + segments[1];\n let signature = segments[2];\n let envelope;\n let payload;\n try {\n envelope = JSON.parse(crypto.decodeBase64StringUtf8(segments[0]));\n }\n catch (err) {\n if (err instanceof Error) {\n err.message = `Can't parse token envelope: ${segments[0]}': ${err.message}`;\n }\n throw err;\n }\n if (!envelope) {\n throw new Error(\"Can't parse token envelope: \" + segments[0]);\n }\n try {\n payload = JSON.parse(crypto.decodeBase64StringUtf8(segments[1]));\n }\n catch (err) {\n if (err instanceof Error) {\n err.message = `Can't parse token payload '${segments[0]}`;\n }\n throw err;\n }\n if (!payload) {\n throw new Error(\"Can't parse token payload: \" + segments[1]);\n }\n if (!Object.prototype.hasOwnProperty.call(certs, envelope.kid)) {\n // If this is not present, then there's no reason to attempt verification\n throw new Error('No pem found for envelope: ' + JSON.stringify(envelope));\n }\n const cert = certs[envelope.kid];\n if (envelope.alg === 'ES256') {\n signature = formatEcdsa.joseToDer(signature, 'ES256').toString('base64');\n }\n const verified = await crypto.verify(cert, signed, signature);\n if (!verified) {\n throw new Error('Invalid token signature: ' + jwt);\n }\n if (!payload.iat) {\n throw new Error('No issue time in token: ' + JSON.stringify(payload));\n }\n if (!payload.exp) {\n throw new Error('No expiration time in token: ' + JSON.stringify(payload));\n }\n const iat = Number(payload.iat);\n if (isNaN(iat))\n throw new Error('iat field using invalid format');\n const exp = Number(payload.exp);\n if (isNaN(exp))\n throw new Error('exp field using invalid format');\n const now = new Date().getTime() / 1000;\n if (exp >= now + maxExpiry) {\n throw new Error('Expiration time too far in future: ' + JSON.stringify(payload));\n }\n const earliest = iat - OAuth2Client.CLOCK_SKEW_SECS_;\n const latest = exp + OAuth2Client.CLOCK_SKEW_SECS_;\n if (now < earliest) {\n throw new Error('Token used too early, ' +\n now +\n ' < ' +\n earliest +\n ': ' +\n JSON.stringify(payload));\n }\n if (now > latest) {\n throw new Error('Token used too late, ' +\n now +\n ' > ' +\n latest +\n ': ' +\n JSON.stringify(payload));\n }\n if (issuers && issuers.indexOf(payload.iss) < 0) {\n throw new Error('Invalid issuer, expected one of [' +\n issuers +\n '], but got ' +\n payload.iss);\n }\n // Check the audience matches if we have one\n if (typeof requiredAudience !== 'undefined' && requiredAudience !== null) {\n const aud = payload.aud;\n let audVerified = false;\n // If the requiredAudience is an array, check if it contains token\n // audience\n if (requiredAudience.constructor === Array) {\n audVerified = requiredAudience.indexOf(aud) > -1;\n }\n else {\n audVerified = aud === requiredAudience;\n }\n if (!audVerified) {\n throw new Error('Wrong recipient, payload audience != requiredAudience');\n }\n }\n return new loginticket_1.LoginTicket(envelope, payload);\n }\n /**\n * Returns a promise that resolves with AccessTokenResponse type if\n * refreshHandler is defined.\n * If not, nothing is returned.\n */\n async processAndValidateRefreshHandler() {\n if (this.refreshHandler) {\n const accessTokenResponse = await this.refreshHandler();\n if (!accessTokenResponse.access_token) {\n throw new Error('No access token is returned by the refreshHandler callback.');\n }\n return accessTokenResponse;\n }\n return;\n }\n /**\n * Returns true if a token is expired or will expire within\n * eagerRefreshThresholdMillismilliseconds.\n * If there is no expiry time, assumes the token is not expired or expiring.\n */\n isTokenExpiring() {\n const expiryDate = this.credentials.expiry_date;\n return expiryDate\n ? expiryDate <= new Date().getTime() + this.eagerRefreshThresholdMillis\n : false;\n }\n}\nexports.OAuth2Client = OAuth2Client;\n//# sourceMappingURL=oauth2client.js.map","\"use strict\";\n// Copyright 2013 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Compute = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst gcpMetadata = require(\"gcp-metadata\");\nconst oauth2client_1 = require(\"./oauth2client\");\nclass Compute extends oauth2client_1.OAuth2Client {\n serviceAccountEmail;\n scopes;\n /**\n * Google Compute Engine service account credentials.\n *\n * Retrieve access token from the metadata server.\n * See: https://cloud.google.com/compute/docs/access/authenticate-workloads#applications\n */\n constructor(options = {}) {\n super(options);\n // Start with an expired refresh token, which will automatically be\n // refreshed before the first API call is made.\n this.credentials = { expiry_date: 1, refresh_token: 'compute-placeholder' };\n this.serviceAccountEmail = options.serviceAccountEmail || 'default';\n this.scopes = Array.isArray(options.scopes)\n ? options.scopes\n : options.scopes\n ? [options.scopes]\n : [];\n }\n /**\n * Refreshes the access token.\n * @param refreshToken Unused parameter\n */\n async refreshTokenNoCache() {\n const tokenPath = `service-accounts/${this.serviceAccountEmail}/token`;\n let data;\n try {\n const instanceOptions = {\n property: tokenPath,\n };\n if (this.scopes.length > 0) {\n instanceOptions.params = {\n scopes: this.scopes.join(','),\n };\n }\n data = await gcpMetadata.instance(instanceOptions);\n }\n catch (e) {\n if (e instanceof gaxios_1.GaxiosError) {\n e.message = `Could not refresh access token: ${e.message}`;\n this.wrapError(e);\n }\n throw e;\n }\n const tokens = data;\n if (data && data.expires_in) {\n tokens.expiry_date = new Date().getTime() + data.expires_in * 1000;\n delete tokens.expires_in;\n }\n this.emit('tokens', tokens);\n return { tokens, res: null };\n }\n /**\n * Fetches an ID token.\n * @param targetAudience the audience for the fetched ID token.\n */\n async fetchIdToken(targetAudience) {\n const idTokenPath = `service-accounts/${this.serviceAccountEmail}/identity` +\n `?format=full&audience=${targetAudience}`;\n let idToken;\n try {\n const instanceOptions = {\n property: idTokenPath,\n };\n idToken = await gcpMetadata.instance(instanceOptions);\n }\n catch (e) {\n if (e instanceof Error) {\n e.message = `Could not fetch ID token: ${e.message}`;\n }\n throw e;\n }\n return idToken;\n }\n wrapError(e) {\n const res = e.response;\n if (res && res.status) {\n e.status = res.status;\n if (res.status === 403) {\n e.message =\n 'A Forbidden error was returned while attempting to retrieve an access ' +\n 'token for the Compute Engine built-in service account. This may be because the Compute ' +\n 'Engine instance does not have the correct permission scopes specified: ' +\n e.message;\n }\n else if (res.status === 404) {\n e.message =\n 'A Not Found error was returned while attempting to retrieve an access' +\n 'token for the Compute Engine built-in service account. This may be because the Compute ' +\n 'Engine instance does not have any permission scopes specified: ' +\n e.message;\n }\n }\n }\n}\nexports.Compute = Compute;\n//# sourceMappingURL=computeclient.js.map","\"use strict\";\n// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IdTokenClient = void 0;\nconst oauth2client_1 = require(\"./oauth2client\");\nclass IdTokenClient extends oauth2client_1.OAuth2Client {\n targetAudience;\n idTokenProvider;\n /**\n * Google ID Token client\n *\n * Retrieve ID token from the metadata server.\n * See: https://cloud.google.com/docs/authentication/get-id-token#metadata-server\n */\n constructor(options) {\n super(options);\n this.targetAudience = options.targetAudience;\n this.idTokenProvider = options.idTokenProvider;\n }\n async getRequestMetadataAsync() {\n if (!this.credentials.id_token ||\n !this.credentials.expiry_date ||\n this.isTokenExpiring()) {\n const idToken = await this.idTokenProvider.fetchIdToken(this.targetAudience);\n this.credentials = {\n id_token: idToken,\n expiry_date: this.getIdTokenExpiryDate(idToken),\n };\n }\n const headers = new Headers({\n authorization: 'Bearer ' + this.credentials.id_token,\n });\n return { headers };\n }\n getIdTokenExpiryDate(idToken) {\n const payloadB64 = idToken.split('.')[1];\n if (payloadB64) {\n const payload = JSON.parse(Buffer.from(payloadB64, 'base64').toString('ascii'));\n return payload.exp * 1000;\n }\n }\n}\nexports.IdTokenClient = IdTokenClient;\n//# sourceMappingURL=idtokenclient.js.map","\"use strict\";\n// Copyright 2018 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GCPEnv = void 0;\nexports.clear = clear;\nexports.getEnv = getEnv;\nconst gcpMetadata = require(\"gcp-metadata\");\nvar GCPEnv;\n(function (GCPEnv) {\n GCPEnv[\"APP_ENGINE\"] = \"APP_ENGINE\";\n GCPEnv[\"KUBERNETES_ENGINE\"] = \"KUBERNETES_ENGINE\";\n GCPEnv[\"CLOUD_FUNCTIONS\"] = \"CLOUD_FUNCTIONS\";\n GCPEnv[\"COMPUTE_ENGINE\"] = \"COMPUTE_ENGINE\";\n GCPEnv[\"CLOUD_RUN\"] = \"CLOUD_RUN\";\n GCPEnv[\"NONE\"] = \"NONE\";\n})(GCPEnv || (exports.GCPEnv = GCPEnv = {}));\nlet envPromise;\nfunction clear() {\n envPromise = undefined;\n}\nasync function getEnv() {\n if (envPromise) {\n return envPromise;\n }\n envPromise = getEnvMemoized();\n return envPromise;\n}\nasync function getEnvMemoized() {\n let env = GCPEnv.NONE;\n if (isAppEngine()) {\n env = GCPEnv.APP_ENGINE;\n }\n else if (isCloudFunction()) {\n env = GCPEnv.CLOUD_FUNCTIONS;\n }\n else if (await isComputeEngine()) {\n if (await isKubernetesEngine()) {\n env = GCPEnv.KUBERNETES_ENGINE;\n }\n else if (isCloudRun()) {\n env = GCPEnv.CLOUD_RUN;\n }\n else {\n env = GCPEnv.COMPUTE_ENGINE;\n }\n }\n else {\n env = GCPEnv.NONE;\n }\n return env;\n}\nfunction isAppEngine() {\n return !!(process.env.GAE_SERVICE || process.env.GAE_MODULE_NAME);\n}\nfunction isCloudFunction() {\n return !!(process.env.FUNCTION_NAME || process.env.FUNCTION_TARGET);\n}\n/**\n * This check only verifies that the environment is running knative.\n * This must be run *after* checking for Kubernetes, otherwise it will\n * return a false positive.\n */\nfunction isCloudRun() {\n return !!process.env.K_CONFIGURATION;\n}\nasync function isKubernetesEngine() {\n try {\n await gcpMetadata.instance('attributes/cluster-name');\n return true;\n }\n catch (e) {\n return false;\n }\n}\nasync function isComputeEngine() {\n return gcpMetadata.isAvailable();\n}\n//# sourceMappingURL=envDetect.js.map","/*global module, process*/\nvar Buffer = require('safe-buffer').Buffer;\nvar Stream = require('stream');\nvar util = require('util');\n\nfunction DataStream(data) {\n this.buffer = null;\n this.writable = true;\n this.readable = true;\n\n // No input\n if (!data) {\n this.buffer = Buffer.alloc(0);\n return this;\n }\n\n // Stream\n if (typeof data.pipe === 'function') {\n this.buffer = Buffer.alloc(0);\n data.pipe(this);\n return this;\n }\n\n // Buffer or String\n // or Object (assumedly a passworded key)\n if (data.length || typeof data === 'object') {\n this.buffer = data;\n this.writable = false;\n process.nextTick(function () {\n this.emit('end', data);\n this.readable = false;\n this.emit('close');\n }.bind(this));\n return this;\n }\n\n throw new TypeError('Unexpected data type ('+ typeof data + ')');\n}\nutil.inherits(DataStream, Stream);\n\nDataStream.prototype.write = function write(data) {\n this.buffer = Buffer.concat([this.buffer, Buffer.from(data)]);\n this.emit('data', data);\n};\n\nDataStream.prototype.end = function end(data) {\n if (data)\n this.write(data);\n this.emit('end', data);\n this.emit('close');\n this.writable = false;\n this.readable = false;\n};\n\nmodule.exports = DataStream;\n","/*jshint node:true */\n'use strict';\nvar Buffer = require('buffer').Buffer; // browserify\nvar SlowBuffer = require('buffer').SlowBuffer;\n\nmodule.exports = bufferEq;\n\nfunction bufferEq(a, b) {\n\n // shortcutting on type is necessary for correctness\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n return false;\n }\n\n // buffer sizes should be well-known information, so despite this\n // shortcutting, it doesn't leak any information about the *contents* of the\n // buffers.\n if (a.length !== b.length) {\n return false;\n }\n\n var c = 0;\n for (var i = 0; i < a.length; i++) {\n /*jshint bitwise:false */\n c |= a[i] ^ b[i]; // XOR\n }\n return c === 0;\n}\n\nbufferEq.install = function() {\n Buffer.prototype.equal = SlowBuffer.prototype.equal = function equal(that) {\n return bufferEq(this, that);\n };\n};\n\nvar origBufEqual = Buffer.prototype.equal;\nvar origSlowBufEqual = SlowBuffer.prototype.equal;\nbufferEq.restore = function() {\n Buffer.prototype.equal = origBufEqual;\n SlowBuffer.prototype.equal = origSlowBufEqual;\n};\n","var bufferEqual = require('buffer-equal-constant-time');\nvar Buffer = require('safe-buffer').Buffer;\nvar crypto = require('crypto');\nvar formatEcdsa = require('ecdsa-sig-formatter');\nvar util = require('util');\n\nvar MSG_INVALID_ALGORITHM = '\"%s\" is not a valid algorithm.\\n Supported algorithms are:\\n \"HS256\", \"HS384\", \"HS512\", \"RS256\", \"RS384\", \"RS512\", \"PS256\", \"PS384\", \"PS512\", \"ES256\", \"ES384\", \"ES512\" and \"none\".'\nvar MSG_INVALID_SECRET = 'secret must be a string or buffer';\nvar MSG_INVALID_VERIFIER_KEY = 'key must be a string or a buffer';\nvar MSG_INVALID_SIGNER_KEY = 'key must be a string, a buffer or an object';\n\nvar supportsKeyObjects = typeof crypto.createPublicKey === 'function';\nif (supportsKeyObjects) {\n MSG_INVALID_VERIFIER_KEY += ' or a KeyObject';\n MSG_INVALID_SECRET += 'or a KeyObject';\n}\n\nfunction checkIsPublicKey(key) {\n if (Buffer.isBuffer(key)) {\n return;\n }\n\n if (typeof key === 'string') {\n return;\n }\n\n if (!supportsKeyObjects) {\n throw typeError(MSG_INVALID_VERIFIER_KEY);\n }\n\n if (typeof key !== 'object') {\n throw typeError(MSG_INVALID_VERIFIER_KEY);\n }\n\n if (typeof key.type !== 'string') {\n throw typeError(MSG_INVALID_VERIFIER_KEY);\n }\n\n if (typeof key.asymmetricKeyType !== 'string') {\n throw typeError(MSG_INVALID_VERIFIER_KEY);\n }\n\n if (typeof key.export !== 'function') {\n throw typeError(MSG_INVALID_VERIFIER_KEY);\n }\n};\n\nfunction checkIsPrivateKey(key) {\n if (Buffer.isBuffer(key)) {\n return;\n }\n\n if (typeof key === 'string') {\n return;\n }\n\n if (typeof key === 'object') {\n return;\n }\n\n throw typeError(MSG_INVALID_SIGNER_KEY);\n};\n\nfunction checkIsSecretKey(key) {\n if (Buffer.isBuffer(key)) {\n return;\n }\n\n if (typeof key === 'string') {\n return key;\n }\n\n if (!supportsKeyObjects) {\n throw typeError(MSG_INVALID_SECRET);\n }\n\n if (typeof key !== 'object') {\n throw typeError(MSG_INVALID_SECRET);\n }\n\n if (key.type !== 'secret') {\n throw typeError(MSG_INVALID_SECRET);\n }\n\n if (typeof key.export !== 'function') {\n throw typeError(MSG_INVALID_SECRET);\n }\n}\n\nfunction fromBase64(base64) {\n return base64\n .replace(/=/g, '')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n}\n\nfunction toBase64(base64url) {\n base64url = base64url.toString();\n\n var padding = 4 - base64url.length % 4;\n if (padding !== 4) {\n for (var i = 0; i < padding; ++i) {\n base64url += '=';\n }\n }\n\n return base64url\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n}\n\nfunction typeError(template) {\n var args = [].slice.call(arguments, 1);\n var errMsg = util.format.bind(util, template).apply(null, args);\n return new TypeError(errMsg);\n}\n\nfunction bufferOrString(obj) {\n return Buffer.isBuffer(obj) || typeof obj === 'string';\n}\n\nfunction normalizeInput(thing) {\n if (!bufferOrString(thing))\n thing = JSON.stringify(thing);\n return thing;\n}\n\nfunction createHmacSigner(bits) {\n return function sign(thing, secret) {\n checkIsSecretKey(secret);\n thing = normalizeInput(thing);\n var hmac = crypto.createHmac('sha' + bits, secret);\n var sig = (hmac.update(thing), hmac.digest('base64'))\n return fromBase64(sig);\n }\n}\n\nfunction createHmacVerifier(bits) {\n return function verify(thing, signature, secret) {\n var computedSig = createHmacSigner(bits)(thing, secret);\n return bufferEqual(Buffer.from(signature), Buffer.from(computedSig));\n }\n}\n\nfunction createKeySigner(bits) {\n return function sign(thing, privateKey) {\n checkIsPrivateKey(privateKey);\n thing = normalizeInput(thing);\n // Even though we are specifying \"RSA\" here, this works with ECDSA\n // keys as well.\n var signer = crypto.createSign('RSA-SHA' + bits);\n var sig = (signer.update(thing), signer.sign(privateKey, 'base64'));\n return fromBase64(sig);\n }\n}\n\nfunction createKeyVerifier(bits) {\n return function verify(thing, signature, publicKey) {\n checkIsPublicKey(publicKey);\n thing = normalizeInput(thing);\n signature = toBase64(signature);\n var verifier = crypto.createVerify('RSA-SHA' + bits);\n verifier.update(thing);\n return verifier.verify(publicKey, signature, 'base64');\n }\n}\n\nfunction createPSSKeySigner(bits) {\n return function sign(thing, privateKey) {\n checkIsPrivateKey(privateKey);\n thing = normalizeInput(thing);\n var signer = crypto.createSign('RSA-SHA' + bits);\n var sig = (signer.update(thing), signer.sign({\n key: privateKey,\n padding: crypto.constants.RSA_PKCS1_PSS_PADDING,\n saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST\n }, 'base64'));\n return fromBase64(sig);\n }\n}\n\nfunction createPSSKeyVerifier(bits) {\n return function verify(thing, signature, publicKey) {\n checkIsPublicKey(publicKey);\n thing = normalizeInput(thing);\n signature = toBase64(signature);\n var verifier = crypto.createVerify('RSA-SHA' + bits);\n verifier.update(thing);\n return verifier.verify({\n key: publicKey,\n padding: crypto.constants.RSA_PKCS1_PSS_PADDING,\n saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST\n }, signature, 'base64');\n }\n}\n\nfunction createECDSASigner(bits) {\n var inner = createKeySigner(bits);\n return function sign() {\n var signature = inner.apply(null, arguments);\n signature = formatEcdsa.derToJose(signature, 'ES' + bits);\n return signature;\n };\n}\n\nfunction createECDSAVerifer(bits) {\n var inner = createKeyVerifier(bits);\n return function verify(thing, signature, publicKey) {\n signature = formatEcdsa.joseToDer(signature, 'ES' + bits).toString('base64');\n var result = inner(thing, signature, publicKey);\n return result;\n };\n}\n\nfunction createNoneSigner() {\n return function sign() {\n return '';\n }\n}\n\nfunction createNoneVerifier() {\n return function verify(thing, signature) {\n return signature === '';\n }\n}\n\nmodule.exports = function jwa(algorithm) {\n var signerFactories = {\n hs: createHmacSigner,\n rs: createKeySigner,\n ps: createPSSKeySigner,\n es: createECDSASigner,\n none: createNoneSigner,\n }\n var verifierFactories = {\n hs: createHmacVerifier,\n rs: createKeyVerifier,\n ps: createPSSKeyVerifier,\n es: createECDSAVerifer,\n none: createNoneVerifier,\n }\n var match = algorithm.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);\n if (!match)\n throw typeError(MSG_INVALID_ALGORITHM, algorithm);\n var algo = (match[1] || match[3]).toLowerCase();\n var bits = match[2];\n\n return {\n sign: signerFactories[algo](bits),\n verify: verifierFactories[algo](bits),\n }\n};\n","/*global module*/\nvar Buffer = require('buffer').Buffer;\n\nmodule.exports = function toString(obj) {\n if (typeof obj === 'string')\n return obj;\n if (typeof obj === 'number' || Buffer.isBuffer(obj))\n return obj.toString();\n return JSON.stringify(obj);\n};\n","/*global module*/\nvar Buffer = require('safe-buffer').Buffer;\nvar DataStream = require('./data-stream');\nvar jwa = require('jwa');\nvar Stream = require('stream');\nvar toString = require('./tostring');\nvar util = require('util');\n\nfunction base64url(string, encoding) {\n return Buffer\n .from(string, encoding)\n .toString('base64')\n .replace(/=/g, '')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n}\n\nfunction jwsSecuredInput(header, payload, encoding) {\n encoding = encoding || 'utf8';\n var encodedHeader = base64url(toString(header), 'binary');\n var encodedPayload = base64url(toString(payload), encoding);\n return util.format('%s.%s', encodedHeader, encodedPayload);\n}\n\nfunction jwsSign(opts) {\n var header = opts.header;\n var payload = opts.payload;\n var secretOrKey = opts.secret || opts.privateKey;\n var encoding = opts.encoding;\n var algo = jwa(header.alg);\n var securedInput = jwsSecuredInput(header, payload, encoding);\n var signature = algo.sign(securedInput, secretOrKey);\n return util.format('%s.%s', securedInput, signature);\n}\n\nfunction SignStream(opts) {\n var secret = opts.secret||opts.privateKey||opts.key;\n var secretStream = new DataStream(secret);\n this.readable = true;\n this.header = opts.header;\n this.encoding = opts.encoding;\n this.secret = this.privateKey = this.key = secretStream;\n this.payload = new DataStream(opts.payload);\n this.secret.once('close', function () {\n if (!this.payload.writable && this.readable)\n this.sign();\n }.bind(this));\n\n this.payload.once('close', function () {\n if (!this.secret.writable && this.readable)\n this.sign();\n }.bind(this));\n}\nutil.inherits(SignStream, Stream);\n\nSignStream.prototype.sign = function sign() {\n try {\n var signature = jwsSign({\n header: this.header,\n payload: this.payload.buffer,\n secret: this.secret.buffer,\n encoding: this.encoding\n });\n this.emit('done', signature);\n this.emit('data', signature);\n this.emit('end');\n this.readable = false;\n return signature;\n } catch (e) {\n this.readable = false;\n this.emit('error', e);\n this.emit('close');\n }\n};\n\nSignStream.sign = jwsSign;\n\nmodule.exports = SignStream;\n","/*global module*/\nvar Buffer = require('safe-buffer').Buffer;\nvar DataStream = require('./data-stream');\nvar jwa = require('jwa');\nvar Stream = require('stream');\nvar toString = require('./tostring');\nvar util = require('util');\nvar JWS_REGEX = /^[a-zA-Z0-9\\-_]+?\\.[a-zA-Z0-9\\-_]+?\\.([a-zA-Z0-9\\-_]+)?$/;\n\nfunction isObject(thing) {\n return Object.prototype.toString.call(thing) === '[object Object]';\n}\n\nfunction safeJsonParse(thing) {\n if (isObject(thing))\n return thing;\n try { return JSON.parse(thing); }\n catch (e) { return undefined; }\n}\n\nfunction headerFromJWS(jwsSig) {\n var encodedHeader = jwsSig.split('.', 1)[0];\n return safeJsonParse(Buffer.from(encodedHeader, 'base64').toString('binary'));\n}\n\nfunction securedInputFromJWS(jwsSig) {\n return jwsSig.split('.', 2).join('.');\n}\n\nfunction signatureFromJWS(jwsSig) {\n return jwsSig.split('.')[2];\n}\n\nfunction payloadFromJWS(jwsSig, encoding) {\n encoding = encoding || 'utf8';\n var payload = jwsSig.split('.')[1];\n return Buffer.from(payload, 'base64').toString(encoding);\n}\n\nfunction isValidJws(string) {\n return JWS_REGEX.test(string) && !!headerFromJWS(string);\n}\n\nfunction jwsVerify(jwsSig, algorithm, secretOrKey) {\n if (!algorithm) {\n var err = new Error(\"Missing algorithm parameter for jws.verify\");\n err.code = \"MISSING_ALGORITHM\";\n throw err;\n }\n jwsSig = toString(jwsSig);\n var signature = signatureFromJWS(jwsSig);\n var securedInput = securedInputFromJWS(jwsSig);\n var algo = jwa(algorithm);\n return algo.verify(securedInput, signature, secretOrKey);\n}\n\nfunction jwsDecode(jwsSig, opts) {\n opts = opts || {};\n jwsSig = toString(jwsSig);\n\n if (!isValidJws(jwsSig))\n return null;\n\n var header = headerFromJWS(jwsSig);\n\n if (!header)\n return null;\n\n var payload = payloadFromJWS(jwsSig);\n if (header.typ === 'JWT' || opts.json)\n payload = JSON.parse(payload, opts.encoding);\n\n return {\n header: header,\n payload: payload,\n signature: signatureFromJWS(jwsSig)\n };\n}\n\nfunction VerifyStream(opts) {\n opts = opts || {};\n var secretOrKey = opts.secret||opts.publicKey||opts.key;\n var secretStream = new DataStream(secretOrKey);\n this.readable = true;\n this.algorithm = opts.algorithm;\n this.encoding = opts.encoding;\n this.secret = this.publicKey = this.key = secretStream;\n this.signature = new DataStream(opts.signature);\n this.secret.once('close', function () {\n if (!this.signature.writable && this.readable)\n this.verify();\n }.bind(this));\n\n this.signature.once('close', function () {\n if (!this.secret.writable && this.readable)\n this.verify();\n }.bind(this));\n}\nutil.inherits(VerifyStream, Stream);\nVerifyStream.prototype.verify = function verify() {\n try {\n var valid = jwsVerify(this.signature.buffer, this.algorithm, this.key.buffer);\n var obj = jwsDecode(this.signature.buffer, this.encoding);\n this.emit('done', valid, obj);\n this.emit('data', valid);\n this.emit('end');\n this.readable = false;\n return valid;\n } catch (e) {\n this.readable = false;\n this.emit('error', e);\n this.emit('close');\n }\n};\n\nVerifyStream.decode = jwsDecode;\nVerifyStream.isValid = isValidJws;\nVerifyStream.verify = jwsVerify;\n\nmodule.exports = VerifyStream;\n","/*global exports*/\nvar SignStream = require('./lib/sign-stream');\nvar VerifyStream = require('./lib/verify-stream');\n\nvar ALGORITHMS = [\n 'HS256', 'HS384', 'HS512',\n 'RS256', 'RS384', 'RS512',\n 'PS256', 'PS384', 'PS512',\n 'ES256', 'ES384', 'ES512'\n];\n\nexports.ALGORITHMS = ALGORITHMS;\nexports.sign = SignStream.sign;\nexports.verify = VerifyStream.verify;\nexports.decode = VerifyStream.decode;\nexports.isValid = VerifyStream.isValid;\nexports.createSign = function createSign(opts) {\n return new SignStream(opts);\n};\nexports.createVerify = function createVerify(opts) {\n return new VerifyStream(opts);\n};\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.GoogleToken = void 0;\nvar fs = _interopRequireWildcard(require(\"fs\"));\nvar _gaxios = require(\"gaxios\");\nvar jws = _interopRequireWildcard(require(\"jws\"));\nvar path = _interopRequireWildcard(require(\"path\"));\nvar _util = require(\"util\");\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { \"default\": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n[\"default\"] = e, t && t.set(e, n), n; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }\nfunction _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }\nfunction _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); }\nfunction _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }\nfunction _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }\nfunction _assertClassBrand(e, t, n) { if (\"function\" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError(\"Private element is not present on this object\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _wrapNativeSuper(t) { var r = \"function\" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if (\"function\" != typeof t) throw new TypeError(\"Super expression must either be null or a function\"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); }\nfunction _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf(\"[native code]\"); } catch (n) { return \"function\" == typeof t; } }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; } /**\n * Copyright 2018 Google LLC\n *\n * Distributed under MIT license.\n * See file LICENSE for detail or copy at https://opensource.org/licenses/MIT\n */\nvar readFile = fs.readFile ? (0, _util.promisify)(fs.readFile) : /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n throw new ErrorWithCode('use key rather than keyFile.', 'MISSING_CREDENTIALS');\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n}));\nvar GOOGLE_TOKEN_URL = 'https://oauth2.googleapis.com/token';\nvar GOOGLE_REVOKE_TOKEN_URL = 'https://oauth2.googleapis.com/revoke?token=';\nvar ErrorWithCode = /*#__PURE__*/function (_Error) {\n function ErrorWithCode(message, code) {\n var _this;\n _classCallCheck(this, ErrorWithCode);\n _this = _callSuper(this, ErrorWithCode, [message]);\n _defineProperty(_this, \"code\", void 0);\n _this.code = code;\n return _this;\n }\n _inherits(ErrorWithCode, _Error);\n return _createClass(ErrorWithCode);\n}(/*#__PURE__*/_wrapNativeSuper(Error));\nvar _inFlightRequest = /*#__PURE__*/new WeakMap();\nvar _GoogleToken_brand = /*#__PURE__*/new WeakSet();\nvar GoogleToken = exports.GoogleToken = /*#__PURE__*/function () {\n /**\n * Create a GoogleToken.\n *\n * @param options Configuration object.\n */\n function GoogleToken(_options) {\n _classCallCheck(this, GoogleToken);\n _classPrivateMethodInitSpec(this, _GoogleToken_brand);\n _defineProperty(this, \"expiresAt\", void 0);\n _defineProperty(this, \"key\", void 0);\n _defineProperty(this, \"keyFile\", void 0);\n _defineProperty(this, \"iss\", void 0);\n _defineProperty(this, \"sub\", void 0);\n _defineProperty(this, \"scope\", void 0);\n _defineProperty(this, \"rawToken\", void 0);\n _defineProperty(this, \"tokenExpires\", void 0);\n _defineProperty(this, \"email\", void 0);\n _defineProperty(this, \"additionalClaims\", void 0);\n _defineProperty(this, \"eagerRefreshThresholdMillis\", void 0);\n _defineProperty(this, \"transporter\", {\n request: function request(opts) {\n return (0, _gaxios.request)(opts);\n }\n });\n _classPrivateFieldInitSpec(this, _inFlightRequest, void 0);\n _assertClassBrand(_GoogleToken_brand, this, _configure).call(this, _options);\n }\n\n /**\n * Returns whether the token has expired.\n *\n * @return true if the token has expired, false otherwise.\n */\n return _createClass(GoogleToken, [{\n key: \"accessToken\",\n get: function get() {\n return this.rawToken ? this.rawToken.access_token : undefined;\n }\n }, {\n key: \"idToken\",\n get: function get() {\n return this.rawToken ? this.rawToken.id_token : undefined;\n }\n }, {\n key: \"tokenType\",\n get: function get() {\n return this.rawToken ? this.rawToken.token_type : undefined;\n }\n }, {\n key: \"refreshToken\",\n get: function get() {\n return this.rawToken ? this.rawToken.refresh_token : undefined;\n }\n }, {\n key: \"hasExpired\",\n value: function hasExpired() {\n var now = new Date().getTime();\n if (this.rawToken && this.expiresAt) {\n return now >= this.expiresAt;\n } else {\n return true;\n }\n }\n\n /**\n * Returns whether the token will expire within eagerRefreshThresholdMillis\n *\n * @return true if the token will be expired within eagerRefreshThresholdMillis, false otherwise.\n */\n }, {\n key: \"isTokenExpiring\",\n value: function isTokenExpiring() {\n var _this$eagerRefreshThr;\n var now = new Date().getTime();\n var eagerRefreshThresholdMillis = (_this$eagerRefreshThr = this.eagerRefreshThresholdMillis) !== null && _this$eagerRefreshThr !== void 0 ? _this$eagerRefreshThr : 0;\n if (this.rawToken && this.expiresAt) {\n return this.expiresAt <= now + eagerRefreshThresholdMillis;\n } else {\n return true;\n }\n }\n\n /**\n * Returns a cached token or retrieves a new one from Google.\n *\n * @param callback The callback function.\n */\n }, {\n key: \"getToken\",\n value: function getToken(callback) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (_typeof(callback) === 'object') {\n opts = callback;\n callback = undefined;\n }\n opts = Object.assign({\n forceRefresh: false\n }, opts);\n if (callback) {\n var cb = callback;\n _assertClassBrand(_GoogleToken_brand, this, _getTokenAsync).call(this, opts).then(function (t) {\n return cb(null, t);\n }, callback);\n return;\n }\n return _assertClassBrand(_GoogleToken_brand, this, _getTokenAsync).call(this, opts);\n }\n\n /**\n * Given a keyFile, extract the key and client email if available\n * @param keyFile Path to a json, pem, or p12 file that contains the key.\n * @returns an object with privateKey and clientEmail properties\n */\n }, {\n key: \"getCredentials\",\n value: (function () {\n var _getCredentials = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(keyFile) {\n var ext, key, body, privateKey, clientEmail, _privateKey;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n ext = path.extname(keyFile);\n _context2.t0 = ext;\n _context2.next = _context2.t0 === '.json' ? 4 : _context2.t0 === '.der' ? 13 : _context2.t0 === '.crt' ? 13 : _context2.t0 === '.pem' ? 13 : _context2.t0 === '.p12' ? 17 : _context2.t0 === '.pfx' ? 17 : 18;\n break;\n case 4:\n _context2.next = 6;\n return readFile(keyFile, 'utf8');\n case 6:\n key = _context2.sent;\n body = JSON.parse(key);\n privateKey = body.private_key;\n clientEmail = body.client_email;\n if (!(!privateKey || !clientEmail)) {\n _context2.next = 12;\n break;\n }\n throw new ErrorWithCode('private_key and client_email are required.', 'MISSING_CREDENTIALS');\n case 12:\n return _context2.abrupt(\"return\", {\n privateKey: privateKey,\n clientEmail: clientEmail\n });\n case 13:\n _context2.next = 15;\n return readFile(keyFile, 'utf8');\n case 15:\n _privateKey = _context2.sent;\n return _context2.abrupt(\"return\", {\n privateKey: _privateKey\n });\n case 17:\n throw new ErrorWithCode('*.p12 certificates are not supported after v6.1.2. ' + 'Consider utilizing *.json format or converting *.p12 to *.pem using the OpenSSL CLI.', 'UNKNOWN_CERTIFICATE_TYPE');\n case 18:\n throw new ErrorWithCode('Unknown certificate type. Type is determined based on file extension. ' + 'Current supported extensions are *.json, and *.pem.', 'UNKNOWN_CERTIFICATE_TYPE');\n case 19:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getCredentials(_x) {\n return _getCredentials.apply(this, arguments);\n }\n return getCredentials;\n }())\n }, {\n key: \"revokeToken\",\n value: function revokeToken(callback) {\n if (callback) {\n _assertClassBrand(_GoogleToken_brand, this, _revokeTokenAsync).call(this).then(function () {\n return callback();\n }, callback);\n return;\n }\n return _assertClassBrand(_GoogleToken_brand, this, _revokeTokenAsync).call(this);\n }\n }]);\n}();\nfunction _getTokenAsync(_x2) {\n return _getTokenAsync2.apply(this, arguments);\n}\nfunction _getTokenAsync2() {\n _getTokenAsync2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(opts) {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n if (!(_classPrivateFieldGet(_inFlightRequest, this) && !opts.forceRefresh)) {\n _context3.next = 2;\n break;\n }\n return _context3.abrupt(\"return\", _classPrivateFieldGet(_inFlightRequest, this));\n case 2:\n _context3.prev = 2;\n _context3.next = 5;\n return _classPrivateFieldSet(_inFlightRequest, this, _assertClassBrand(_GoogleToken_brand, this, _getTokenAsyncInner).call(this, opts));\n case 5:\n return _context3.abrupt(\"return\", _context3.sent);\n case 6:\n _context3.prev = 6;\n _classPrivateFieldSet(_inFlightRequest, this, undefined);\n return _context3.finish(6);\n case 9:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this, [[2,, 6, 9]]);\n }));\n return _getTokenAsync2.apply(this, arguments);\n}\nfunction _getTokenAsyncInner(_x3) {\n return _getTokenAsyncInner2.apply(this, arguments);\n}\nfunction _getTokenAsyncInner2() {\n _getTokenAsyncInner2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(opts) {\n var creds;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!(this.isTokenExpiring() === false && opts.forceRefresh === false)) {\n _context4.next = 2;\n break;\n }\n return _context4.abrupt(\"return\", Promise.resolve(this.rawToken));\n case 2:\n if (!(!this.key && !this.keyFile)) {\n _context4.next = 4;\n break;\n }\n throw new Error('No key or keyFile set.');\n case 4:\n if (!(!this.key && this.keyFile)) {\n _context4.next = 11;\n break;\n }\n _context4.next = 7;\n return this.getCredentials(this.keyFile);\n case 7:\n creds = _context4.sent;\n this.key = creds.privateKey;\n this.iss = creds.clientEmail || this.iss;\n if (!creds.clientEmail) {\n _assertClassBrand(_GoogleToken_brand, this, _ensureEmail).call(this);\n }\n case 11:\n return _context4.abrupt(\"return\", _assertClassBrand(_GoogleToken_brand, this, _requestToken).call(this));\n case 12:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n return _getTokenAsyncInner2.apply(this, arguments);\n}\nfunction _ensureEmail() {\n if (!this.iss) {\n throw new ErrorWithCode('email is required.', 'MISSING_CREDENTIALS');\n }\n}\nfunction _revokeTokenAsync() {\n return _revokeTokenAsync2.apply(this, arguments);\n}\nfunction _revokeTokenAsync2() {\n _revokeTokenAsync2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n var url;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n if (this.accessToken) {\n _context5.next = 2;\n break;\n }\n throw new Error('No token to revoke.');\n case 2:\n url = GOOGLE_REVOKE_TOKEN_URL + this.accessToken;\n _context5.next = 5;\n return this.transporter.request({\n url: url,\n retry: true\n });\n case 5:\n _assertClassBrand(_GoogleToken_brand, this, _configure).call(this, {\n email: this.iss,\n sub: this.sub,\n key: this.key,\n keyFile: this.keyFile,\n scope: this.scope,\n additionalClaims: this.additionalClaims\n });\n case 6:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n return _revokeTokenAsync2.apply(this, arguments);\n}\n/**\n * Configure the GoogleToken for re-use.\n * @param {object} options Configuration object.\n */\nfunction _configure() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.keyFile = options.keyFile;\n this.key = options.key;\n this.rawToken = undefined;\n this.iss = options.email || options.iss;\n this.sub = options.sub;\n this.additionalClaims = options.additionalClaims;\n if (_typeof(options.scope) === 'object') {\n this.scope = options.scope.join(' ');\n } else {\n this.scope = options.scope;\n }\n this.eagerRefreshThresholdMillis = options.eagerRefreshThresholdMillis;\n if (options.transporter) {\n this.transporter = options.transporter;\n }\n}\n/**\n * Request the token from Google.\n */\nfunction _requestToken() {\n return _requestToken2.apply(this, arguments);\n}\nfunction _requestToken2() {\n _requestToken2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {\n var iat, additionalClaims, payload, signedJWT, r, _response, _response2, body, desc;\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n iat = Math.floor(new Date().getTime() / 1000);\n additionalClaims = this.additionalClaims || {};\n payload = Object.assign({\n iss: this.iss,\n scope: this.scope,\n aud: GOOGLE_TOKEN_URL,\n exp: iat + 3600,\n iat: iat,\n sub: this.sub\n }, additionalClaims);\n signedJWT = jws.sign({\n header: {\n alg: 'RS256'\n },\n payload: payload,\n secret: this.key\n });\n _context6.prev = 4;\n _context6.next = 7;\n return this.transporter.request({\n method: 'POST',\n url: GOOGLE_TOKEN_URL,\n data: new URLSearchParams({\n grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',\n assertion: signedJWT\n }),\n responseType: 'json',\n retryConfig: {\n httpMethodsToRetry: ['POST']\n }\n });\n case 7:\n r = _context6.sent;\n this.rawToken = r.data;\n this.expiresAt = r.data.expires_in === null || r.data.expires_in === undefined ? undefined : (iat + r.data.expires_in) * 1000;\n return _context6.abrupt(\"return\", this.rawToken);\n case 13:\n _context6.prev = 13;\n _context6.t0 = _context6[\"catch\"](4);\n this.rawToken = undefined;\n this.tokenExpires = undefined;\n body = _context6.t0.response && (_response = _context6.t0.response) !== null && _response !== void 0 && _response.data ? (_response2 = _context6.t0.response) === null || _response2 === void 0 ? void 0 : _response2.data : {};\n if (body.error) {\n desc = body.error_description ? \": \".concat(body.error_description) : '';\n _context6.t0.message = \"\".concat(body.error).concat(desc);\n }\n throw _context6.t0;\n case 20:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this, [[4, 13]]);\n }));\n return _requestToken2.apply(this, arguments);\n}","\"use strict\";\n// Copyright 2015 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.JWTAccess = void 0;\nconst jws = require(\"jws\");\nconst util_1 = require(\"../util\");\nconst DEFAULT_HEADER = {\n alg: 'RS256',\n typ: 'JWT',\n};\nclass JWTAccess {\n email;\n key;\n keyId;\n projectId;\n eagerRefreshThresholdMillis;\n cache = new util_1.LRUCache({\n capacity: 500,\n maxAge: 60 * 60 * 1000,\n });\n /**\n * JWTAccess service account credentials.\n *\n * Create a new access token by using the credential to create a new JWT token\n * that's recognized as the access token.\n *\n * @param email the service account email address.\n * @param key the private key that will be used to sign the token.\n * @param keyId the ID of the private key used to sign the token.\n */\n constructor(email, key, keyId, eagerRefreshThresholdMillis) {\n this.email = email;\n this.key = key;\n this.keyId = keyId;\n this.eagerRefreshThresholdMillis =\n eagerRefreshThresholdMillis ?? 5 * 60 * 1000;\n }\n /**\n * Ensures that we're caching a key appropriately, giving precedence to scopes vs. url\n *\n * @param url The URI being authorized.\n * @param scopes The scope or scopes being authorized\n * @returns A string that returns the cached key.\n */\n getCachedKey(url, scopes) {\n let cacheKey = url;\n if (scopes && Array.isArray(scopes) && scopes.length) {\n cacheKey = url ? `${url}_${scopes.join('_')}` : `${scopes.join('_')}`;\n }\n else if (typeof scopes === 'string') {\n cacheKey = url ? `${url}_${scopes}` : scopes;\n }\n if (!cacheKey) {\n throw Error('Scopes or url must be provided');\n }\n return cacheKey;\n }\n /**\n * Get a non-expired access token, after refreshing if necessary.\n *\n * @param url The URI being authorized.\n * @param additionalClaims An object with a set of additional claims to\n * include in the payload.\n * @returns An object that includes the authorization header.\n */\n getRequestHeaders(url, additionalClaims, scopes) {\n // Return cached authorization headers, unless we are within\n // eagerRefreshThresholdMillis ms of them expiring:\n const key = this.getCachedKey(url, scopes);\n const cachedToken = this.cache.get(key);\n const now = Date.now();\n if (cachedToken &&\n cachedToken.expiration - now > this.eagerRefreshThresholdMillis) {\n // Copying headers into a new `Headers` object to avoid potential leakage -\n // as this is a cache it is possible for multiple requests to reference this\n // same value.\n return new Headers(cachedToken.headers);\n }\n const iat = Math.floor(Date.now() / 1000);\n const exp = JWTAccess.getExpirationTime(iat);\n let defaultClaims;\n // Turn scopes into space-separated string\n if (Array.isArray(scopes)) {\n scopes = scopes.join(' ');\n }\n // If scopes are specified, sign with scopes\n if (scopes) {\n defaultClaims = {\n iss: this.email,\n sub: this.email,\n scope: scopes,\n exp,\n iat,\n };\n }\n else {\n defaultClaims = {\n iss: this.email,\n sub: this.email,\n aud: url,\n exp,\n iat,\n };\n }\n // if additionalClaims are provided, ensure they do not collide with\n // other required claims.\n if (additionalClaims) {\n for (const claim in defaultClaims) {\n if (additionalClaims[claim]) {\n throw new Error(`The '${claim}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`);\n }\n }\n }\n const header = this.keyId\n ? { ...DEFAULT_HEADER, kid: this.keyId }\n : DEFAULT_HEADER;\n const payload = Object.assign(defaultClaims, additionalClaims);\n // Sign the jwt and add it to the cache\n const signedJWT = jws.sign({ header, payload, secret: this.key });\n const headers = new Headers({ authorization: `Bearer ${signedJWT}` });\n this.cache.set(key, {\n expiration: exp * 1000,\n headers,\n });\n return headers;\n }\n /**\n * Returns an expiration time for the JWT token.\n *\n * @param iat The issued at time for the JWT.\n * @returns An expiration time for the JWT.\n */\n static getExpirationTime(iat) {\n const exp = iat + 3600; // 3600 seconds = 1 hour\n return exp;\n }\n /**\n * Create a JWTAccess credentials instance using the given input options.\n * @param json The input object.\n */\n fromJSON(json) {\n if (!json) {\n throw new Error('Must pass in a JSON object containing the service account auth settings.');\n }\n if (!json.client_email) {\n throw new Error('The incoming JSON object does not contain a client_email field');\n }\n if (!json.private_key) {\n throw new Error('The incoming JSON object does not contain a private_key field');\n }\n // Extract the relevant information from the json key file.\n this.email = json.client_email;\n this.key = json.private_key;\n this.keyId = json.private_key_id;\n this.projectId = json.project_id;\n }\n fromStream(inputStream, callback) {\n if (callback) {\n this.fromStreamAsync(inputStream).then(() => callback(), callback);\n }\n else {\n return this.fromStreamAsync(inputStream);\n }\n }\n fromStreamAsync(inputStream) {\n return new Promise((resolve, reject) => {\n if (!inputStream) {\n reject(new Error('Must pass in a stream containing the service account auth settings.'));\n }\n let s = '';\n inputStream\n .setEncoding('utf8')\n .on('data', chunk => (s += chunk))\n .on('error', reject)\n .on('end', () => {\n try {\n const data = JSON.parse(s);\n this.fromJSON(data);\n resolve();\n }\n catch (err) {\n reject(err);\n }\n });\n });\n }\n}\nexports.JWTAccess = JWTAccess;\n//# sourceMappingURL=jwtaccess.js.map","\"use strict\";\n// Copyright 2013 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.JWT = void 0;\nconst gtoken_1 = require(\"gtoken\");\nconst jwtaccess_1 = require(\"./jwtaccess\");\nconst oauth2client_1 = require(\"./oauth2client\");\nconst authclient_1 = require(\"./authclient\");\nclass JWT extends oauth2client_1.OAuth2Client {\n email;\n keyFile;\n key;\n keyId;\n defaultScopes;\n scopes;\n scope;\n subject;\n gtoken;\n additionalClaims;\n useJWTAccessWithScope;\n defaultServicePath;\n access;\n /**\n * JWT service account credentials.\n *\n * Retrieve access token using gtoken.\n *\n * @param options the\n */\n constructor(options = {}) {\n super(options);\n this.email = options.email;\n this.keyFile = options.keyFile;\n this.key = options.key;\n this.keyId = options.keyId;\n this.scopes = options.scopes;\n this.subject = options.subject;\n this.additionalClaims = options.additionalClaims;\n // Start with an expired refresh token, which will automatically be\n // refreshed before the first API call is made.\n this.credentials = { refresh_token: 'jwt-placeholder', expiry_date: 1 };\n }\n /**\n * Creates a copy of the credential with the specified scopes.\n * @param scopes List of requested scopes or a single scope.\n * @return The cloned instance.\n */\n createScoped(scopes) {\n const jwt = new JWT(this);\n jwt.scopes = scopes;\n return jwt;\n }\n /**\n * Obtains the metadata to be sent with the request.\n *\n * @param url the URI being authorized.\n */\n async getRequestMetadataAsync(url) {\n url = this.defaultServicePath ? `https://${this.defaultServicePath}/` : url;\n const useSelfSignedJWT = (!this.hasUserScopes() && url) ||\n (this.useJWTAccessWithScope && this.hasAnyScopes()) ||\n this.universeDomain !== authclient_1.DEFAULT_UNIVERSE;\n if (this.subject && this.universeDomain !== authclient_1.DEFAULT_UNIVERSE) {\n throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${authclient_1.DEFAULT_UNIVERSE}`);\n }\n if (!this.apiKey && useSelfSignedJWT) {\n if (this.additionalClaims &&\n this.additionalClaims.target_audience) {\n const { tokens } = await this.refreshToken();\n return {\n headers: this.addSharedMetadataHeaders(new Headers({\n authorization: `Bearer ${tokens.id_token}`,\n })),\n };\n }\n else {\n // no scopes have been set, but a uri has been provided. Use JWTAccess\n // credentials.\n if (!this.access) {\n this.access = new jwtaccess_1.JWTAccess(this.email, this.key, this.keyId, this.eagerRefreshThresholdMillis);\n }\n let scopes;\n if (this.hasUserScopes()) {\n scopes = this.scopes;\n }\n else if (!url) {\n scopes = this.defaultScopes;\n }\n const useScopes = this.useJWTAccessWithScope ||\n this.universeDomain !== authclient_1.DEFAULT_UNIVERSE;\n const headers = await this.access.getRequestHeaders(url ?? undefined, this.additionalClaims, \n // Scopes take precedent over audience for signing,\n // so we only provide them if `useJWTAccessWithScope` is on or\n // if we are in a non-default universe\n useScopes ? scopes : undefined);\n return { headers: this.addSharedMetadataHeaders(headers) };\n }\n }\n else if (this.hasAnyScopes() || this.apiKey) {\n return super.getRequestMetadataAsync(url);\n }\n else {\n // If no audience, apiKey, or scopes are provided, we should not attempt\n // to populate any headers:\n return { headers: new Headers() };\n }\n }\n /**\n * Fetches an ID token.\n * @param targetAudience the audience for the fetched ID token.\n */\n async fetchIdToken(targetAudience) {\n // Create a new gToken for fetching an ID token\n const gtoken = new gtoken_1.GoogleToken({\n iss: this.email,\n sub: this.subject,\n scope: this.scopes || this.defaultScopes,\n keyFile: this.keyFile,\n key: this.key,\n additionalClaims: { target_audience: targetAudience },\n transporter: this.transporter,\n });\n await gtoken.getToken({\n forceRefresh: true,\n });\n if (!gtoken.idToken) {\n throw new Error('Unknown error: Failed to fetch ID token');\n }\n return gtoken.idToken;\n }\n /**\n * Determine if there are currently scopes available.\n */\n hasUserScopes() {\n if (!this.scopes) {\n return false;\n }\n return this.scopes.length > 0;\n }\n /**\n * Are there any default or user scopes defined.\n */\n hasAnyScopes() {\n if (this.scopes && this.scopes.length > 0)\n return true;\n if (this.defaultScopes && this.defaultScopes.length > 0)\n return true;\n return false;\n }\n authorize(callback) {\n if (callback) {\n this.authorizeAsync().then(r => callback(null, r), callback);\n }\n else {\n return this.authorizeAsync();\n }\n }\n async authorizeAsync() {\n const result = await this.refreshToken();\n if (!result) {\n throw new Error('No result returned');\n }\n this.credentials = result.tokens;\n this.credentials.refresh_token = 'jwt-placeholder';\n this.key = this.gtoken.key;\n this.email = this.gtoken.iss;\n return result.tokens;\n }\n /**\n * Refreshes the access token.\n * @param refreshToken ignored\n * @private\n */\n async refreshTokenNoCache() {\n const gtoken = this.createGToken();\n const token = await gtoken.getToken({\n forceRefresh: this.isTokenExpiring(),\n });\n const tokens = {\n access_token: token.access_token,\n token_type: 'Bearer',\n expiry_date: gtoken.expiresAt,\n id_token: gtoken.idToken,\n };\n this.emit('tokens', tokens);\n return { res: null, tokens };\n }\n /**\n * Create a gToken if it doesn't already exist.\n */\n createGToken() {\n if (!this.gtoken) {\n this.gtoken = new gtoken_1.GoogleToken({\n iss: this.email,\n sub: this.subject,\n scope: this.scopes || this.defaultScopes,\n keyFile: this.keyFile,\n key: this.key,\n additionalClaims: this.additionalClaims,\n transporter: this.transporter,\n });\n }\n return this.gtoken;\n }\n /**\n * Create a JWT credentials instance using the given input options.\n * @param json The input object.\n *\n * @remarks\n *\n * **Important**: If you accept a credential configuration (credential JSON/File/Stream) from an external source for authentication to Google Cloud, you must validate it before providing it to any Google API or library. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. For more information, refer to {@link https://cloud.google.com/docs/authentication/external/externally-sourced-credentials Validate credential configurations from external sources}.\n */\n fromJSON(json) {\n if (!json) {\n throw new Error('Must pass in a JSON object containing the service account auth settings.');\n }\n if (!json.client_email) {\n throw new Error('The incoming JSON object does not contain a client_email field');\n }\n if (!json.private_key) {\n throw new Error('The incoming JSON object does not contain a private_key field');\n }\n // Extract the relevant information from the json key file.\n this.email = json.client_email;\n this.key = json.private_key;\n this.keyId = json.private_key_id;\n this.projectId = json.project_id;\n this.quotaProjectId = json.quota_project_id;\n this.universeDomain = json.universe_domain || this.universeDomain;\n }\n fromStream(inputStream, callback) {\n if (callback) {\n this.fromStreamAsync(inputStream).then(() => callback(), callback);\n }\n else {\n return this.fromStreamAsync(inputStream);\n }\n }\n fromStreamAsync(inputStream) {\n return new Promise((resolve, reject) => {\n if (!inputStream) {\n throw new Error('Must pass in a stream containing the service account auth settings.');\n }\n let s = '';\n inputStream\n .setEncoding('utf8')\n .on('error', reject)\n .on('data', chunk => (s += chunk))\n .on('end', () => {\n try {\n const data = JSON.parse(s);\n this.fromJSON(data);\n resolve();\n }\n catch (e) {\n reject(e);\n }\n });\n });\n }\n /**\n * Creates a JWT credentials instance using an API Key for authentication.\n * @param apiKey The API Key in string form.\n */\n fromAPIKey(apiKey) {\n if (typeof apiKey !== 'string') {\n throw new Error('Must provide an API Key string.');\n }\n this.apiKey = apiKey;\n }\n /**\n * Using the key or keyFile on the JWT client, obtain an object that contains\n * the key and the client email.\n */\n async getCredentials() {\n if (this.key) {\n return { private_key: this.key, client_email: this.email };\n }\n else if (this.keyFile) {\n const gtoken = this.createGToken();\n const creds = await gtoken.getCredentials(this.keyFile);\n return { private_key: creds.privateKey, client_email: creds.clientEmail };\n }\n throw new Error('A key or a keyFile must be provided to getCredentials.');\n }\n}\nexports.JWT = JWT;\n//# sourceMappingURL=jwtclient.js.map","\"use strict\";\n// Copyright 2015 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UserRefreshClient = exports.USER_REFRESH_ACCOUNT_TYPE = void 0;\nconst oauth2client_1 = require(\"./oauth2client\");\nexports.USER_REFRESH_ACCOUNT_TYPE = 'authorized_user';\nclass UserRefreshClient extends oauth2client_1.OAuth2Client {\n // TODO: refactor tests to make this private\n // In a future gts release, the _propertyName rule will be lifted.\n // This is also a hard one because `this.refreshToken` is a function.\n _refreshToken;\n /**\n * The User Refresh Token client.\n *\n * @param optionsOrClientId The User Refresh Token client options. Passing an `clientId` directly is **@DEPRECATED**.\n * @param clientSecret **@DEPRECATED**. Provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead.\n * @param refreshToken **@DEPRECATED**. Provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead.\n * @param eagerRefreshThresholdMillis **@DEPRECATED**. Provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead.\n * @param forceRefreshOnFailure **@DEPRECATED**. Provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead.\n */\n constructor(optionsOrClientId, \n /**\n * @deprecated - provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead\n */\n clientSecret, \n /**\n * @deprecated - provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead\n */\n refreshToken, \n /**\n * @deprecated - provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead\n */\n eagerRefreshThresholdMillis, \n /**\n * @deprecated - provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead\n */\n forceRefreshOnFailure) {\n const opts = optionsOrClientId && typeof optionsOrClientId === 'object'\n ? optionsOrClientId\n : {\n clientId: optionsOrClientId,\n clientSecret,\n refreshToken,\n eagerRefreshThresholdMillis,\n forceRefreshOnFailure,\n };\n super(opts);\n this._refreshToken = opts.refreshToken;\n this.credentials.refresh_token = opts.refreshToken;\n }\n /**\n * Refreshes the access token.\n * @param refreshToken An ignored refreshToken..\n * @param callback Optional callback.\n */\n async refreshTokenNoCache() {\n return super.refreshTokenNoCache(this._refreshToken);\n }\n async fetchIdToken(targetAudience) {\n const res = await this.transporter.request({\n ...UserRefreshClient.RETRY_CONFIG,\n url: this.endpoints.oauth2TokenUrl,\n method: 'POST',\n data: new URLSearchParams({\n client_id: this._clientId,\n client_secret: this._clientSecret,\n grant_type: 'refresh_token',\n refresh_token: this._refreshToken,\n target_audience: targetAudience,\n }),\n });\n return res.data.id_token;\n }\n /**\n * Create a UserRefreshClient credentials instance using the given input\n * options.\n * @param json The input object.\n */\n fromJSON(json) {\n if (!json) {\n throw new Error('Must pass in a JSON object containing the user refresh token');\n }\n if (json.type !== 'authorized_user') {\n throw new Error('The incoming JSON object does not have the \"authorized_user\" type');\n }\n if (!json.client_id) {\n throw new Error('The incoming JSON object does not contain a client_id field');\n }\n if (!json.client_secret) {\n throw new Error('The incoming JSON object does not contain a client_secret field');\n }\n if (!json.refresh_token) {\n throw new Error('The incoming JSON object does not contain a refresh_token field');\n }\n this._clientId = json.client_id;\n this._clientSecret = json.client_secret;\n this._refreshToken = json.refresh_token;\n this.credentials.refresh_token = json.refresh_token;\n this.quotaProjectId = json.quota_project_id;\n this.universeDomain = json.universe_domain || this.universeDomain;\n }\n fromStream(inputStream, callback) {\n if (callback) {\n this.fromStreamAsync(inputStream).then(() => callback(), callback);\n }\n else {\n return this.fromStreamAsync(inputStream);\n }\n }\n async fromStreamAsync(inputStream) {\n return new Promise((resolve, reject) => {\n if (!inputStream) {\n return reject(new Error('Must pass in a stream containing the user refresh token.'));\n }\n let s = '';\n inputStream\n .setEncoding('utf8')\n .on('error', reject)\n .on('data', chunk => (s += chunk))\n .on('end', () => {\n try {\n const data = JSON.parse(s);\n this.fromJSON(data);\n return resolve();\n }\n catch (err) {\n return reject(err);\n }\n });\n });\n }\n /**\n * Create a UserRefreshClient credentials instance using the given input\n * options.\n * @param json The input object.\n */\n static fromJSON(json) {\n const client = new UserRefreshClient();\n client.fromJSON(json);\n return client;\n }\n}\nexports.UserRefreshClient = UserRefreshClient;\n//# sourceMappingURL=refreshclient.js.map","\"use strict\";\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Impersonated = exports.IMPERSONATED_ACCOUNT_TYPE = void 0;\nconst oauth2client_1 = require(\"./oauth2client\");\nconst gaxios_1 = require(\"gaxios\");\nconst util_1 = require(\"../util\");\nexports.IMPERSONATED_ACCOUNT_TYPE = 'impersonated_service_account';\nclass Impersonated extends oauth2client_1.OAuth2Client {\n sourceClient;\n targetPrincipal;\n targetScopes;\n delegates;\n lifetime;\n endpoint;\n /**\n * Impersonated service account credentials.\n *\n * Create a new access token by impersonating another service account.\n *\n * Impersonated Credentials allowing credentials issued to a user or\n * service account to impersonate another. The source project using\n * Impersonated Credentials must enable the \"IAMCredentials\" API.\n * Also, the target service account must grant the orginating principal\n * the \"Service Account Token Creator\" IAM role.\n *\n * @param {object} options - The configuration object.\n * @param {object} [options.sourceClient] the source credential used as to\n * acquire the impersonated credentials.\n * @param {string} [options.targetPrincipal] the service account to\n * impersonate.\n * @param {string[]} [options.delegates] the chained list of delegates\n * required to grant the final access_token. If set, the sequence of\n * identities must have \"Service Account Token Creator\" capability granted to\n * the preceding identity. For example, if set to [serviceAccountB,\n * serviceAccountC], the sourceCredential must have the Token Creator role on\n * serviceAccountB. serviceAccountB must have the Token Creator on\n * serviceAccountC. Finally, C must have Token Creator on target_principal.\n * If left unset, sourceCredential must have that role on targetPrincipal.\n * @param {string[]} [options.targetScopes] scopes to request during the\n * authorization grant.\n * @param {number} [options.lifetime] number of seconds the delegated\n * credential should be valid for up to 3600 seconds by default, or 43,200\n * seconds by extending the token's lifetime, see:\n * https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials#sa-credentials-oauth\n * @param {string} [options.endpoint] api endpoint override.\n */\n constructor(options = {}) {\n super(options);\n // Start with an expired refresh token, which will automatically be\n // refreshed before the first API call is made.\n this.credentials = {\n expiry_date: 1,\n refresh_token: 'impersonated-placeholder',\n };\n this.sourceClient = options.sourceClient ?? new oauth2client_1.OAuth2Client();\n this.targetPrincipal = options.targetPrincipal ?? '';\n this.delegates = options.delegates ?? [];\n this.targetScopes = options.targetScopes ?? [];\n this.lifetime = options.lifetime ?? 3600;\n const usingExplicitUniverseDomain = !!(0, util_1.originalOrCamelOptions)(options).get('universe_domain');\n if (!usingExplicitUniverseDomain) {\n // override the default universe with the source's universe\n this.universeDomain = this.sourceClient.universeDomain;\n }\n else if (this.sourceClient.universeDomain !== this.universeDomain) {\n // non-default universe and is not matching the source - this could be a credential leak\n throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);\n }\n this.endpoint =\n options.endpoint ?? `https://iamcredentials.${this.universeDomain}`;\n }\n /**\n * Signs some bytes.\n *\n * {@link https://cloud.google.com/iam/docs/reference/credentials/rest/v1/projects.serviceAccounts/signBlob Reference Documentation}\n * @param blobToSign String to sign.\n *\n * @returns A {@link SignBlobResponse} denoting the keyID and signedBlob in base64 string\n */\n async sign(blobToSign) {\n await this.sourceClient.getAccessToken();\n const name = `projects/-/serviceAccounts/${this.targetPrincipal}`;\n const u = `${this.endpoint}/v1/${name}:signBlob`;\n const body = {\n delegates: this.delegates,\n payload: Buffer.from(blobToSign).toString('base64'),\n };\n const res = await this.sourceClient.request({\n ...Impersonated.RETRY_CONFIG,\n url: u,\n data: body,\n method: 'POST',\n });\n return res.data;\n }\n /** The service account email to be impersonated. */\n getTargetPrincipal() {\n return this.targetPrincipal;\n }\n /**\n * Refreshes the access token.\n */\n async refreshToken() {\n try {\n await this.sourceClient.getAccessToken();\n const name = 'projects/-/serviceAccounts/' + this.targetPrincipal;\n const u = `${this.endpoint}/v1/${name}:generateAccessToken`;\n const body = {\n delegates: this.delegates,\n scope: this.targetScopes,\n lifetime: this.lifetime + 's',\n };\n const res = await this.sourceClient.request({\n ...Impersonated.RETRY_CONFIG,\n url: u,\n data: body,\n method: 'POST',\n });\n const tokenResponse = res.data;\n this.credentials.access_token = tokenResponse.accessToken;\n this.credentials.expiry_date = Date.parse(tokenResponse.expireTime);\n return {\n tokens: this.credentials,\n res,\n };\n }\n catch (error) {\n if (!(error instanceof Error))\n throw error;\n let status = 0;\n let message = '';\n if (error instanceof gaxios_1.GaxiosError) {\n status = error?.response?.data?.error?.status;\n message = error?.response?.data?.error?.message;\n }\n if (status && message) {\n error.message = `${status}: unable to impersonate: ${message}`;\n throw error;\n }\n else {\n error.message = `unable to impersonate: ${error}`;\n throw error;\n }\n }\n }\n /**\n * Generates an OpenID Connect ID token for a service account.\n *\n * {@link https://cloud.google.com/iam/docs/reference/credentials/rest/v1/projects.serviceAccounts/generateIdToken Reference Documentation}\n *\n * @param targetAudience the audience for the fetched ID token.\n * @param options the for the request\n * @return an OpenID Connect ID token\n */\n async fetchIdToken(targetAudience, options) {\n await this.sourceClient.getAccessToken();\n const name = `projects/-/serviceAccounts/${this.targetPrincipal}`;\n const u = `${this.endpoint}/v1/${name}:generateIdToken`;\n const body = {\n delegates: this.delegates,\n audience: targetAudience,\n includeEmail: options?.includeEmail ?? true,\n useEmailAzp: options?.includeEmail ?? true,\n };\n const res = await this.sourceClient.request({\n ...Impersonated.RETRY_CONFIG,\n url: u,\n data: body,\n method: 'POST',\n });\n return res.data.token;\n }\n}\nexports.Impersonated = Impersonated;\n//# sourceMappingURL=impersonated.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OAuthClientAuthHandler = void 0;\nexports.getErrorFromOAuthErrorResponse = getErrorFromOAuthErrorResponse;\nconst gaxios_1 = require(\"gaxios\");\nconst crypto_1 = require(\"../crypto/crypto\");\n/** List of HTTP methods that accept request bodies. */\nconst METHODS_SUPPORTING_REQUEST_BODY = ['PUT', 'POST', 'PATCH'];\n/**\n * Abstract class for handling client authentication in OAuth-based\n * operations.\n * When request-body client authentication is used, only application/json and\n * application/x-www-form-urlencoded content types for HTTP methods that support\n * request bodies are supported.\n */\nclass OAuthClientAuthHandler {\n #crypto = (0, crypto_1.createCrypto)();\n #clientAuthentication;\n transporter;\n /**\n * Instantiates an OAuth client authentication handler.\n * @param options The OAuth Client Auth Handler instance options. Passing an `ClientAuthentication` directly is **@DEPRECATED**.\n */\n constructor(options) {\n if (options && 'clientId' in options) {\n this.#clientAuthentication = options;\n this.transporter = new gaxios_1.Gaxios();\n }\n else {\n this.#clientAuthentication = options?.clientAuthentication;\n this.transporter = options?.transporter || new gaxios_1.Gaxios();\n }\n }\n /**\n * Applies client authentication on the OAuth request's headers or POST\n * body but does not process the request.\n * @param opts The GaxiosOptions whose headers or data are to be modified\n * depending on the client authentication mechanism to be used.\n * @param bearerToken The optional bearer token to use for authentication.\n * When this is used, no client authentication credentials are needed.\n */\n applyClientAuthenticationOptions(opts, bearerToken) {\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers);\n // Inject authenticated header.\n this.injectAuthenticatedHeaders(opts, bearerToken);\n // Inject authenticated request body.\n if (!bearerToken) {\n this.injectAuthenticatedRequestBody(opts);\n }\n }\n /**\n * Applies client authentication on the request's header if either\n * basic authentication or bearer token authentication is selected.\n *\n * @param opts The GaxiosOptions whose headers or data are to be modified\n * depending on the client authentication mechanism to be used.\n * @param bearerToken The optional bearer token to use for authentication.\n * When this is used, no client authentication credentials are needed.\n */\n injectAuthenticatedHeaders(opts, bearerToken) {\n // Bearer token prioritized higher than basic Auth.\n if (bearerToken) {\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers, {\n authorization: `Bearer ${bearerToken}`,\n });\n }\n else if (this.#clientAuthentication?.confidentialClientType === 'basic') {\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers);\n const clientId = this.#clientAuthentication.clientId;\n const clientSecret = this.#clientAuthentication.clientSecret || '';\n const base64EncodedCreds = this.#crypto.encodeBase64StringUtf8(`${clientId}:${clientSecret}`);\n gaxios_1.Gaxios.mergeHeaders(opts.headers, {\n authorization: `Basic ${base64EncodedCreds}`,\n });\n }\n }\n /**\n * Applies client authentication on the request's body if request-body\n * client authentication is selected.\n *\n * @param opts The GaxiosOptions whose headers or data are to be modified\n * depending on the client authentication mechanism to be used.\n */\n injectAuthenticatedRequestBody(opts) {\n if (this.#clientAuthentication?.confidentialClientType === 'request-body') {\n const method = (opts.method || 'GET').toUpperCase();\n if (!METHODS_SUPPORTING_REQUEST_BODY.includes(method)) {\n throw new Error(`${method} HTTP method does not support ` +\n `${this.#clientAuthentication.confidentialClientType} ` +\n 'client authentication');\n }\n // Get content-type\n const headers = new Headers(opts.headers);\n const contentType = headers.get('content-type');\n // Inject authenticated request body\n if (contentType?.startsWith('application/x-www-form-urlencoded') ||\n opts.data instanceof URLSearchParams) {\n const data = new URLSearchParams(opts.data ?? '');\n data.append('client_id', this.#clientAuthentication.clientId);\n data.append('client_secret', this.#clientAuthentication.clientSecret || '');\n opts.data = data;\n }\n else if (contentType?.startsWith('application/json')) {\n opts.data = opts.data || {};\n Object.assign(opts.data, {\n client_id: this.#clientAuthentication.clientId,\n client_secret: this.#clientAuthentication.clientSecret || '',\n });\n }\n else {\n throw new Error(`${contentType} content-types are not supported with ` +\n `${this.#clientAuthentication.confidentialClientType} ` +\n 'client authentication');\n }\n }\n }\n /**\n * Retry config for Auth-related requests.\n *\n * @remarks\n *\n * This is not a part of the default {@link AuthClient.transporter transporter/gaxios}\n * config as some downstream APIs would prefer if customers explicitly enable retries,\n * such as GCS.\n */\n static get RETRY_CONFIG() {\n return {\n retry: true,\n retryConfig: {\n httpMethodsToRetry: ['GET', 'PUT', 'POST', 'HEAD', 'OPTIONS', 'DELETE'],\n },\n };\n }\n}\nexports.OAuthClientAuthHandler = OAuthClientAuthHandler;\n/**\n * Converts an OAuth error response to a native JavaScript Error.\n * @param resp The OAuth error response to convert to a native Error object.\n * @param err The optional original error. If provided, the error properties\n * will be copied to the new error.\n * @return The converted native Error object.\n */\nfunction getErrorFromOAuthErrorResponse(resp, err) {\n // Error response.\n const errorCode = resp.error;\n const errorDescription = resp.error_description;\n const errorUri = resp.error_uri;\n let message = `Error code ${errorCode}`;\n if (typeof errorDescription !== 'undefined') {\n message += `: ${errorDescription}`;\n }\n if (typeof errorUri !== 'undefined') {\n message += ` - ${errorUri}`;\n }\n const newError = new Error(message);\n // Copy properties from original error to newly generated error.\n if (err) {\n const keys = Object.keys(err);\n if (err.stack) {\n // Copy error.stack if available.\n keys.push('stack');\n }\n keys.forEach(key => {\n // Do not overwrite the message field.\n if (key !== 'message') {\n Object.defineProperty(newError, key, {\n value: err[key],\n writable: false,\n enumerable: true,\n });\n }\n });\n }\n return newError;\n}\n//# sourceMappingURL=oauth2common.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StsCredentials = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst oauth2common_1 = require(\"./oauth2common\");\n/**\n * Implements the OAuth 2.0 token exchange based on\n * https://tools.ietf.org/html/rfc8693\n */\nclass StsCredentials extends oauth2common_1.OAuthClientAuthHandler {\n #tokenExchangeEndpoint;\n /**\n * Initializes an STS credentials instance.\n *\n * @param options The STS credentials instance options. Passing an `tokenExchangeEndpoint` directly is **@DEPRECATED**.\n * @param clientAuthentication **@DEPRECATED**. Provide a {@link StsCredentialsConstructionOptions `StsCredentialsConstructionOptions`} object in the first parameter instead.\n */\n constructor(options = {\n tokenExchangeEndpoint: '',\n }, \n /**\n * @deprecated - provide a {@link StsCredentialsConstructionOptions `StsCredentialsConstructionOptions`} object in the first parameter instead\n */\n clientAuthentication) {\n if (typeof options !== 'object' || options instanceof URL) {\n options = {\n tokenExchangeEndpoint: options,\n clientAuthentication,\n };\n }\n super(options);\n this.#tokenExchangeEndpoint = options.tokenExchangeEndpoint;\n }\n /**\n * Exchanges the provided token for another type of token based on the\n * rfc8693 spec.\n * @param stsCredentialsOptions The token exchange options used to populate\n * the token exchange request.\n * @param additionalHeaders Optional additional headers to pass along the\n * request.\n * @param options Optional additional GCP-specific non-spec defined options\n * to send with the request.\n * Example: `&options=${encodeUriComponent(JSON.stringified(options))}`\n * @return A promise that resolves with the token exchange response containing\n * the requested token and its expiration time.\n */\n async exchangeToken(stsCredentialsOptions, headers, options) {\n const values = {\n grant_type: stsCredentialsOptions.grantType,\n resource: stsCredentialsOptions.resource,\n audience: stsCredentialsOptions.audience,\n scope: stsCredentialsOptions.scope?.join(' '),\n requested_token_type: stsCredentialsOptions.requestedTokenType,\n subject_token: stsCredentialsOptions.subjectToken,\n subject_token_type: stsCredentialsOptions.subjectTokenType,\n actor_token: stsCredentialsOptions.actingParty?.actorToken,\n actor_token_type: stsCredentialsOptions.actingParty?.actorTokenType,\n // Non-standard GCP-specific options.\n options: options && JSON.stringify(options),\n };\n // Keep defined fields.\n const payload = {};\n Object.entries(values).forEach(([key, value]) => {\n if (value !== undefined) {\n payload[key] = value;\n }\n });\n const opts = {\n ...StsCredentials.RETRY_CONFIG,\n url: this.#tokenExchangeEndpoint.toString(),\n method: 'POST',\n headers,\n data: new URLSearchParams(payload),\n };\n // Apply OAuth client authentication.\n this.applyClientAuthenticationOptions(opts);\n try {\n const response = await this.transporter.request(opts);\n // Successful response.\n const stsSuccessfulResponse = response.data;\n stsSuccessfulResponse.res = response;\n return stsSuccessfulResponse;\n }\n catch (error) {\n // Translate error to OAuthError.\n if (error instanceof gaxios_1.GaxiosError && error.response) {\n throw (0, oauth2common_1.getErrorFromOAuthErrorResponse)(error.response.data, \n // Preserve other fields from the original error.\n error);\n }\n // Request could fail before the server responds.\n throw error;\n }\n }\n}\nexports.StsCredentials = StsCredentials;\n//# sourceMappingURL=stscredentials.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseExternalAccountClient = exports.CLOUD_RESOURCE_MANAGER = exports.EXTERNAL_ACCOUNT_TYPE = exports.EXPIRATION_TIME_OFFSET = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst stream = require(\"stream\");\nconst authclient_1 = require(\"./authclient\");\nconst sts = require(\"./stscredentials\");\nconst util_1 = require(\"../util\");\nconst shared_cjs_1 = require(\"../shared.cjs\");\n/**\n * The required token exchange grant_type: rfc8693#section-2.1\n */\nconst STS_GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:token-exchange';\n/**\n * The requested token exchange requested_token_type: rfc8693#section-2.1\n */\nconst STS_REQUEST_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:access_token';\n/** The default OAuth scope to request when none is provided. */\nconst DEFAULT_OAUTH_SCOPE = 'https://www.googleapis.com/auth/cloud-platform';\n/** Default impersonated token lifespan in seconds.*/\nconst DEFAULT_TOKEN_LIFESPAN = 3600;\n/**\n * Offset to take into account network delays and server clock skews.\n */\nexports.EXPIRATION_TIME_OFFSET = 5 * 60 * 1000;\n/**\n * The credentials JSON file type for external account clients.\n * There are 3 types of JSON configs:\n * 1. authorized_user => Google end user credential\n * 2. service_account => Google service account credential\n * 3. external_Account => non-GCP service (eg. AWS, Azure, K8s)\n */\nexports.EXTERNAL_ACCOUNT_TYPE = 'external_account';\n/**\n * Cloud resource manager URL used to retrieve project information.\n *\n * @deprecated use {@link BaseExternalAccountClient.cloudResourceManagerURL} instead\n **/\nexports.CLOUD_RESOURCE_MANAGER = 'https://cloudresourcemanager.googleapis.com/v1/projects/';\n/** The workforce audience pattern. */\nconst WORKFORCE_AUDIENCE_PATTERN = '//iam\\\\.googleapis\\\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+';\nconst DEFAULT_TOKEN_URL = 'https://sts.{universeDomain}/v1/token';\n/**\n * Base external account client. This is used to instantiate AuthClients for\n * exchanging external account credentials for GCP access token and authorizing\n * requests to GCP APIs.\n * The base class implements common logic for exchanging various type of\n * external credentials for GCP access token. The logic of determining and\n * retrieving the external credential based on the environment and\n * credential_source will be left for the subclasses.\n */\nclass BaseExternalAccountClient extends authclient_1.AuthClient {\n /**\n * OAuth scopes for the GCP access token to use. When not provided,\n * the default https://www.googleapis.com/auth/cloud-platform is\n * used.\n */\n scopes;\n cachedAccessToken;\n audience;\n subjectTokenType;\n serviceAccountImpersonationUrl;\n serviceAccountImpersonationLifetime;\n stsCredential;\n clientAuth;\n workforcePoolUserProject;\n projectNumber;\n configLifetimeRequested;\n credentialSourceType;\n /**\n * @example\n * ```ts\n * new URL('https://cloudresourcemanager.googleapis.com/v1/projects/');\n * ```\n */\n cloudResourceManagerURL;\n supplierContext;\n /**\n * A pending access token request. Used for concurrent calls.\n */\n #pendingAccessToken = null;\n /**\n * Instantiate a BaseExternalAccountClient instance using the provided JSON\n * object loaded from an external account credentials file.\n * @param options The external account options object typically loaded\n * from the external account JSON credential file. The camelCased options\n * are aliases for the snake_cased options.\n */\n constructor(options) {\n super(options);\n const opts = (0, util_1.originalOrCamelOptions)(options);\n const type = opts.get('type');\n if (type && type !== exports.EXTERNAL_ACCOUNT_TYPE) {\n throw new Error(`Expected \"${exports.EXTERNAL_ACCOUNT_TYPE}\" type but ` +\n `received \"${options.type}\"`);\n }\n const clientId = opts.get('client_id');\n const clientSecret = opts.get('client_secret');\n const tokenUrl = opts.get('token_url') ??\n DEFAULT_TOKEN_URL.replace('{universeDomain}', this.universeDomain);\n const subjectTokenType = opts.get('subject_token_type');\n const workforcePoolUserProject = opts.get('workforce_pool_user_project');\n const serviceAccountImpersonationUrl = opts.get('service_account_impersonation_url');\n const serviceAccountImpersonation = opts.get('service_account_impersonation');\n const serviceAccountImpersonationLifetime = (0, util_1.originalOrCamelOptions)(serviceAccountImpersonation).get('token_lifetime_seconds');\n this.cloudResourceManagerURL = new URL(opts.get('cloud_resource_manager_url') ||\n `https://cloudresourcemanager.${this.universeDomain}/v1/projects/`);\n if (clientId) {\n this.clientAuth = {\n confidentialClientType: 'basic',\n clientId,\n clientSecret,\n };\n }\n this.stsCredential = new sts.StsCredentials({\n tokenExchangeEndpoint: tokenUrl,\n clientAuthentication: this.clientAuth,\n });\n this.scopes = opts.get('scopes') || [DEFAULT_OAUTH_SCOPE];\n this.cachedAccessToken = null;\n this.audience = opts.get('audience');\n this.subjectTokenType = subjectTokenType;\n this.workforcePoolUserProject = workforcePoolUserProject;\n const workforceAudiencePattern = new RegExp(WORKFORCE_AUDIENCE_PATTERN);\n if (this.workforcePoolUserProject &&\n !this.audience.match(workforceAudiencePattern)) {\n throw new Error('workforcePoolUserProject should not be set for non-workforce pool ' +\n 'credentials.');\n }\n this.serviceAccountImpersonationUrl = serviceAccountImpersonationUrl;\n this.serviceAccountImpersonationLifetime =\n serviceAccountImpersonationLifetime;\n if (this.serviceAccountImpersonationLifetime) {\n this.configLifetimeRequested = true;\n }\n else {\n this.configLifetimeRequested = false;\n this.serviceAccountImpersonationLifetime = DEFAULT_TOKEN_LIFESPAN;\n }\n this.projectNumber = this.getProjectNumber(this.audience);\n this.supplierContext = {\n audience: this.audience,\n subjectTokenType: this.subjectTokenType,\n transporter: this.transporter,\n };\n }\n /** The service account email to be impersonated, if available. */\n getServiceAccountEmail() {\n if (this.serviceAccountImpersonationUrl) {\n if (this.serviceAccountImpersonationUrl.length > 256) {\n /**\n * Prevents DOS attacks.\n * @see {@link https://github.com/googleapis/google-auth-library-nodejs/security/code-scanning/84}\n **/\n throw new RangeError(`URL is too long: ${this.serviceAccountImpersonationUrl}`);\n }\n // Parse email from URL. The formal looks as follows:\n // https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/name@project-id.iam.gserviceaccount.com:generateAccessToken\n const re = /serviceAccounts\\/(?[^:]+):generateAccessToken$/;\n const result = re.exec(this.serviceAccountImpersonationUrl);\n return result?.groups?.email || null;\n }\n return null;\n }\n /**\n * Provides a mechanism to inject GCP access tokens directly.\n * When the provided credential expires, a new credential, using the\n * external account options, is retrieved.\n * @param credentials The Credentials object to set on the current client.\n */\n setCredentials(credentials) {\n super.setCredentials(credentials);\n this.cachedAccessToken = credentials;\n }\n /**\n * @return A promise that resolves with the current GCP access token\n * response. If the current credential is expired, a new one is retrieved.\n */\n async getAccessToken() {\n // If cached access token is unavailable or expired, force refresh.\n if (!this.cachedAccessToken || this.isExpired(this.cachedAccessToken)) {\n await this.refreshAccessTokenAsync();\n }\n // Return GCP access token in GetAccessTokenResponse format.\n return {\n token: this.cachedAccessToken.access_token,\n res: this.cachedAccessToken.res,\n };\n }\n /**\n * The main authentication interface. It takes an optional url which when\n * present is the endpoint being accessed, and returns a Promise which\n * resolves with authorization header fields.\n *\n * The result has the form:\n * { authorization: 'Bearer ' }\n */\n async getRequestHeaders() {\n const accessTokenResponse = await this.getAccessToken();\n const headers = new Headers({\n authorization: `Bearer ${accessTokenResponse.token}`,\n });\n return this.addSharedMetadataHeaders(headers);\n }\n request(opts, callback) {\n if (callback) {\n this.requestAsync(opts).then(r => callback(null, r), e => {\n return callback(e, e.response);\n });\n }\n else {\n return this.requestAsync(opts);\n }\n }\n /**\n * @return A promise that resolves with the project ID corresponding to the\n * current workload identity pool or current workforce pool if\n * determinable. For workforce pool credential, it returns the project ID\n * corresponding to the workforcePoolUserProject.\n * This is introduced to match the current pattern of using the Auth\n * library:\n * const projectId = await auth.getProjectId();\n * const url = `https://dns.googleapis.com/dns/v1/projects/${projectId}`;\n * const res = await client.request({ url });\n * The resource may not have permission\n * (resourcemanager.projects.get) to call this API or the required\n * scopes may not be selected:\n * https://cloud.google.com/resource-manager/reference/rest/v1/projects/get#authorization-scopes\n */\n async getProjectId() {\n const projectNumber = this.projectNumber || this.workforcePoolUserProject;\n if (this.projectId) {\n // Return previously determined project ID.\n return this.projectId;\n }\n else if (projectNumber) {\n // Preferable not to use request() to avoid retrial policies.\n const headers = await this.getRequestHeaders();\n const response = await this.transporter.request({\n ...BaseExternalAccountClient.RETRY_CONFIG,\n headers,\n url: `${this.cloudResourceManagerURL.toString()}${projectNumber}`,\n });\n this.projectId = response.data.projectId;\n return this.projectId;\n }\n return null;\n }\n /**\n * Authenticates the provided HTTP request, processes it and resolves with the\n * returned response.\n * @param opts The HTTP request options.\n * @param reAuthRetried Whether the current attempt is a retry after a failed attempt due to an auth failure.\n * @return A promise that resolves with the successful response.\n */\n async requestAsync(opts, reAuthRetried = false) {\n let response;\n try {\n const requestHeaders = await this.getRequestHeaders();\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers);\n this.addUserProjectAndAuthHeaders(opts.headers, requestHeaders);\n response = await this.transporter.request(opts);\n }\n catch (e) {\n const res = e.response;\n if (res) {\n const statusCode = res.status;\n // Retry the request for metadata if the following criteria are true:\n // - We haven't already retried. It only makes sense to retry once.\n // - The response was a 401 or a 403\n // - The request didn't send a readableStream\n // - forceRefreshOnFailure is true\n const isReadableStream = res.config.data instanceof stream.Readable;\n const isAuthErr = statusCode === 401 || statusCode === 403;\n if (!reAuthRetried &&\n isAuthErr &&\n !isReadableStream &&\n this.forceRefreshOnFailure) {\n await this.refreshAccessTokenAsync();\n return await this.requestAsync(opts, true);\n }\n }\n throw e;\n }\n return response;\n }\n /**\n * Forces token refresh, even if unexpired tokens are currently cached.\n * External credentials are exchanged for GCP access tokens via the token\n * exchange endpoint and other settings provided in the client options\n * object.\n * If the service_account_impersonation_url is provided, an additional\n * step to exchange the external account GCP access token for a service\n * account impersonated token is performed.\n * @return A promise that resolves with the fresh GCP access tokens.\n */\n async refreshAccessTokenAsync() {\n // Use an existing access token request, or cache a new one\n this.#pendingAccessToken =\n this.#pendingAccessToken || this.#internalRefreshAccessTokenAsync();\n try {\n return await this.#pendingAccessToken;\n }\n finally {\n // clear pending access token for future requests\n this.#pendingAccessToken = null;\n }\n }\n async #internalRefreshAccessTokenAsync() {\n // Retrieve the external credential.\n const subjectToken = await this.retrieveSubjectToken();\n // Construct the STS credentials options.\n const stsCredentialsOptions = {\n grantType: STS_GRANT_TYPE,\n audience: this.audience,\n requestedTokenType: STS_REQUEST_TOKEN_TYPE,\n subjectToken,\n subjectTokenType: this.subjectTokenType,\n // generateAccessToken requires the provided access token to have\n // scopes:\n // https://www.googleapis.com/auth/iam or\n // https://www.googleapis.com/auth/cloud-platform\n // The new service account access token scopes will match the user\n // provided ones.\n scope: this.serviceAccountImpersonationUrl\n ? [DEFAULT_OAUTH_SCOPE]\n : this.getScopesArray(),\n };\n // Exchange the external credentials for a GCP access token.\n // Client auth is prioritized over passing the workforcePoolUserProject\n // parameter for STS token exchange.\n const additionalOptions = !this.clientAuth && this.workforcePoolUserProject\n ? { userProject: this.workforcePoolUserProject }\n : undefined;\n const additionalHeaders = new Headers({\n 'x-goog-api-client': this.getMetricsHeaderValue(),\n });\n const stsResponse = await this.stsCredential.exchangeToken(stsCredentialsOptions, additionalHeaders, additionalOptions);\n if (this.serviceAccountImpersonationUrl) {\n this.cachedAccessToken = await this.getImpersonatedAccessToken(stsResponse.access_token);\n }\n else if (stsResponse.expires_in) {\n // Save response in cached access token.\n this.cachedAccessToken = {\n access_token: stsResponse.access_token,\n expiry_date: new Date().getTime() + stsResponse.expires_in * 1000,\n res: stsResponse.res,\n };\n }\n else {\n // Save response in cached access token.\n this.cachedAccessToken = {\n access_token: stsResponse.access_token,\n res: stsResponse.res,\n };\n }\n // Save credentials.\n this.credentials = {};\n Object.assign(this.credentials, this.cachedAccessToken);\n delete this.credentials.res;\n // Trigger tokens event to notify external listeners.\n this.emit('tokens', {\n refresh_token: null,\n expiry_date: this.cachedAccessToken.expiry_date,\n access_token: this.cachedAccessToken.access_token,\n token_type: 'Bearer',\n id_token: null,\n });\n // Return the cached access token.\n return this.cachedAccessToken;\n }\n /**\n * Returns the workload identity pool project number if it is determinable\n * from the audience resource name.\n * @param audience The STS audience used to determine the project number.\n * @return The project number associated with the workload identity pool, if\n * this can be determined from the STS audience field. Otherwise, null is\n * returned.\n */\n getProjectNumber(audience) {\n // STS audience pattern:\n // //iam.googleapis.com/projects/$PROJECT_NUMBER/locations/...\n const match = audience.match(/\\/projects\\/([^/]+)/);\n if (!match) {\n return null;\n }\n return match[1];\n }\n /**\n * Exchanges an external account GCP access token for a service\n * account impersonated access token using iamcredentials\n * GenerateAccessToken API.\n * @param token The access token to exchange for a service account access\n * token.\n * @return A promise that resolves with the service account impersonated\n * credentials response.\n */\n async getImpersonatedAccessToken(token) {\n const opts = {\n ...BaseExternalAccountClient.RETRY_CONFIG,\n url: this.serviceAccountImpersonationUrl,\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n authorization: `Bearer ${token}`,\n },\n data: {\n scope: this.getScopesArray(),\n lifetime: this.serviceAccountImpersonationLifetime + 's',\n },\n };\n const response = await this.transporter.request(opts);\n const successResponse = response.data;\n return {\n access_token: successResponse.accessToken,\n // Convert from ISO format to timestamp.\n expiry_date: new Date(successResponse.expireTime).getTime(),\n res: response,\n };\n }\n /**\n * Returns whether the provided credentials are expired or not.\n * If there is no expiry time, assumes the token is not expired or expiring.\n * @param accessToken The credentials to check for expiration.\n * @return Whether the credentials are expired or not.\n */\n isExpired(accessToken) {\n const now = new Date().getTime();\n return accessToken.expiry_date\n ? now >= accessToken.expiry_date - this.eagerRefreshThresholdMillis\n : false;\n }\n /**\n * @return The list of scopes for the requested GCP access token.\n */\n getScopesArray() {\n // Since scopes can be provided as string or array, the type should\n // be normalized.\n if (typeof this.scopes === 'string') {\n return [this.scopes];\n }\n return this.scopes || [DEFAULT_OAUTH_SCOPE];\n }\n getMetricsHeaderValue() {\n const nodeVersion = process.version.replace(/^v/, '');\n const saImpersonation = this.serviceAccountImpersonationUrl !== undefined;\n const credentialSourceType = this.credentialSourceType\n ? this.credentialSourceType\n : 'unknown';\n return `gl-node/${nodeVersion} auth/${shared_cjs_1.pkg.version} google-byoid-sdk source/${credentialSourceType} sa-impersonation/${saImpersonation} config-lifetime/${this.configLifetimeRequested}`;\n }\n}\nexports.BaseExternalAccountClient = BaseExternalAccountClient;\n//# sourceMappingURL=baseexternalclient.js.map","\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FileSubjectTokenSupplier = void 0;\nconst util_1 = require(\"util\");\nconst fs = require(\"fs\");\n// fs.readfile is undefined in browser karma tests causing\n// `npm run browser-test` to fail as test.oauth2.ts imports this file via\n// src/index.ts.\n// Fallback to void function to avoid promisify throwing a TypeError.\nconst readFile = (0, util_1.promisify)(fs.readFile ?? (() => { }));\nconst realpath = (0, util_1.promisify)(fs.realpath ?? (() => { }));\nconst lstat = (0, util_1.promisify)(fs.lstat ?? (() => { }));\n/**\n * Internal subject token supplier implementation used when a file location\n * is configured in the credential configuration used to build an {@link IdentityPoolClient}\n */\nclass FileSubjectTokenSupplier {\n filePath;\n formatType;\n subjectTokenFieldName;\n /**\n * Instantiates a new file based subject token supplier.\n * @param opts The file subject token supplier options to build the supplier\n * with.\n */\n constructor(opts) {\n this.filePath = opts.filePath;\n this.formatType = opts.formatType;\n this.subjectTokenFieldName = opts.subjectTokenFieldName;\n }\n /**\n * Returns the subject token stored at the file specified in the constructor.\n * @param context {@link ExternalAccountSupplierContext} from the calling\n * {@link IdentityPoolClient}, contains the requested audience and subject\n * token type for the external account identity. Not used.\n */\n async getSubjectToken() {\n // Make sure there is a file at the path. lstatSync will throw if there is\n // nothing there.\n let parsedFilePath = this.filePath;\n try {\n // Resolve path to actual file in case of symlink. Expect a thrown error\n // if not resolvable.\n parsedFilePath = await realpath(parsedFilePath);\n if (!(await lstat(parsedFilePath)).isFile()) {\n throw new Error();\n }\n }\n catch (err) {\n if (err instanceof Error) {\n err.message = `The file at ${parsedFilePath} does not exist, or it is not a file. ${err.message}`;\n }\n throw err;\n }\n let subjectToken;\n const rawText = await readFile(parsedFilePath, { encoding: 'utf8' });\n if (this.formatType === 'text') {\n subjectToken = rawText;\n }\n else if (this.formatType === 'json' && this.subjectTokenFieldName) {\n const json = JSON.parse(rawText);\n subjectToken = json[this.subjectTokenFieldName];\n }\n if (!subjectToken) {\n throw new Error('Unable to parse the subject_token from the credential_source file');\n }\n return subjectToken;\n }\n}\nexports.FileSubjectTokenSupplier = FileSubjectTokenSupplier;\n//# sourceMappingURL=filesubjecttokensupplier.js.map","\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UrlSubjectTokenSupplier = void 0;\n/**\n * Internal subject token supplier implementation used when a URL\n * is configured in the credential configuration used to build an {@link IdentityPoolClient}\n */\nclass UrlSubjectTokenSupplier {\n url;\n headers;\n formatType;\n subjectTokenFieldName;\n additionalGaxiosOptions;\n /**\n * Instantiates a URL subject token supplier.\n * @param opts The URL subject token supplier options to build the supplier with.\n */\n constructor(opts) {\n this.url = opts.url;\n this.formatType = opts.formatType;\n this.subjectTokenFieldName = opts.subjectTokenFieldName;\n this.headers = opts.headers;\n this.additionalGaxiosOptions = opts.additionalGaxiosOptions;\n }\n /**\n * Sends a GET request to the URL provided in the constructor and resolves\n * with the returned external subject token.\n * @param context {@link ExternalAccountSupplierContext} from the calling\n * {@link IdentityPoolClient}, contains the requested audience and subject\n * token type for the external account identity. Not used.\n */\n async getSubjectToken(context) {\n const opts = {\n ...this.additionalGaxiosOptions,\n url: this.url,\n method: 'GET',\n headers: this.headers,\n };\n let subjectToken;\n if (this.formatType === 'text') {\n const response = await context.transporter.request(opts);\n subjectToken = response.data;\n }\n else if (this.formatType === 'json' && this.subjectTokenFieldName) {\n const response = await context.transporter.request(opts);\n subjectToken = response.data[this.subjectTokenFieldName];\n }\n if (!subjectToken) {\n throw new Error('Unable to parse the subject_token from the credential_source URL');\n }\n return subjectToken;\n }\n}\nexports.UrlSubjectTokenSupplier = UrlSubjectTokenSupplier;\n//# sourceMappingURL=urlsubjecttokensupplier.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IdentityPoolClient = void 0;\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\nconst util_1 = require(\"../util\");\nconst filesubjecttokensupplier_1 = require(\"./filesubjecttokensupplier\");\nconst urlsubjecttokensupplier_1 = require(\"./urlsubjecttokensupplier\");\n/**\n * Defines the Url-sourced and file-sourced external account clients mainly\n * used for K8s and Azure workloads.\n */\nclass IdentityPoolClient extends baseexternalclient_1.BaseExternalAccountClient {\n subjectTokenSupplier;\n /**\n * Instantiate an IdentityPoolClient instance using the provided JSON\n * object loaded from an external account credentials file.\n * An error is thrown if the credential is not a valid file-sourced or\n * url-sourced credential or a workforce pool user project is provided\n * with a non workforce audience.\n * @param options The external account options object typically loaded\n * from the external account JSON credential file. The camelCased options\n * are aliases for the snake_cased options.\n */\n constructor(options) {\n super(options);\n const opts = (0, util_1.originalOrCamelOptions)(options);\n const credentialSource = opts.get('credential_source');\n const subjectTokenSupplier = opts.get('subject_token_supplier');\n // Validate credential sourcing configuration.\n if (!credentialSource && !subjectTokenSupplier) {\n throw new Error('A credential source or subject token supplier must be specified.');\n }\n if (credentialSource && subjectTokenSupplier) {\n throw new Error('Only one of credential source or subject token supplier can be specified.');\n }\n if (subjectTokenSupplier) {\n this.subjectTokenSupplier = subjectTokenSupplier;\n this.credentialSourceType = 'programmatic';\n }\n else {\n const credentialSourceOpts = (0, util_1.originalOrCamelOptions)(credentialSource);\n const formatOpts = (0, util_1.originalOrCamelOptions)(credentialSourceOpts.get('format'));\n // Text is the default format type.\n const formatType = formatOpts.get('type') || 'text';\n const formatSubjectTokenFieldName = formatOpts.get('subject_token_field_name');\n if (formatType !== 'json' && formatType !== 'text') {\n throw new Error(`Invalid credential_source format \"${formatType}\"`);\n }\n if (formatType === 'json' && !formatSubjectTokenFieldName) {\n throw new Error('Missing subject_token_field_name for JSON credential_source format');\n }\n const file = credentialSourceOpts.get('file');\n const url = credentialSourceOpts.get('url');\n const headers = credentialSourceOpts.get('headers');\n if (file && url) {\n throw new Error('No valid Identity Pool \"credential_source\" provided, must be either file or url.');\n }\n else if (file && !url) {\n this.credentialSourceType = 'file';\n this.subjectTokenSupplier = new filesubjecttokensupplier_1.FileSubjectTokenSupplier({\n filePath: file,\n formatType: formatType,\n subjectTokenFieldName: formatSubjectTokenFieldName,\n });\n }\n else if (!file && url) {\n this.credentialSourceType = 'url';\n this.subjectTokenSupplier = new urlsubjecttokensupplier_1.UrlSubjectTokenSupplier({\n url: url,\n formatType: formatType,\n subjectTokenFieldName: formatSubjectTokenFieldName,\n headers: headers,\n additionalGaxiosOptions: IdentityPoolClient.RETRY_CONFIG,\n });\n }\n else {\n throw new Error('No valid Identity Pool \"credential_source\" provided, must be either file or url.');\n }\n }\n }\n /**\n * Triggered when a external subject token is needed to be exchanged for a GCP\n * access token via GCP STS endpoint. Gets a subject token by calling\n * the configured {@link SubjectTokenSupplier}\n * @return A promise that resolves with the external subject token.\n */\n async retrieveSubjectToken() {\n return this.subjectTokenSupplier.getSubjectToken(this.supplierContext);\n }\n}\nexports.IdentityPoolClient = IdentityPoolClient;\n//# sourceMappingURL=identitypoolclient.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AwsRequestSigner = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst crypto_1 = require(\"../crypto/crypto\");\n/** AWS Signature Version 4 signing algorithm identifier. */\nconst AWS_ALGORITHM = 'AWS4-HMAC-SHA256';\n/**\n * The termination string for the AWS credential scope value as defined in\n * https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n */\nconst AWS_REQUEST_TYPE = 'aws4_request';\n/**\n * Implements an AWS API request signer based on the AWS Signature Version 4\n * signing process.\n * https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nclass AwsRequestSigner {\n getCredentials;\n region;\n crypto;\n /**\n * Instantiates an AWS API request signer used to send authenticated signed\n * requests to AWS APIs based on the AWS Signature Version 4 signing process.\n * This also provides a mechanism to generate the signed request without\n * sending it.\n * @param getCredentials A mechanism to retrieve AWS security credentials\n * when needed.\n * @param region The AWS region to use.\n */\n constructor(getCredentials, region) {\n this.getCredentials = getCredentials;\n this.region = region;\n this.crypto = (0, crypto_1.createCrypto)();\n }\n /**\n * Generates the signed request for the provided HTTP request for calling\n * an AWS API. This follows the steps described at:\n * https://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html\n * @param amzOptions The AWS request options that need to be signed.\n * @return A promise that resolves with the GaxiosOptions containing the\n * signed HTTP request parameters.\n */\n async getRequestOptions(amzOptions) {\n if (!amzOptions.url) {\n throw new RangeError('\"url\" is required in \"amzOptions\"');\n }\n // Stringify JSON requests. This will be set in the request body of the\n // generated signed request.\n const requestPayloadData = typeof amzOptions.data === 'object'\n ? JSON.stringify(amzOptions.data)\n : amzOptions.data;\n const url = amzOptions.url;\n const method = amzOptions.method || 'GET';\n const requestPayload = amzOptions.body || requestPayloadData;\n const additionalAmzHeaders = amzOptions.headers;\n const awsSecurityCredentials = await this.getCredentials();\n const uri = new URL(url);\n if (typeof requestPayload !== 'string' && requestPayload !== undefined) {\n throw new TypeError(`'requestPayload' is expected to be a string if provided. Got: ${requestPayload}`);\n }\n const headerMap = await generateAuthenticationHeaderMap({\n crypto: this.crypto,\n host: uri.host,\n canonicalUri: uri.pathname,\n canonicalQuerystring: uri.search.slice(1),\n method,\n region: this.region,\n securityCredentials: awsSecurityCredentials,\n requestPayload,\n additionalAmzHeaders,\n });\n // Append additional optional headers, eg. X-Amz-Target, Content-Type, etc.\n const headers = gaxios_1.Gaxios.mergeHeaders(\n // Add x-amz-date if available.\n headerMap.amzDate ? { 'x-amz-date': headerMap.amzDate } : {}, {\n authorization: headerMap.authorizationHeader,\n host: uri.host,\n }, additionalAmzHeaders || {});\n if (awsSecurityCredentials.token) {\n gaxios_1.Gaxios.mergeHeaders(headers, {\n 'x-amz-security-token': awsSecurityCredentials.token,\n });\n }\n const awsSignedReq = {\n url,\n method: method,\n headers,\n };\n if (requestPayload !== undefined) {\n awsSignedReq.body = requestPayload;\n }\n return awsSignedReq;\n }\n}\nexports.AwsRequestSigner = AwsRequestSigner;\n/**\n * Creates the HMAC-SHA256 hash of the provided message using the\n * provided key.\n *\n * @param crypto The crypto instance used to facilitate cryptographic\n * operations.\n * @param key The HMAC-SHA256 key to use.\n * @param msg The message to hash.\n * @return The computed hash bytes.\n */\nasync function sign(crypto, key, msg) {\n return await crypto.signWithHmacSha256(key, msg);\n}\n/**\n * Calculates the signing key used to calculate the signature for\n * AWS Signature Version 4 based on:\n * https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param crypto The crypto instance used to facilitate cryptographic\n * operations.\n * @param key The AWS secret access key.\n * @param dateStamp The '%Y%m%d' date format.\n * @param region The AWS region.\n * @param serviceName The AWS service name, eg. sts.\n * @return The signing key bytes.\n */\nasync function getSigningKey(crypto, key, dateStamp, region, serviceName) {\n const kDate = await sign(crypto, `AWS4${key}`, dateStamp);\n const kRegion = await sign(crypto, kDate, region);\n const kService = await sign(crypto, kRegion, serviceName);\n const kSigning = await sign(crypto, kService, 'aws4_request');\n return kSigning;\n}\n/**\n * Generates the authentication header map needed for generating the AWS\n * Signature Version 4 signed request.\n *\n * @param option The options needed to compute the authentication header map.\n * @return The AWS authentication header map which constitutes of the following\n * components: amz-date, authorization header and canonical query string.\n */\nasync function generateAuthenticationHeaderMap(options) {\n const additionalAmzHeaders = gaxios_1.Gaxios.mergeHeaders(options.additionalAmzHeaders);\n const requestPayload = options.requestPayload || '';\n // iam.amazonaws.com host => iam service.\n // sts.us-east-2.amazonaws.com => sts service.\n const serviceName = options.host.split('.')[0];\n const now = new Date();\n // Format: '%Y%m%dT%H%M%SZ'.\n const amzDate = now\n .toISOString()\n .replace(/[-:]/g, '')\n .replace(/\\.[0-9]+/, '');\n // Format: '%Y%m%d'.\n const dateStamp = now.toISOString().replace(/[-]/g, '').replace(/T.*/, '');\n // Add AWS token if available.\n if (options.securityCredentials.token) {\n additionalAmzHeaders.set('x-amz-security-token', options.securityCredentials.token);\n }\n // Header keys need to be sorted alphabetically.\n const amzHeaders = gaxios_1.Gaxios.mergeHeaders({\n host: options.host,\n }, \n // Previously the date was not fixed with x-amz- and could be provided manually.\n // https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-header-value-trim.req\n additionalAmzHeaders.has('date') ? {} : { 'x-amz-date': amzDate }, additionalAmzHeaders);\n let canonicalHeaders = '';\n // TypeScript is missing `Headers#keys` at the time of writing\n const signedHeadersList = [\n ...amzHeaders.keys(),\n ].sort();\n signedHeadersList.forEach(key => {\n canonicalHeaders += `${key}:${amzHeaders.get(key)}\\n`;\n });\n const signedHeaders = signedHeadersList.join(';');\n const payloadHash = await options.crypto.sha256DigestHex(requestPayload);\n // https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n const canonicalRequest = `${options.method.toUpperCase()}\\n` +\n `${options.canonicalUri}\\n` +\n `${options.canonicalQuerystring}\\n` +\n `${canonicalHeaders}\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`;\n const credentialScope = `${dateStamp}/${options.region}/${serviceName}/${AWS_REQUEST_TYPE}`;\n // https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n const stringToSign = `${AWS_ALGORITHM}\\n` +\n `${amzDate}\\n` +\n `${credentialScope}\\n` +\n (await options.crypto.sha256DigestHex(canonicalRequest));\n // https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n const signingKey = await getSigningKey(options.crypto, options.securityCredentials.secretAccessKey, dateStamp, options.region, serviceName);\n const signature = await sign(options.crypto, signingKey, stringToSign);\n // https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n const authorizationHeader = `${AWS_ALGORITHM} Credential=${options.securityCredentials.accessKeyId}/` +\n `${credentialScope}, SignedHeaders=${signedHeaders}, ` +\n `Signature=${(0, crypto_1.fromArrayBufferToHex)(signature)}`;\n return {\n // Do not return x-amz-date if date is available.\n amzDate: additionalAmzHeaders.has('date') ? undefined : amzDate,\n authorizationHeader,\n canonicalQuerystring: options.canonicalQuerystring,\n };\n}\n//# sourceMappingURL=awsrequestsigner.js.map","\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultAwsSecurityCredentialsSupplier = void 0;\n/**\n * Internal AWS security credentials supplier implementation used by {@link AwsClient}\n * when a credential source is provided instead of a user defined supplier.\n * The logic is summarized as:\n * 1. If imdsv2_session_token_url is provided in the credential source, then\n * fetch the aws session token and include it in the headers of the\n * metadata requests. This is a requirement for IDMSv2 but optional\n * for IDMSv1.\n * 2. Retrieve AWS region from availability-zone.\n * 3a. Check AWS credentials in environment variables. If not found, get\n * from security-credentials endpoint.\n * 3b. Get AWS credentials from security-credentials endpoint. In order\n * to retrieve this, the AWS role needs to be determined by calling\n * security-credentials endpoint without any argument. Then the\n * credentials can be retrieved via: security-credentials/role_name\n * 4. Generate the signed request to AWS STS GetCallerIdentity action.\n * 5. Inject x-goog-cloud-target-resource into header and serialize the\n * signed request. This will be the subject-token to pass to GCP STS.\n */\nclass DefaultAwsSecurityCredentialsSupplier {\n regionUrl;\n securityCredentialsUrl;\n imdsV2SessionTokenUrl;\n additionalGaxiosOptions;\n /**\n * Instantiates a new DefaultAwsSecurityCredentialsSupplier using information\n * from the credential_source stored in the ADC file.\n * @param opts The default aws security credentials supplier options object to\n * build the supplier with.\n */\n constructor(opts) {\n this.regionUrl = opts.regionUrl;\n this.securityCredentialsUrl = opts.securityCredentialsUrl;\n this.imdsV2SessionTokenUrl = opts.imdsV2SessionTokenUrl;\n this.additionalGaxiosOptions = opts.additionalGaxiosOptions;\n }\n /**\n * Returns the active AWS region. This first checks to see if the region\n * is available as an environment variable. If it is not, then the supplier\n * will call the region URL.\n * @param context {@link ExternalAccountSupplierContext} from the calling\n * {@link AwsClient}, contains the requested audience and subject token type\n * for the external account identity.\n * @return A promise that resolves with the AWS region string.\n */\n async getAwsRegion(context) {\n // Priority order for region determination:\n // AWS_REGION > AWS_DEFAULT_REGION > metadata server.\n if (this.#regionFromEnv) {\n return this.#regionFromEnv;\n }\n const metadataHeaders = new Headers();\n if (!this.#regionFromEnv && this.imdsV2SessionTokenUrl) {\n metadataHeaders.set('x-aws-ec2-metadata-token', await this.#getImdsV2SessionToken(context.transporter));\n }\n if (!this.regionUrl) {\n throw new RangeError('Unable to determine AWS region due to missing ' +\n '\"options.credential_source.region_url\"');\n }\n const opts = {\n ...this.additionalGaxiosOptions,\n url: this.regionUrl,\n method: 'GET',\n headers: metadataHeaders,\n };\n const response = await context.transporter.request(opts);\n // Remove last character. For example, if us-east-2b is returned,\n // the region would be us-east-2.\n return response.data.substr(0, response.data.length - 1);\n }\n /**\n * Returns AWS security credentials. This first checks to see if the credentials\n * is available as environment variables. If it is not, then the supplier\n * will call the security credentials URL.\n * @param context {@link ExternalAccountSupplierContext} from the calling\n * {@link AwsClient}, contains the requested audience and subject token type\n * for the external account identity.\n * @return A promise that resolves with the AWS security credentials.\n */\n async getAwsSecurityCredentials(context) {\n // Check environment variables for permanent credentials first.\n // https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html\n if (this.#securityCredentialsFromEnv) {\n return this.#securityCredentialsFromEnv;\n }\n const metadataHeaders = new Headers();\n if (this.imdsV2SessionTokenUrl) {\n metadataHeaders.set('x-aws-ec2-metadata-token', await this.#getImdsV2SessionToken(context.transporter));\n }\n // Since the role on a VM can change, we don't need to cache it.\n const roleName = await this.#getAwsRoleName(metadataHeaders, context.transporter);\n // Temporary credentials typically last for several hours.\n // Expiration is returned in response.\n // Consider future optimization of this logic to cache AWS tokens\n // until their natural expiration.\n const awsCreds = await this.#retrieveAwsSecurityCredentials(roleName, metadataHeaders, context.transporter);\n return {\n accessKeyId: awsCreds.AccessKeyId,\n secretAccessKey: awsCreds.SecretAccessKey,\n token: awsCreds.Token,\n };\n }\n /**\n * @param transporter The transporter to use for requests.\n * @return A promise that resolves with the IMDSv2 Session Token.\n */\n async #getImdsV2SessionToken(transporter) {\n const opts = {\n ...this.additionalGaxiosOptions,\n url: this.imdsV2SessionTokenUrl,\n method: 'PUT',\n headers: { 'x-aws-ec2-metadata-token-ttl-seconds': '300' },\n };\n const response = await transporter.request(opts);\n return response.data;\n }\n /**\n * @param headers The headers to be used in the metadata request.\n * @param transporter The transporter to use for requests.\n * @return A promise that resolves with the assigned role to the current\n * AWS VM. This is needed for calling the security-credentials endpoint.\n */\n async #getAwsRoleName(headers, transporter) {\n if (!this.securityCredentialsUrl) {\n throw new Error('Unable to determine AWS role name due to missing ' +\n '\"options.credential_source.url\"');\n }\n const opts = {\n ...this.additionalGaxiosOptions,\n url: this.securityCredentialsUrl,\n method: 'GET',\n headers: headers,\n };\n const response = await transporter.request(opts);\n return response.data;\n }\n /**\n * Retrieves the temporary AWS credentials by calling the security-credentials\n * endpoint as specified in the `credential_source` object.\n * @param roleName The role attached to the current VM.\n * @param headers The headers to be used in the metadata request.\n * @param transporter The transporter to use for requests.\n * @return A promise that resolves with the temporary AWS credentials\n * needed for creating the GetCallerIdentity signed request.\n */\n async #retrieveAwsSecurityCredentials(roleName, headers, transporter) {\n const response = await transporter.request({\n ...this.additionalGaxiosOptions,\n url: `${this.securityCredentialsUrl}/${roleName}`,\n headers: headers,\n });\n return response.data;\n }\n get #regionFromEnv() {\n // The AWS region can be provided through AWS_REGION or AWS_DEFAULT_REGION.\n // Only one is required.\n return (process.env['AWS_REGION'] || process.env['AWS_DEFAULT_REGION'] || null);\n }\n get #securityCredentialsFromEnv() {\n // Both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are required.\n if (process.env['AWS_ACCESS_KEY_ID'] &&\n process.env['AWS_SECRET_ACCESS_KEY']) {\n return {\n accessKeyId: process.env['AWS_ACCESS_KEY_ID'],\n secretAccessKey: process.env['AWS_SECRET_ACCESS_KEY'],\n token: process.env['AWS_SESSION_TOKEN'],\n };\n }\n return null;\n }\n}\nexports.DefaultAwsSecurityCredentialsSupplier = DefaultAwsSecurityCredentialsSupplier;\n//# sourceMappingURL=defaultawssecuritycredentialssupplier.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AwsClient = void 0;\nconst awsrequestsigner_1 = require(\"./awsrequestsigner\");\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\nconst defaultawssecuritycredentialssupplier_1 = require(\"./defaultawssecuritycredentialssupplier\");\nconst util_1 = require(\"../util\");\nconst gaxios_1 = require(\"gaxios\");\n/**\n * AWS external account client. This is used for AWS workloads, where\n * AWS STS GetCallerIdentity serialized signed requests are exchanged for\n * GCP access token.\n */\nclass AwsClient extends baseexternalclient_1.BaseExternalAccountClient {\n environmentId;\n awsSecurityCredentialsSupplier;\n regionalCredVerificationUrl;\n awsRequestSigner;\n region;\n static #DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL = 'https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15';\n /**\n * @deprecated AWS client no validates the EC2 metadata address.\n **/\n static AWS_EC2_METADATA_IPV4_ADDRESS = '169.254.169.254';\n /**\n * @deprecated AWS client no validates the EC2 metadata address.\n **/\n static AWS_EC2_METADATA_IPV6_ADDRESS = 'fd00:ec2::254';\n /**\n * Instantiates an AwsClient instance using the provided JSON\n * object loaded from an external account credentials file.\n * An error is thrown if the credential is not a valid AWS credential.\n * @param options The external account options object typically loaded\n * from the external account JSON credential file.\n */\n constructor(options) {\n super(options);\n const opts = (0, util_1.originalOrCamelOptions)(options);\n const credentialSource = opts.get('credential_source');\n const awsSecurityCredentialsSupplier = opts.get('aws_security_credentials_supplier');\n // Validate credential sourcing configuration.\n if (!credentialSource && !awsSecurityCredentialsSupplier) {\n throw new Error('A credential source or AWS security credentials supplier must be specified.');\n }\n if (credentialSource && awsSecurityCredentialsSupplier) {\n throw new Error('Only one of credential source or AWS security credentials supplier can be specified.');\n }\n if (awsSecurityCredentialsSupplier) {\n this.awsSecurityCredentialsSupplier = awsSecurityCredentialsSupplier;\n this.regionalCredVerificationUrl =\n AwsClient.#DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL;\n this.credentialSourceType = 'programmatic';\n }\n else {\n const credentialSourceOpts = (0, util_1.originalOrCamelOptions)(credentialSource);\n this.environmentId = credentialSourceOpts.get('environment_id');\n // This is only required if the AWS region is not available in the\n // AWS_REGION or AWS_DEFAULT_REGION environment variables.\n const regionUrl = credentialSourceOpts.get('region_url');\n // This is only required if AWS security credentials are not available in\n // environment variables.\n const securityCredentialsUrl = credentialSourceOpts.get('url');\n const imdsV2SessionTokenUrl = credentialSourceOpts.get('imdsv2_session_token_url');\n this.awsSecurityCredentialsSupplier =\n new defaultawssecuritycredentialssupplier_1.DefaultAwsSecurityCredentialsSupplier({\n regionUrl: regionUrl,\n securityCredentialsUrl: securityCredentialsUrl,\n imdsV2SessionTokenUrl: imdsV2SessionTokenUrl,\n });\n this.regionalCredVerificationUrl = credentialSourceOpts.get('regional_cred_verification_url');\n this.credentialSourceType = 'aws';\n // Data validators.\n this.validateEnvironmentId();\n }\n this.awsRequestSigner = null;\n this.region = '';\n }\n validateEnvironmentId() {\n const match = this.environmentId?.match(/^(aws)(\\d+)$/);\n if (!match || !this.regionalCredVerificationUrl) {\n throw new Error('No valid AWS \"credential_source\" provided');\n }\n else if (parseInt(match[2], 10) !== 1) {\n throw new Error(`aws version \"${match[2]}\" is not supported in the current build.`);\n }\n }\n /**\n * Triggered when an external subject token is needed to be exchanged for a\n * GCP access token via GCP STS endpoint. This will call the\n * {@link AwsSecurityCredentialsSupplier} to retrieve an AWS region and AWS\n * Security Credentials, then use them to create a signed AWS STS request that\n * can be exchanged for a GCP access token.\n * @return A promise that resolves with the external subject token.\n */\n async retrieveSubjectToken() {\n // Initialize AWS request signer if not already initialized.\n if (!this.awsRequestSigner) {\n this.region = await this.awsSecurityCredentialsSupplier.getAwsRegion(this.supplierContext);\n this.awsRequestSigner = new awsrequestsigner_1.AwsRequestSigner(async () => {\n return this.awsSecurityCredentialsSupplier.getAwsSecurityCredentials(this.supplierContext);\n }, this.region);\n }\n // Generate signed request to AWS STS GetCallerIdentity API.\n // Use the required regional endpoint. Otherwise, the request will fail.\n const options = await this.awsRequestSigner.getRequestOptions({\n ...AwsClient.RETRY_CONFIG,\n url: this.regionalCredVerificationUrl.replace('{region}', this.region),\n method: 'POST',\n });\n // The GCP STS endpoint expects the headers to be formatted as:\n // [\n // {key: 'x-amz-date', value: '...'},\n // {key: 'authorization', value: '...'},\n // ...\n // ]\n // And then serialized as:\n // encodeURIComponent(JSON.stringify({\n // url: '...',\n // method: 'POST',\n // headers: [{key: 'x-amz-date', value: '...'}, ...]\n // }))\n const reformattedHeader = [];\n const extendedHeaders = gaxios_1.Gaxios.mergeHeaders({\n // The full, canonical resource name of the workload identity pool\n // provider, with or without the HTTPS prefix.\n // Including this header as part of the signature is recommended to\n // ensure data integrity.\n 'x-goog-cloud-target-resource': this.audience,\n }, options.headers);\n // Reformat header to GCP STS expected format.\n extendedHeaders.forEach((value, key) => reformattedHeader.push({ key, value }));\n // Serialize the reformatted signed request.\n return encodeURIComponent(JSON.stringify({\n url: options.url,\n method: options.method,\n headers: reformattedHeader,\n }));\n }\n}\nexports.AwsClient = AwsClient;\n//# sourceMappingURL=awsclient.js.map","\"use strict\";\n// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InvalidSubjectTokenError = exports.InvalidMessageFieldError = exports.InvalidCodeFieldError = exports.InvalidTokenTypeFieldError = exports.InvalidExpirationTimeFieldError = exports.InvalidSuccessFieldError = exports.InvalidVersionFieldError = exports.ExecutableResponseError = exports.ExecutableResponse = void 0;\nconst SAML_SUBJECT_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:saml2';\nconst OIDC_SUBJECT_TOKEN_TYPE1 = 'urn:ietf:params:oauth:token-type:id_token';\nconst OIDC_SUBJECT_TOKEN_TYPE2 = 'urn:ietf:params:oauth:token-type:jwt';\n/**\n * Defines the response of a 3rd party executable run by the pluggable auth client.\n */\nclass ExecutableResponse {\n /**\n * The version of the Executable response. Only version 1 is currently supported.\n */\n version;\n /**\n * Whether the executable ran successfully.\n */\n success;\n /**\n * The epoch time for expiration of the token in seconds.\n */\n expirationTime;\n /**\n * The type of subject token in the response, currently supported values are:\n * urn:ietf:params:oauth:token-type:saml2\n * urn:ietf:params:oauth:token-type:id_token\n * urn:ietf:params:oauth:token-type:jwt\n */\n tokenType;\n /**\n * The error code from the executable.\n */\n errorCode;\n /**\n * The error message from the executable.\n */\n errorMessage;\n /**\n * The subject token from the executable, format depends on tokenType.\n */\n subjectToken;\n /**\n * Instantiates an ExecutableResponse instance using the provided JSON object\n * from the output of the executable.\n * @param responseJson Response from a 3rd party executable, loaded from a\n * run of the executable or a cached output file.\n */\n constructor(responseJson) {\n // Check that the required fields exist in the json response.\n if (!responseJson.version) {\n throw new InvalidVersionFieldError(\"Executable response must contain a 'version' field.\");\n }\n if (responseJson.success === undefined) {\n throw new InvalidSuccessFieldError(\"Executable response must contain a 'success' field.\");\n }\n this.version = responseJson.version;\n this.success = responseJson.success;\n // Validate required fields for a successful response.\n if (this.success) {\n this.expirationTime = responseJson.expiration_time;\n this.tokenType = responseJson.token_type;\n // Validate token type field.\n if (this.tokenType !== SAML_SUBJECT_TOKEN_TYPE &&\n this.tokenType !== OIDC_SUBJECT_TOKEN_TYPE1 &&\n this.tokenType !== OIDC_SUBJECT_TOKEN_TYPE2) {\n throw new InvalidTokenTypeFieldError(\"Executable response must contain a 'token_type' field when successful \" +\n `and it must be one of ${OIDC_SUBJECT_TOKEN_TYPE1}, ${OIDC_SUBJECT_TOKEN_TYPE2}, or ${SAML_SUBJECT_TOKEN_TYPE}.`);\n }\n // Validate subject token.\n if (this.tokenType === SAML_SUBJECT_TOKEN_TYPE) {\n if (!responseJson.saml_response) {\n throw new InvalidSubjectTokenError(`Executable response must contain a 'saml_response' field when token_type=${SAML_SUBJECT_TOKEN_TYPE}.`);\n }\n this.subjectToken = responseJson.saml_response;\n }\n else {\n if (!responseJson.id_token) {\n throw new InvalidSubjectTokenError(\"Executable response must contain a 'id_token' field when \" +\n `token_type=${OIDC_SUBJECT_TOKEN_TYPE1} or ${OIDC_SUBJECT_TOKEN_TYPE2}.`);\n }\n this.subjectToken = responseJson.id_token;\n }\n }\n else {\n // Both code and message must be provided for unsuccessful responses.\n if (!responseJson.code) {\n throw new InvalidCodeFieldError(\"Executable response must contain a 'code' field when unsuccessful.\");\n }\n if (!responseJson.message) {\n throw new InvalidMessageFieldError(\"Executable response must contain a 'message' field when unsuccessful.\");\n }\n this.errorCode = responseJson.code;\n this.errorMessage = responseJson.message;\n }\n }\n /**\n * @return A boolean representing if the response has a valid token. Returns\n * true when the response was successful and the token is not expired.\n */\n isValid() {\n return !this.isExpired() && this.success;\n }\n /**\n * @return A boolean representing if the response is expired. Returns true if the\n * provided timeout has passed.\n */\n isExpired() {\n return (this.expirationTime !== undefined &&\n this.expirationTime < Math.round(Date.now() / 1000));\n }\n}\nexports.ExecutableResponse = ExecutableResponse;\n/**\n * An error thrown by the ExecutableResponse class.\n */\nclass ExecutableResponseError extends Error {\n constructor(message) {\n super(message);\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\nexports.ExecutableResponseError = ExecutableResponseError;\n/**\n * An error thrown when the 'version' field in an executable response is missing or invalid.\n */\nclass InvalidVersionFieldError extends ExecutableResponseError {\n}\nexports.InvalidVersionFieldError = InvalidVersionFieldError;\n/**\n * An error thrown when the 'success' field in an executable response is missing or invalid.\n */\nclass InvalidSuccessFieldError extends ExecutableResponseError {\n}\nexports.InvalidSuccessFieldError = InvalidSuccessFieldError;\n/**\n * An error thrown when the 'expiration_time' field in an executable response is missing or invalid.\n */\nclass InvalidExpirationTimeFieldError extends ExecutableResponseError {\n}\nexports.InvalidExpirationTimeFieldError = InvalidExpirationTimeFieldError;\n/**\n * An error thrown when the 'token_type' field in an executable response is missing or invalid.\n */\nclass InvalidTokenTypeFieldError extends ExecutableResponseError {\n}\nexports.InvalidTokenTypeFieldError = InvalidTokenTypeFieldError;\n/**\n * An error thrown when the 'code' field in an executable response is missing or invalid.\n */\nclass InvalidCodeFieldError extends ExecutableResponseError {\n}\nexports.InvalidCodeFieldError = InvalidCodeFieldError;\n/**\n * An error thrown when the 'message' field in an executable response is missing or invalid.\n */\nclass InvalidMessageFieldError extends ExecutableResponseError {\n}\nexports.InvalidMessageFieldError = InvalidMessageFieldError;\n/**\n * An error thrown when the subject token in an executable response is missing or invalid.\n */\nclass InvalidSubjectTokenError extends ExecutableResponseError {\n}\nexports.InvalidSubjectTokenError = InvalidSubjectTokenError;\n//# sourceMappingURL=executable-response.js.map","\"use strict\";\n// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PluggableAuthHandler = exports.ExecutableError = void 0;\nconst executable_response_1 = require(\"./executable-response\");\nconst childProcess = require(\"child_process\");\nconst fs = require(\"fs\");\n/**\n * Error thrown from the executable run by PluggableAuthClient.\n */\nclass ExecutableError extends Error {\n /**\n * The exit code returned by the executable.\n */\n code;\n constructor(message, code) {\n super(`The executable failed with exit code: ${code} and error message: ${message}.`);\n this.code = code;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\nexports.ExecutableError = ExecutableError;\n/**\n * A handler used to retrieve 3rd party token responses from user defined\n * executables and cached file output for the PluggableAuthClient class.\n */\nclass PluggableAuthHandler {\n commandComponents;\n timeoutMillis;\n outputFile;\n /**\n * Instantiates a PluggableAuthHandler instance using the provided\n * PluggableAuthHandlerOptions object.\n */\n constructor(options) {\n if (!options.command) {\n throw new Error('No command provided.');\n }\n this.commandComponents = PluggableAuthHandler.parseCommand(options.command);\n this.timeoutMillis = options.timeoutMillis;\n if (!this.timeoutMillis) {\n throw new Error('No timeoutMillis provided.');\n }\n this.outputFile = options.outputFile;\n }\n /**\n * Calls user provided executable to get a 3rd party subject token and\n * returns the response.\n * @param envMap a Map of additional Environment Variables required for\n * the executable.\n * @return A promise that resolves with the executable response.\n */\n retrieveResponseFromExecutable(envMap) {\n return new Promise((resolve, reject) => {\n // Spawn process to run executable using added environment variables.\n const child = childProcess.spawn(this.commandComponents[0], this.commandComponents.slice(1), {\n env: { ...process.env, ...Object.fromEntries(envMap) },\n });\n let output = '';\n // Append stdout to output as executable runs.\n child.stdout.on('data', (data) => {\n output += data;\n });\n // Append stderr as executable runs.\n child.stderr.on('data', (err) => {\n output += err;\n });\n // Set up a timeout to end the child process and throw an error.\n const timeout = setTimeout(() => {\n // Kill child process and remove listeners so 'close' event doesn't get\n // read after child process is killed.\n child.removeAllListeners();\n child.kill();\n return reject(new Error('The executable failed to finish within the timeout specified.'));\n }, this.timeoutMillis);\n child.on('close', (code) => {\n // Cancel timeout if executable closes before timeout is reached.\n clearTimeout(timeout);\n if (code === 0) {\n // If the executable completed successfully, try to return the parsed response.\n try {\n const responseJson = JSON.parse(output);\n const response = new executable_response_1.ExecutableResponse(responseJson);\n return resolve(response);\n }\n catch (error) {\n if (error instanceof executable_response_1.ExecutableResponseError) {\n return reject(error);\n }\n return reject(new executable_response_1.ExecutableResponseError(`The executable returned an invalid response: ${output}`));\n }\n }\n else {\n return reject(new ExecutableError(output, code.toString()));\n }\n });\n });\n }\n /**\n * Checks user provided output file for response from previous run of\n * executable and return the response if it exists, is formatted correctly, and is not expired.\n */\n async retrieveCachedResponse() {\n if (!this.outputFile || this.outputFile.length === 0) {\n return undefined;\n }\n let filePath;\n try {\n filePath = await fs.promises.realpath(this.outputFile);\n }\n catch {\n // If file path cannot be resolved, return undefined.\n return undefined;\n }\n if (!(await fs.promises.lstat(filePath)).isFile()) {\n // If path does not lead to file, return undefined.\n return undefined;\n }\n const responseString = await fs.promises.readFile(filePath, {\n encoding: 'utf8',\n });\n if (responseString === '') {\n return undefined;\n }\n try {\n const responseJson = JSON.parse(responseString);\n const response = new executable_response_1.ExecutableResponse(responseJson);\n // Check if response is successful and unexpired.\n if (response.isValid()) {\n return new executable_response_1.ExecutableResponse(responseJson);\n }\n return undefined;\n }\n catch (error) {\n if (error instanceof executable_response_1.ExecutableResponseError) {\n throw error;\n }\n throw new executable_response_1.ExecutableResponseError(`The output file contained an invalid response: ${responseString}`);\n }\n }\n /**\n * Parses given command string into component array, splitting on spaces unless\n * spaces are between quotation marks.\n */\n static parseCommand(command) {\n // Split the command into components by splitting on spaces,\n // unless spaces are contained in quotation marks.\n const components = command.match(/(?:[^\\s\"]+|\"[^\"]*\")+/g);\n if (!components) {\n throw new Error(`Provided command: \"${command}\" could not be parsed.`);\n }\n // Remove quotation marks from the beginning and end of each component if they are present.\n for (let i = 0; i < components.length; i++) {\n if (components[i][0] === '\"' && components[i].slice(-1) === '\"') {\n components[i] = components[i].slice(1, -1);\n }\n }\n return components;\n }\n}\nexports.PluggableAuthHandler = PluggableAuthHandler;\n//# sourceMappingURL=pluggable-auth-handler.js.map","\"use strict\";\n// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PluggableAuthClient = exports.ExecutableError = void 0;\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\nconst executable_response_1 = require(\"./executable-response\");\nconst pluggable_auth_handler_1 = require(\"./pluggable-auth-handler\");\nvar pluggable_auth_handler_2 = require(\"./pluggable-auth-handler\");\nObject.defineProperty(exports, \"ExecutableError\", { enumerable: true, get: function () { return pluggable_auth_handler_2.ExecutableError; } });\n/**\n * The default executable timeout when none is provided, in milliseconds.\n */\nconst DEFAULT_EXECUTABLE_TIMEOUT_MILLIS = 30 * 1000;\n/**\n * The minimum allowed executable timeout in milliseconds.\n */\nconst MINIMUM_EXECUTABLE_TIMEOUT_MILLIS = 5 * 1000;\n/**\n * The maximum allowed executable timeout in milliseconds.\n */\nconst MAXIMUM_EXECUTABLE_TIMEOUT_MILLIS = 120 * 1000;\n/**\n * The environment variable to check to see if executable can be run.\n * Value must be set to '1' for the executable to run.\n */\nconst GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES = 'GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES';\n/**\n * The maximum currently supported executable version.\n */\nconst MAXIMUM_EXECUTABLE_VERSION = 1;\n/**\n * PluggableAuthClient enables the exchange of workload identity pool external credentials for\n * Google access tokens by retrieving 3rd party tokens through a user supplied executable. These\n * scripts/executables are completely independent of the Google Cloud Auth libraries. These\n * credentials plug into ADC and will call the specified executable to retrieve the 3rd party token\n * to be exchanged for a Google access token.\n *\n *

To use these credentials, the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment variable\n * must be set to '1'. This is for security reasons.\n *\n *

Both OIDC and SAML are supported. The executable must adhere to a specific response format\n * defined below.\n *\n *

The executable must print out the 3rd party token to STDOUT in JSON format. When an\n * output_file is specified in the credential configuration, the executable must also handle writing the\n * JSON response to this file.\n *\n *

\n * OIDC response sample:\n * {\n *   \"version\": 1,\n *   \"success\": true,\n *   \"token_type\": \"urn:ietf:params:oauth:token-type:id_token\",\n *   \"id_token\": \"HEADER.PAYLOAD.SIGNATURE\",\n *   \"expiration_time\": 1620433341\n * }\n *\n * SAML2 response sample:\n * {\n *   \"version\": 1,\n *   \"success\": true,\n *   \"token_type\": \"urn:ietf:params:oauth:token-type:saml2\",\n *   \"saml_response\": \"...\",\n *   \"expiration_time\": 1620433341\n * }\n *\n * Error response sample:\n * {\n *   \"version\": 1,\n *   \"success\": false,\n *   \"code\": \"401\",\n *   \"message\": \"Error message.\"\n * }\n * 
\n *\n *

The \"expiration_time\" field in the JSON response is only required for successful\n * responses when an output file was specified in the credential configuration\n *\n *

The auth libraries will populate certain environment variables that will be accessible by the\n * executable, such as: GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE, GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE,\n * GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE, GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL, and\n * GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE.\n *\n *

Please see this repositories README for a complete executable request/response specification.\n */\nclass PluggableAuthClient extends baseexternalclient_1.BaseExternalAccountClient {\n /**\n * The command used to retrieve the third party token.\n */\n command;\n /**\n * The timeout in milliseconds for running executable,\n * set to default if none provided.\n */\n timeoutMillis;\n /**\n * The path to file to check for cached executable response.\n */\n outputFile;\n /**\n * Executable and output file handler.\n */\n handler;\n /**\n * Instantiates a PluggableAuthClient instance using the provided JSON\n * object loaded from an external account credentials file.\n * An error is thrown if the credential is not a valid pluggable auth credential.\n * @param options The external account options object typically loaded from\n * the external account JSON credential file.\n */\n constructor(options) {\n super(options);\n if (!options.credential_source.executable) {\n throw new Error('No valid Pluggable Auth \"credential_source\" provided.');\n }\n this.command = options.credential_source.executable.command;\n if (!this.command) {\n throw new Error('No valid Pluggable Auth \"credential_source\" provided.');\n }\n // Check if the provided timeout exists and if it is valid.\n if (options.credential_source.executable.timeout_millis === undefined) {\n this.timeoutMillis = DEFAULT_EXECUTABLE_TIMEOUT_MILLIS;\n }\n else {\n this.timeoutMillis = options.credential_source.executable.timeout_millis;\n if (this.timeoutMillis < MINIMUM_EXECUTABLE_TIMEOUT_MILLIS ||\n this.timeoutMillis > MAXIMUM_EXECUTABLE_TIMEOUT_MILLIS) {\n throw new Error(`Timeout must be between ${MINIMUM_EXECUTABLE_TIMEOUT_MILLIS} and ` +\n `${MAXIMUM_EXECUTABLE_TIMEOUT_MILLIS} milliseconds.`);\n }\n }\n this.outputFile = options.credential_source.executable.output_file;\n this.handler = new pluggable_auth_handler_1.PluggableAuthHandler({\n command: this.command,\n timeoutMillis: this.timeoutMillis,\n outputFile: this.outputFile,\n });\n this.credentialSourceType = 'executable';\n }\n /**\n * Triggered when an external subject token is needed to be exchanged for a\n * GCP access token via GCP STS endpoint.\n * This uses the `options.credential_source` object to figure out how\n * to retrieve the token using the current environment. In this case,\n * this calls a user provided executable which returns the subject token.\n * The logic is summarized as:\n * 1. Validated that the executable is allowed to run. The\n * GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment must be set to\n * 1 for security reasons.\n * 2. If an output file is specified by the user, check the file location\n * for a response. If the file exists and contains a valid response,\n * return the subject token from the file.\n * 3. Call the provided executable and return response.\n * @return A promise that resolves with the external subject token.\n */\n async retrieveSubjectToken() {\n // Check if the executable is allowed to run.\n if (process.env[GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES] !== '1') {\n throw new Error('Pluggable Auth executables need to be explicitly allowed to run by ' +\n 'setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment ' +\n 'Variable to 1.');\n }\n let executableResponse = undefined;\n // Try to get cached executable response from output file.\n if (this.outputFile) {\n executableResponse = await this.handler.retrieveCachedResponse();\n }\n // If no response from output file, call the executable.\n if (!executableResponse) {\n // Set up environment map with required values for the executable.\n const envMap = new Map();\n envMap.set('GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE', this.audience);\n envMap.set('GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE', this.subjectTokenType);\n // Always set to 0 because interactive mode is not supported.\n envMap.set('GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE', '0');\n if (this.outputFile) {\n envMap.set('GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE', this.outputFile);\n }\n const serviceAccountEmail = this.getServiceAccountEmail();\n if (serviceAccountEmail) {\n envMap.set('GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL', serviceAccountEmail);\n }\n executableResponse =\n await this.handler.retrieveResponseFromExecutable(envMap);\n }\n if (executableResponse.version > MAXIMUM_EXECUTABLE_VERSION) {\n throw new Error(`Version of executable is not currently supported, maximum supported version is ${MAXIMUM_EXECUTABLE_VERSION}.`);\n }\n // Check that response was successful.\n if (!executableResponse.success) {\n throw new pluggable_auth_handler_1.ExecutableError(executableResponse.errorMessage, executableResponse.errorCode);\n }\n // Check that response contains expiration time if output file was specified.\n if (this.outputFile) {\n if (!executableResponse.expirationTime) {\n throw new executable_response_1.InvalidExpirationTimeFieldError('The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.');\n }\n }\n // Check that response is not expired.\n if (executableResponse.isExpired()) {\n throw new Error('Executable response is expired.');\n }\n // Return subject token from response.\n return executableResponse.subjectToken;\n }\n}\nexports.PluggableAuthClient = PluggableAuthClient;\n//# sourceMappingURL=pluggable-auth-client.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExternalAccountClient = void 0;\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\nconst identitypoolclient_1 = require(\"./identitypoolclient\");\nconst awsclient_1 = require(\"./awsclient\");\nconst pluggable_auth_client_1 = require(\"./pluggable-auth-client\");\n/**\n * Dummy class with no constructor. Developers are expected to use fromJSON.\n */\nclass ExternalAccountClient {\n constructor() {\n throw new Error('ExternalAccountClients should be initialized via: ' +\n 'ExternalAccountClient.fromJSON(), ' +\n 'directly via explicit constructors, eg. ' +\n 'new AwsClient(options), new IdentityPoolClient(options), new' +\n 'PluggableAuthClientOptions, or via ' +\n 'new GoogleAuth(options).getClient()');\n }\n /**\n * This static method will instantiate the\n * corresponding type of external account credential depending on the\n * underlying credential source.\n * @param options The external account options object typically loaded\n * from the external account JSON credential file.\n * @return A BaseExternalAccountClient instance or null if the options\n * provided do not correspond to an external account credential.\n */\n static fromJSON(options) {\n if (options && options.type === baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) {\n if (options.credential_source?.environment_id) {\n return new awsclient_1.AwsClient(options);\n }\n else if (options.credential_source?.executable) {\n return new pluggable_auth_client_1.PluggableAuthClient(options);\n }\n else {\n return new identitypoolclient_1.IdentityPoolClient(options);\n }\n }\n else {\n return null;\n }\n }\n}\nexports.ExternalAccountClient = ExternalAccountClient;\n//# sourceMappingURL=externalclient.js.map","\"use strict\";\n// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExternalAccountAuthorizedUserClient = exports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE = void 0;\nconst authclient_1 = require(\"./authclient\");\nconst oauth2common_1 = require(\"./oauth2common\");\nconst gaxios_1 = require(\"gaxios\");\nconst stream = require(\"stream\");\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\n/**\n * The credentials JSON file type for external account authorized user clients.\n */\nexports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE = 'external_account_authorized_user';\nconst DEFAULT_TOKEN_URL = 'https://sts.{universeDomain}/v1/oauthtoken';\n/**\n * Handler for token refresh requests sent to the token_url endpoint for external\n * authorized user credentials.\n */\nclass ExternalAccountAuthorizedUserHandler extends oauth2common_1.OAuthClientAuthHandler {\n #tokenRefreshEndpoint;\n /**\n * Initializes an ExternalAccountAuthorizedUserHandler instance.\n * @param url The URL of the token refresh endpoint.\n * @param transporter The transporter to use for the refresh request.\n * @param clientAuthentication The client authentication credentials to use\n * for the refresh request.\n */\n constructor(options) {\n super(options);\n this.#tokenRefreshEndpoint = options.tokenRefreshEndpoint;\n }\n /**\n * Requests a new access token from the token_url endpoint using the provided\n * refresh token.\n * @param refreshToken The refresh token to use to generate a new access token.\n * @param additionalHeaders Optional additional headers to pass along the\n * request.\n * @return A promise that resolves with the token refresh response containing\n * the requested access token and its expiration time.\n */\n async refreshToken(refreshToken, headers) {\n const opts = {\n ...ExternalAccountAuthorizedUserHandler.RETRY_CONFIG,\n url: this.#tokenRefreshEndpoint,\n method: 'POST',\n headers,\n data: new URLSearchParams({\n grant_type: 'refresh_token',\n refresh_token: refreshToken,\n }),\n };\n // Apply OAuth client authentication.\n this.applyClientAuthenticationOptions(opts);\n try {\n const response = await this.transporter.request(opts);\n // Successful response.\n const tokenRefreshResponse = response.data;\n tokenRefreshResponse.res = response;\n return tokenRefreshResponse;\n }\n catch (error) {\n // Translate error to OAuthError.\n if (error instanceof gaxios_1.GaxiosError && error.response) {\n throw (0, oauth2common_1.getErrorFromOAuthErrorResponse)(error.response.data, \n // Preserve other fields from the original error.\n error);\n }\n // Request could fail before the server responds.\n throw error;\n }\n }\n}\n/**\n * External Account Authorized User Client. This is used for OAuth2 credentials\n * sourced using external identities through Workforce Identity Federation.\n * Obtaining the initial access and refresh token can be done through the\n * Google Cloud CLI.\n */\nclass ExternalAccountAuthorizedUserClient extends authclient_1.AuthClient {\n cachedAccessToken;\n externalAccountAuthorizedUserHandler;\n refreshToken;\n /**\n * Instantiates an ExternalAccountAuthorizedUserClient instances using the\n * provided JSON object loaded from a credentials files.\n * An error is throws if the credential is not valid.\n * @param options The external account authorized user option object typically\n * from the external accoutn authorized user JSON credential file.\n */\n constructor(options) {\n super(options);\n if (options.universe_domain) {\n this.universeDomain = options.universe_domain;\n }\n this.refreshToken = options.refresh_token;\n const clientAuthentication = {\n confidentialClientType: 'basic',\n clientId: options.client_id,\n clientSecret: options.client_secret,\n };\n this.externalAccountAuthorizedUserHandler =\n new ExternalAccountAuthorizedUserHandler({\n tokenRefreshEndpoint: options.token_url ??\n DEFAULT_TOKEN_URL.replace('{universeDomain}', this.universeDomain),\n transporter: this.transporter,\n clientAuthentication,\n });\n this.cachedAccessToken = null;\n this.quotaProjectId = options.quota_project_id;\n // As threshold could be zero,\n // eagerRefreshThresholdMillis || EXPIRATION_TIME_OFFSET will override the\n // zero value.\n if (typeof options?.eagerRefreshThresholdMillis !== 'number') {\n this.eagerRefreshThresholdMillis = baseexternalclient_1.EXPIRATION_TIME_OFFSET;\n }\n else {\n this.eagerRefreshThresholdMillis = options\n .eagerRefreshThresholdMillis;\n }\n this.forceRefreshOnFailure = !!options?.forceRefreshOnFailure;\n }\n async getAccessToken() {\n // If cached access token is unavailable or expired, force refresh.\n if (!this.cachedAccessToken || this.isExpired(this.cachedAccessToken)) {\n await this.refreshAccessTokenAsync();\n }\n // Return GCP access token in GetAccessTokenResponse format.\n return {\n token: this.cachedAccessToken.access_token,\n res: this.cachedAccessToken.res,\n };\n }\n async getRequestHeaders() {\n const accessTokenResponse = await this.getAccessToken();\n const headers = new Headers({\n authorization: `Bearer ${accessTokenResponse.token}`,\n });\n return this.addSharedMetadataHeaders(headers);\n }\n request(opts, callback) {\n if (callback) {\n this.requestAsync(opts).then(r => callback(null, r), e => {\n return callback(e, e.response);\n });\n }\n else {\n return this.requestAsync(opts);\n }\n }\n /**\n * Authenticates the provided HTTP request, processes it and resolves with the\n * returned response.\n * @param opts The HTTP request options.\n * @param reAuthRetried Whether the current attempt is a retry after a failed attempt due to an auth failure.\n * @return A promise that resolves with the successful response.\n */\n async requestAsync(opts, reAuthRetried = false) {\n let response;\n try {\n const requestHeaders = await this.getRequestHeaders();\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers);\n this.addUserProjectAndAuthHeaders(opts.headers, requestHeaders);\n response = await this.transporter.request(opts);\n }\n catch (e) {\n const res = e.response;\n if (res) {\n const statusCode = res.status;\n // Retry the request for metadata if the following criteria are true:\n // - We haven't already retried. It only makes sense to retry once.\n // - The response was a 401 or a 403\n // - The request didn't send a readableStream\n // - forceRefreshOnFailure is true\n const isReadableStream = res.config.data instanceof stream.Readable;\n const isAuthErr = statusCode === 401 || statusCode === 403;\n if (!reAuthRetried &&\n isAuthErr &&\n !isReadableStream &&\n this.forceRefreshOnFailure) {\n await this.refreshAccessTokenAsync();\n return await this.requestAsync(opts, true);\n }\n }\n throw e;\n }\n return response;\n }\n /**\n * Forces token refresh, even if unexpired tokens are currently cached.\n * @return A promise that resolves with the refreshed credential.\n */\n async refreshAccessTokenAsync() {\n // Refresh the access token using the refresh token.\n const refreshResponse = await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);\n this.cachedAccessToken = {\n access_token: refreshResponse.access_token,\n expiry_date: new Date().getTime() + refreshResponse.expires_in * 1000,\n res: refreshResponse.res,\n };\n if (refreshResponse.refresh_token !== undefined) {\n this.refreshToken = refreshResponse.refresh_token;\n }\n return this.cachedAccessToken;\n }\n /**\n * Returns whether the provided credentials are expired or not.\n * If there is no expiry time, assumes the token is not expired or expiring.\n * @param credentials The credentials to check for expiration.\n * @return Whether the credentials are expired or not.\n */\n isExpired(credentials) {\n const now = new Date().getTime();\n return credentials.expiry_date\n ? now >= credentials.expiry_date - this.eagerRefreshThresholdMillis\n : false;\n }\n}\nexports.ExternalAccountAuthorizedUserClient = ExternalAccountAuthorizedUserClient;\n//# sourceMappingURL=externalAccountAuthorizedUserClient.js.map","\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GoogleAuth = exports.GoogleAuthExceptionMessages = void 0;\nconst child_process_1 = require(\"child_process\");\nconst fs = require(\"fs\");\nconst gaxios_1 = require(\"gaxios\");\nconst gcpMetadata = require(\"gcp-metadata\");\nconst os = require(\"os\");\nconst path = require(\"path\");\nconst crypto_1 = require(\"../crypto/crypto\");\nconst computeclient_1 = require(\"./computeclient\");\nconst idtokenclient_1 = require(\"./idtokenclient\");\nconst envDetect_1 = require(\"./envDetect\");\nconst jwtclient_1 = require(\"./jwtclient\");\nconst refreshclient_1 = require(\"./refreshclient\");\nconst impersonated_1 = require(\"./impersonated\");\nconst externalclient_1 = require(\"./externalclient\");\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\nconst authclient_1 = require(\"./authclient\");\nconst externalAccountAuthorizedUserClient_1 = require(\"./externalAccountAuthorizedUserClient\");\nconst util_1 = require(\"../util\");\nexports.GoogleAuthExceptionMessages = {\n API_KEY_WITH_CREDENTIALS: 'API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.',\n NO_PROJECT_ID_FOUND: 'Unable to detect a Project Id in the current environment. \\n' +\n 'To learn more about authentication and Google APIs, visit: \\n' +\n 'https://cloud.google.com/docs/authentication/getting-started',\n NO_CREDENTIALS_FOUND: 'Unable to find credentials in current environment. \\n' +\n 'To learn more about authentication and Google APIs, visit: \\n' +\n 'https://cloud.google.com/docs/authentication/getting-started',\n NO_ADC_FOUND: 'Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.',\n NO_UNIVERSE_DOMAIN_FOUND: 'Unable to detect a Universe Domain in the current environment.\\n' +\n 'To learn more about Universe Domain retrieval, visit: \\n' +\n 'https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys',\n};\nclass GoogleAuth {\n /**\n * Caches a value indicating whether the auth layer is running on Google\n * Compute Engine.\n * @private\n */\n checkIsGCE = undefined;\n useJWTAccessWithScope;\n defaultServicePath;\n // Note: this properly is only public to satisfy unit tests.\n // https://github.com/Microsoft/TypeScript/issues/5228\n get isGCE() {\n return this.checkIsGCE;\n }\n _findProjectIdPromise;\n _cachedProjectId;\n // To save the contents of the JSON credential file\n jsonContent = null;\n apiKey;\n cachedCredential = null;\n /**\n * A pending {@link AuthClient}. Used for concurrent {@link GoogleAuth.getClient} calls.\n */\n #pendingAuthClient = null;\n /**\n * Scopes populated by the client library by default. We differentiate between\n * these and user defined scopes when deciding whether to use a self-signed JWT.\n */\n defaultScopes;\n keyFilename;\n scopes;\n clientOptions = {};\n /**\n * Configuration is resolved in the following order of precedence:\n * - {@link GoogleAuthOptions.credentials `credentials`}\n * - {@link GoogleAuthOptions.keyFilename `keyFilename`}\n * - {@link GoogleAuthOptions.keyFile `keyFile`}\n *\n * {@link GoogleAuthOptions.clientOptions `clientOptions`} are passed to the\n * {@link AuthClient `AuthClient`s}.\n *\n * @param opts\n */\n constructor(opts = {}) {\n this._cachedProjectId = opts.projectId || null;\n this.cachedCredential = opts.authClient || null;\n this.keyFilename = opts.keyFilename || opts.keyFile;\n this.scopes = opts.scopes;\n this.clientOptions = opts.clientOptions || {};\n this.jsonContent = opts.credentials || null;\n this.apiKey = opts.apiKey || this.clientOptions.apiKey || null;\n // Cannot use both API Key + Credentials\n if (this.apiKey && (this.jsonContent || this.clientOptions.credentials)) {\n throw new RangeError(exports.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);\n }\n if (opts.universeDomain) {\n this.clientOptions.universeDomain = opts.universeDomain;\n }\n }\n // GAPIC client libraries should always use self-signed JWTs. The following\n // variables are set on the JWT client in order to indicate the type of library,\n // and sign the JWT with the correct audience and scopes (if not supplied).\n setGapicJWTValues(client) {\n client.defaultServicePath = this.defaultServicePath;\n client.useJWTAccessWithScope = this.useJWTAccessWithScope;\n client.defaultScopes = this.defaultScopes;\n }\n getProjectId(callback) {\n if (callback) {\n this.getProjectIdAsync().then(r => callback(null, r), callback);\n }\n else {\n return this.getProjectIdAsync();\n }\n }\n /**\n * A temporary method for internal `getProjectId` usages where `null` is\n * acceptable. In a future major release, `getProjectId` should return `null`\n * (as the `Promise` base signature describes) and this private\n * method should be removed.\n *\n * @returns Promise that resolves with project id (or `null`)\n */\n async getProjectIdOptional() {\n try {\n return await this.getProjectId();\n }\n catch (e) {\n if (e instanceof Error &&\n e.message === exports.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND) {\n return null;\n }\n else {\n throw e;\n }\n }\n }\n /**\n * A private method for finding and caching a projectId.\n *\n * Supports environments in order of precedence:\n * - GCLOUD_PROJECT or GOOGLE_CLOUD_PROJECT environment variable\n * - GOOGLE_APPLICATION_CREDENTIALS JSON file\n * - Cloud SDK: `gcloud config config-helper --format json`\n * - GCE project ID from metadata server\n *\n * @returns projectId\n */\n async findAndCacheProjectId() {\n let projectId = null;\n projectId ||= await this.getProductionProjectId();\n projectId ||= await this.getFileProjectId();\n projectId ||= await this.getDefaultServiceProjectId();\n projectId ||= await this.getGCEProjectId();\n projectId ||= await this.getExternalAccountClientProjectId();\n if (projectId) {\n this._cachedProjectId = projectId;\n return projectId;\n }\n else {\n throw new Error(exports.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND);\n }\n }\n async getProjectIdAsync() {\n if (this._cachedProjectId) {\n return this._cachedProjectId;\n }\n if (!this._findProjectIdPromise) {\n this._findProjectIdPromise = this.findAndCacheProjectId();\n }\n return this._findProjectIdPromise;\n }\n /**\n * Retrieves a universe domain from the metadata server via\n * {@link gcpMetadata.universe}.\n *\n * @returns a universe domain\n */\n async getUniverseDomainFromMetadataServer() {\n let universeDomain;\n try {\n universeDomain = await gcpMetadata.universe('universe-domain');\n universeDomain ||= authclient_1.DEFAULT_UNIVERSE;\n }\n catch (e) {\n if (e && e?.response?.status === 404) {\n universeDomain = authclient_1.DEFAULT_UNIVERSE;\n }\n else {\n throw e;\n }\n }\n return universeDomain;\n }\n /**\n * Retrieves, caches, and returns the universe domain in the following order\n * of precedence:\n * - The universe domain in {@link GoogleAuth.clientOptions}\n * - An existing or ADC {@link AuthClient}'s universe domain\n * - {@link gcpMetadata.universe}, if {@link Compute} client\n *\n * @returns The universe domain\n */\n async getUniverseDomain() {\n let universeDomain = (0, util_1.originalOrCamelOptions)(this.clientOptions).get('universe_domain');\n try {\n universeDomain ??= (await this.getClient()).universeDomain;\n }\n catch {\n // client or ADC is not available\n universeDomain ??= authclient_1.DEFAULT_UNIVERSE;\n }\n return universeDomain;\n }\n /**\n * @returns Any scopes (user-specified or default scopes specified by the\n * client library) that need to be set on the current Auth client.\n */\n getAnyScopes() {\n return this.scopes || this.defaultScopes;\n }\n getApplicationDefault(optionsOrCallback = {}, callback) {\n let options;\n if (typeof optionsOrCallback === 'function') {\n callback = optionsOrCallback;\n }\n else {\n options = optionsOrCallback;\n }\n if (callback) {\n this.getApplicationDefaultAsync(options).then(r => callback(null, r.credential, r.projectId), callback);\n }\n else {\n return this.getApplicationDefaultAsync(options);\n }\n }\n async getApplicationDefaultAsync(options = {}) {\n // If we've already got a cached credential, return it.\n // This will also preserve one's configured quota project, in case they\n // set one directly on the credential previously.\n if (this.cachedCredential) {\n // cache, while preserving existing quota project preferences\n return await this.#prepareAndCacheClient(this.cachedCredential, null);\n }\n let credential;\n // Check for the existence of a local environment variable pointing to the\n // location of the credential file. This is typically used in local\n // developer scenarios.\n credential =\n await this._tryGetApplicationCredentialsFromEnvironmentVariable(options);\n if (credential) {\n if (credential instanceof jwtclient_1.JWT) {\n credential.scopes = this.scopes;\n }\n else if (credential instanceof baseexternalclient_1.BaseExternalAccountClient) {\n credential.scopes = this.getAnyScopes();\n }\n return await this.#prepareAndCacheClient(credential);\n }\n // Look in the well-known credential file location.\n credential =\n await this._tryGetApplicationCredentialsFromWellKnownFile(options);\n if (credential) {\n if (credential instanceof jwtclient_1.JWT) {\n credential.scopes = this.scopes;\n }\n else if (credential instanceof baseexternalclient_1.BaseExternalAccountClient) {\n credential.scopes = this.getAnyScopes();\n }\n return await this.#prepareAndCacheClient(credential);\n }\n // Determine if we're running on GCE.\n if (await this._checkIsGCE()) {\n options.scopes = this.getAnyScopes();\n return await this.#prepareAndCacheClient(new computeclient_1.Compute(options));\n }\n throw new Error(exports.GoogleAuthExceptionMessages.NO_ADC_FOUND);\n }\n async #prepareAndCacheClient(credential, quotaProjectIdOverride = process.env['GOOGLE_CLOUD_QUOTA_PROJECT'] || null) {\n const projectId = await this.getProjectIdOptional();\n if (quotaProjectIdOverride) {\n credential.quotaProjectId = quotaProjectIdOverride;\n }\n this.cachedCredential = credential;\n return { credential, projectId };\n }\n /**\n * Determines whether the auth layer is running on Google Compute Engine.\n * Checks for GCP Residency, then fallback to checking if metadata server\n * is available.\n *\n * @returns A promise that resolves with the boolean.\n * @api private\n */\n async _checkIsGCE() {\n if (this.checkIsGCE === undefined) {\n this.checkIsGCE =\n gcpMetadata.getGCPResidency() || (await gcpMetadata.isAvailable());\n }\n return this.checkIsGCE;\n }\n /**\n * Attempts to load default credentials from the environment variable path..\n * @returns Promise that resolves with the OAuth2Client or null.\n * @api private\n */\n async _tryGetApplicationCredentialsFromEnvironmentVariable(options) {\n const credentialsPath = process.env['GOOGLE_APPLICATION_CREDENTIALS'] ||\n process.env['google_application_credentials'];\n if (!credentialsPath || credentialsPath.length === 0) {\n return null;\n }\n try {\n return this._getApplicationCredentialsFromFilePath(credentialsPath, options);\n }\n catch (e) {\n if (e instanceof Error) {\n e.message = `Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${e.message}`;\n }\n throw e;\n }\n }\n /**\n * Attempts to load default credentials from a well-known file location\n * @return Promise that resolves with the OAuth2Client or null.\n * @api private\n */\n async _tryGetApplicationCredentialsFromWellKnownFile(options) {\n // First, figure out the location of the file, depending upon the OS type.\n let location = null;\n if (this._isWindows()) {\n // Windows\n location = process.env['APPDATA'];\n }\n else {\n // Linux or Mac\n const home = process.env['HOME'];\n if (home) {\n location = path.join(home, '.config');\n }\n }\n // If we found the root path, expand it.\n if (location) {\n location = path.join(location, 'gcloud', 'application_default_credentials.json');\n if (!fs.existsSync(location)) {\n location = null;\n }\n }\n // The file does not exist.\n if (!location) {\n return null;\n }\n // The file seems to exist. Try to use it.\n const client = await this._getApplicationCredentialsFromFilePath(location, options);\n return client;\n }\n /**\n * Attempts to load default credentials from a file at the given path..\n * @param filePath The path to the file to read.\n * @returns Promise that resolves with the OAuth2Client\n * @api private\n */\n async _getApplicationCredentialsFromFilePath(filePath, options = {}) {\n // Make sure the path looks like a string.\n if (!filePath || filePath.length === 0) {\n throw new Error('The file path is invalid.');\n }\n // Make sure there is a file at the path. lstatSync will throw if there is\n // nothing there.\n try {\n // Resolve path to actual file in case of symlink. Expect a thrown error\n // if not resolvable.\n filePath = fs.realpathSync(filePath);\n if (!fs.lstatSync(filePath).isFile()) {\n throw new Error();\n }\n }\n catch (err) {\n if (err instanceof Error) {\n err.message = `The file at ${filePath} does not exist, or it is not a file. ${err.message}`;\n }\n throw err;\n }\n // Now open a read stream on the file, and parse it.\n const readStream = fs.createReadStream(filePath);\n return this.fromStream(readStream, options);\n }\n /**\n * Create a credentials instance using a given impersonated input options.\n * @param json The impersonated input object.\n * @returns JWT or UserRefresh Client with data\n */\n fromImpersonatedJSON(json) {\n if (!json) {\n throw new Error('Must pass in a JSON object containing an impersonated refresh token');\n }\n if (json.type !== impersonated_1.IMPERSONATED_ACCOUNT_TYPE) {\n throw new Error(`The incoming JSON object does not have the \"${impersonated_1.IMPERSONATED_ACCOUNT_TYPE}\" type`);\n }\n if (!json.source_credentials) {\n throw new Error('The incoming JSON object does not contain a source_credentials field');\n }\n if (!json.service_account_impersonation_url) {\n throw new Error('The incoming JSON object does not contain a service_account_impersonation_url field');\n }\n const sourceClient = this.fromJSON(json.source_credentials);\n if (json.service_account_impersonation_url?.length > 256) {\n /**\n * Prevents DOS attacks.\n * @see {@link https://github.com/googleapis/google-auth-library-nodejs/security/code-scanning/85}\n **/\n throw new RangeError(`Target principal is too long: ${json.service_account_impersonation_url}`);\n }\n // Extract service account from service_account_impersonation_url\n const targetPrincipal = /(?[^/]+):(generateAccessToken|generateIdToken)$/.exec(json.service_account_impersonation_url)?.groups?.target;\n if (!targetPrincipal) {\n throw new RangeError(`Cannot extract target principal from ${json.service_account_impersonation_url}`);\n }\n const targetScopes = this.getAnyScopes() ?? [];\n return new impersonated_1.Impersonated({\n ...json,\n sourceClient,\n targetPrincipal,\n targetScopes: Array.isArray(targetScopes) ? targetScopes : [targetScopes],\n });\n }\n /**\n * Create a credentials instance using the given input options.\n * This client is not cached.\n *\n * **Important**: If you accept a credential configuration (credential JSON/File/Stream) from an external source for authentication to Google Cloud, you must validate it before providing it to any Google API or library. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. For more information, refer to {@link https://cloud.google.com/docs/authentication/external/externally-sourced-credentials Validate credential configurations from external sources}.\n *\n * @param json The input object.\n * @param options The JWT or UserRefresh options for the client\n * @returns JWT or UserRefresh Client with data\n */\n fromJSON(json, options = {}) {\n let client;\n // user's preferred universe domain\n const preferredUniverseDomain = (0, util_1.originalOrCamelOptions)(options).get('universe_domain');\n if (json.type === refreshclient_1.USER_REFRESH_ACCOUNT_TYPE) {\n client = new refreshclient_1.UserRefreshClient(options);\n client.fromJSON(json);\n }\n else if (json.type === impersonated_1.IMPERSONATED_ACCOUNT_TYPE) {\n client = this.fromImpersonatedJSON(json);\n }\n else if (json.type === baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) {\n client = externalclient_1.ExternalAccountClient.fromJSON({\n ...json,\n ...options,\n });\n client.scopes = this.getAnyScopes();\n }\n else if (json.type === externalAccountAuthorizedUserClient_1.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE) {\n client = new externalAccountAuthorizedUserClient_1.ExternalAccountAuthorizedUserClient({\n ...json,\n ...options,\n });\n }\n else {\n options.scopes = this.scopes;\n client = new jwtclient_1.JWT(options);\n this.setGapicJWTValues(client);\n client.fromJSON(json);\n }\n if (preferredUniverseDomain) {\n client.universeDomain = preferredUniverseDomain;\n }\n return client;\n }\n /**\n * Return a JWT or UserRefreshClient from JavaScript object, caching both the\n * object used to instantiate and the client.\n * @param json The input object.\n * @param options The JWT or UserRefresh options for the client\n * @returns JWT or UserRefresh Client with data\n */\n _cacheClientFromJSON(json, options) {\n const client = this.fromJSON(json, options);\n // cache both raw data used to instantiate client and client itself.\n this.jsonContent = json;\n this.cachedCredential = client;\n return client;\n }\n fromStream(inputStream, optionsOrCallback = {}, callback) {\n let options = {};\n if (typeof optionsOrCallback === 'function') {\n callback = optionsOrCallback;\n }\n else {\n options = optionsOrCallback;\n }\n if (callback) {\n this.fromStreamAsync(inputStream, options).then(r => callback(null, r), callback);\n }\n else {\n return this.fromStreamAsync(inputStream, options);\n }\n }\n fromStreamAsync(inputStream, options) {\n return new Promise((resolve, reject) => {\n if (!inputStream) {\n throw new Error('Must pass in a stream containing the Google auth settings.');\n }\n const chunks = [];\n inputStream\n .setEncoding('utf8')\n .on('error', reject)\n .on('data', chunk => chunks.push(chunk))\n .on('end', () => {\n try {\n try {\n const data = JSON.parse(chunks.join(''));\n const r = this._cacheClientFromJSON(data, options);\n return resolve(r);\n }\n catch (err) {\n // If we failed parsing this.keyFileName, assume that it\n // is a PEM or p12 certificate:\n if (!this.keyFilename)\n throw err;\n const client = new jwtclient_1.JWT({\n ...this.clientOptions,\n keyFile: this.keyFilename,\n });\n this.cachedCredential = client;\n this.setGapicJWTValues(client);\n return resolve(client);\n }\n }\n catch (err) {\n return reject(err);\n }\n });\n });\n }\n /**\n * Create a credentials instance using the given API key string.\n * The created client is not cached. In order to create and cache it use the {@link GoogleAuth.getClient `getClient`} method after first providing an {@link GoogleAuth.apiKey `apiKey`}.\n *\n * @param apiKey The API key string\n * @param options An optional options object.\n * @returns A JWT loaded from the key\n */\n fromAPIKey(apiKey, options = {}) {\n return new jwtclient_1.JWT({ ...options, apiKey });\n }\n /**\n * Determines whether the current operating system is Windows.\n * @api private\n */\n _isWindows() {\n const sys = os.platform();\n if (sys && sys.length >= 3) {\n if (sys.substring(0, 3).toLowerCase() === 'win') {\n return true;\n }\n }\n return false;\n }\n /**\n * Run the Google Cloud SDK command that prints the default project ID\n */\n async getDefaultServiceProjectId() {\n return new Promise(resolve => {\n (0, child_process_1.exec)('gcloud config config-helper --format json', (err, stdout) => {\n if (!err && stdout) {\n try {\n const projectId = JSON.parse(stdout).configuration.properties.core.project;\n resolve(projectId);\n return;\n }\n catch (e) {\n // ignore errors\n }\n }\n resolve(null);\n });\n });\n }\n /**\n * Loads the project id from environment variables.\n * @api private\n */\n getProductionProjectId() {\n return (process.env['GCLOUD_PROJECT'] ||\n process.env['GOOGLE_CLOUD_PROJECT'] ||\n process.env['gcloud_project'] ||\n process.env['google_cloud_project']);\n }\n /**\n * Loads the project id from the GOOGLE_APPLICATION_CREDENTIALS json file.\n * @api private\n */\n async getFileProjectId() {\n if (this.cachedCredential) {\n // Try to read the project ID from the cached credentials file\n return this.cachedCredential.projectId;\n }\n // Ensure the projectId is loaded from the keyFile if available.\n if (this.keyFilename) {\n const creds = await this.getClient();\n if (creds && creds.projectId) {\n return creds.projectId;\n }\n }\n // Try to load a credentials file and read its project ID\n const r = await this._tryGetApplicationCredentialsFromEnvironmentVariable();\n if (r) {\n return r.projectId;\n }\n else {\n return null;\n }\n }\n /**\n * Gets the project ID from external account client if available.\n */\n async getExternalAccountClientProjectId() {\n if (!this.jsonContent || this.jsonContent.type !== baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) {\n return null;\n }\n const creds = await this.getClient();\n // Do not suppress the underlying error, as the error could contain helpful\n // information for debugging and fixing. This is especially true for\n // external account creds as in order to get the project ID, the following\n // operations have to succeed:\n // 1. Valid credentials file should be supplied.\n // 2. Ability to retrieve access tokens from STS token exchange API.\n // 3. Ability to exchange for service account impersonated credentials (if\n // enabled).\n // 4. Ability to get project info using the access token from step 2 or 3.\n // Without surfacing the error, it is harder for developers to determine\n // which step went wrong.\n return await creds.getProjectId();\n }\n /**\n * Gets the Compute Engine project ID if it can be inferred.\n */\n async getGCEProjectId() {\n try {\n const r = await gcpMetadata.project('project-id');\n return r;\n }\n catch (e) {\n // Ignore any errors\n return null;\n }\n }\n getCredentials(callback) {\n if (callback) {\n this.getCredentialsAsync().then(r => callback(null, r), callback);\n }\n else {\n return this.getCredentialsAsync();\n }\n }\n async getCredentialsAsync() {\n const client = await this.getClient();\n if (client instanceof impersonated_1.Impersonated) {\n return { client_email: client.getTargetPrincipal() };\n }\n if (client instanceof baseexternalclient_1.BaseExternalAccountClient) {\n const serviceAccountEmail = client.getServiceAccountEmail();\n if (serviceAccountEmail) {\n return {\n client_email: serviceAccountEmail,\n universe_domain: client.universeDomain,\n };\n }\n }\n if (this.jsonContent) {\n return {\n client_email: this.jsonContent.client_email,\n private_key: this.jsonContent.private_key,\n universe_domain: this.jsonContent.universe_domain,\n };\n }\n if (await this._checkIsGCE()) {\n const [client_email, universe_domain] = await Promise.all([\n gcpMetadata.instance('service-accounts/default/email'),\n this.getUniverseDomain(),\n ]);\n return { client_email, universe_domain };\n }\n throw new Error(exports.GoogleAuthExceptionMessages.NO_CREDENTIALS_FOUND);\n }\n /**\n * Automatically obtain an {@link AuthClient `AuthClient`} based on the\n * provided configuration. If no options were passed, use Application\n * Default Credentials.\n */\n async getClient() {\n if (this.cachedCredential) {\n return this.cachedCredential;\n }\n // Use an existing auth client request, or cache a new one\n this.#pendingAuthClient =\n this.#pendingAuthClient || this.#determineClient();\n try {\n return await this.#pendingAuthClient;\n }\n finally {\n // reset the pending auth client in case it is changed later\n this.#pendingAuthClient = null;\n }\n }\n async #determineClient() {\n if (this.jsonContent) {\n return this._cacheClientFromJSON(this.jsonContent, this.clientOptions);\n }\n else if (this.keyFilename) {\n const filePath = path.resolve(this.keyFilename);\n const stream = fs.createReadStream(filePath);\n return await this.fromStreamAsync(stream, this.clientOptions);\n }\n else if (this.apiKey) {\n const client = await this.fromAPIKey(this.apiKey, this.clientOptions);\n client.scopes = this.scopes;\n const { credential } = await this.#prepareAndCacheClient(client);\n return credential;\n }\n else {\n const { credential } = await this.getApplicationDefaultAsync(this.clientOptions);\n return credential;\n }\n }\n /**\n * Creates a client which will fetch an ID token for authorization.\n * @param targetAudience the audience for the fetched ID token.\n * @returns IdTokenClient for making HTTP calls authenticated with ID tokens.\n */\n async getIdTokenClient(targetAudience) {\n const client = await this.getClient();\n if (!('fetchIdToken' in client)) {\n throw new Error('Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.');\n }\n return new idtokenclient_1.IdTokenClient({ targetAudience, idTokenProvider: client });\n }\n /**\n * Automatically obtain application default credentials, and return\n * an access token for making requests.\n */\n async getAccessToken() {\n const client = await this.getClient();\n return (await client.getAccessToken()).token;\n }\n /**\n * Obtain the HTTP headers that will provide authorization for a given\n * request.\n */\n async getRequestHeaders(url) {\n const client = await this.getClient();\n return client.getRequestHeaders(url);\n }\n /**\n * Obtain credentials for a request, then attach the appropriate headers to\n * the request options.\n * @param opts Axios or Request options on which to attach the headers\n */\n async authorizeRequest(opts = {}) {\n const url = opts.url;\n const client = await this.getClient();\n const headers = await client.getRequestHeaders(url);\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers, headers);\n return opts;\n }\n /**\n * Automatically obtain application default credentials, and make an\n * HTTP request using the given options.\n * @param opts Axios request options for the HTTP request.\n */\n async request(opts) {\n const client = await this.getClient();\n return client.request(opts);\n }\n /**\n * Determine the compute environment in which the code is running.\n */\n getEnv() {\n return (0, envDetect_1.getEnv)();\n }\n /**\n * Sign the given data with the current private key, or go out\n * to the IAM API to sign it.\n * @param data The data to be signed.\n * @param endpoint A custom endpoint to use.\n *\n * @example\n * ```\n * sign('data', 'https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/');\n * ```\n */\n async sign(data, endpoint) {\n const client = await this.getClient();\n const universe = await this.getUniverseDomain();\n endpoint =\n endpoint ||\n `https://iamcredentials.${universe}/v1/projects/-/serviceAccounts/`;\n if (client instanceof impersonated_1.Impersonated) {\n const signed = await client.sign(data);\n return signed.signedBlob;\n }\n const crypto = (0, crypto_1.createCrypto)();\n if (client instanceof jwtclient_1.JWT && client.key) {\n const sign = await crypto.sign(client.key, data);\n return sign;\n }\n const creds = await this.getCredentials();\n if (!creds.client_email) {\n throw new Error('Cannot sign data without `client_email`.');\n }\n return this.signBlob(crypto, creds.client_email, data, endpoint);\n }\n async signBlob(crypto, emailOrUniqueId, data, endpoint) {\n const url = new URL(endpoint + `${emailOrUniqueId}:signBlob`);\n const res = await this.request({\n method: 'POST',\n url: url.href,\n data: {\n payload: crypto.encodeBase64StringUtf8(data),\n },\n retry: true,\n retryConfig: {\n httpMethodsToRetry: ['POST'],\n },\n });\n return res.data.signedBlob;\n }\n}\nexports.GoogleAuth = GoogleAuth;\n//# sourceMappingURL=googleauth.js.map","\"use strict\";\n// Copyright 2014 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IAMAuth = void 0;\nclass IAMAuth {\n selector;\n token;\n /**\n * IAM credentials.\n *\n * @param selector the iam authority selector\n * @param token the token\n * @constructor\n */\n constructor(selector, token) {\n this.selector = selector;\n this.token = token;\n this.selector = selector;\n this.token = token;\n }\n /**\n * Acquire the HTTP headers required to make an authenticated request.\n */\n getRequestHeaders() {\n return {\n 'x-goog-iam-authority-selector': this.selector,\n 'x-goog-iam-authorization-token': this.token,\n };\n }\n}\nexports.IAMAuth = IAMAuth;\n//# sourceMappingURL=iam.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DownscopedClient = exports.EXPIRATION_TIME_OFFSET = exports.MAX_ACCESS_BOUNDARY_RULES_COUNT = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst stream = require(\"stream\");\nconst authclient_1 = require(\"./authclient\");\nconst sts = require(\"./stscredentials\");\n/**\n * The required token exchange grant_type: rfc8693#section-2.1\n */\nconst STS_GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:token-exchange';\n/**\n * The requested token exchange requested_token_type: rfc8693#section-2.1\n */\nconst STS_REQUEST_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:access_token';\n/**\n * The requested token exchange subject_token_type: rfc8693#section-2.1\n */\nconst STS_SUBJECT_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:access_token';\n/**\n * The maximum number of access boundary rules a Credential Access Boundary\n * can contain.\n */\nexports.MAX_ACCESS_BOUNDARY_RULES_COUNT = 10;\n/**\n * Offset to take into account network delays and server clock skews.\n */\nexports.EXPIRATION_TIME_OFFSET = 5 * 60 * 1000;\n/**\n * Defines a set of Google credentials that are downscoped from an existing set\n * of Google OAuth2 credentials. This is useful to restrict the Identity and\n * Access Management (IAM) permissions that a short-lived credential can use.\n * The common pattern of usage is to have a token broker with elevated access\n * generate these downscoped credentials from higher access source credentials\n * and pass the downscoped short-lived access tokens to a token consumer via\n * some secure authenticated channel for limited access to Google Cloud Storage\n * resources.\n */\nclass DownscopedClient extends authclient_1.AuthClient {\n authClient;\n credentialAccessBoundary;\n cachedDownscopedAccessToken;\n stsCredential;\n /**\n * Instantiates a downscoped client object using the provided source\n * AuthClient and credential access boundary rules.\n * To downscope permissions of a source AuthClient, a Credential Access\n * Boundary that specifies which resources the new credential can access, as\n * well as an upper bound on the permissions that are available on each\n * resource, has to be defined. A downscoped client can then be instantiated\n * using the source AuthClient and the Credential Access Boundary.\n * @param options the {@link DownscopedClientOptions `DownscopedClientOptions`} to use. Passing an `AuthClient` directly is **@DEPRECATED**.\n * @param credentialAccessBoundary **@DEPRECATED**. Provide a {@link DownscopedClientOptions `DownscopedClientOptions`} object in the first parameter instead.\n */\n constructor(\n /**\n * AuthClient is for backwards-compatibility.\n */\n options, \n /**\n * @deprecated - provide a {@link DownscopedClientOptions `DownscopedClientOptions`} object in the first parameter instead\n */\n credentialAccessBoundary = {\n accessBoundary: {\n accessBoundaryRules: [],\n },\n }) {\n super(options instanceof authclient_1.AuthClient ? {} : options);\n if (options instanceof authclient_1.AuthClient) {\n this.authClient = options;\n this.credentialAccessBoundary = credentialAccessBoundary;\n }\n else {\n this.authClient = options.authClient;\n this.credentialAccessBoundary = options.credentialAccessBoundary;\n }\n // Check 1-10 Access Boundary Rules are defined within Credential Access\n // Boundary.\n if (this.credentialAccessBoundary.accessBoundary.accessBoundaryRules\n .length === 0) {\n throw new Error('At least one access boundary rule needs to be defined.');\n }\n else if (this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length >\n exports.MAX_ACCESS_BOUNDARY_RULES_COUNT) {\n throw new Error('The provided access boundary has more than ' +\n `${exports.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`);\n }\n // Check at least one permission should be defined in each Access Boundary\n // Rule.\n for (const rule of this.credentialAccessBoundary.accessBoundary\n .accessBoundaryRules) {\n if (rule.availablePermissions.length === 0) {\n throw new Error('At least one permission should be defined in access boundary rules.');\n }\n }\n this.stsCredential = new sts.StsCredentials({\n tokenExchangeEndpoint: `https://sts.${this.universeDomain}/v1/token`,\n });\n this.cachedDownscopedAccessToken = null;\n }\n /**\n * Provides a mechanism to inject Downscoped access tokens directly.\n * The expiry_date field is required to facilitate determination of the token\n * expiration which would make it easier for the token consumer to handle.\n * @param credentials The Credentials object to set on the current client.\n */\n setCredentials(credentials) {\n if (!credentials.expiry_date) {\n throw new Error('The access token expiry_date field is missing in the provided ' +\n 'credentials.');\n }\n super.setCredentials(credentials);\n this.cachedDownscopedAccessToken = credentials;\n }\n async getAccessToken() {\n // If the cached access token is unavailable or expired, force refresh.\n // The Downscoped access token will be returned in\n // DownscopedAccessTokenResponse format.\n if (!this.cachedDownscopedAccessToken ||\n this.isExpired(this.cachedDownscopedAccessToken)) {\n await this.refreshAccessTokenAsync();\n }\n // Return Downscoped access token in DownscopedAccessTokenResponse format.\n return {\n token: this.cachedDownscopedAccessToken.access_token,\n expirationTime: this.cachedDownscopedAccessToken.expiry_date,\n res: this.cachedDownscopedAccessToken.res,\n };\n }\n /**\n * The main authentication interface. It takes an optional url which when\n * present is the endpoint being accessed, and returns a Promise which\n * resolves with authorization header fields.\n *\n * The result has the form:\n * { authorization: 'Bearer ' }\n */\n async getRequestHeaders() {\n const accessTokenResponse = await this.getAccessToken();\n const headers = new Headers({\n authorization: `Bearer ${accessTokenResponse.token}`,\n });\n return this.addSharedMetadataHeaders(headers);\n }\n request(opts, callback) {\n if (callback) {\n this.requestAsync(opts).then(r => callback(null, r), e => {\n return callback(e, e.response);\n });\n }\n else {\n return this.requestAsync(opts);\n }\n }\n /**\n * Authenticates the provided HTTP request, processes it and resolves with the\n * returned response.\n * @param opts The HTTP request options.\n * @param reAuthRetried Whether the current attempt is a retry after a failed attempt due to an auth failure\n * @return A promise that resolves with the successful response.\n */\n async requestAsync(opts, reAuthRetried = false) {\n let response;\n try {\n const requestHeaders = await this.getRequestHeaders();\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers);\n this.addUserProjectAndAuthHeaders(opts.headers, requestHeaders);\n response = await this.transporter.request(opts);\n }\n catch (e) {\n const res = e.response;\n if (res) {\n const statusCode = res.status;\n // Retry the request for metadata if the following criteria are true:\n // - We haven't already retried. It only makes sense to retry once.\n // - The response was a 401 or a 403\n // - The request didn't send a readableStream\n // - forceRefreshOnFailure is true\n const isReadableStream = res.config.data instanceof stream.Readable;\n const isAuthErr = statusCode === 401 || statusCode === 403;\n if (!reAuthRetried &&\n isAuthErr &&\n !isReadableStream &&\n this.forceRefreshOnFailure) {\n await this.refreshAccessTokenAsync();\n return await this.requestAsync(opts, true);\n }\n }\n throw e;\n }\n return response;\n }\n /**\n * Forces token refresh, even if unexpired tokens are currently cached.\n * GCP access tokens are retrieved from authclient object/source credential.\n * Then GCP access tokens are exchanged for downscoped access tokens via the\n * token exchange endpoint.\n * @return A promise that resolves with the fresh downscoped access token.\n */\n async refreshAccessTokenAsync() {\n // Retrieve GCP access token from source credential.\n const subjectToken = (await this.authClient.getAccessToken()).token;\n // Construct the STS credentials options.\n const stsCredentialsOptions = {\n grantType: STS_GRANT_TYPE,\n requestedTokenType: STS_REQUEST_TOKEN_TYPE,\n subjectToken: subjectToken,\n subjectTokenType: STS_SUBJECT_TOKEN_TYPE,\n };\n // Exchange the source AuthClient access token for a Downscoped access\n // token.\n const stsResponse = await this.stsCredential.exchangeToken(stsCredentialsOptions, undefined, this.credentialAccessBoundary);\n /**\n * The STS endpoint will only return the expiration time for the downscoped\n * access token if the original access token represents a service account.\n * The downscoped token's expiration time will always match the source\n * credential expiration. When no expires_in is returned, we can copy the\n * source credential's expiration time.\n */\n const sourceCredExpireDate = this.authClient.credentials?.expiry_date || null;\n const expiryDate = stsResponse.expires_in\n ? new Date().getTime() + stsResponse.expires_in * 1000\n : sourceCredExpireDate;\n // Save response in cached access token.\n this.cachedDownscopedAccessToken = {\n access_token: stsResponse.access_token,\n expiry_date: expiryDate,\n res: stsResponse.res,\n };\n // Save credentials.\n this.credentials = {};\n Object.assign(this.credentials, this.cachedDownscopedAccessToken);\n delete this.credentials.res;\n // Trigger tokens event to notify external listeners.\n this.emit('tokens', {\n refresh_token: null,\n expiry_date: this.cachedDownscopedAccessToken.expiry_date,\n access_token: this.cachedDownscopedAccessToken.access_token,\n token_type: 'Bearer',\n id_token: null,\n });\n // Return the cached access token.\n return this.cachedDownscopedAccessToken;\n }\n /**\n * Returns whether the provided credentials are expired or not.\n * If there is no expiry time, assumes the token is not expired or expiring.\n * @param downscopedAccessToken The credentials to check for expiration.\n * @return Whether the credentials are expired or not.\n */\n isExpired(downscopedAccessToken) {\n const now = new Date().getTime();\n return downscopedAccessToken.expiry_date\n ? now >=\n downscopedAccessToken.expiry_date - this.eagerRefreshThresholdMillis\n : false;\n }\n}\nexports.DownscopedClient = DownscopedClient;\n//# sourceMappingURL=downscopedclient.js.map","\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PassThroughClient = void 0;\nconst authclient_1 = require(\"./authclient\");\n/**\n * An AuthClient without any Authentication information. Useful for:\n * - Anonymous access\n * - Local Emulators\n * - Testing Environments\n *\n */\nclass PassThroughClient extends authclient_1.AuthClient {\n /**\n * Creates a request without any authentication headers or checks.\n *\n * @remarks\n *\n * In testing environments it may be useful to change the provided\n * {@link AuthClient.transporter} for any desired request overrides/handling.\n *\n * @param opts\n * @returns The response of the request.\n */\n async request(opts) {\n return this.transporter.request(opts);\n }\n /**\n * A required method of the base class.\n * Always will return an empty object.\n *\n * @returns {}\n */\n async getAccessToken() {\n return {};\n }\n /**\n * A required method of the base class.\n * Always will return an empty object.\n *\n * @returns {}\n */\n async getRequestHeaders() {\n return new Headers();\n }\n}\nexports.PassThroughClient = PassThroughClient;\n//# sourceMappingURL=passthrough.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GoogleAuth = exports.auth = exports.PassThroughClient = exports.ExecutableError = exports.PluggableAuthClient = exports.DownscopedClient = exports.BaseExternalAccountClient = exports.ExternalAccountClient = exports.IdentityPoolClient = exports.AwsRequestSigner = exports.AwsClient = exports.UserRefreshClient = exports.LoginTicket = exports.ClientAuthentication = exports.OAuth2Client = exports.CodeChallengeMethod = exports.Impersonated = exports.JWT = exports.JWTAccess = exports.IdTokenClient = exports.IAMAuth = exports.GCPEnv = exports.Compute = exports.DEFAULT_UNIVERSE = exports.AuthClient = exports.gaxios = exports.gcpMetadata = void 0;\n// Copyright 2017 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nconst googleauth_1 = require(\"./auth/googleauth\");\nObject.defineProperty(exports, \"GoogleAuth\", { enumerable: true, get: function () { return googleauth_1.GoogleAuth; } });\n// Export common deps to ensure types/instances are the exact match. Useful\n// for consistently configuring the library across versions.\nexports.gcpMetadata = require(\"gcp-metadata\");\nexports.gaxios = require(\"gaxios\");\nvar authclient_1 = require(\"./auth/authclient\");\nObject.defineProperty(exports, \"AuthClient\", { enumerable: true, get: function () { return authclient_1.AuthClient; } });\nObject.defineProperty(exports, \"DEFAULT_UNIVERSE\", { enumerable: true, get: function () { return authclient_1.DEFAULT_UNIVERSE; } });\nvar computeclient_1 = require(\"./auth/computeclient\");\nObject.defineProperty(exports, \"Compute\", { enumerable: true, get: function () { return computeclient_1.Compute; } });\nvar envDetect_1 = require(\"./auth/envDetect\");\nObject.defineProperty(exports, \"GCPEnv\", { enumerable: true, get: function () { return envDetect_1.GCPEnv; } });\nvar iam_1 = require(\"./auth/iam\");\nObject.defineProperty(exports, \"IAMAuth\", { enumerable: true, get: function () { return iam_1.IAMAuth; } });\nvar idtokenclient_1 = require(\"./auth/idtokenclient\");\nObject.defineProperty(exports, \"IdTokenClient\", { enumerable: true, get: function () { return idtokenclient_1.IdTokenClient; } });\nvar jwtaccess_1 = require(\"./auth/jwtaccess\");\nObject.defineProperty(exports, \"JWTAccess\", { enumerable: true, get: function () { return jwtaccess_1.JWTAccess; } });\nvar jwtclient_1 = require(\"./auth/jwtclient\");\nObject.defineProperty(exports, \"JWT\", { enumerable: true, get: function () { return jwtclient_1.JWT; } });\nvar impersonated_1 = require(\"./auth/impersonated\");\nObject.defineProperty(exports, \"Impersonated\", { enumerable: true, get: function () { return impersonated_1.Impersonated; } });\nvar oauth2client_1 = require(\"./auth/oauth2client\");\nObject.defineProperty(exports, \"CodeChallengeMethod\", { enumerable: true, get: function () { return oauth2client_1.CodeChallengeMethod; } });\nObject.defineProperty(exports, \"OAuth2Client\", { enumerable: true, get: function () { return oauth2client_1.OAuth2Client; } });\nObject.defineProperty(exports, \"ClientAuthentication\", { enumerable: true, get: function () { return oauth2client_1.ClientAuthentication; } });\nvar loginticket_1 = require(\"./auth/loginticket\");\nObject.defineProperty(exports, \"LoginTicket\", { enumerable: true, get: function () { return loginticket_1.LoginTicket; } });\nvar refreshclient_1 = require(\"./auth/refreshclient\");\nObject.defineProperty(exports, \"UserRefreshClient\", { enumerable: true, get: function () { return refreshclient_1.UserRefreshClient; } });\nvar awsclient_1 = require(\"./auth/awsclient\");\nObject.defineProperty(exports, \"AwsClient\", { enumerable: true, get: function () { return awsclient_1.AwsClient; } });\nvar awsrequestsigner_1 = require(\"./auth/awsrequestsigner\");\nObject.defineProperty(exports, \"AwsRequestSigner\", { enumerable: true, get: function () { return awsrequestsigner_1.AwsRequestSigner; } });\nvar identitypoolclient_1 = require(\"./auth/identitypoolclient\");\nObject.defineProperty(exports, \"IdentityPoolClient\", { enumerable: true, get: function () { return identitypoolclient_1.IdentityPoolClient; } });\nvar externalclient_1 = require(\"./auth/externalclient\");\nObject.defineProperty(exports, \"ExternalAccountClient\", { enumerable: true, get: function () { return externalclient_1.ExternalAccountClient; } });\nvar baseexternalclient_1 = require(\"./auth/baseexternalclient\");\nObject.defineProperty(exports, \"BaseExternalAccountClient\", { enumerable: true, get: function () { return baseexternalclient_1.BaseExternalAccountClient; } });\nvar downscopedclient_1 = require(\"./auth/downscopedclient\");\nObject.defineProperty(exports, \"DownscopedClient\", { enumerable: true, get: function () { return downscopedclient_1.DownscopedClient; } });\nvar pluggable_auth_client_1 = require(\"./auth/pluggable-auth-client\");\nObject.defineProperty(exports, \"PluggableAuthClient\", { enumerable: true, get: function () { return pluggable_auth_client_1.PluggableAuthClient; } });\nObject.defineProperty(exports, \"ExecutableError\", { enumerable: true, get: function () { return pluggable_auth_client_1.ExecutableError; } });\nvar passthrough_1 = require(\"./auth/passthrough\");\nObject.defineProperty(exports, \"PassThroughClient\", { enumerable: true, get: function () { return passthrough_1.PassThroughClient; } });\nconst auth = new googleauth_1.GoogleAuth();\nexports.auth = auth;\n//# sourceMappingURL=index.js.map","'use strict';\n\nvar crypto = require('crypto');\n\n/**\n * Exported function\n *\n * Options:\n *\n * - `algorithm` hash algo to be used by this instance: *'sha1', 'md5'\n * - `excludeValues` {true|*false} hash object keys, values ignored\n * - `encoding` hash encoding, supports 'buffer', '*hex', 'binary', 'base64'\n * - `ignoreUnknown` {true|*false} ignore unknown object types\n * - `replacer` optional function that replaces values before hashing\n * - `respectFunctionProperties` {*true|false} consider function properties when hashing\n * - `respectFunctionNames` {*true|false} consider 'name' property of functions for hashing\n * - `respectType` {*true|false} Respect special properties (prototype, constructor)\n * when hashing to distinguish between types\n * - `unorderedArrays` {true|*false} Sort all arrays before hashing\n * - `unorderedSets` {*true|false} Sort `Set` and `Map` instances before hashing\n * * = default\n *\n * @param {object} object value to hash\n * @param {object} options hashing options\n * @return {string} hash value\n * @api public\n */\nexports = module.exports = objectHash;\n\nfunction objectHash(object, options){\n options = applyDefaults(object, options);\n\n return hash(object, options);\n}\n\n/**\n * Exported sugar methods\n *\n * @param {object} object value to hash\n * @return {string} hash value\n * @api public\n */\nexports.sha1 = function(object){\n return objectHash(object);\n};\nexports.keys = function(object){\n return objectHash(object, {excludeValues: true, algorithm: 'sha1', encoding: 'hex'});\n};\nexports.MD5 = function(object){\n return objectHash(object, {algorithm: 'md5', encoding: 'hex'});\n};\nexports.keysMD5 = function(object){\n return objectHash(object, {algorithm: 'md5', encoding: 'hex', excludeValues: true});\n};\n\n// Internals\nvar hashes = crypto.getHashes ? crypto.getHashes().slice() : ['sha1', 'md5'];\nhashes.push('passthrough');\nvar encodings = ['buffer', 'hex', 'binary', 'base64'];\n\nfunction applyDefaults(object, sourceOptions){\n sourceOptions = sourceOptions || {};\n\n // create a copy rather than mutating\n var options = {};\n options.algorithm = sourceOptions.algorithm || 'sha1';\n options.encoding = sourceOptions.encoding || 'hex';\n options.excludeValues = sourceOptions.excludeValues ? true : false;\n options.algorithm = options.algorithm.toLowerCase();\n options.encoding = options.encoding.toLowerCase();\n options.ignoreUnknown = sourceOptions.ignoreUnknown !== true ? false : true; // default to false\n options.respectType = sourceOptions.respectType === false ? false : true; // default to true\n options.respectFunctionNames = sourceOptions.respectFunctionNames === false ? false : true;\n options.respectFunctionProperties = sourceOptions.respectFunctionProperties === false ? false : true;\n options.unorderedArrays = sourceOptions.unorderedArrays !== true ? false : true; // default to false\n options.unorderedSets = sourceOptions.unorderedSets === false ? false : true; // default to false\n options.unorderedObjects = sourceOptions.unorderedObjects === false ? false : true; // default to true\n options.replacer = sourceOptions.replacer || undefined;\n options.excludeKeys = sourceOptions.excludeKeys || undefined;\n\n if(typeof object === 'undefined') {\n throw new Error('Object argument required.');\n }\n\n // if there is a case-insensitive match in the hashes list, accept it\n // (i.e. SHA256 for sha256)\n for (var i = 0; i < hashes.length; ++i) {\n if (hashes[i].toLowerCase() === options.algorithm.toLowerCase()) {\n options.algorithm = hashes[i];\n }\n }\n\n if(hashes.indexOf(options.algorithm) === -1){\n throw new Error('Algorithm \"' + options.algorithm + '\" not supported. ' +\n 'supported values: ' + hashes.join(', '));\n }\n\n if(encodings.indexOf(options.encoding) === -1 &&\n options.algorithm !== 'passthrough'){\n throw new Error('Encoding \"' + options.encoding + '\" not supported. ' +\n 'supported values: ' + encodings.join(', '));\n }\n\n return options;\n}\n\n/** Check if the given function is a native function */\nfunction isNativeFunction(f) {\n if ((typeof f) !== 'function') {\n return false;\n }\n var exp = /^function\\s+\\w*\\s*\\(\\s*\\)\\s*{\\s+\\[native code\\]\\s+}$/i;\n return exp.exec(Function.prototype.toString.call(f)) != null;\n}\n\nfunction hash(object, options) {\n var hashingStream;\n\n if (options.algorithm !== 'passthrough') {\n hashingStream = crypto.createHash(options.algorithm);\n } else {\n hashingStream = new PassThrough();\n }\n\n if (typeof hashingStream.write === 'undefined') {\n hashingStream.write = hashingStream.update;\n hashingStream.end = hashingStream.update;\n }\n\n var hasher = typeHasher(options, hashingStream);\n hasher.dispatch(object);\n if (!hashingStream.update) {\n hashingStream.end('');\n }\n\n if (hashingStream.digest) {\n return hashingStream.digest(options.encoding === 'buffer' ? undefined : options.encoding);\n }\n\n var buf = hashingStream.read();\n if (options.encoding === 'buffer') {\n return buf;\n }\n\n return buf.toString(options.encoding);\n}\n\n/**\n * Expose streaming API\n *\n * @param {object} object Value to serialize\n * @param {object} options Options, as for hash()\n * @param {object} stream A stream to write the serializiation to\n * @api public\n */\nexports.writeToStream = function(object, options, stream) {\n if (typeof stream === 'undefined') {\n stream = options;\n options = {};\n }\n\n options = applyDefaults(object, options);\n\n return typeHasher(options, stream).dispatch(object);\n};\n\nfunction typeHasher(options, writeTo, context){\n context = context || [];\n var write = function(str) {\n if (writeTo.update) {\n return writeTo.update(str, 'utf8');\n } else {\n return writeTo.write(str, 'utf8');\n }\n };\n\n return {\n dispatch: function(value){\n if (options.replacer) {\n value = options.replacer(value);\n }\n\n var type = typeof value;\n if (value === null) {\n type = 'null';\n }\n\n //console.log(\"[DEBUG] Dispatch: \", value, \"->\", type, \" -> \", \"_\" + type);\n\n return this['_' + type](value);\n },\n _object: function(object) {\n var pattern = (/\\[object (.*)\\]/i);\n var objString = Object.prototype.toString.call(object);\n var objType = pattern.exec(objString);\n if (!objType) { // object type did not match [object ...]\n objType = 'unknown:[' + objString + ']';\n } else {\n objType = objType[1]; // take only the class name\n }\n\n objType = objType.toLowerCase();\n\n var objectNumber = null;\n\n if ((objectNumber = context.indexOf(object)) >= 0) {\n return this.dispatch('[CIRCULAR:' + objectNumber + ']');\n } else {\n context.push(object);\n }\n\n if (typeof Buffer !== 'undefined' && Buffer.isBuffer && Buffer.isBuffer(object)) {\n write('buffer:');\n return write(object);\n }\n\n if(objType !== 'object' && objType !== 'function' && objType !== 'asyncfunction') {\n if(this['_' + objType]) {\n this['_' + objType](object);\n } else if (options.ignoreUnknown) {\n return write('[' + objType + ']');\n } else {\n throw new Error('Unknown object type \"' + objType + '\"');\n }\n }else{\n var keys = Object.keys(object);\n if (options.unorderedObjects) {\n keys = keys.sort();\n }\n // Make sure to incorporate special properties, so\n // Types with different prototypes will produce\n // a different hash and objects derived from\n // different functions (`new Foo`, `new Bar`) will\n // produce different hashes.\n // We never do this for native functions since some\n // seem to break because of that.\n if (options.respectType !== false && !isNativeFunction(object)) {\n keys.splice(0, 0, 'prototype', '__proto__', 'constructor');\n }\n\n if (options.excludeKeys) {\n keys = keys.filter(function(key) { return !options.excludeKeys(key); });\n }\n\n write('object:' + keys.length + ':');\n var self = this;\n return keys.forEach(function(key){\n self.dispatch(key);\n write(':');\n if(!options.excludeValues) {\n self.dispatch(object[key]);\n }\n write(',');\n });\n }\n },\n _array: function(arr, unordered){\n unordered = typeof unordered !== 'undefined' ? unordered :\n options.unorderedArrays !== false; // default to options.unorderedArrays\n\n var self = this;\n write('array:' + arr.length + ':');\n if (!unordered || arr.length <= 1) {\n return arr.forEach(function(entry) {\n return self.dispatch(entry);\n });\n }\n\n // the unordered case is a little more complicated:\n // since there is no canonical ordering on objects,\n // i.e. {a:1} < {a:2} and {a:1} > {a:2} are both false,\n // we first serialize each entry using a PassThrough stream\n // before sorting.\n // also: we can’t use the same context array for all entries\n // since the order of hashing should *not* matter. instead,\n // we keep track of the additions to a copy of the context array\n // and add all of them to the global context array when we’re done\n var contextAdditions = [];\n var entries = arr.map(function(entry) {\n var strm = new PassThrough();\n var localContext = context.slice(); // make copy\n var hasher = typeHasher(options, strm, localContext);\n hasher.dispatch(entry);\n // take only what was added to localContext and append it to contextAdditions\n contextAdditions = contextAdditions.concat(localContext.slice(context.length));\n return strm.read().toString();\n });\n context = context.concat(contextAdditions);\n entries.sort();\n return this._array(entries, false);\n },\n _date: function(date){\n return write('date:' + date.toJSON());\n },\n _symbol: function(sym){\n return write('symbol:' + sym.toString());\n },\n _error: function(err){\n return write('error:' + err.toString());\n },\n _boolean: function(bool){\n return write('bool:' + bool.toString());\n },\n _string: function(string){\n write('string:' + string.length + ':');\n write(string.toString());\n },\n _function: function(fn){\n write('fn:');\n if (isNativeFunction(fn)) {\n this.dispatch('[native]');\n } else {\n this.dispatch(fn.toString());\n }\n\n if (options.respectFunctionNames !== false) {\n // Make sure we can still distinguish native functions\n // by their name, otherwise String and Function will\n // have the same hash\n this.dispatch(\"function-name:\" + String(fn.name));\n }\n\n if (options.respectFunctionProperties) {\n this._object(fn);\n }\n },\n _number: function(number){\n return write('number:' + number.toString());\n },\n _xml: function(xml){\n return write('xml:' + xml.toString());\n },\n _null: function() {\n return write('Null');\n },\n _undefined: function() {\n return write('Undefined');\n },\n _regexp: function(regex){\n return write('regex:' + regex.toString());\n },\n _uint8array: function(arr){\n write('uint8array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _uint8clampedarray: function(arr){\n write('uint8clampedarray:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _int8array: function(arr){\n write('int8array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _uint16array: function(arr){\n write('uint16array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _int16array: function(arr){\n write('int16array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _uint32array: function(arr){\n write('uint32array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _int32array: function(arr){\n write('int32array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _float32array: function(arr){\n write('float32array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _float64array: function(arr){\n write('float64array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _arraybuffer: function(arr){\n write('arraybuffer:');\n return this.dispatch(new Uint8Array(arr));\n },\n _url: function(url) {\n return write('url:' + url.toString(), 'utf8');\n },\n _map: function(map) {\n write('map:');\n var arr = Array.from(map);\n return this._array(arr, options.unorderedSets !== false);\n },\n _set: function(set) {\n write('set:');\n var arr = Array.from(set);\n return this._array(arr, options.unorderedSets !== false);\n },\n _file: function(file) {\n write('file:');\n return this.dispatch([file.name, file.size, file.type, file.lastModfied]);\n },\n _blob: function() {\n if (options.ignoreUnknown) {\n return write('[blob]');\n }\n\n throw Error('Hashing Blob objects is currently not supported\\n' +\n '(see https://github.com/puleos/object-hash/issues/26)\\n' +\n 'Use \"options.replacer\" or \"options.ignoreUnknown\"\\n');\n },\n _domwindow: function() { return write('domwindow'); },\n _bigint: function(number){\n return write('bigint:' + number.toString());\n },\n /* Node.js standard native objects */\n _process: function() { return write('process'); },\n _timer: function() { return write('timer'); },\n _pipe: function() { return write('pipe'); },\n _tcp: function() { return write('tcp'); },\n _udp: function() { return write('udp'); },\n _tty: function() { return write('tty'); },\n _statwatcher: function() { return write('statwatcher'); },\n _securecontext: function() { return write('securecontext'); },\n _connection: function() { return write('connection'); },\n _zlib: function() { return write('zlib'); },\n _context: function() { return write('context'); },\n _nodescript: function() { return write('nodescript'); },\n _httpparser: function() { return write('httpparser'); },\n _dataview: function() { return write('dataview'); },\n _signal: function() { return write('signal'); },\n _fsevent: function() { return write('fsevent'); },\n _tlswrap: function() { return write('tlswrap'); },\n };\n}\n\n// Mini-implementation of stream.PassThrough\n// We are far from having need for the full implementation, and we can\n// make assumptions like \"many writes, then only one final read\"\n// and we can ignore encoding specifics\nfunction PassThrough() {\n return {\n buf: '',\n\n write: function(b) {\n this.buf += b;\n },\n\n end: function(b) {\n this.buf += b;\n },\n\n read: function() {\n return this.buf;\n }\n };\n}\n","\"use strict\";\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hasWindowFetch = hasWindowFetch;\nexports.isNodeJS = isNodeJS;\nexports.hasAbortController = hasAbortController;\n/* global window */\nconst features = {\n windowFetch: typeof window !== 'undefined' &&\n window?.fetch &&\n typeof window?.fetch === 'function',\n // eslint-disable-next-line n/no-unsupported-features/node-builtins\n textEncoder: typeof TextEncoder !== 'undefined',\n // eslint-disable-next-line n/no-unsupported-features/node-builtins\n textDecoder: typeof TextDecoder !== 'undefined',\n nodeJS: typeof process !== 'undefined' && process?.versions?.node,\n abortController: typeof AbortController !== 'undefined',\n};\nfunction hasWindowFetch() {\n return features.windowFetch;\n}\nfunction isNodeJS() {\n return features.nodeJS;\n}\nfunction hasAbortController() {\n return features.abortController;\n}\n//# sourceMappingURL=featureDetection.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.warn = warn;\nconst featureDetection_1 = require(\"./featureDetection\");\nconst emittedWarnings = new Set();\n// warnType is the type of warning (e.g. 'DeprecationWarning', 'ExperimentalWarning', etc.)\nfunction warn(code, message, warnType) {\n // Only show a given warning once\n if (emittedWarnings.has(code)) {\n return;\n }\n emittedWarnings.add(code);\n if (!(0, featureDetection_1.isNodeJS)()) {\n console.warn(message);\n }\n else if (typeof warnType !== 'undefined') {\n process.emitWarning(message, {\n type: warnType,\n });\n }\n else {\n process.emitWarning(message);\n }\n}\n//# sourceMappingURL=warnings.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.camelToSnakeCase = camelToSnakeCase;\nexports.toCamelCase = toCamelCase;\nexports.toLowerCamelCase = toLowerCamelCase;\nexports.makeUUID = makeUUID;\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst randomUUID = () => globalThis.crypto?.randomUUID() || require('crypto').randomUUID();\nfunction words(str, normalize = false) {\n if (normalize) {\n // strings like somethingABCSomething are special case for protobuf.js,\n // they should be split as \"something\", \"abc\", \"something\".\n // Deal with sequences of capital letters first.\n str = str.replace(/([A-Z])([A-Z]+)([A-Z])/g, (str) => {\n return (str[0] +\n str.slice(1, str.length - 1).toLowerCase() +\n str[str.length - 1]);\n });\n }\n // split on spaces, non-alphanumeric, or capital letters\n // note: we keep the capitalization of the first word (special case: IPProtocol)\n return str\n .split(/(?=[A-Z])|[^A-Za-z0-9.]+/)\n .filter(w => w.length > 0)\n .map((w, index) => (index === 0 ? w : w.toLowerCase()));\n}\n/**\n * Converts the first character of the given string to lower case.\n */\nfunction lowercase(str) {\n if (str.length === 0) {\n return str;\n }\n return str[0].toLowerCase() + str.slice(1);\n}\n/**\n * Converts a given string from camelCase (used by protobuf.js and in JSON)\n * to snake_case (normally used in proto definitions).\n */\nfunction camelToSnakeCase(str) {\n // Keep the first position capitalization, otherwise decapitalize with underscore.\n const wordsList = words(str);\n if (wordsList.length === 0) {\n return str;\n }\n const result = [wordsList[0]];\n result.push(...wordsList.slice(1).map(lowercase));\n return result.join('_');\n}\n/**\n * Capitalizes the first character of the given string.\n */\nfunction capitalize(str) {\n if (str.length === 0) {\n return str;\n }\n return str[0].toUpperCase() + str.slice(1);\n}\n/**\n * Converts a given string from snake_case (normally used in proto definitions) or\n * PascalCase (also used in proto definitions) to camelCase (used by protobuf.js).\n * Preserves capitalization of the first character.\n */\nfunction toCamelCase(str) {\n const wordsList = words(str, /*normalize:*/ true);\n if (wordsList.length === 0) {\n return str;\n }\n const result = [wordsList[0]];\n result.push(...wordsList.slice(1).map(w => {\n if (w.match(/^\\d+$/)) {\n return '_' + w;\n }\n return capitalize(w);\n }));\n return result.join('');\n}\n/**\n * Converts a given string to lower camel case (forcing the first character to be\n * in lower case).\n */\nfunction toLowerCamelCase(str) {\n const camelCase = toCamelCase(str);\n if (camelCase.length === 0) {\n return camelCase;\n }\n return camelCase[0].toLowerCase() + camelCase.slice(1);\n}\n/**\n * Converts a given string to lower camel case (forcing the first character to be\n * in lower case).\n */\nfunction makeUUID() {\n return randomUUID();\n}\n//# sourceMappingURL=util.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpCodeToRpcCodeMap = exports.Status = void 0;\nexports.rpcCodeFromHttpStatusCode = rpcCodeFromHttpStatusCode;\n// The following is a copy of the Status enum defined in @grpc/grpc-js,\n// src/constants.ts. We need to use some of these statuses here and there,\n// but we don't want to include the whole @grpc/grpc-js into the browser\n// bundle just to have this small enum.\nvar Status;\n(function (Status) {\n Status[Status[\"OK\"] = 0] = \"OK\";\n Status[Status[\"CANCELLED\"] = 1] = \"CANCELLED\";\n Status[Status[\"UNKNOWN\"] = 2] = \"UNKNOWN\";\n Status[Status[\"INVALID_ARGUMENT\"] = 3] = \"INVALID_ARGUMENT\";\n Status[Status[\"DEADLINE_EXCEEDED\"] = 4] = \"DEADLINE_EXCEEDED\";\n Status[Status[\"NOT_FOUND\"] = 5] = \"NOT_FOUND\";\n Status[Status[\"ALREADY_EXISTS\"] = 6] = \"ALREADY_EXISTS\";\n Status[Status[\"PERMISSION_DENIED\"] = 7] = \"PERMISSION_DENIED\";\n Status[Status[\"RESOURCE_EXHAUSTED\"] = 8] = \"RESOURCE_EXHAUSTED\";\n Status[Status[\"FAILED_PRECONDITION\"] = 9] = \"FAILED_PRECONDITION\";\n Status[Status[\"ABORTED\"] = 10] = \"ABORTED\";\n Status[Status[\"OUT_OF_RANGE\"] = 11] = \"OUT_OF_RANGE\";\n Status[Status[\"UNIMPLEMENTED\"] = 12] = \"UNIMPLEMENTED\";\n Status[Status[\"INTERNAL\"] = 13] = \"INTERNAL\";\n Status[Status[\"UNAVAILABLE\"] = 14] = \"UNAVAILABLE\";\n Status[Status[\"DATA_LOSS\"] = 15] = \"DATA_LOSS\";\n Status[Status[\"UNAUTHENTICATED\"] = 16] = \"UNAUTHENTICATED\";\n})(Status || (exports.Status = Status = {}));\nexports.HttpCodeToRpcCodeMap = new Map([\n [400, Status.INVALID_ARGUMENT],\n [401, Status.UNAUTHENTICATED],\n [403, Status.PERMISSION_DENIED],\n [404, Status.NOT_FOUND],\n [409, Status.ABORTED],\n [416, Status.OUT_OF_RANGE],\n [429, Status.RESOURCE_EXHAUSTED],\n [499, Status.CANCELLED],\n [501, Status.UNIMPLEMENTED],\n [503, Status.UNAVAILABLE],\n [504, Status.DEADLINE_EXCEEDED],\n]);\n// Maps HTTP status codes to gRPC status codes above.\nfunction rpcCodeFromHttpStatusCode(httpStatusCode) {\n if (exports.HttpCodeToRpcCodeMap.has(httpStatusCode)) {\n return exports.HttpCodeToRpcCodeMap.get(httpStatusCode);\n }\n // All 2xx\n if (httpStatusCode >= 200 && httpStatusCode < 300) {\n return Status.OK;\n }\n // All other 4xx\n if (httpStatusCode >= 400 && httpStatusCode < 500) {\n return Status.FAILED_PRECONDITION;\n }\n // All other 5xx\n if (httpStatusCode >= 500 && httpStatusCode < 600) {\n return Status.INTERNAL;\n }\n // Everything else\n return Status.UNKNOWN;\n}\n//# sourceMappingURL=status.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CallSettings = exports.RetryOptions = void 0;\nexports.convertRetryOptions = convertRetryOptions;\nexports.createRetryOptions = createRetryOptions;\nexports.createBackoffSettings = createBackoffSettings;\nexports.createDefaultBackoffSettings = createDefaultBackoffSettings;\nexports.createMaxRetriesBackoffSettings = createMaxRetriesBackoffSettings;\nexports.createBundleOptions = createBundleOptions;\nexports.constructSettings = constructSettings;\nexports.createByteLengthFunction = createByteLengthFunction;\nconst warnings_1 = require(\"./warnings\");\nconst util_1 = require(\"./util\");\nconst status_1 = require(\"./status\");\n/**\n * Encapsulates the overridable settings for a particular API call.\n *\n * ``CallOptions`` is an optional arg for all GAX API calls. It is used to\n * configure the settings of a specific API call.\n *\n * When provided, its values override the GAX service defaults for that\n * particular call.\n *\n * Typically the API clients will accept this as the second to the last\n * argument. See the examples below.\n * @typedef {Object} CallOptions\n * @property {number=} timeout - The client-side timeout for API calls.\n * @property {RetryOptions=} retry - determines whether and how to retry\n * on transient errors. When set to null, the call will not retry.\n * @property {boolean=} autoPaginate - If set to false and the call is\n * configured for paged iteration, page unrolling is not performed, instead\n * the callback will be called with the response object.\n * @property {Object=} pageToken - If set and the call is configured for\n * paged iteration, paged iteration is not performed and requested with this\n * pageToken.\n * @property {number} maxResults - If set and the call is configured for\n * paged iteration, the call will stop when the number of response elements\n * reaches to the specified size. By default, it will unroll the page to\n * the end of the list.\n * @property {boolean=} isBundling - If set to false and the call is configured\n * for bundling, bundling is not performed.\n * @property {BackoffSettings=} longrunning - BackoffSettings used for polling.\n * @example\n * // suppress bundling for bundled method.\n * api.bundlingMethod(\n * param, {optParam: aValue, isBundling: false}, function(err, response) {\n * // handle response.\n * });\n * @example\n * // suppress streaming for page-streaming method.\n * api.pageStreamingMethod(\n * param, {optParam: aValue, autoPaginate: false}, function(err, page) {\n * // not returning a stream, but callback is called with the paged response.\n * });\n */\n/**\n * Per-call configurable settings for retrying upon transient failure.\n * @implements {RetryOptionsType}\n * @typedef {Object} RetryOptions\n * @property {number[]} retryCodes\n * @property {BackoffSettings} backoffSettings\n * @property {(function)} shouldRetryFn\n * @property {(function)} getResumptionRequestFn\n */\nclass RetryOptions {\n retryCodes;\n backoffSettings;\n shouldRetryFn;\n getResumptionRequestFn;\n constructor(retryCodes, backoffSettings, shouldRetryFn, getResumptionRequestFn) {\n this.retryCodes = retryCodes;\n this.backoffSettings = backoffSettings;\n this.shouldRetryFn = shouldRetryFn;\n this.getResumptionRequestFn = getResumptionRequestFn;\n }\n}\nexports.RetryOptions = RetryOptions;\nclass CallSettings {\n timeout;\n retry;\n autoPaginate;\n pageToken;\n pageSize;\n maxResults;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n otherArgs;\n bundleOptions;\n isBundling;\n longrunning;\n apiName;\n retryRequestOptions;\n /**\n * @param {Object} settings - An object containing parameters of this settings.\n * @param {number} settings.timeout - The client-side timeout for API calls.\n * This parameter is ignored for retrying calls.\n * @param {RetryOptions} settings.retry - The configuration for retrying upon\n * transient error. If set to null, this call will not retry.\n * @param {boolean} settings.autoPaginate - If there is no `pageDescriptor`,\n * this attrbute has no meaning. Otherwise, determines whether a page\n * streamed response should make the page structure transparent to the user by\n * flattening the repeated field in the returned generator.\n * @param {number} settings.pageToken - If there is no `pageDescriptor`,\n * this attribute has no meaning. Otherwise, determines the page token used\n * in the page streaming request.\n * @param {Object} settings.otherArgs - Additional arguments to be passed to\n * the API calls.\n *\n * @constructor\n */\n constructor(settings) {\n settings = settings || {};\n this.timeout = settings.timeout || 30 * 1000;\n this.retry = settings.retry;\n this.autoPaginate =\n 'autoPaginate' in settings ? settings.autoPaginate : true;\n this.maxResults = settings.maxResults;\n this.otherArgs = settings.otherArgs || {};\n this.bundleOptions = settings.bundleOptions;\n this.isBundling = 'isBundling' in settings ? settings.isBundling : true;\n this.longrunning =\n 'longrunning' in settings ? settings.longrunning : undefined;\n this.apiName = settings.apiName ?? undefined;\n this.retryRequestOptions = settings.retryRequestOptions;\n }\n /**\n * Returns a new CallSettings merged from this and a CallOptions object.\n *\n * @param {CallOptions} options - an instance whose values override\n * those in this object. If null, ``merge`` returns a copy of this\n * object\n * @return {CallSettings} The merged CallSettings instance.\n */\n merge(options) {\n if (!options) {\n return new CallSettings(this);\n }\n let timeout = this.timeout;\n let retry = this.retry;\n let autoPaginate = this.autoPaginate;\n let maxResults = this.maxResults;\n let otherArgs = this.otherArgs;\n let isBundling = this.isBundling;\n let longrunning = this.longrunning;\n let apiName = this.apiName;\n let retryRequestOptions = this.retryRequestOptions;\n // If the user provides a timeout to the method, that timeout value will be used\n // to override the backoff settings.\n if ('timeout' in options) {\n timeout = options.timeout;\n }\n // If a method-specific timeout is set in the service config, and the retry codes for that\n // method are non-null, then that timeout value will be used to\n // override backoff settings.\n if (retry?.retryCodes) {\n retry.backoffSettings.initialRpcTimeoutMillis = timeout;\n retry.backoffSettings.maxRpcTimeoutMillis = timeout;\n retry.backoffSettings.totalTimeoutMillis = timeout;\n }\n if ('retry' in options) {\n retry = mergeRetryOptions(retry || {}, options.retry);\n }\n if ('autoPaginate' in options && !options.autoPaginate) {\n autoPaginate = false;\n }\n if ('maxResults' in options) {\n maxResults = options.maxResults;\n }\n if ('otherArgs' in options) {\n otherArgs = {};\n for (const key in this.otherArgs) {\n otherArgs[key] = this.otherArgs[key];\n }\n for (const optionsKey in options.otherArgs) {\n otherArgs[optionsKey] = options.otherArgs[optionsKey];\n }\n }\n if ('isBundling' in options) {\n isBundling = options.isBundling;\n }\n if ('maxRetries' in options && options.maxRetries !== undefined) {\n retry.backoffSettings.maxRetries = options.maxRetries;\n delete retry.backoffSettings.totalTimeoutMillis;\n }\n if ('longrunning' in options) {\n longrunning = options.longrunning;\n }\n if ('apiName' in options) {\n apiName = options.apiName;\n }\n if ('retryRequestOptions' in options) {\n retryRequestOptions = options.retryRequestOptions;\n }\n return new CallSettings({\n timeout,\n retry,\n bundleOptions: this.bundleOptions,\n longrunning,\n autoPaginate,\n maxResults,\n otherArgs,\n isBundling,\n apiName,\n retryRequestOptions,\n });\n }\n}\nexports.CallSettings = CallSettings;\n/**\n * Validates passed retry options in preparation for eventual parameter deprecation\n * converts retryRequestOptions to retryOptions\n * then sets retryRequestOptions to null\n *\n * @param {CallOptions} options - a list of passed retry option\n * @return {CallOptions} A new CallOptions object.\n *\n */\nfunction convertRetryOptions(options, gaxStreamingRetries) {\n // options will be undefined if no CallOptions object is passed at call time\n if (!options) {\n return options;\n }\n // if a user provided retry AND retryRequestOptions at call time, throw an error\n // otherwise, convert supported parameters\n if (!gaxStreamingRetries) {\n return options;\n }\n if (options.retry && options.retryRequestOptions) {\n throw new Error('Only one of retry or retryRequestOptions may be set');\n } // handles parameter conversion from retryRequestOptions to retryOptions\n if (options.retryRequestOptions) {\n if (options.retryRequestOptions.objectMode !== undefined) {\n (0, warnings_1.warn)('retry_request_options', 'objectMode override is not supported. It is set to true internally by default in gax.', 'UnsupportedParameterWarning');\n }\n if (options.retryRequestOptions.noResponseRetries !== undefined) {\n (0, warnings_1.warn)('retry_request_options', 'noResponseRetries override is not supported. Please specify retry codes or a function to determine retry eligibility.', 'UnsupportedParameterWarning');\n }\n if (options.retryRequestOptions.currentRetryAttempt !== undefined) {\n (0, warnings_1.warn)('retry_request_options', 'currentRetryAttempt override is not supported. Retry attempts are tracked internally.', 'UnsupportedParameterWarning');\n }\n let retryCodes = [status_1.Status.UNAVAILABLE];\n let shouldRetryFn;\n if (options.retryRequestOptions.shouldRetryFn) {\n retryCodes = [];\n shouldRetryFn = options.retryRequestOptions.shouldRetryFn;\n }\n //Backoff settings\n options.maxRetries =\n options?.retryRequestOptions?.retries ?? options.maxRetries;\n // create a default backoff settings object in case the user didn't provide overrides for everything\n const backoffSettings = createDefaultBackoffSettings();\n let maxRetryDelayMillis;\n let totalTimeoutMillis;\n // maxRetryDelay - this is in seconds, need to convert to milliseconds\n if (options.retryRequestOptions.maxRetryDelay !== undefined) {\n maxRetryDelayMillis = options.retryRequestOptions.maxRetryDelay * 1000;\n }\n // retryDelayMultiplier - should be a one to one mapping to retryDelayMultiplier\n const retryDelayMultiplier = options?.retryRequestOptions?.retryDelayMultiplier ??\n backoffSettings.retryDelayMultiplier;\n // this is in seconds and needs to be converted to milliseconds and the totalTimeoutMillis parameter\n if (options.retryRequestOptions.totalTimeout !== undefined) {\n totalTimeoutMillis = options.retryRequestOptions.totalTimeout * 1000;\n }\n else {\n if (options.maxRetries === undefined) {\n totalTimeoutMillis = 30000;\n (0, warnings_1.warn)('retry_request_options_no_max_retries_timeout', 'Neither maxRetries nor totalTimeout were passed. Defaulting to totalTimeout of 30000ms.', 'MissingParameterWarning');\n }\n }\n // for the variables the user wants to override, override in the backoff settings object we made\n backoffSettings.maxRetryDelayMillis =\n maxRetryDelayMillis ?? backoffSettings.maxRetryDelayMillis;\n backoffSettings.retryDelayMultiplier =\n retryDelayMultiplier ?? backoffSettings.retryDelayMultiplier;\n backoffSettings.totalTimeoutMillis =\n totalTimeoutMillis ?? backoffSettings.totalTimeoutMillis;\n const convertedRetryOptions = createRetryOptions(retryCodes, backoffSettings, shouldRetryFn);\n options.retry = convertedRetryOptions;\n delete options.retryRequestOptions; // completely remove them to avoid any further confusion\n (0, warnings_1.warn)('retry_request_options', 'retryRequestOptions will be deprecated in a future release. Please use retryOptions to pass retry options at call time', 'DeprecationWarning');\n }\n return options;\n}\n/**\n * Per-call configurable settings for retrying upon transient failure.\n * @param {number[]} retryCodes - a list of Google API canonical error codes OR a function that returns a boolean to determine retry behavior\n * upon which a retry should be attempted.\n * @param {BackoffSettings} backoffSettings - configures the retry\n * exponential backoff algorithm.\n * @param {function} shouldRetryFn - a function that determines whether a call should retry. If this is defined retryCodes must be empty\n * @param {function} getResumptionRequestFn - a function with a resumption strategy - only used with server streaming retries\n * @return {RetryOptions} A new RetryOptions object.\n *\n */\nfunction createRetryOptions(retryCodes, backoffSettings, shouldRetryFn, getResumptionRequestFn) {\n return {\n retryCodes,\n backoffSettings,\n shouldRetryFn,\n getResumptionRequestFn,\n };\n}\n/**\n * Parameters to the exponential backoff algorithm for retrying.\n *\n * @param {number} initialRetryDelayMillis - the initial delay time,\n * in milliseconds, between the completion of the first failed request and the\n * initiation of the first retrying request.\n * @param {number} retryDelayMultiplier - the multiplier by which to\n * increase the delay time between the completion of failed requests, and the\n * initiation of the subsequent retrying request.\n * @param {number} maxRetryDelayMillis - the maximum delay time, in\n * milliseconds, between requests. When this value is reached,\n * ``retryDelayMultiplier`` will no longer be used to increase delay time.\n * @param {number} initialRpcTimeoutMillis - the initial timeout parameter\n * to the request.\n * @param {number} rpcTimeoutMultiplier - the multiplier by which to\n * increase the timeout parameter between failed requests.\n * @param {number} maxRpcTimeoutMillis - the maximum timeout parameter, in\n * milliseconds, for a request. When this value is reached,\n * ``rpcTimeoutMultiplier`` will no longer be used to increase the timeout.\n * @param {number} totalTimeoutMillis - the total time, in milliseconds,\n * starting from when the initial request is sent, after which an error will\n * be returned, regardless of the retrying attempts made meanwhile.\n * @return {BackoffSettings} a new settings.\n *\n */\nfunction createBackoffSettings(initialRetryDelayMillis, retryDelayMultiplier, maxRetryDelayMillis, initialRpcTimeoutMillis, rpcTimeoutMultiplier, maxRpcTimeoutMillis, totalTimeoutMillis) {\n return {\n initialRetryDelayMillis,\n retryDelayMultiplier,\n maxRetryDelayMillis,\n initialRpcTimeoutMillis,\n rpcTimeoutMultiplier,\n maxRpcTimeoutMillis,\n totalTimeoutMillis,\n };\n}\nfunction createDefaultBackoffSettings() {\n return createBackoffSettings(100, 1.3, 60000, null, null, null, null);\n}\n/**\n * Parameters to the exponential backoff algorithm for retrying.\n * This function is unsupported, and intended for internal use only.\n *\n * @param {number} initialRetryDelayMillis - the initial delay time,\n * in milliseconds, between the completion of the first failed request and the\n * initiation of the first retrying request.\n * @param {number} retryDelayMultiplier - the multiplier by which to\n * increase the delay time between the completion of failed requests, and the\n * initiation of the subsequent retrying request.\n * @param {number} maxRetryDelayMillis - the maximum delay time, in\n * milliseconds, between requests. When this value is reached,\n * ``retryDelayMultiplier`` will no longer be used to increase delay time.\n * @param {number} initialRpcTimeoutMillis - the initial timeout parameter\n * to the request.\n * @param {number} rpcTimeoutMultiplier - the multiplier by which to\n * increase the timeout parameter between failed requests.\n * @param {number} maxRpcTimeoutMillis - the maximum timeout parameter, in\n * milliseconds, for a request. When this value is reached,\n * ``rpcTimeoutMultiplier`` will no longer be used to increase the timeout.\n * @param {number} maxRetries - the maximum number of retrying attempts that\n * will be made. If reached, an error will be returned.\n * @return {BackoffSettings} a new settings.\n *\n */\nfunction createMaxRetriesBackoffSettings(initialRetryDelayMillis, retryDelayMultiplier, maxRetryDelayMillis, initialRpcTimeoutMillis, rpcTimeoutMultiplier, maxRpcTimeoutMillis, maxRetries) {\n return {\n initialRetryDelayMillis,\n retryDelayMultiplier,\n maxRetryDelayMillis,\n initialRpcTimeoutMillis,\n rpcTimeoutMultiplier,\n maxRpcTimeoutMillis,\n maxRetries,\n };\n}\n/**\n * Creates a new {@link BundleOptions}.\n *\n * @private\n * @param {Object} options - An object to hold optional parameters. See\n * properties for the content of options.\n * @return {BundleOptions} - A new options.\n */\nfunction createBundleOptions(options) {\n const params = [\n 'element_count_threshold',\n 'element_count_limit',\n 'request_byte_threshold',\n 'request_byte_limit',\n 'delay_threshold_millis',\n ];\n params.forEach(param => {\n if (param in options && typeof options[param] !== 'number') {\n throw new Error(`${param} should be a number`);\n }\n });\n const elementCountThreshold = options.element_count_threshold || 0;\n const elementCountLimit = options.element_count_limit || 0;\n const requestByteThreshold = options.request_byte_threshold || 0;\n const requestByteLimit = options.request_byte_limit || 0;\n const delayThreshold = options.delay_threshold_millis || 0;\n if (elementCountThreshold === 0 &&\n requestByteThreshold === 0 &&\n delayThreshold === 0) {\n throw new Error('one threshold should be > 0');\n }\n return {\n elementCountThreshold,\n elementCountLimit,\n requestByteThreshold,\n requestByteLimit,\n delayThreshold,\n };\n}\n/**\n * Helper for {@link constructSettings}\n *\n * @private\n *\n * @param {Object} methodConfig - A dictionary representing a single\n * `methods` entry of the standard API client config file. (See\n * {@link constructSettings} for information on this yaml.)\n * @param {?Object} retryCodes - A dictionary parsed from the\n * `retry_codes_def` entry of the standard API client config\n * file. (See {@link constructSettings} for information on this yaml.)\n * @param {Object} retryParams - A dictionary parsed from the\n * `retry_params` entry of the standard API client config\n * file. (See {@link constructSettings} for information on this yaml.)\n * @param {Object} retryNames - A dictionary mapping the string names\n * used in the standard API client config file to API response\n * status codes.\n * @return {?RetryOptions} The new retry options.\n */\nfunction constructRetry(methodConfig, retryCodes, retryParams, retryNames) {\n if (!methodConfig) {\n return null;\n }\n let codes = null; // this is one instance where it will NOT be an array OR a function because we do not allow shouldRetryFn in the client\n if (retryCodes && 'retry_codes_name' in methodConfig) {\n const retryCodesName = methodConfig['retry_codes_name'];\n codes = (retryCodes[retryCodesName] || []).map(name => {\n return Number(retryNames[name]);\n });\n }\n let backoffSettings = null;\n if (retryParams && 'retry_params_name' in methodConfig) {\n const params = retryParams[methodConfig.retry_params_name];\n backoffSettings = createBackoffSettings(params.initial_retry_delay_millis, params.retry_delay_multiplier, params.max_retry_delay_millis, params.initial_rpc_timeout_millis, params.rpc_timeout_multiplier, params.max_rpc_timeout_millis, params.total_timeout_millis);\n }\n return createRetryOptions(codes, backoffSettings);\n}\n/**\n * Helper for {@link constructSettings}\n *\n * Takes two retry options, and merges them into a single RetryOption instance.\n *\n * @private\n *\n * @param {RetryOptions} retry - The base RetryOptions.\n * @param {RetryOptions} overrides - The RetryOptions used for overriding\n * `retry`. Use the values if it is not null. If entire `overrides` is null,\n * ignore the base retry and return null.\n * @return {?RetryOptions} The merged RetryOptions.\n */\nfunction mergeRetryOptions(retry, overrides) {\n if (!overrides) {\n return null;\n }\n if (!overrides.retryCodes &&\n !overrides.backoffSettings &&\n !overrides.shouldRetryFn &&\n !overrides.getResumptionRequestFn) {\n return retry;\n }\n const retryCodes = overrides.retryCodes\n ? overrides.retryCodes\n : retry.retryCodes;\n const backoffSettings = overrides.backoffSettings\n ? overrides.backoffSettings\n : retry.backoffSettings;\n const shouldRetryFn = overrides.shouldRetryFn\n ? overrides.shouldRetryFn\n : retry.shouldRetryFn;\n const getResumptionRequestFn = overrides.getResumptionRequestFn\n ? overrides.getResumptionRequestFn\n : retry.getResumptionRequestFn;\n return createRetryOptions(retryCodes, backoffSettings, shouldRetryFn, getResumptionRequestFn);\n}\n/**\n * Constructs a dictionary mapping method names to {@link CallSettings}.\n *\n * The `clientConfig` parameter is parsed from a client configuration JSON\n * file of the form:\n *\n * {\n * \"interfaces\": {\n * \"google.fake.v1.ServiceName\": {\n * \"retry_codes\": {\n * \"idempotent\": [\"UNAVAILABLE\", \"DEADLINE_EXCEEDED\"],\n * \"non_idempotent\": []\n * },\n * \"retry_params\": {\n * \"default\": {\n * \"initial_retry_delay_millis\": 100,\n * \"retry_delay_multiplier\": 1.2,\n * \"max_retry_delay_millis\": 1000,\n * \"initial_rpc_timeout_millis\": 2000,\n * \"rpc_timeout_multiplier\": 1.5,\n * \"max_rpc_timeout_millis\": 30000,\n * \"total_timeout_millis\": 45000\n * }\n * },\n * \"methods\": {\n * \"CreateFoo\": {\n * \"retry_codes_name\": \"idempotent\",\n * \"retry_params_name\": \"default\"\n * },\n * \"Publish\": {\n * \"retry_codes_name\": \"non_idempotent\",\n * \"retry_params_name\": \"default\",\n * \"bundling\": {\n * \"element_count_threshold\": 40,\n * \"element_count_limit\": 200,\n * \"request_byte_threshold\": 90000,\n * \"request_byte_limit\": 100000,\n * \"delay_threshold_millis\": 100\n * }\n * }\n * }\n * }\n * }\n * }\n *\n * @param {String} serviceName - The fully-qualified name of this\n * service, used as a key into the client config file (in the\n * example above, this value should be 'google.fake.v1.ServiceName').\n * @param {Object} clientConfig - A dictionary parsed from the\n * standard API client config file.\n * @param {Object} configOverrides - A dictionary in the same structure of\n * client_config to override the settings.\n * @param {Object.} retryNames - A dictionary mapping the strings\n * referring to response status codes to objects representing\n * those codes.\n * @param {Object} otherArgs - the non-request arguments to be passed to the API\n * calls.\n * @return {Object} A mapping from method name to CallSettings, or null if the\n * service is not found in the config.\n */\nfunction constructSettings(serviceName, clientConfig, configOverrides, retryNames, otherArgs) {\n otherArgs = otherArgs || {};\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const defaults = {};\n const serviceConfig = (clientConfig.interfaces || {})[serviceName];\n if (!serviceConfig) {\n return null;\n }\n // users can override the config from client side, like bundling options.\n // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/main/src/gax.ts#L546\n // The way to override bundling options:\n //\n // const customConfig = {\"interfaces\": {\"service\": {\"methods\": {\"methodName\": {\"bundling\": {..}}}}}}\n // const client = new Client({ projectId, customConfig });\n const overrides = (configOverrides.interfaces || {})[serviceName] || {};\n const methods = serviceConfig.methods;\n const overridingMethods = overrides.methods || {};\n for (const methodName in methods) {\n const methodConfig = methods[methodName];\n const jsName = (0, util_1.toLowerCamelCase)(methodName);\n let retry = constructRetry(methodConfig, serviceConfig.retry_codes, serviceConfig.retry_params, retryNames);\n let bundlingConfig = methodConfig.bundling;\n let timeout = methodConfig.timeout_millis;\n if (methodName in overridingMethods) {\n const overridingMethod = overridingMethods[methodName];\n if (overridingMethod) {\n if ('bundling' in overridingMethod) {\n bundlingConfig = overridingMethod.bundling;\n }\n if ('timeout_millis' in overridingMethod) {\n timeout = overridingMethod.timeout_millis;\n }\n }\n retry = mergeRetryOptions(retry, constructRetry(overridingMethod, overrides.retry_codes, overrides.retry_params, retryNames));\n }\n const apiName = serviceName;\n defaults[jsName] = new CallSettings({\n timeout,\n retry,\n bundleOptions: bundlingConfig\n ? createBundleOptions(bundlingConfig)\n : null,\n otherArgs,\n apiName,\n });\n }\n return defaults;\n}\nfunction createByteLengthFunction(message) {\n return function getByteLength(obj) {\n try {\n return message.encode(obj).finish().length;\n }\n catch (err) {\n const stringified = JSON.stringify(obj);\n (0, warnings_1.warn)('error_encoding_protobufjs_object', `Cannot encode protobuf.js object: ${stringified}: ${err}`);\n // We failed to encode the object properly, let's just return an upper boundary of its length.\n // It's only needed for calculating the size of the batch, so it's safe if it's bigger than needed.\n return stringified.length;\n }\n };\n}\n//# sourceMappingURL=gax.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GoogleProtoFilesRoot = exports.GrpcClient = exports.ClientStub = void 0;\nconst grpcProtoLoader = __importStar(require(\"@grpc/proto-loader\"));\nconst child_process_1 = require(\"child_process\");\nconst fs = __importStar(require(\"fs\"));\nconst google_auth_library_1 = require(\"google-auth-library\");\nconst grpc = __importStar(require(\"@grpc/grpc-js\"));\nconst os = __importStar(require(\"os\"));\nconst path_1 = require(\"path\");\nconst path = __importStar(require(\"path\"));\nconst protobuf = __importStar(require(\"protobufjs\"));\nconst object_hash_1 = __importDefault(require(\"object-hash\"));\nconst gax = __importStar(require(\"./gax\"));\nconst googleProtoFilesDir = path.join(__dirname, '..', '..', 'build', 'protos');\n// INCLUDE_DIRS is passed to @grpc/proto-loader\nconst INCLUDE_DIRS = [];\nINCLUDE_DIRS.push(googleProtoFilesDir);\n// COMMON_PROTO_FILES logic is here for protobufjs loads (see\n// GoogleProtoFilesRoot below)\nconst protosList_json_1 = __importDefault(require(\"./protosList.json\"));\n// use the correct path separator for the OS we are running on\nconst COMMON_PROTO_FILES = protosList_json_1.default.map(file => file.replace(/[/\\\\]/g, path.sep));\n/*\n * Async version of readFile.\n *\n * @returns {Promise} Contents of file at path.\n */\nasync function readFileAsync(path) {\n return new Promise((resolve, reject) => {\n fs.readFile(path, 'utf8', (err, content) => {\n if (err)\n return reject(err);\n else\n resolve(content);\n });\n });\n}\n/*\n * Async version of execFile.\n *\n * @returns {Promise} stdout from command execution.\n */\nasync function execFileAsync(command, args) {\n return new Promise((resolve, reject) => {\n (0, child_process_1.execFile)(command, args, (err, stdout) => {\n if (err)\n return reject(err);\n else\n resolve(stdout);\n });\n });\n}\nclass ClientStub extends grpc.Client {\n}\nexports.ClientStub = ClientStub;\nclass GrpcClient {\n auth;\n grpc;\n grpcVersion;\n fallback;\n static protoCache = new Map();\n httpRules;\n /**\n * Key for proto cache map. We are doing our best to make sure we respect\n * the options, so if the same proto file is loaded with different set of\n * options, the cache won't be used. Since some of the options are\n * Functions (e.g. `enums: String` - see below in `loadProto()`),\n * they will be omitted from the cache key. If the cache breaks anything\n * for you, use the `ignoreCache` parameter of `loadProto()` to disable it.\n */\n static protoCacheKey(filename, options) {\n if (!filename ||\n (Array.isArray(filename) && (filename.length === 0 || !filename[0]))) {\n return undefined;\n }\n return JSON.stringify(filename) + ' ' + JSON.stringify(options);\n }\n /**\n * In rare cases users might need to deallocate all memory consumed by loaded protos.\n * This method will delete the proto cache content.\n */\n static clearProtoCache() {\n GrpcClient.protoCache.clear();\n }\n /**\n * A class which keeps the context of gRPC and auth for the gRPC.\n *\n * @param {Object=} options - The optional parameters. It will be directly\n * passed to google-auth-library library, so parameters like keyFile or\n * credentials will be valid.\n * @param {Object=} options.auth - An instance of google-auth-library.\n * When specified, this auth instance will be used instead of creating\n * a new one.\n * @param {Object=} options.grpc - When specified, this will be used\n * for the 'grpc' module in this context. By default, it will load the grpc\n * module in the standard way.\n * @constructor\n */\n constructor(options = {}) {\n this.auth = options.auth || new google_auth_library_1.GoogleAuth(options);\n this.fallback = false;\n const minimumVersion = 10;\n const major = Number(process.version.match(/^v(\\d+)/)?.[1]);\n if (Number.isNaN(major) || major < minimumVersion) {\n const errorMessage = `Node.js v${minimumVersion}.0.0 is a minimum requirement. To learn about legacy version support visit: ` +\n 'https://github.com/googleapis/google-cloud-node#supported-nodejs-versions';\n throw new Error(errorMessage);\n }\n if ('grpc' in options) {\n this.grpc = options.grpc;\n this.grpcVersion = '';\n }\n else {\n this.grpc = grpc;\n this.grpcVersion = require('@grpc/grpc-js/package.json').version;\n }\n }\n /**\n * Creates a gRPC credentials. It asks the auth data if necessary.\n * @private\n * @param {Object} opts - options values for configuring credentials.\n * @param {Object=} opts.sslCreds - when specified, this is used instead\n * of default channel credentials.\n * @return {Promise} The promise which will be resolved to the gRPC credential.\n */\n async _getCredentials(opts) {\n if (opts.sslCreds) {\n return opts.sslCreds;\n }\n const grpc = this.grpc;\n const sslCreds = opts.cert && opts.key\n ? grpc.credentials.createSsl(null, Buffer.from(opts.key), Buffer.from(opts.cert))\n : grpc.credentials.createSsl();\n const client = await this.auth.getClient();\n const credentials = grpc.credentials.combineChannelCredentials(sslCreds, grpc.credentials.createFromGoogleCredential({\n // the `grpc` package does not support the `Headers` object yet\n getRequestHeaders: async (url) => {\n const headers = await client.getRequestHeaders(url);\n const genericHeadersObject = {};\n headers.forEach((value, key) => (genericHeadersObject[key] = value));\n return genericHeadersObject;\n },\n }));\n return credentials;\n }\n static defaultOptions() {\n // This set of @grpc/proto-loader options\n // 'closely approximates the existing behavior of grpc.load'\n const includeDirs = INCLUDE_DIRS.slice();\n const options = {\n keepCase: false,\n longs: String,\n enums: String,\n defaults: true,\n oneofs: true,\n includeDirs,\n };\n return options;\n }\n /**\n * Loads the gRPC service from the proto file(s) at the given path and with the\n * given options. Caches the loaded protos so the subsequent loads don't do\n * any disk reads.\n * @param filename The path to the proto file(s).\n * @param options Options for loading the proto file.\n * @param ignoreCache Defaults to `false`. Set it to `true` if the caching logic\n * incorrectly decides that the options object is the same, or if you want to\n * re-read the protos from disk for any other reason.\n */\n loadFromProto(filename, options, ignoreCache = false) {\n const cacheKey = GrpcClient.protoCacheKey(filename, options);\n let grpcPackage = cacheKey\n ? GrpcClient.protoCache.get(cacheKey)\n : undefined;\n if (ignoreCache || !grpcPackage) {\n const packageDef = grpcProtoLoader.loadSync(filename, options);\n grpcPackage = this.grpc.loadPackageDefinition(packageDef);\n if (cacheKey) {\n GrpcClient.protoCache.set(cacheKey, grpcPackage);\n }\n }\n return grpcPackage;\n }\n /**\n * Load gRPC proto service from a filename looking in googleapis common protos\n * when necessary. Caches the loaded protos so the subsequent loads don't do\n * any disk reads.\n * @param {String} protoPath - The directory to search for the protofile.\n * @param {String|String[]} filename - The filename(s) of the proto(s) to be loaded.\n * If omitted, protoPath will be treated as a file path to load.\n * @param ignoreCache Defaults to `false`. Set it to `true` if the caching logic\n * incorrectly decides that the options object is the same, or if you want to\n * re-read the protos from disk for any other reason.\n * @return {Object} The gRPC loaded result (the toplevel namespace\n * object).\n */\n loadProto(protoPath, filename, ignoreCache = false) {\n if (!filename) {\n filename = path.basename(protoPath);\n protoPath = path.dirname(protoPath);\n }\n if (Array.isArray(filename) && filename.length === 0) {\n return {};\n }\n const options = GrpcClient.defaultOptions();\n options.includeDirs.unshift(protoPath);\n return this.loadFromProto(filename, options, ignoreCache);\n }\n static _resolveFile(protoPath, filename) {\n if (fs.existsSync(path.join(protoPath, filename))) {\n return path.join(protoPath, filename);\n }\n else if (COMMON_PROTO_FILES.indexOf(filename) > -1) {\n return path.join(googleProtoFilesDir, filename);\n }\n throw new Error(filename + ' could not be found in ' + protoPath);\n }\n loadProtoJSON(json, ignoreCache = false) {\n const hash = (0, object_hash_1.default)(JSON.stringify(json)).toString();\n const cached = GrpcClient.protoCache.get(hash);\n if (cached && !ignoreCache) {\n return cached;\n }\n const options = GrpcClient.defaultOptions();\n const packageDefinition = grpcProtoLoader.fromJSON(json, options);\n const grpcPackage = this.grpc.loadPackageDefinition(packageDefinition);\n GrpcClient.protoCache.set(hash, grpcPackage);\n return grpcPackage;\n }\n metadataBuilder(headers) {\n const Metadata = this.grpc.Metadata;\n const baseMetadata = new Metadata();\n for (const key in headers) {\n const value = headers[key];\n if (Array.isArray(value)) {\n value.forEach(v => baseMetadata.add(key, v));\n }\n else {\n baseMetadata.set(key, `${value}`);\n }\n }\n return function buildMetadata(abTests, moreHeaders) {\n // TODO: bring the A/B testing info into the metadata.\n let copied = false;\n let metadata = baseMetadata;\n if (moreHeaders) {\n for (const key in moreHeaders) {\n if (key.toLowerCase() !== 'x-goog-api-client') {\n if (!copied) {\n copied = true;\n metadata = metadata.clone();\n }\n const value = moreHeaders[key];\n if (Array.isArray(value)) {\n value.forEach(v => metadata.add(key, v));\n }\n else {\n metadata.set(key, `${value}`);\n }\n }\n }\n }\n return metadata;\n };\n }\n /**\n * A wrapper of {@link constructSettings} function under the gRPC context.\n *\n * Most of parameters are common among constructSettings, please take a look.\n * @param {string} serviceName - The fullly-qualified name of the service.\n * @param {Object} clientConfig - A dictionary of the client config.\n * @param {Object} configOverrides - A dictionary of overriding configs.\n * @param {Object} headers - A dictionary of additional HTTP header name to\n * its value.\n * @return {Object} A mapping of method names to CallSettings.\n */\n constructSettings(serviceName, clientConfig, configOverrides, headers) {\n return gax.constructSettings(serviceName, clientConfig, configOverrides, this.grpc.status, { metadataBuilder: this.metadataBuilder(headers) });\n }\n /**\n * Creates a gRPC stub with current gRPC and auth.\n * @param {function} CreateStub - The constructor function of the stub.\n * @param {Object} options - The optional arguments to customize\n * gRPC connection. This options will be passed to the constructor of\n * gRPC client too.\n * @param {string} options.servicePath - The name of the server of the service.\n * @param {number} options.port - The port of the service.\n * @param {grpcTypes.ClientCredentials=} options.sslCreds - The credentials to be used\n * to set up gRPC connection.\n * @param {string} defaultServicePath - The default service path.\n * @return {Promise} A promise which resolves to a gRPC stub instance.\n */\n async createStub(CreateStub, options, customServicePath) {\n // The following options are understood by grpc-gcp and need a special treatment\n // (should be passed without a `grpc.` prefix)\n const grpcGcpOptions = [\n 'grpc.callInvocationTransformer',\n 'grpc.channelFactoryOverride',\n 'grpc.gcpApiConfig',\n ];\n const [cert, key] = await this._detectClientCertificate(options, options.universeDomain);\n const servicePath = this._mtlsServicePath(options.servicePath, customServicePath, cert && key);\n const opts = Object.assign({}, options, { cert, key, servicePath });\n const serviceAddress = servicePath + ':' + opts.port;\n if (!options.universeDomain) {\n options.universeDomain = 'googleapis.com';\n }\n if (options.universeDomain) {\n const universeFromAuth = await this.auth.getUniverseDomain();\n if (universeFromAuth && options.universeDomain !== universeFromAuth) {\n throw new Error(`The configured universe domain (${options.universeDomain}) does not match the universe domain found in the credentials (${universeFromAuth}). ` +\n \"If you haven't configured the universe domain explicitly, googleapis.com is the default.\");\n }\n }\n const creds = await this._getCredentials(opts);\n const grpcOptions = {};\n // @grpc/grpc-js limits max receive/send message length starting from v0.8.0\n // https://github.com/grpc/grpc-node/releases/tag/%40grpc%2Fgrpc-js%400.8.0\n // To keep the existing behavior and avoid libraries breakage, we pass -1 there as suggested.\n grpcOptions['grpc.max_receive_message_length'] = -1;\n grpcOptions['grpc.max_send_message_length'] = -1;\n grpcOptions['grpc.initial_reconnect_backoff_ms'] = 1000;\n Object.keys(opts).forEach(key => {\n const value = options[key];\n // the older versions had a bug which required users to call an option\n // grpc.grpc.* to make it actually pass to gRPC as grpc.*, let's handle\n // this here until the next major release\n if (key.startsWith('grpc.grpc.')) {\n key = key.replace(/^grpc\\./, '');\n }\n if (key.startsWith('grpc.')) {\n if (grpcGcpOptions.includes(key)) {\n key = key.replace(/^grpc\\./, '');\n }\n grpcOptions[key] = value;\n }\n if (key.startsWith('grpc-node.')) {\n grpcOptions[key] = value;\n }\n });\n const stub = new CreateStub(serviceAddress, creds, grpcOptions);\n return stub;\n }\n /**\n * Detect mTLS client certificate based on logic described in\n * https://google.aip.dev/auth/4114.\n *\n * @param {object} [options] - The configuration object.\n * @returns {Promise} Resolves array of strings representing cert and key.\n */\n async _detectClientCertificate(opts, universeDomain) {\n const certRegex = /(?-----BEGIN CERTIFICATE-----.*?-----END CERTIFICATE-----)/s;\n const keyRegex = /(?-----BEGIN PRIVATE KEY-----.*?-----END PRIVATE KEY-----)/s;\n // If GOOGLE_API_USE_CLIENT_CERTIFICATE is true...:\n if (typeof process !== 'undefined' &&\n process?.env?.GOOGLE_API_USE_CLIENT_CERTIFICATE === 'true') {\n if (universeDomain && universeDomain !== 'googleapis.com') {\n throw new Error('mTLS is not supported outside of googleapis.com universe domain.');\n }\n if (opts?.cert && opts?.key) {\n return [opts.cert, opts.key];\n }\n // If context aware metadata exists, run the cert provider command,\n // parse the output to extract cert and key, and use this cert/key.\n const metadataPath = (0, path_1.join)(os.homedir(), '.secureConnect', 'context_aware_metadata.json');\n const metadata = JSON.parse(await readFileAsync(metadataPath));\n if (!metadata.cert_provider_command) {\n throw Error('no cert_provider_command found');\n }\n const stdout = await execFileAsync(metadata.cert_provider_command[0], metadata.cert_provider_command.slice(1));\n const matchCert = stdout.toString().match(certRegex);\n const matchKey = stdout.toString().match(keyRegex);\n if (!(matchCert?.groups && matchKey?.groups)) {\n throw Error('unable to parse certificate and key');\n }\n else {\n return [matchCert.groups.cert, matchKey.groups.key];\n }\n }\n // If GOOGLE_API_USE_CLIENT_CERTIFICATE is not set or false,\n // use no cert or key:\n return [undefined, undefined];\n }\n /**\n * Return service path, taking into account mTLS logic.\n * See: https://google.aip.dev/auth/4114\n *\n * @param {string|undefined} servicePath - The path of the service.\n * @param {string|undefined} customServicePath - Did the user provide a custom service URL.\n * @param {boolean} hasCertificate - Was a certificate found.\n * @returns {string} The DNS address for this service.\n */\n _mtlsServicePath(servicePath, customServicePath, hasCertificate) {\n // If user provides a custom service path, return the current service\n // path and do not attempt to add mtls subdomain:\n if (customServicePath || !servicePath)\n return servicePath;\n if (typeof process !== 'undefined' &&\n process?.env?.GOOGLE_API_USE_MTLS_ENDPOINT === 'never') {\n // It was explicitly asked that mtls endpoint not be used:\n return servicePath;\n }\n else if ((typeof process !== 'undefined' &&\n process?.env?.GOOGLE_API_USE_MTLS_ENDPOINT === 'always') ||\n hasCertificate) {\n // Either auto-detect or explicit setting of endpoint:\n return servicePath.replace('googleapis.com', 'mtls.googleapis.com');\n }\n return servicePath;\n }\n /**\n * Creates a 'bytelength' function for a given proto message class.\n *\n * See {@link BundleDescriptor} about the meaning of the return value.\n *\n * @param {function} message - a constructor function that is generated by\n * protobuf.js. Assumes 'encoder' field in the message.\n * @return {function(Object):number} - a function to compute the byte length\n * for an object.\n */\n static createByteLengthFunction(message) {\n return gax.createByteLengthFunction(message);\n }\n}\nexports.GrpcClient = GrpcClient;\nclass GoogleProtoFilesRoot extends protobuf.Root {\n constructor(...args) {\n super(...args);\n }\n // Causes the loading of an included proto to check if it is a common\n // proto. If it is a common proto, use the bundled proto.\n resolvePath(originPath, includePath) {\n originPath = path.normalize(originPath);\n includePath = path.normalize(includePath);\n // Fully qualified paths don't need to be resolved.\n if (path.isAbsolute(includePath)) {\n if (!fs.existsSync(includePath)) {\n throw new Error('The include `' + includePath + '` was not found.');\n }\n return includePath;\n }\n if (COMMON_PROTO_FILES.indexOf(includePath) > -1) {\n return path.join(googleProtoFilesDir, includePath);\n }\n return GoogleProtoFilesRoot._findIncludePath(originPath, includePath);\n }\n static _findIncludePath(originPath, includePath) {\n originPath = path.normalize(originPath);\n includePath = path.normalize(includePath);\n let current = originPath;\n let found = fs.existsSync(path.join(current, includePath));\n while (!found && current.length > 0) {\n current = current.substring(0, current.lastIndexOf(path.sep));\n found = fs.existsSync(path.join(current, includePath));\n }\n if (!found) {\n throw new Error('The include `' + includePath + '` was not found.');\n }\n return path.join(current, includePath);\n }\n}\nexports.GoogleProtoFilesRoot = GoogleProtoFilesRoot;\n//# sourceMappingURL=grpc.js.map","// minimal library entry point.\n\n\"use strict\";\nmodule.exports = require(\"./src/index-minimal\");\n","(e=>{\"function\"==typeof define&&define.amd?define([\"protobufjs/minimal\"],e):\"function\"==typeof require&&\"object\"==typeof module&&module&&module.exports&&(module.exports=e(require(\"protobufjs/minimal\")))})(function(o){var e,t,n,r,F,a=o.Reader,i=o.Writer,p=o.util,l=o.roots.iam_protos||(o.roots.iam_protos={});function B(e,t,n){o.rpc.Service.call(this,e,t,n)}function s(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:o.resource=e.string();break;case 2:o.policy=l.google.iam.v1.Policy.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},s.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},s.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.resource&&e.hasOwnProperty(\"resource\")&&!p.isString(e.resource))return\"resource: string expected\";if(null!=e.policy&&e.hasOwnProperty(\"policy\")){e=l.google.iam.v1.Policy.verify(e.policy);if(e)return\"policy.\"+e}return null},s.fromObject=function(e){if(e instanceof l.google.iam.v1.SetIamPolicyRequest)return e;var t=new l.google.iam.v1.SetIamPolicyRequest;if(null!=e.resource&&(t.resource=String(e.resource)),null!=e.policy){if(\"object\"!=typeof e.policy)throw TypeError(\".google.iam.v1.SetIamPolicyRequest.policy: object expected\");t.policy=l.google.iam.v1.Policy.fromObject(e.policy)}return t},s.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.resource=\"\",n.policy=null),null!=e.resource&&e.hasOwnProperty(\"resource\")&&(n.resource=e.resource),null!=e.policy&&e.hasOwnProperty(\"policy\")&&(n.policy=l.google.iam.v1.Policy.toObject(e.policy,t)),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},s),t.GetIamPolicyRequest=(u.prototype.resource=\"\",u.prototype.options=null,u.create=function(e){return new u(e)},u.encode=function(e,t){return t=t||i.create(),null!=e.resource&&Object.hasOwnProperty.call(e,\"resource\")&&t.uint32(10).string(e.resource),null!=e.options&&Object.hasOwnProperty.call(e,\"options\")&&l.google.iam.v1.GetPolicyOptions.encode(e.options,t.uint32(18).fork()).ldelim(),t},u.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},u.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new l.google.iam.v1.GetIamPolicyRequest;e.pos>>3){case 1:o.resource=e.string();break;case 2:o.options=l.google.iam.v1.GetPolicyOptions.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},u.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},u.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.resource&&e.hasOwnProperty(\"resource\")&&!p.isString(e.resource))return\"resource: string expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){e=l.google.iam.v1.GetPolicyOptions.verify(e.options);if(e)return\"options.\"+e}return null},u.fromObject=function(e){if(e instanceof l.google.iam.v1.GetIamPolicyRequest)return e;var t=new l.google.iam.v1.GetIamPolicyRequest;if(null!=e.resource&&(t.resource=String(e.resource)),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.iam.v1.GetIamPolicyRequest.options: object expected\");t.options=l.google.iam.v1.GetPolicyOptions.fromObject(e.options)}return t},u.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.resource=\"\",n.options=null),null!=e.resource&&e.hasOwnProperty(\"resource\")&&(n.resource=e.resource),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=l.google.iam.v1.GetPolicyOptions.toObject(e.options,t)),n},u.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},u),t.TestIamPermissionsRequest=(c.prototype.resource=\"\",c.prototype.permissions=p.emptyArray,c.create=function(e){return new c(e)},c.encode=function(e,t){if(t=t||i.create(),null!=e.resource&&Object.hasOwnProperty.call(e,\"resource\")&&t.uint32(10).string(e.resource),null!=e.permissions&&e.permissions.length)for(var n=0;n>>3){case 1:o.resource=e.string();break;case 2:o.permissions&&o.permissions.length||(o.permissions=[]),o.permissions.push(e.string());break;default:e.skipType(7&r)}}return o},c.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},c.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.resource&&e.hasOwnProperty(\"resource\")&&!p.isString(e.resource))return\"resource: string expected\";if(null!=e.permissions&&e.hasOwnProperty(\"permissions\")){if(!Array.isArray(e.permissions))return\"permissions: array expected\";for(var t=0;t>>3==1?(o.permissions&&o.permissions.length||(o.permissions=[]),o.permissions.push(e.string())):e.skipType(7&r)}return o},G.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},G.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.permissions&&e.hasOwnProperty(\"permissions\")){if(!Array.isArray(e.permissions))return\"permissions: array expected\";for(var t=0;t>>3==1?o.requestedPolicyVersion=e.int32():e.skipType(7&r)}return o},U.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},U.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.requestedPolicyVersion&&e.hasOwnProperty(\"requestedPolicyVersion\")&&!p.isInteger(e.requestedPolicyVersion)?\"requestedPolicyVersion: integer expected\":null},U.fromObject=function(e){var t;return e instanceof l.google.iam.v1.GetPolicyOptions?e:(t=new l.google.iam.v1.GetPolicyOptions,null!=e.requestedPolicyVersion&&(t.requestedPolicyVersion=0|e.requestedPolicyVersion),t)},U.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.requestedPolicyVersion=0),null!=e.requestedPolicyVersion&&e.hasOwnProperty(\"requestedPolicyVersion\")&&(n.requestedPolicyVersion=e.requestedPolicyVersion),n},U.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},U),t.Policy=(d.prototype.version=0,d.prototype.bindings=p.emptyArray,d.prototype.etag=p.newBuffer([]),d.create=function(e){return new d(e)},d.encode=function(e,t){if(t=t||i.create(),null!=e.version&&Object.hasOwnProperty.call(e,\"version\")&&t.uint32(8).int32(e.version),null!=e.etag&&Object.hasOwnProperty.call(e,\"etag\")&&t.uint32(26).bytes(e.etag),null!=e.bindings&&e.bindings.length)for(var n=0;n>>3){case 1:o.version=e.int32();break;case 4:o.bindings&&o.bindings.length||(o.bindings=[]),o.bindings.push(l.google.iam.v1.Binding.decode(e,e.uint32()));break;case 3:o.etag=e.bytes();break;default:e.skipType(7&r)}}return o},d.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},d.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.version&&e.hasOwnProperty(\"version\")&&!p.isInteger(e.version))return\"version: integer expected\";if(null!=e.bindings&&e.hasOwnProperty(\"bindings\")){if(!Array.isArray(e.bindings))return\"bindings: array expected\";for(var t=0;t>>3){case 1:o.role=e.string();break;case 2:o.members&&o.members.length||(o.members=[]),o.members.push(e.string());break;case 3:o.condition=l.google.type.Expr.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},g.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},g.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.role&&e.hasOwnProperty(\"role\")&&!p.isString(e.role))return\"role: string expected\";if(null!=e.members&&e.hasOwnProperty(\"members\")){if(!Array.isArray(e.members))return\"members: array expected\";for(var t=0;t>>3){case 1:o.bindingDeltas&&o.bindingDeltas.length||(o.bindingDeltas=[]),o.bindingDeltas.push(l.google.iam.v1.BindingDelta.decode(e,e.uint32()));break;case 2:o.auditConfigDeltas&&o.auditConfigDeltas.length||(o.auditConfigDeltas=[]),o.auditConfigDeltas.push(l.google.iam.v1.AuditConfigDelta.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},M.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},M.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.bindingDeltas&&e.hasOwnProperty(\"bindingDeltas\")){if(!Array.isArray(e.bindingDeltas))return\"bindingDeltas: array expected\";for(var t=0;t>>3){case 1:o.action=e.int32();break;case 2:o.role=e.string();break;case 3:o.member=e.string();break;case 4:o.condition=l.google.type.Expr.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},f.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},f.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.action&&e.hasOwnProperty(\"action\"))switch(e.action){default:return\"action: enum value expected\";case 0:case 1:case 2:}if(null!=e.role&&e.hasOwnProperty(\"role\")&&!p.isString(e.role))return\"role: string expected\";if(null!=e.member&&e.hasOwnProperty(\"member\")&&!p.isString(e.member))return\"member: string expected\";if(null!=e.condition&&e.hasOwnProperty(\"condition\")){e=l.google.type.Expr.verify(e.condition);if(e)return\"condition.\"+e}return null},f.fromObject=function(e){if(e instanceof l.google.iam.v1.BindingDelta)return e;var t=new l.google.iam.v1.BindingDelta;switch(e.action){case\"ACTION_UNSPECIFIED\":case 0:t.action=0;break;case\"ADD\":case 1:t.action=1;break;case\"REMOVE\":case 2:t.action=2}if(null!=e.role&&(t.role=String(e.role)),null!=e.member&&(t.member=String(e.member)),null!=e.condition){if(\"object\"!=typeof e.condition)throw TypeError(\".google.iam.v1.BindingDelta.condition: object expected\");t.condition=l.google.type.Expr.fromObject(e.condition)}return t},f.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.action=t.enums===String?\"ACTION_UNSPECIFIED\":0,n.role=\"\",n.member=\"\",n.condition=null),null!=e.action&&e.hasOwnProperty(\"action\")&&(n.action=t.enums===String?l.google.iam.v1.BindingDelta.Action[e.action]:e.action),null!=e.role&&e.hasOwnProperty(\"role\")&&(n.role=e.role),null!=e.member&&e.hasOwnProperty(\"member\")&&(n.member=e.member),null!=e.condition&&e.hasOwnProperty(\"condition\")&&(n.condition=l.google.type.Expr.toObject(e.condition,t)),n},f.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},f.Action=(e={},(r=Object.create(e))[e[0]=\"ACTION_UNSPECIFIED\"]=0,r[e[1]=\"ADD\"]=1,r[e[2]=\"REMOVE\"]=2,r),f),t.AuditConfigDelta=(y.prototype.action=0,y.prototype.service=\"\",y.prototype.exemptedMember=\"\",y.prototype.logType=\"\",y.create=function(e){return new y(e)},y.encode=function(e,t){return t=t||i.create(),null!=e.action&&Object.hasOwnProperty.call(e,\"action\")&&t.uint32(8).int32(e.action),null!=e.service&&Object.hasOwnProperty.call(e,\"service\")&&t.uint32(18).string(e.service),null!=e.exemptedMember&&Object.hasOwnProperty.call(e,\"exemptedMember\")&&t.uint32(26).string(e.exemptedMember),null!=e.logType&&Object.hasOwnProperty.call(e,\"logType\")&&t.uint32(34).string(e.logType),t},y.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},y.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new l.google.iam.v1.AuditConfigDelta;e.pos>>3){case 1:o.action=e.int32();break;case 2:o.service=e.string();break;case 3:o.exemptedMember=e.string();break;case 4:o.logType=e.string();break;default:e.skipType(7&r)}}return o},y.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},y.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.action&&e.hasOwnProperty(\"action\"))switch(e.action){default:return\"action: enum value expected\";case 0:case 1:case 2:}return null!=e.service&&e.hasOwnProperty(\"service\")&&!p.isString(e.service)?\"service: string expected\":null!=e.exemptedMember&&e.hasOwnProperty(\"exemptedMember\")&&!p.isString(e.exemptedMember)?\"exemptedMember: string expected\":null!=e.logType&&e.hasOwnProperty(\"logType\")&&!p.isString(e.logType)?\"logType: string expected\":null},y.fromObject=function(e){if(e instanceof l.google.iam.v1.AuditConfigDelta)return e;var t=new l.google.iam.v1.AuditConfigDelta;switch(e.action){case\"ACTION_UNSPECIFIED\":case 0:t.action=0;break;case\"ADD\":case 1:t.action=1;break;case\"REMOVE\":case 2:t.action=2}return null!=e.service&&(t.service=String(e.service)),null!=e.exemptedMember&&(t.exemptedMember=String(e.exemptedMember)),null!=e.logType&&(t.logType=String(e.logType)),t},y.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.action=t.enums===String?\"ACTION_UNSPECIFIED\":0,n.service=\"\",n.exemptedMember=\"\",n.logType=\"\"),null!=e.action&&e.hasOwnProperty(\"action\")&&(n.action=t.enums===String?l.google.iam.v1.AuditConfigDelta.Action[e.action]:e.action),null!=e.service&&e.hasOwnProperty(\"service\")&&(n.service=e.service),null!=e.exemptedMember&&e.hasOwnProperty(\"exemptedMember\")&&(n.exemptedMember=e.exemptedMember),null!=e.logType&&e.hasOwnProperty(\"logType\")&&(n.logType=e.logType),n},y.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},y.Action=(e={},(r=Object.create(e))[e[0]=\"ACTION_UNSPECIFIED\"]=0,r[e[1]=\"ADD\"]=1,r[e[2]=\"REMOVE\"]=2,r),y),t.logging=((e={}).AuditData=(L.prototype.policyDelta=null,L.create=function(e){return new L(e)},L.encode=function(e,t){return t=t||i.create(),null!=e.policyDelta&&Object.hasOwnProperty.call(e,\"policyDelta\")&&l.google.iam.v1.PolicyDelta.encode(e.policyDelta,t.uint32(18).fork()).ldelim(),t},L.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},L.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new l.google.iam.v1.logging.AuditData;e.pos>>3==2?o.policyDelta=l.google.iam.v1.PolicyDelta.decode(e,e.uint32()):e.skipType(7&r)}return o},L.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},L.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.policyDelta&&e.hasOwnProperty(\"policyDelta\")){e=l.google.iam.v1.PolicyDelta.verify(e.policyDelta);if(e)return\"policyDelta.\"+e}return null},L.fromObject=function(e){if(e instanceof l.google.iam.v1.logging.AuditData)return e;var t=new l.google.iam.v1.logging.AuditData;if(null!=e.policyDelta){if(\"object\"!=typeof e.policyDelta)throw TypeError(\".google.iam.v1.logging.AuditData.policyDelta: object expected\");t.policyDelta=l.google.iam.v1.PolicyDelta.fromObject(e.policyDelta)}return t},L.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.policyDelta=null),null!=e.policyDelta&&e.hasOwnProperty(\"policyDelta\")&&(n.policyDelta=l.google.iam.v1.PolicyDelta.toObject(e.policyDelta,t)),n},L.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},L),e),t),n),F.api=((r={}).Http=(J.prototype.rules=p.emptyArray,J.prototype.fullyDecodeReservedExpansion=!1,J.create=function(e){return new J(e)},J.encode=function(e,t){if(t=t||i.create(),null!=e.rules&&e.rules.length)for(var n=0;n>>3){case 1:o.rules&&o.rules.length||(o.rules=[]),o.rules.push(l.google.api.HttpRule.decode(e,e.uint32()));break;case 2:o.fullyDecodeReservedExpansion=e.bool();break;default:e.skipType(7&r)}}return o},J.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},J.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.rules&&e.hasOwnProperty(\"rules\")){if(!Array.isArray(e.rules))return\"rules: array expected\";for(var t=0;t>>3){case 1:o.selector=e.string();break;case 2:o.get=e.string();break;case 3:o.put=e.string();break;case 4:o.post=e.string();break;case 5:o.delete=e.string();break;case 6:o.patch=e.string();break;case 8:o.custom=l.google.api.CustomHttpPattern.decode(e,e.uint32());break;case 7:o.body=e.string();break;case 12:o.responseBody=e.string();break;case 11:o.additionalBindings&&o.additionalBindings.length||(o.additionalBindings=[]),o.additionalBindings.push(l.google.api.HttpRule.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},h.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},h.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";var t={};if(null!=e.selector&&e.hasOwnProperty(\"selector\")&&!p.isString(e.selector))return\"selector: string expected\";if(null!=e.get&&e.hasOwnProperty(\"get\")&&(t.pattern=1,!p.isString(e.get)))return\"get: string expected\";if(null!=e.put&&e.hasOwnProperty(\"put\")){if(1===t.pattern)return\"pattern: multiple values\";if(t.pattern=1,!p.isString(e.put))return\"put: string expected\"}if(null!=e.post&&e.hasOwnProperty(\"post\")){if(1===t.pattern)return\"pattern: multiple values\";if(t.pattern=1,!p.isString(e.post))return\"post: string expected\"}if(null!=e.delete&&e.hasOwnProperty(\"delete\")){if(1===t.pattern)return\"pattern: multiple values\";if(t.pattern=1,!p.isString(e.delete))return\"delete: string expected\"}if(null!=e.patch&&e.hasOwnProperty(\"patch\")){if(1===t.pattern)return\"pattern: multiple values\";if(t.pattern=1,!p.isString(e.patch))return\"patch: string expected\"}if(null!=e.custom&&e.hasOwnProperty(\"custom\")){if(1===t.pattern)return\"pattern: multiple values\";if(t.pattern=1,n=l.google.api.CustomHttpPattern.verify(e.custom))return\"custom.\"+n}if(null!=e.body&&e.hasOwnProperty(\"body\")&&!p.isString(e.body))return\"body: string expected\";if(null!=e.responseBody&&e.hasOwnProperty(\"responseBody\")&&!p.isString(e.responseBody))return\"responseBody: string expected\";if(null!=e.additionalBindings&&e.hasOwnProperty(\"additionalBindings\")){if(!Array.isArray(e.additionalBindings))return\"additionalBindings: array expected\";for(var n,o=0;o>>3){case 1:o.kind=e.string();break;case 2:o.path=e.string();break;default:e.skipType(7&r)}}return o},_.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},_.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.kind&&e.hasOwnProperty(\"kind\")&&!p.isString(e.kind)?\"kind: string expected\":null!=e.path&&e.hasOwnProperty(\"path\")&&!p.isString(e.path)?\"path: string expected\":null},_.fromObject=function(e){var t;return e instanceof l.google.api.CustomHttpPattern?e:(t=new l.google.api.CustomHttpPattern,null!=e.kind&&(t.kind=String(e.kind)),null!=e.path&&(t.path=String(e.path)),t)},_.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.kind=\"\",n.path=\"\"),null!=e.kind&&e.hasOwnProperty(\"kind\")&&(n.kind=e.kind),null!=e.path&&e.hasOwnProperty(\"path\")&&(n.path=e.path),n},_.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},_),r.FieldBehavior=(e={},(t=Object.create(e))[e[0]=\"FIELD_BEHAVIOR_UNSPECIFIED\"]=0,t[e[1]=\"OPTIONAL\"]=1,t[e[2]=\"REQUIRED\"]=2,t[e[3]=\"OUTPUT_ONLY\"]=3,t[e[4]=\"INPUT_ONLY\"]=4,t[e[5]=\"IMMUTABLE\"]=5,t),r.ResourceDescriptor=(b.prototype.type=\"\",b.prototype.pattern=p.emptyArray,b.prototype.nameField=\"\",b.prototype.history=0,b.prototype.plural=\"\",b.prototype.singular=\"\",b.create=function(e){return new b(e)},b.encode=function(e,t){if(t=t||i.create(),null!=e.type&&Object.hasOwnProperty.call(e,\"type\")&&t.uint32(10).string(e.type),null!=e.pattern&&e.pattern.length)for(var n=0;n>>3){case 1:o.type=e.string();break;case 2:o.pattern&&o.pattern.length||(o.pattern=[]),o.pattern.push(e.string());break;case 3:o.nameField=e.string();break;case 4:o.history=e.int32();break;case 5:o.plural=e.string();break;case 6:o.singular=e.string();break;default:e.skipType(7&r)}}return o},b.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},b.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.type&&e.hasOwnProperty(\"type\")&&!p.isString(e.type))return\"type: string expected\";if(null!=e.pattern&&e.hasOwnProperty(\"pattern\")){if(!Array.isArray(e.pattern))return\"pattern: array expected\";for(var t=0;t>>3){case 1:o.type=e.string();break;case 2:o.childType=e.string();break;default:e.skipType(7&r)}}return o},H.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},H.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.type&&e.hasOwnProperty(\"type\")&&!p.isString(e.type)?\"type: string expected\":null!=e.childType&&e.hasOwnProperty(\"childType\")&&!p.isString(e.childType)?\"childType: string expected\":null},H.fromObject=function(e){var t;return e instanceof l.google.api.ResourceReference?e:(t=new l.google.api.ResourceReference,null!=e.type&&(t.type=String(e.type)),null!=e.childType&&(t.childType=String(e.childType)),t)},H.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.type=\"\",n.childType=\"\"),null!=e.type&&e.hasOwnProperty(\"type\")&&(n.type=e.type),null!=e.childType&&e.hasOwnProperty(\"childType\")&&(n.childType=e.childType),n},H.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},H),r),F.protobuf=((n={}).FileDescriptorSet=(q.prototype.file=p.emptyArray,q.create=function(e){return new q(e)},q.encode=function(e,t){if(t=t||i.create(),null!=e.file&&e.file.length)for(var n=0;n>>3==1?(o.file&&o.file.length||(o.file=[]),o.file.push(l.google.protobuf.FileDescriptorProto.decode(e,e.uint32()))):e.skipType(7&r)}return o},q.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},q.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.file&&e.hasOwnProperty(\"file\")){if(!Array.isArray(e.file))return\"file: array expected\";for(var t=0;t>>3){case 1:o.name=e.string();break;case 2:o.package=e.string();break;case 3:o.dependency&&o.dependency.length||(o.dependency=[]),o.dependency.push(e.string());break;case 10:if(o.publicDependency&&o.publicDependency.length||(o.publicDependency=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos>>3){case 1:o.name=e.string();break;case 2:o.field&&o.field.length||(o.field=[]),o.field.push(l.google.protobuf.FieldDescriptorProto.decode(e,e.uint32()));break;case 6:o.extension&&o.extension.length||(o.extension=[]),o.extension.push(l.google.protobuf.FieldDescriptorProto.decode(e,e.uint32()));break;case 3:o.nestedType&&o.nestedType.length||(o.nestedType=[]),o.nestedType.push(l.google.protobuf.DescriptorProto.decode(e,e.uint32()));break;case 4:o.enumType&&o.enumType.length||(o.enumType=[]),o.enumType.push(l.google.protobuf.EnumDescriptorProto.decode(e,e.uint32()));break;case 5:o.extensionRange&&o.extensionRange.length||(o.extensionRange=[]),o.extensionRange.push(l.google.protobuf.DescriptorProto.ExtensionRange.decode(e,e.uint32()));break;case 8:o.oneofDecl&&o.oneofDecl.length||(o.oneofDecl=[]),o.oneofDecl.push(l.google.protobuf.OneofDescriptorProto.decode(e,e.uint32()));break;case 7:o.options=l.google.protobuf.MessageOptions.decode(e,e.uint32());break;case 9:o.reservedRange&&o.reservedRange.length||(o.reservedRange=[]),o.reservedRange.push(l.google.protobuf.DescriptorProto.ReservedRange.decode(e,e.uint32()));break;case 10:o.reservedName&&o.reservedName.length||(o.reservedName=[]),o.reservedName.push(e.string());break;default:e.skipType(7&r)}}return o},O.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},O.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!p.isString(e.name))return\"name: string expected\";if(null!=e.field&&e.hasOwnProperty(\"field\")){if(!Array.isArray(e.field))return\"field: array expected\";for(var t=0;t>>3){case 1:o.start=e.int32();break;case 2:o.end=e.int32();break;case 3:o.options=l.google.protobuf.ExtensionRangeOptions.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},v.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},v.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.start&&e.hasOwnProperty(\"start\")&&!p.isInteger(e.start))return\"start: integer expected\";if(null!=e.end&&e.hasOwnProperty(\"end\")&&!p.isInteger(e.end))return\"end: integer expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){e=l.google.protobuf.ExtensionRangeOptions.verify(e.options);if(e)return\"options.\"+e}return null},v.fromObject=function(e){if(e instanceof l.google.protobuf.DescriptorProto.ExtensionRange)return e;var t=new l.google.protobuf.DescriptorProto.ExtensionRange;if(null!=e.start&&(t.start=0|e.start),null!=e.end&&(t.end=0|e.end),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.protobuf.DescriptorProto.ExtensionRange.options: object expected\");t.options=l.google.protobuf.ExtensionRangeOptions.fromObject(e.options)}return t},v.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.start=0,n.end=0,n.options=null),null!=e.start&&e.hasOwnProperty(\"start\")&&(n.start=e.start),null!=e.end&&e.hasOwnProperty(\"end\")&&(n.end=e.end),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=l.google.protobuf.ExtensionRangeOptions.toObject(e.options,t)),n},v.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},v),O.ReservedRange=(Y.prototype.start=0,Y.prototype.end=0,Y.create=function(e){return new Y(e)},Y.encode=function(e,t){return t=t||i.create(),null!=e.start&&Object.hasOwnProperty.call(e,\"start\")&&t.uint32(8).int32(e.start),null!=e.end&&Object.hasOwnProperty.call(e,\"end\")&&t.uint32(16).int32(e.end),t},Y.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},Y.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new l.google.protobuf.DescriptorProto.ReservedRange;e.pos>>3){case 1:o.start=e.int32();break;case 2:o.end=e.int32();break;default:e.skipType(7&r)}}return o},Y.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},Y.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.start&&e.hasOwnProperty(\"start\")&&!p.isInteger(e.start)?\"start: integer expected\":null!=e.end&&e.hasOwnProperty(\"end\")&&!p.isInteger(e.end)?\"end: integer expected\":null},Y.fromObject=function(e){var t;return e instanceof l.google.protobuf.DescriptorProto.ReservedRange?e:(t=new l.google.protobuf.DescriptorProto.ReservedRange,null!=e.start&&(t.start=0|e.start),null!=e.end&&(t.end=0|e.end),t)},Y.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.start=0,n.end=0),null!=e.start&&e.hasOwnProperty(\"start\")&&(n.start=e.start),null!=e.end&&e.hasOwnProperty(\"end\")&&(n.end=e.end),n},Y.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},Y),O),n.ExtensionRangeOptions=(z.prototype.uninterpretedOption=p.emptyArray,z.create=function(e){return new z(e)},z.encode=function(e,t){if(t=t||i.create(),null!=e.uninterpretedOption&&e.uninterpretedOption.length)for(var n=0;n>>3==999?(o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(l.google.protobuf.UninterpretedOption.decode(e,e.uint32()))):e.skipType(7&r)}return o},z.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},z.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 1:o.name=e.string();break;case 3:o.number=e.int32();break;case 4:o.label=e.int32();break;case 5:o.type=e.int32();break;case 6:o.typeName=e.string();break;case 2:o.extendee=e.string();break;case 7:o.defaultValue=e.string();break;case 9:o.oneofIndex=e.int32();break;case 10:o.jsonName=e.string();break;case 8:o.options=l.google.protobuf.FieldOptions.decode(e,e.uint32());break;case 17:o.proto3Optional=e.bool();break;default:e.skipType(7&r)}}return o},P.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},P.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!p.isString(e.name))return\"name: string expected\";if(null!=e.number&&e.hasOwnProperty(\"number\")&&!p.isInteger(e.number))return\"number: integer expected\";if(null!=e.label&&e.hasOwnProperty(\"label\"))switch(e.label){default:return\"label: enum value expected\";case 1:case 2:case 3:}if(null!=e.type&&e.hasOwnProperty(\"type\"))switch(e.type){default:return\"type: enum value expected\";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:}if(null!=e.typeName&&e.hasOwnProperty(\"typeName\")&&!p.isString(e.typeName))return\"typeName: string expected\";if(null!=e.extendee&&e.hasOwnProperty(\"extendee\")&&!p.isString(e.extendee))return\"extendee: string expected\";if(null!=e.defaultValue&&e.hasOwnProperty(\"defaultValue\")&&!p.isString(e.defaultValue))return\"defaultValue: string expected\";if(null!=e.oneofIndex&&e.hasOwnProperty(\"oneofIndex\")&&!p.isInteger(e.oneofIndex))return\"oneofIndex: integer expected\";if(null!=e.jsonName&&e.hasOwnProperty(\"jsonName\")&&!p.isString(e.jsonName))return\"jsonName: string expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){var t=l.google.protobuf.FieldOptions.verify(e.options);if(t)return\"options.\"+t}return null!=e.proto3Optional&&e.hasOwnProperty(\"proto3Optional\")&&\"boolean\"!=typeof e.proto3Optional?\"proto3Optional: boolean expected\":null},P.fromObject=function(e){if(e instanceof l.google.protobuf.FieldDescriptorProto)return e;var t=new l.google.protobuf.FieldDescriptorProto;switch(null!=e.name&&(t.name=String(e.name)),null!=e.number&&(t.number=0|e.number),e.label){case\"LABEL_OPTIONAL\":case 1:t.label=1;break;case\"LABEL_REQUIRED\":case 2:t.label=2;break;case\"LABEL_REPEATED\":case 3:t.label=3}switch(e.type){case\"TYPE_DOUBLE\":case 1:t.type=1;break;case\"TYPE_FLOAT\":case 2:t.type=2;break;case\"TYPE_INT64\":case 3:t.type=3;break;case\"TYPE_UINT64\":case 4:t.type=4;break;case\"TYPE_INT32\":case 5:t.type=5;break;case\"TYPE_FIXED64\":case 6:t.type=6;break;case\"TYPE_FIXED32\":case 7:t.type=7;break;case\"TYPE_BOOL\":case 8:t.type=8;break;case\"TYPE_STRING\":case 9:t.type=9;break;case\"TYPE_GROUP\":case 10:t.type=10;break;case\"TYPE_MESSAGE\":case 11:t.type=11;break;case\"TYPE_BYTES\":case 12:t.type=12;break;case\"TYPE_UINT32\":case 13:t.type=13;break;case\"TYPE_ENUM\":case 14:t.type=14;break;case\"TYPE_SFIXED32\":case 15:t.type=15;break;case\"TYPE_SFIXED64\":case 16:t.type=16;break;case\"TYPE_SINT32\":case 17:t.type=17;break;case\"TYPE_SINT64\":case 18:t.type=18}if(null!=e.typeName&&(t.typeName=String(e.typeName)),null!=e.extendee&&(t.extendee=String(e.extendee)),null!=e.defaultValue&&(t.defaultValue=String(e.defaultValue)),null!=e.oneofIndex&&(t.oneofIndex=0|e.oneofIndex),null!=e.jsonName&&(t.jsonName=String(e.jsonName)),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.protobuf.FieldDescriptorProto.options: object expected\");t.options=l.google.protobuf.FieldOptions.fromObject(e.options)}return null!=e.proto3Optional&&(t.proto3Optional=Boolean(e.proto3Optional)),t},P.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\",n.extendee=\"\",n.number=0,n.label=t.enums===String?\"LABEL_OPTIONAL\":1,n.type=t.enums===String?\"TYPE_DOUBLE\":1,n.typeName=\"\",n.defaultValue=\"\",n.options=null,n.oneofIndex=0,n.jsonName=\"\",n.proto3Optional=!1),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),null!=e.extendee&&e.hasOwnProperty(\"extendee\")&&(n.extendee=e.extendee),null!=e.number&&e.hasOwnProperty(\"number\")&&(n.number=e.number),null!=e.label&&e.hasOwnProperty(\"label\")&&(n.label=t.enums===String?l.google.protobuf.FieldDescriptorProto.Label[e.label]:e.label),null!=e.type&&e.hasOwnProperty(\"type\")&&(n.type=t.enums===String?l.google.protobuf.FieldDescriptorProto.Type[e.type]:e.type),null!=e.typeName&&e.hasOwnProperty(\"typeName\")&&(n.typeName=e.typeName),null!=e.defaultValue&&e.hasOwnProperty(\"defaultValue\")&&(n.defaultValue=e.defaultValue),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=l.google.protobuf.FieldOptions.toObject(e.options,t)),null!=e.oneofIndex&&e.hasOwnProperty(\"oneofIndex\")&&(n.oneofIndex=e.oneofIndex),null!=e.jsonName&&e.hasOwnProperty(\"jsonName\")&&(n.jsonName=e.jsonName),null!=e.proto3Optional&&e.hasOwnProperty(\"proto3Optional\")&&(n.proto3Optional=e.proto3Optional),n},P.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},P.Type=(e={},(t=Object.create(e))[e[1]=\"TYPE_DOUBLE\"]=1,t[e[2]=\"TYPE_FLOAT\"]=2,t[e[3]=\"TYPE_INT64\"]=3,t[e[4]=\"TYPE_UINT64\"]=4,t[e[5]=\"TYPE_INT32\"]=5,t[e[6]=\"TYPE_FIXED64\"]=6,t[e[7]=\"TYPE_FIXED32\"]=7,t[e[8]=\"TYPE_BOOL\"]=8,t[e[9]=\"TYPE_STRING\"]=9,t[e[10]=\"TYPE_GROUP\"]=10,t[e[11]=\"TYPE_MESSAGE\"]=11,t[e[12]=\"TYPE_BYTES\"]=12,t[e[13]=\"TYPE_UINT32\"]=13,t[e[14]=\"TYPE_ENUM\"]=14,t[e[15]=\"TYPE_SFIXED32\"]=15,t[e[16]=\"TYPE_SFIXED64\"]=16,t[e[17]=\"TYPE_SINT32\"]=17,t[e[18]=\"TYPE_SINT64\"]=18,t),P.Label=(e={},(t=Object.create(e))[e[1]=\"LABEL_OPTIONAL\"]=1,t[e[2]=\"LABEL_REQUIRED\"]=2,t[e[3]=\"LABEL_REPEATED\"]=3,t),P),n.OneofDescriptorProto=(W.prototype.name=\"\",W.prototype.options=null,W.create=function(e){return new W(e)},W.encode=function(e,t){return t=t||i.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),null!=e.options&&Object.hasOwnProperty.call(e,\"options\")&&l.google.protobuf.OneofOptions.encode(e.options,t.uint32(18).fork()).ldelim(),t},W.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},W.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new l.google.protobuf.OneofDescriptorProto;e.pos>>3){case 1:o.name=e.string();break;case 2:o.options=l.google.protobuf.OneofOptions.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},W.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},W.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!p.isString(e.name))return\"name: string expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){e=l.google.protobuf.OneofOptions.verify(e.options);if(e)return\"options.\"+e}return null},W.fromObject=function(e){if(e instanceof l.google.protobuf.OneofDescriptorProto)return e;var t=new l.google.protobuf.OneofDescriptorProto;if(null!=e.name&&(t.name=String(e.name)),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.protobuf.OneofDescriptorProto.options: object expected\");t.options=l.google.protobuf.OneofOptions.fromObject(e.options)}return t},W.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\",n.options=null),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=l.google.protobuf.OneofOptions.toObject(e.options,t)),n},W.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},W),n.EnumDescriptorProto=(w.prototype.name=\"\",w.prototype.value=p.emptyArray,w.prototype.options=null,w.prototype.reservedRange=p.emptyArray,w.prototype.reservedName=p.emptyArray,w.create=function(e){return new w(e)},w.encode=function(e,t){if(t=t||i.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),null!=e.value&&e.value.length)for(var n=0;n>>3){case 1:o.name=e.string();break;case 2:o.value&&o.value.length||(o.value=[]),o.value.push(l.google.protobuf.EnumValueDescriptorProto.decode(e,e.uint32()));break;case 3:o.options=l.google.protobuf.EnumOptions.decode(e,e.uint32());break;case 4:o.reservedRange&&o.reservedRange.length||(o.reservedRange=[]),o.reservedRange.push(l.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(e,e.uint32()));break;case 5:o.reservedName&&o.reservedName.length||(o.reservedName=[]),o.reservedName.push(e.string());break;default:e.skipType(7&r)}}return o},w.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},w.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!p.isString(e.name))return\"name: string expected\";if(null!=e.value&&e.hasOwnProperty(\"value\")){if(!Array.isArray(e.value))return\"value: array expected\";for(var t=0;t>>3){case 1:o.start=e.int32();break;case 2:o.end=e.int32();break;default:e.skipType(7&r)}}return o},X.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},X.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.start&&e.hasOwnProperty(\"start\")&&!p.isInteger(e.start)?\"start: integer expected\":null!=e.end&&e.hasOwnProperty(\"end\")&&!p.isInteger(e.end)?\"end: integer expected\":null},X.fromObject=function(e){var t;return e instanceof l.google.protobuf.EnumDescriptorProto.EnumReservedRange?e:(t=new l.google.protobuf.EnumDescriptorProto.EnumReservedRange,null!=e.start&&(t.start=0|e.start),null!=e.end&&(t.end=0|e.end),t)},X.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.start=0,n.end=0),null!=e.start&&e.hasOwnProperty(\"start\")&&(n.start=e.start),null!=e.end&&e.hasOwnProperty(\"end\")&&(n.end=e.end),n},X.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},X),w),n.EnumValueDescriptorProto=(j.prototype.name=\"\",j.prototype.number=0,j.prototype.options=null,j.create=function(e){return new j(e)},j.encode=function(e,t){return t=t||i.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),null!=e.number&&Object.hasOwnProperty.call(e,\"number\")&&t.uint32(16).int32(e.number),null!=e.options&&Object.hasOwnProperty.call(e,\"options\")&&l.google.protobuf.EnumValueOptions.encode(e.options,t.uint32(26).fork()).ldelim(),t},j.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},j.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new l.google.protobuf.EnumValueDescriptorProto;e.pos>>3){case 1:o.name=e.string();break;case 2:o.number=e.int32();break;case 3:o.options=l.google.protobuf.EnumValueOptions.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},j.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},j.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!p.isString(e.name))return\"name: string expected\";if(null!=e.number&&e.hasOwnProperty(\"number\")&&!p.isInteger(e.number))return\"number: integer expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){e=l.google.protobuf.EnumValueOptions.verify(e.options);if(e)return\"options.\"+e}return null},j.fromObject=function(e){if(e instanceof l.google.protobuf.EnumValueDescriptorProto)return e;var t=new l.google.protobuf.EnumValueDescriptorProto;if(null!=e.name&&(t.name=String(e.name)),null!=e.number&&(t.number=0|e.number),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.protobuf.EnumValueDescriptorProto.options: object expected\");t.options=l.google.protobuf.EnumValueOptions.fromObject(e.options)}return t},j.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\",n.number=0,n.options=null),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),null!=e.number&&e.hasOwnProperty(\"number\")&&(n.number=e.number),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=l.google.protobuf.EnumValueOptions.toObject(e.options,t)),n},j.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},j),n.ServiceDescriptorProto=(D.prototype.name=\"\",D.prototype.method=p.emptyArray,D.prototype.options=null,D.create=function(e){return new D(e)},D.encode=function(e,t){if(t=t||i.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),null!=e.method&&e.method.length)for(var n=0;n>>3){case 1:o.name=e.string();break;case 2:o.method&&o.method.length||(o.method=[]),o.method.push(l.google.protobuf.MethodDescriptorProto.decode(e,e.uint32()));break;case 3:o.options=l.google.protobuf.ServiceOptions.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},D.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},D.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!p.isString(e.name))return\"name: string expected\";if(null!=e.method&&e.hasOwnProperty(\"method\")){if(!Array.isArray(e.method))return\"method: array expected\";for(var t=0;t>>3){case 1:o.name=e.string();break;case 2:o.inputType=e.string();break;case 3:o.outputType=e.string();break;case 4:o.options=l.google.protobuf.MethodOptions.decode(e,e.uint32());break;case 5:o.clientStreaming=e.bool();break;case 6:o.serverStreaming=e.bool();break;default:e.skipType(7&r)}}return o},x.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},x.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!p.isString(e.name))return\"name: string expected\";if(null!=e.inputType&&e.hasOwnProperty(\"inputType\")&&!p.isString(e.inputType))return\"inputType: string expected\";if(null!=e.outputType&&e.hasOwnProperty(\"outputType\")&&!p.isString(e.outputType))return\"outputType: string expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){var t=l.google.protobuf.MethodOptions.verify(e.options);if(t)return\"options.\"+t}return null!=e.clientStreaming&&e.hasOwnProperty(\"clientStreaming\")&&\"boolean\"!=typeof e.clientStreaming?\"clientStreaming: boolean expected\":null!=e.serverStreaming&&e.hasOwnProperty(\"serverStreaming\")&&\"boolean\"!=typeof e.serverStreaming?\"serverStreaming: boolean expected\":null},x.fromObject=function(e){if(e instanceof l.google.protobuf.MethodDescriptorProto)return e;var t=new l.google.protobuf.MethodDescriptorProto;if(null!=e.name&&(t.name=String(e.name)),null!=e.inputType&&(t.inputType=String(e.inputType)),null!=e.outputType&&(t.outputType=String(e.outputType)),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.protobuf.MethodDescriptorProto.options: object expected\");t.options=l.google.protobuf.MethodOptions.fromObject(e.options)}return null!=e.clientStreaming&&(t.clientStreaming=Boolean(e.clientStreaming)),null!=e.serverStreaming&&(t.serverStreaming=Boolean(e.serverStreaming)),t},x.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\",n.inputType=\"\",n.outputType=\"\",n.options=null,n.clientStreaming=!1,n.serverStreaming=!1),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),null!=e.inputType&&e.hasOwnProperty(\"inputType\")&&(n.inputType=e.inputType),null!=e.outputType&&e.hasOwnProperty(\"outputType\")&&(n.outputType=e.outputType),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=l.google.protobuf.MethodOptions.toObject(e.options,t)),null!=e.clientStreaming&&e.hasOwnProperty(\"clientStreaming\")&&(n.clientStreaming=e.clientStreaming),null!=e.serverStreaming&&e.hasOwnProperty(\"serverStreaming\")&&(n.serverStreaming=e.serverStreaming),n},x.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},x),n.FileOptions=(S.prototype.javaPackage=\"\",S.prototype.javaOuterClassname=\"\",S.prototype.javaMultipleFiles=!1,S.prototype.javaGenerateEqualsAndHash=!1,S.prototype.javaStringCheckUtf8=!1,S.prototype.optimizeFor=1,S.prototype.goPackage=\"\",S.prototype.ccGenericServices=!1,S.prototype.javaGenericServices=!1,S.prototype.pyGenericServices=!1,S.prototype.phpGenericServices=!1,S.prototype.deprecated=!1,S.prototype.ccEnableArenas=!0,S.prototype.objcClassPrefix=\"\",S.prototype.csharpNamespace=\"\",S.prototype.swiftPrefix=\"\",S.prototype.phpClassPrefix=\"\",S.prototype.phpNamespace=\"\",S.prototype.phpMetadataNamespace=\"\",S.prototype.rubyPackage=\"\",S.prototype.uninterpretedOption=p.emptyArray,S.prototype[\".google.api.resourceDefinition\"]=p.emptyArray,S.create=function(e){return new S(e)},S.encode=function(e,t){if(t=t||i.create(),null!=e.javaPackage&&Object.hasOwnProperty.call(e,\"javaPackage\")&&t.uint32(10).string(e.javaPackage),null!=e.javaOuterClassname&&Object.hasOwnProperty.call(e,\"javaOuterClassname\")&&t.uint32(66).string(e.javaOuterClassname),null!=e.optimizeFor&&Object.hasOwnProperty.call(e,\"optimizeFor\")&&t.uint32(72).int32(e.optimizeFor),null!=e.javaMultipleFiles&&Object.hasOwnProperty.call(e,\"javaMultipleFiles\")&&t.uint32(80).bool(e.javaMultipleFiles),null!=e.goPackage&&Object.hasOwnProperty.call(e,\"goPackage\")&&t.uint32(90).string(e.goPackage),null!=e.ccGenericServices&&Object.hasOwnProperty.call(e,\"ccGenericServices\")&&t.uint32(128).bool(e.ccGenericServices),null!=e.javaGenericServices&&Object.hasOwnProperty.call(e,\"javaGenericServices\")&&t.uint32(136).bool(e.javaGenericServices),null!=e.pyGenericServices&&Object.hasOwnProperty.call(e,\"pyGenericServices\")&&t.uint32(144).bool(e.pyGenericServices),null!=e.javaGenerateEqualsAndHash&&Object.hasOwnProperty.call(e,\"javaGenerateEqualsAndHash\")&&t.uint32(160).bool(e.javaGenerateEqualsAndHash),null!=e.deprecated&&Object.hasOwnProperty.call(e,\"deprecated\")&&t.uint32(184).bool(e.deprecated),null!=e.javaStringCheckUtf8&&Object.hasOwnProperty.call(e,\"javaStringCheckUtf8\")&&t.uint32(216).bool(e.javaStringCheckUtf8),null!=e.ccEnableArenas&&Object.hasOwnProperty.call(e,\"ccEnableArenas\")&&t.uint32(248).bool(e.ccEnableArenas),null!=e.objcClassPrefix&&Object.hasOwnProperty.call(e,\"objcClassPrefix\")&&t.uint32(290).string(e.objcClassPrefix),null!=e.csharpNamespace&&Object.hasOwnProperty.call(e,\"csharpNamespace\")&&t.uint32(298).string(e.csharpNamespace),null!=e.swiftPrefix&&Object.hasOwnProperty.call(e,\"swiftPrefix\")&&t.uint32(314).string(e.swiftPrefix),null!=e.phpClassPrefix&&Object.hasOwnProperty.call(e,\"phpClassPrefix\")&&t.uint32(322).string(e.phpClassPrefix),null!=e.phpNamespace&&Object.hasOwnProperty.call(e,\"phpNamespace\")&&t.uint32(330).string(e.phpNamespace),null!=e.phpGenericServices&&Object.hasOwnProperty.call(e,\"phpGenericServices\")&&t.uint32(336).bool(e.phpGenericServices),null!=e.phpMetadataNamespace&&Object.hasOwnProperty.call(e,\"phpMetadataNamespace\")&&t.uint32(354).string(e.phpMetadataNamespace),null!=e.rubyPackage&&Object.hasOwnProperty.call(e,\"rubyPackage\")&&t.uint32(362).string(e.rubyPackage),null!=e.uninterpretedOption&&e.uninterpretedOption.length)for(var n=0;n>>3){case 1:o.javaPackage=e.string();break;case 8:o.javaOuterClassname=e.string();break;case 10:o.javaMultipleFiles=e.bool();break;case 20:o.javaGenerateEqualsAndHash=e.bool();break;case 27:o.javaStringCheckUtf8=e.bool();break;case 9:o.optimizeFor=e.int32();break;case 11:o.goPackage=e.string();break;case 16:o.ccGenericServices=e.bool();break;case 17:o.javaGenericServices=e.bool();break;case 18:o.pyGenericServices=e.bool();break;case 42:o.phpGenericServices=e.bool();break;case 23:o.deprecated=e.bool();break;case 31:o.ccEnableArenas=e.bool();break;case 36:o.objcClassPrefix=e.string();break;case 37:o.csharpNamespace=e.string();break;case 39:o.swiftPrefix=e.string();break;case 40:o.phpClassPrefix=e.string();break;case 41:o.phpNamespace=e.string();break;case 44:o.phpMetadataNamespace=e.string();break;case 45:o.rubyPackage=e.string();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(l.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;case 1053:o[\".google.api.resourceDefinition\"]&&o[\".google.api.resourceDefinition\"].length||(o[\".google.api.resourceDefinition\"]=[]),o[\".google.api.resourceDefinition\"].push(l.google.api.ResourceDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},S.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},S.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.javaPackage&&e.hasOwnProperty(\"javaPackage\")&&!p.isString(e.javaPackage))return\"javaPackage: string expected\";if(null!=e.javaOuterClassname&&e.hasOwnProperty(\"javaOuterClassname\")&&!p.isString(e.javaOuterClassname))return\"javaOuterClassname: string expected\";if(null!=e.javaMultipleFiles&&e.hasOwnProperty(\"javaMultipleFiles\")&&\"boolean\"!=typeof e.javaMultipleFiles)return\"javaMultipleFiles: boolean expected\";if(null!=e.javaGenerateEqualsAndHash&&e.hasOwnProperty(\"javaGenerateEqualsAndHash\")&&\"boolean\"!=typeof e.javaGenerateEqualsAndHash)return\"javaGenerateEqualsAndHash: boolean expected\";if(null!=e.javaStringCheckUtf8&&e.hasOwnProperty(\"javaStringCheckUtf8\")&&\"boolean\"!=typeof e.javaStringCheckUtf8)return\"javaStringCheckUtf8: boolean expected\";if(null!=e.optimizeFor&&e.hasOwnProperty(\"optimizeFor\"))switch(e.optimizeFor){default:return\"optimizeFor: enum value expected\";case 1:case 2:case 3:}if(null!=e.goPackage&&e.hasOwnProperty(\"goPackage\")&&!p.isString(e.goPackage))return\"goPackage: string expected\";if(null!=e.ccGenericServices&&e.hasOwnProperty(\"ccGenericServices\")&&\"boolean\"!=typeof e.ccGenericServices)return\"ccGenericServices: boolean expected\";if(null!=e.javaGenericServices&&e.hasOwnProperty(\"javaGenericServices\")&&\"boolean\"!=typeof e.javaGenericServices)return\"javaGenericServices: boolean expected\";if(null!=e.pyGenericServices&&e.hasOwnProperty(\"pyGenericServices\")&&\"boolean\"!=typeof e.pyGenericServices)return\"pyGenericServices: boolean expected\";if(null!=e.phpGenericServices&&e.hasOwnProperty(\"phpGenericServices\")&&\"boolean\"!=typeof e.phpGenericServices)return\"phpGenericServices: boolean expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.ccEnableArenas&&e.hasOwnProperty(\"ccEnableArenas\")&&\"boolean\"!=typeof e.ccEnableArenas)return\"ccEnableArenas: boolean expected\";if(null!=e.objcClassPrefix&&e.hasOwnProperty(\"objcClassPrefix\")&&!p.isString(e.objcClassPrefix))return\"objcClassPrefix: string expected\";if(null!=e.csharpNamespace&&e.hasOwnProperty(\"csharpNamespace\")&&!p.isString(e.csharpNamespace))return\"csharpNamespace: string expected\";if(null!=e.swiftPrefix&&e.hasOwnProperty(\"swiftPrefix\")&&!p.isString(e.swiftPrefix))return\"swiftPrefix: string expected\";if(null!=e.phpClassPrefix&&e.hasOwnProperty(\"phpClassPrefix\")&&!p.isString(e.phpClassPrefix))return\"phpClassPrefix: string expected\";if(null!=e.phpNamespace&&e.hasOwnProperty(\"phpNamespace\")&&!p.isString(e.phpNamespace))return\"phpNamespace: string expected\";if(null!=e.phpMetadataNamespace&&e.hasOwnProperty(\"phpMetadataNamespace\")&&!p.isString(e.phpMetadataNamespace))return\"phpMetadataNamespace: string expected\";if(null!=e.rubyPackage&&e.hasOwnProperty(\"rubyPackage\")&&!p.isString(e.rubyPackage))return\"rubyPackage: string expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 1:o.messageSetWireFormat=e.bool();break;case 2:o.noStandardDescriptorAccessor=e.bool();break;case 3:o.deprecated=e.bool();break;case 7:o.mapEntry=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(l.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;case 1053:o[\".google.api.resource\"]=l.google.api.ResourceDescriptor.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},k.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},k.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.messageSetWireFormat&&e.hasOwnProperty(\"messageSetWireFormat\")&&\"boolean\"!=typeof e.messageSetWireFormat)return\"messageSetWireFormat: boolean expected\";if(null!=e.noStandardDescriptorAccessor&&e.hasOwnProperty(\"noStandardDescriptorAccessor\")&&\"boolean\"!=typeof e.noStandardDescriptorAccessor)return\"noStandardDescriptorAccessor: boolean expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.mapEntry&&e.hasOwnProperty(\"mapEntry\")&&\"boolean\"!=typeof e.mapEntry)return\"mapEntry: boolean expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 1:o.ctype=e.int32();break;case 2:o.packed=e.bool();break;case 6:o.jstype=e.int32();break;case 5:o.lazy=e.bool();break;case 3:o.deprecated=e.bool();break;case 10:o.weak=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(l.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;case 1052:if(o[\".google.api.fieldBehavior\"]&&o[\".google.api.fieldBehavior\"].length||(o[\".google.api.fieldBehavior\"]=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos>>3==999?(o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(l.google.protobuf.UninterpretedOption.decode(e,e.uint32()))):e.skipType(7&r)}return o},Q.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},Q.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 2:o.allowAlias=e.bool();break;case 3:o.deprecated=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(l.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},E.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},E.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.allowAlias&&e.hasOwnProperty(\"allowAlias\")&&\"boolean\"!=typeof e.allowAlias)return\"allowAlias: boolean expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 1:o.deprecated=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(l.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},K.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},K.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 33:o.deprecated=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(l.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;case 1049:o[\".google.api.defaultHost\"]=e.string();break;case 1050:o[\".google.api.oauthScopes\"]=e.string();break;default:e.skipType(7&r)}}return o},A.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},A.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 33:o.deprecated=e.bool();break;case 34:o.idempotencyLevel=e.int32();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(l.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;case 72295728:o[\".google.api.http\"]=l.google.api.HttpRule.decode(e,e.uint32());break;case 1051:o[\".google.api.methodSignature\"]&&o[\".google.api.methodSignature\"].length||(o[\".google.api.methodSignature\"]=[]),o[\".google.api.methodSignature\"].push(e.string());break;default:e.skipType(7&r)}}return o},N.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},N.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.idempotencyLevel&&e.hasOwnProperty(\"idempotencyLevel\"))switch(e.idempotencyLevel){default:return\"idempotencyLevel: enum value expected\";case 0:case 1:case 2:}if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 2:o.name&&o.name.length||(o.name=[]),o.name.push(l.google.protobuf.UninterpretedOption.NamePart.decode(e,e.uint32()));break;case 3:o.identifierValue=e.string();break;case 4:o.positiveIntValue=e.uint64();break;case 5:o.negativeIntValue=e.int64();break;case 6:o.doubleValue=e.double();break;case 7:o.stringValue=e.bytes();break;case 8:o.aggregateValue=e.string();break;default:e.skipType(7&r)}}return o},R.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},R.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")){if(!Array.isArray(e.name))return\"name: array expected\";for(var t=0;t>>0,e.positiveIntValue.high>>>0).toNumber(!0))),null!=e.negativeIntValue&&(p.Long?(t.negativeIntValue=p.Long.fromValue(e.negativeIntValue)).unsigned=!1:\"string\"==typeof e.negativeIntValue?t.negativeIntValue=parseInt(e.negativeIntValue,10):\"number\"==typeof e.negativeIntValue?t.negativeIntValue=e.negativeIntValue:\"object\"==typeof e.negativeIntValue&&(t.negativeIntValue=new p.LongBits(e.negativeIntValue.low>>>0,e.negativeIntValue.high>>>0).toNumber())),null!=e.doubleValue&&(t.doubleValue=Number(e.doubleValue)),null!=e.stringValue&&(\"string\"==typeof e.stringValue?p.base64.decode(e.stringValue,t.stringValue=p.newBuffer(p.base64.length(e.stringValue)),0):e.stringValue.length&&(t.stringValue=e.stringValue)),null!=e.aggregateValue&&(t.aggregateValue=String(e.aggregateValue)),t},R.toObject=function(e,t){var n,o={};if(((t=t||{}).arrays||t.defaults)&&(o.name=[]),t.defaults&&(o.identifierValue=\"\",p.Long?(n=new p.Long(0,0,!0),o.positiveIntValue=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):o.positiveIntValue=t.longs===String?\"0\":0,p.Long?(n=new p.Long(0,0,!1),o.negativeIntValue=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):o.negativeIntValue=t.longs===String?\"0\":0,o.doubleValue=0,t.bytes===String?o.stringValue=\"\":(o.stringValue=[],t.bytes!==Array&&(o.stringValue=p.newBuffer(o.stringValue))),o.aggregateValue=\"\"),e.name&&e.name.length){o.name=[];for(var r=0;r>>0,e.positiveIntValue.high>>>0).toNumber(!0):e.positiveIntValue),null!=e.negativeIntValue&&e.hasOwnProperty(\"negativeIntValue\")&&(\"number\"==typeof e.negativeIntValue?o.negativeIntValue=t.longs===String?String(e.negativeIntValue):e.negativeIntValue:o.negativeIntValue=t.longs===String?p.Long.prototype.toString.call(e.negativeIntValue):t.longs===Number?new p.LongBits(e.negativeIntValue.low>>>0,e.negativeIntValue.high>>>0).toNumber():e.negativeIntValue),null!=e.doubleValue&&e.hasOwnProperty(\"doubleValue\")&&(o.doubleValue=t.json&&!isFinite(e.doubleValue)?String(e.doubleValue):e.doubleValue),null!=e.stringValue&&e.hasOwnProperty(\"stringValue\")&&(o.stringValue=t.bytes===String?p.base64.encode(e.stringValue,0,e.stringValue.length):t.bytes===Array?Array.prototype.slice.call(e.stringValue):e.stringValue),null!=e.aggregateValue&&e.hasOwnProperty(\"aggregateValue\")&&(o.aggregateValue=e.aggregateValue),o},R.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},R.NamePart=(Z.prototype.namePart=\"\",Z.prototype.isExtension=!1,Z.create=function(e){return new Z(e)},Z.encode=function(e,t){return(t=t||i.create()).uint32(10).string(e.namePart),t.uint32(16).bool(e.isExtension),t},Z.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},Z.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new l.google.protobuf.UninterpretedOption.NamePart;e.pos>>3){case 1:o.namePart=e.string();break;case 2:o.isExtension=e.bool();break;default:e.skipType(7&r)}}if(!o.hasOwnProperty(\"namePart\"))throw p.ProtocolError(\"missing required 'namePart'\",{instance:o});if(o.hasOwnProperty(\"isExtension\"))return o;throw p.ProtocolError(\"missing required 'isExtension'\",{instance:o})},Z.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},Z.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":p.isString(e.namePart)?\"boolean\"!=typeof e.isExtension?\"isExtension: boolean expected\":null:\"namePart: string expected\"},Z.fromObject=function(e){var t;return e instanceof l.google.protobuf.UninterpretedOption.NamePart?e:(t=new l.google.protobuf.UninterpretedOption.NamePart,null!=e.namePart&&(t.namePart=String(e.namePart)),null!=e.isExtension&&(t.isExtension=Boolean(e.isExtension)),t)},Z.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.namePart=\"\",n.isExtension=!1),null!=e.namePart&&e.hasOwnProperty(\"namePart\")&&(n.namePart=e.namePart),null!=e.isExtension&&e.hasOwnProperty(\"isExtension\")&&(n.isExtension=e.isExtension),n},Z.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},Z),R),n.SourceCodeInfo=($.prototype.location=p.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,t){if(t=t||i.create(),null!=e.location&&e.location.length)for(var n=0;n>>3==1?(o.location&&o.location.length||(o.location=[]),o.location.push(l.google.protobuf.SourceCodeInfo.Location.decode(e,e.uint32()))):e.skipType(7&r)}return o},$.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},$.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.location&&e.hasOwnProperty(\"location\")){if(!Array.isArray(e.location))return\"location: array expected\";for(var t=0;t>>3){case 1:if(o.path&&o.path.length||(o.path=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos>>3==1?(o.annotation&&o.annotation.length||(o.annotation=[]),o.annotation.push(l.google.protobuf.GeneratedCodeInfo.Annotation.decode(e,e.uint32()))):e.skipType(7&r)}return o},ee.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},ee.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.annotation&&e.hasOwnProperty(\"annotation\")){if(!Array.isArray(e.annotation))return\"annotation: array expected\";for(var t=0;t>>3){case 1:if(o.path&&o.path.length||(o.path=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos>>3){case 1:o.expression=e.string();break;case 2:o.title=e.string();break;case 3:o.description=e.string();break;case 4:o.location=e.string();break;default:e.skipType(7&r)}}return o},V.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},V.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.expression&&e.hasOwnProperty(\"expression\")&&!p.isString(e.expression)?\"expression: string expected\":null!=e.title&&e.hasOwnProperty(\"title\")&&!p.isString(e.title)?\"title: string expected\":null!=e.description&&e.hasOwnProperty(\"description\")&&!p.isString(e.description)?\"description: string expected\":null!=e.location&&e.hasOwnProperty(\"location\")&&!p.isString(e.location)?\"location: string expected\":null},V.fromObject=function(e){var t;return e instanceof l.google.type.Expr?e:(t=new l.google.type.Expr,null!=e.expression&&(t.expression=String(e.expression)),null!=e.title&&(t.title=String(e.title)),null!=e.description&&(t.description=String(e.description)),null!=e.location&&(t.location=String(e.location)),t)},V.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.expression=\"\",n.title=\"\",n.description=\"\",n.location=\"\"),null!=e.expression&&e.hasOwnProperty(\"expression\")&&(n.expression=e.expression),null!=e.title&&e.hasOwnProperty(\"title\")&&(n.title=e.title),null!=e.description&&e.hasOwnProperty(\"description\")&&(n.description=e.description),null!=e.location&&e.hasOwnProperty(\"location\")&&(n.location=e.location),n},V.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},V),r),F),l});","(e=>{\"function\"==typeof define&&define.amd?define([\"protobufjs/minimal\"],e):\"function\"==typeof require&&\"object\"==typeof module&&module&&module.exports&&(module.exports=e(require(\"protobufjs/minimal\")))})(function(o){var e,t,n,F,s=o.Reader,r=o.Writer,u=o.util,c=o.roots.locations_protos||(o.roots.locations_protos={});function L(e,t,n){o.rpc.Service.call(this,e,t,n)}function i(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:o.name=e.string();break;case 2:o.filter=e.string();break;case 3:o.pageSize=e.int32();break;case 4:o.pageToken=e.string();break;default:e.skipType(7&r)}}return o},i.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},i.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.name&&e.hasOwnProperty(\"name\")&&!u.isString(e.name)?\"name: string expected\":null!=e.filter&&e.hasOwnProperty(\"filter\")&&!u.isString(e.filter)?\"filter: string expected\":null!=e.pageSize&&e.hasOwnProperty(\"pageSize\")&&!u.isInteger(e.pageSize)?\"pageSize: integer expected\":null!=e.pageToken&&e.hasOwnProperty(\"pageToken\")&&!u.isString(e.pageToken)?\"pageToken: string expected\":null},i.fromObject=function(e){var t;return e instanceof c.google.cloud.location.ListLocationsRequest?e:(t=new c.google.cloud.location.ListLocationsRequest,null!=e.name&&(t.name=String(e.name)),null!=e.filter&&(t.filter=String(e.filter)),null!=e.pageSize&&(t.pageSize=0|e.pageSize),null!=e.pageToken&&(t.pageToken=String(e.pageToken)),t)},i.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\",n.filter=\"\",n.pageSize=0,n.pageToken=\"\"),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),null!=e.filter&&e.hasOwnProperty(\"filter\")&&(n.filter=e.filter),null!=e.pageSize&&e.hasOwnProperty(\"pageSize\")&&(n.pageSize=e.pageSize),null!=e.pageToken&&e.hasOwnProperty(\"pageToken\")&&(n.pageToken=e.pageToken),n},i.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},i),e.ListLocationsResponse=(a.prototype.locations=u.emptyArray,a.prototype.nextPageToken=\"\",a.create=function(e){return new a(e)},a.encode=function(e,t){if(t=t||r.create(),null!=e.locations&&e.locations.length)for(var n=0;n>>3){case 1:o.locations&&o.locations.length||(o.locations=[]),o.locations.push(c.google.cloud.location.Location.decode(e,e.uint32()));break;case 2:o.nextPageToken=e.string();break;default:e.skipType(7&r)}}return o},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.locations&&e.hasOwnProperty(\"locations\")){if(!Array.isArray(e.locations))return\"locations: array expected\";for(var t=0;t>>3==1?o.name=e.string():e.skipType(7&r)}return o},G.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},G.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.name&&e.hasOwnProperty(\"name\")&&!u.isString(e.name)?\"name: string expected\":null},G.fromObject=function(e){var t;return e instanceof c.google.cloud.location.GetLocationRequest?e:(t=new c.google.cloud.location.GetLocationRequest,null!=e.name&&(t.name=String(e.name)),t)},G.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\"),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),n},G.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},G),e.Location=(p.prototype.name=\"\",p.prototype.locationId=\"\",p.prototype.displayName=\"\",p.prototype.labels=u.emptyObject,p.prototype.metadata=null,p.create=function(e){return new p(e)},p.encode=function(e,t){if(t=t||r.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),null!=e.labels&&Object.hasOwnProperty.call(e,\"labels\"))for(var n=Object.keys(e.labels),o=0;o>>3){case 1:o.name=e.string();break;case 4:o.locationId=e.string();break;case 5:o.displayName=e.string();break;case 2:o.labels===u.emptyObject&&(o.labels={});for(var i=e.uint32()+e.pos,a=\"\",p=\"\";e.pos>>3){case 1:a=e.string();break;case 2:p=e.string();break;default:e.skipType(7&l)}}o.labels[a]=p;break;case 3:o.metadata=c.google.protobuf.Any.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},p.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},p.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!u.isString(e.name))return\"name: string expected\";if(null!=e.locationId&&e.hasOwnProperty(\"locationId\")&&!u.isString(e.locationId))return\"locationId: string expected\";if(null!=e.displayName&&e.hasOwnProperty(\"displayName\")&&!u.isString(e.displayName))return\"displayName: string expected\";if(null!=e.labels&&e.hasOwnProperty(\"labels\")){if(!u.isObject(e.labels))return\"labels: object expected\";for(var t=Object.keys(e.labels),n=0;n>>3){case 1:o.rules&&o.rules.length||(o.rules=[]),o.rules.push(c.google.api.HttpRule.decode(e,e.uint32()));break;case 2:o.fullyDecodeReservedExpansion=e.bool();break;default:e.skipType(7&r)}}return o},l.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},l.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.rules&&e.hasOwnProperty(\"rules\")){if(!Array.isArray(e.rules))return\"rules: array expected\";for(var t=0;t>>3){case 1:o.selector=e.string();break;case 2:o.get=e.string();break;case 3:o.put=e.string();break;case 4:o.post=e.string();break;case 5:o.delete=e.string();break;case 6:o.patch=e.string();break;case 8:o.custom=c.google.api.CustomHttpPattern.decode(e,e.uint32());break;case 7:o.body=e.string();break;case 12:o.responseBody=e.string();break;case 11:o.additionalBindings&&o.additionalBindings.length||(o.additionalBindings=[]),o.additionalBindings.push(c.google.api.HttpRule.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},d.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},d.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";var t={};if(null!=e.selector&&e.hasOwnProperty(\"selector\")&&!u.isString(e.selector))return\"selector: string expected\";if(null!=e.get&&e.hasOwnProperty(\"get\")&&(t.pattern=1,!u.isString(e.get)))return\"get: string expected\";if(null!=e.put&&e.hasOwnProperty(\"put\")){if(1===t.pattern)return\"pattern: multiple values\";if(t.pattern=1,!u.isString(e.put))return\"put: string expected\"}if(null!=e.post&&e.hasOwnProperty(\"post\")){if(1===t.pattern)return\"pattern: multiple values\";if(t.pattern=1,!u.isString(e.post))return\"post: string expected\"}if(null!=e.delete&&e.hasOwnProperty(\"delete\")){if(1===t.pattern)return\"pattern: multiple values\";if(t.pattern=1,!u.isString(e.delete))return\"delete: string expected\"}if(null!=e.patch&&e.hasOwnProperty(\"patch\")){if(1===t.pattern)return\"pattern: multiple values\";if(t.pattern=1,!u.isString(e.patch))return\"patch: string expected\"}if(null!=e.custom&&e.hasOwnProperty(\"custom\")){if(1===t.pattern)return\"pattern: multiple values\";if(t.pattern=1,n=c.google.api.CustomHttpPattern.verify(e.custom))return\"custom.\"+n}if(null!=e.body&&e.hasOwnProperty(\"body\")&&!u.isString(e.body))return\"body: string expected\";if(null!=e.responseBody&&e.hasOwnProperty(\"responseBody\")&&!u.isString(e.responseBody))return\"responseBody: string expected\";if(null!=e.additionalBindings&&e.hasOwnProperty(\"additionalBindings\")){if(!Array.isArray(e.additionalBindings))return\"additionalBindings: array expected\";for(var n,o=0;o>>3){case 1:o.kind=e.string();break;case 2:o.path=e.string();break;default:e.skipType(7&r)}}return o},g.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},g.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.kind&&e.hasOwnProperty(\"kind\")&&!u.isString(e.kind)?\"kind: string expected\":null!=e.path&&e.hasOwnProperty(\"path\")&&!u.isString(e.path)?\"path: string expected\":null},g.fromObject=function(e){var t;return e instanceof c.google.api.CustomHttpPattern?e:(t=new c.google.api.CustomHttpPattern,null!=e.kind&&(t.kind=String(e.kind)),null!=e.path&&(t.path=String(e.path)),t)},g.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.kind=\"\",n.path=\"\"),null!=e.kind&&e.hasOwnProperty(\"kind\")&&(n.kind=e.kind),null!=e.path&&e.hasOwnProperty(\"path\")&&(n.path=e.path),n},g.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},g),e),F.protobuf=((n={}).FileDescriptorSet=(B.prototype.file=u.emptyArray,B.create=function(e){return new B(e)},B.encode=function(e,t){if(t=t||r.create(),null!=e.file&&e.file.length)for(var n=0;n>>3==1?(o.file&&o.file.length||(o.file=[]),o.file.push(c.google.protobuf.FileDescriptorProto.decode(e,e.uint32()))):e.skipType(7&r)}return o},B.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},B.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.file&&e.hasOwnProperty(\"file\")){if(!Array.isArray(e.file))return\"file: array expected\";for(var t=0;t>>3){case 1:o.name=e.string();break;case 2:o.package=e.string();break;case 3:o.dependency&&o.dependency.length||(o.dependency=[]),o.dependency.push(e.string());break;case 10:if(o.publicDependency&&o.publicDependency.length||(o.publicDependency=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos>>3){case 1:o.name=e.string();break;case 2:o.field&&o.field.length||(o.field=[]),o.field.push(c.google.protobuf.FieldDescriptorProto.decode(e,e.uint32()));break;case 6:o.extension&&o.extension.length||(o.extension=[]),o.extension.push(c.google.protobuf.FieldDescriptorProto.decode(e,e.uint32()));break;case 3:o.nestedType&&o.nestedType.length||(o.nestedType=[]),o.nestedType.push(c.google.protobuf.DescriptorProto.decode(e,e.uint32()));break;case 4:o.enumType&&o.enumType.length||(o.enumType=[]),o.enumType.push(c.google.protobuf.EnumDescriptorProto.decode(e,e.uint32()));break;case 5:o.extensionRange&&o.extensionRange.length||(o.extensionRange=[]),o.extensionRange.push(c.google.protobuf.DescriptorProto.ExtensionRange.decode(e,e.uint32()));break;case 8:o.oneofDecl&&o.oneofDecl.length||(o.oneofDecl=[]),o.oneofDecl.push(c.google.protobuf.OneofDescriptorProto.decode(e,e.uint32()));break;case 7:o.options=c.google.protobuf.MessageOptions.decode(e,e.uint32());break;case 9:o.reservedRange&&o.reservedRange.length||(o.reservedRange=[]),o.reservedRange.push(c.google.protobuf.DescriptorProto.ReservedRange.decode(e,e.uint32()));break;case 10:o.reservedName&&o.reservedName.length||(o.reservedName=[]),o.reservedName.push(e.string());break;default:e.skipType(7&r)}}return o},y.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},y.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!u.isString(e.name))return\"name: string expected\";if(null!=e.field&&e.hasOwnProperty(\"field\")){if(!Array.isArray(e.field))return\"field: array expected\";for(var t=0;t>>3){case 1:o.start=e.int32();break;case 2:o.end=e.int32();break;case 3:o.options=c.google.protobuf.ExtensionRangeOptions.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},h.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},h.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.start&&e.hasOwnProperty(\"start\")&&!u.isInteger(e.start))return\"start: integer expected\";if(null!=e.end&&e.hasOwnProperty(\"end\")&&!u.isInteger(e.end))return\"end: integer expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){e=c.google.protobuf.ExtensionRangeOptions.verify(e.options);if(e)return\"options.\"+e}return null},h.fromObject=function(e){if(e instanceof c.google.protobuf.DescriptorProto.ExtensionRange)return e;var t=new c.google.protobuf.DescriptorProto.ExtensionRange;if(null!=e.start&&(t.start=0|e.start),null!=e.end&&(t.end=0|e.end),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.protobuf.DescriptorProto.ExtensionRange.options: object expected\");t.options=c.google.protobuf.ExtensionRangeOptions.fromObject(e.options)}return t},h.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.start=0,n.end=0,n.options=null),null!=e.start&&e.hasOwnProperty(\"start\")&&(n.start=e.start),null!=e.end&&e.hasOwnProperty(\"end\")&&(n.end=e.end),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=c.google.protobuf.ExtensionRangeOptions.toObject(e.options,t)),n},h.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},h),y.ReservedRange=(b.prototype.start=0,b.prototype.end=0,b.create=function(e){return new b(e)},b.encode=function(e,t){return t=t||r.create(),null!=e.start&&Object.hasOwnProperty.call(e,\"start\")&&t.uint32(8).int32(e.start),null!=e.end&&Object.hasOwnProperty.call(e,\"end\")&&t.uint32(16).int32(e.end),t},b.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},b.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.google.protobuf.DescriptorProto.ReservedRange;e.pos>>3){case 1:o.start=e.int32();break;case 2:o.end=e.int32();break;default:e.skipType(7&r)}}return o},b.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},b.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.start&&e.hasOwnProperty(\"start\")&&!u.isInteger(e.start)?\"start: integer expected\":null!=e.end&&e.hasOwnProperty(\"end\")&&!u.isInteger(e.end)?\"end: integer expected\":null},b.fromObject=function(e){var t;return e instanceof c.google.protobuf.DescriptorProto.ReservedRange?e:(t=new c.google.protobuf.DescriptorProto.ReservedRange,null!=e.start&&(t.start=0|e.start),null!=e.end&&(t.end=0|e.end),t)},b.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.start=0,n.end=0),null!=e.start&&e.hasOwnProperty(\"start\")&&(n.start=e.start),null!=e.end&&e.hasOwnProperty(\"end\")&&(n.end=e.end),n},b.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},b),y),n.ExtensionRangeOptions=(U.prototype.uninterpretedOption=u.emptyArray,U.create=function(e){return new U(e)},U.encode=function(e,t){if(t=t||r.create(),null!=e.uninterpretedOption&&e.uninterpretedOption.length)for(var n=0;n>>3==999?(o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(c.google.protobuf.UninterpretedOption.decode(e,e.uint32()))):e.skipType(7&r)}return o},U.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},U.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 1:o.name=e.string();break;case 3:o.number=e.int32();break;case 4:o.label=e.int32();break;case 5:o.type=e.int32();break;case 6:o.typeName=e.string();break;case 2:o.extendee=e.string();break;case 7:o.defaultValue=e.string();break;case 9:o.oneofIndex=e.int32();break;case 10:o.jsonName=e.string();break;case 8:o.options=c.google.protobuf.FieldOptions.decode(e,e.uint32());break;case 17:o.proto3Optional=e.bool();break;default:e.skipType(7&r)}}return o},O.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},O.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!u.isString(e.name))return\"name: string expected\";if(null!=e.number&&e.hasOwnProperty(\"number\")&&!u.isInteger(e.number))return\"number: integer expected\";if(null!=e.label&&e.hasOwnProperty(\"label\"))switch(e.label){default:return\"label: enum value expected\";case 1:case 2:case 3:}if(null!=e.type&&e.hasOwnProperty(\"type\"))switch(e.type){default:return\"type: enum value expected\";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:}if(null!=e.typeName&&e.hasOwnProperty(\"typeName\")&&!u.isString(e.typeName))return\"typeName: string expected\";if(null!=e.extendee&&e.hasOwnProperty(\"extendee\")&&!u.isString(e.extendee))return\"extendee: string expected\";if(null!=e.defaultValue&&e.hasOwnProperty(\"defaultValue\")&&!u.isString(e.defaultValue))return\"defaultValue: string expected\";if(null!=e.oneofIndex&&e.hasOwnProperty(\"oneofIndex\")&&!u.isInteger(e.oneofIndex))return\"oneofIndex: integer expected\";if(null!=e.jsonName&&e.hasOwnProperty(\"jsonName\")&&!u.isString(e.jsonName))return\"jsonName: string expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){var t=c.google.protobuf.FieldOptions.verify(e.options);if(t)return\"options.\"+t}return null!=e.proto3Optional&&e.hasOwnProperty(\"proto3Optional\")&&\"boolean\"!=typeof e.proto3Optional?\"proto3Optional: boolean expected\":null},O.fromObject=function(e){if(e instanceof c.google.protobuf.FieldDescriptorProto)return e;var t=new c.google.protobuf.FieldDescriptorProto;switch(null!=e.name&&(t.name=String(e.name)),null!=e.number&&(t.number=0|e.number),e.label){case\"LABEL_OPTIONAL\":case 1:t.label=1;break;case\"LABEL_REQUIRED\":case 2:t.label=2;break;case\"LABEL_REPEATED\":case 3:t.label=3}switch(e.type){case\"TYPE_DOUBLE\":case 1:t.type=1;break;case\"TYPE_FLOAT\":case 2:t.type=2;break;case\"TYPE_INT64\":case 3:t.type=3;break;case\"TYPE_UINT64\":case 4:t.type=4;break;case\"TYPE_INT32\":case 5:t.type=5;break;case\"TYPE_FIXED64\":case 6:t.type=6;break;case\"TYPE_FIXED32\":case 7:t.type=7;break;case\"TYPE_BOOL\":case 8:t.type=8;break;case\"TYPE_STRING\":case 9:t.type=9;break;case\"TYPE_GROUP\":case 10:t.type=10;break;case\"TYPE_MESSAGE\":case 11:t.type=11;break;case\"TYPE_BYTES\":case 12:t.type=12;break;case\"TYPE_UINT32\":case 13:t.type=13;break;case\"TYPE_ENUM\":case 14:t.type=14;break;case\"TYPE_SFIXED32\":case 15:t.type=15;break;case\"TYPE_SFIXED64\":case 16:t.type=16;break;case\"TYPE_SINT32\":case 17:t.type=17;break;case\"TYPE_SINT64\":case 18:t.type=18}if(null!=e.typeName&&(t.typeName=String(e.typeName)),null!=e.extendee&&(t.extendee=String(e.extendee)),null!=e.defaultValue&&(t.defaultValue=String(e.defaultValue)),null!=e.oneofIndex&&(t.oneofIndex=0|e.oneofIndex),null!=e.jsonName&&(t.jsonName=String(e.jsonName)),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.protobuf.FieldDescriptorProto.options: object expected\");t.options=c.google.protobuf.FieldOptions.fromObject(e.options)}return null!=e.proto3Optional&&(t.proto3Optional=Boolean(e.proto3Optional)),t},O.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\",n.extendee=\"\",n.number=0,n.label=t.enums===String?\"LABEL_OPTIONAL\":1,n.type=t.enums===String?\"TYPE_DOUBLE\":1,n.typeName=\"\",n.defaultValue=\"\",n.options=null,n.oneofIndex=0,n.jsonName=\"\",n.proto3Optional=!1),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),null!=e.extendee&&e.hasOwnProperty(\"extendee\")&&(n.extendee=e.extendee),null!=e.number&&e.hasOwnProperty(\"number\")&&(n.number=e.number),null!=e.label&&e.hasOwnProperty(\"label\")&&(n.label=t.enums===String?c.google.protobuf.FieldDescriptorProto.Label[e.label]:e.label),null!=e.type&&e.hasOwnProperty(\"type\")&&(n.type=t.enums===String?c.google.protobuf.FieldDescriptorProto.Type[e.type]:e.type),null!=e.typeName&&e.hasOwnProperty(\"typeName\")&&(n.typeName=e.typeName),null!=e.defaultValue&&e.hasOwnProperty(\"defaultValue\")&&(n.defaultValue=e.defaultValue),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=c.google.protobuf.FieldOptions.toObject(e.options,t)),null!=e.oneofIndex&&e.hasOwnProperty(\"oneofIndex\")&&(n.oneofIndex=e.oneofIndex),null!=e.jsonName&&e.hasOwnProperty(\"jsonName\")&&(n.jsonName=e.jsonName),null!=e.proto3Optional&&e.hasOwnProperty(\"proto3Optional\")&&(n.proto3Optional=e.proto3Optional),n},O.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},O.Type=(e={},(t=Object.create(e))[e[1]=\"TYPE_DOUBLE\"]=1,t[e[2]=\"TYPE_FLOAT\"]=2,t[e[3]=\"TYPE_INT64\"]=3,t[e[4]=\"TYPE_UINT64\"]=4,t[e[5]=\"TYPE_INT32\"]=5,t[e[6]=\"TYPE_FIXED64\"]=6,t[e[7]=\"TYPE_FIXED32\"]=7,t[e[8]=\"TYPE_BOOL\"]=8,t[e[9]=\"TYPE_STRING\"]=9,t[e[10]=\"TYPE_GROUP\"]=10,t[e[11]=\"TYPE_MESSAGE\"]=11,t[e[12]=\"TYPE_BYTES\"]=12,t[e[13]=\"TYPE_UINT32\"]=13,t[e[14]=\"TYPE_ENUM\"]=14,t[e[15]=\"TYPE_SFIXED32\"]=15,t[e[16]=\"TYPE_SFIXED64\"]=16,t[e[17]=\"TYPE_SINT32\"]=17,t[e[18]=\"TYPE_SINT64\"]=18,t),O.Label=(e={},(t=Object.create(e))[e[1]=\"LABEL_OPTIONAL\"]=1,t[e[2]=\"LABEL_REQUIRED\"]=2,t[e[3]=\"LABEL_REPEATED\"]=3,t),O),n.OneofDescriptorProto=(m.prototype.name=\"\",m.prototype.options=null,m.create=function(e){return new m(e)},m.encode=function(e,t){return t=t||r.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),null!=e.options&&Object.hasOwnProperty.call(e,\"options\")&&c.google.protobuf.OneofOptions.encode(e.options,t.uint32(18).fork()).ldelim(),t},m.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},m.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.google.protobuf.OneofDescriptorProto;e.pos>>3){case 1:o.name=e.string();break;case 2:o.options=c.google.protobuf.OneofOptions.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},m.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},m.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!u.isString(e.name))return\"name: string expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){e=c.google.protobuf.OneofOptions.verify(e.options);if(e)return\"options.\"+e}return null},m.fromObject=function(e){if(e instanceof c.google.protobuf.OneofDescriptorProto)return e;var t=new c.google.protobuf.OneofDescriptorProto;if(null!=e.name&&(t.name=String(e.name)),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.protobuf.OneofDescriptorProto.options: object expected\");t.options=c.google.protobuf.OneofOptions.fromObject(e.options)}return t},m.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\",n.options=null),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=c.google.protobuf.OneofOptions.toObject(e.options,t)),n},m.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},m),n.EnumDescriptorProto=(v.prototype.name=\"\",v.prototype.value=u.emptyArray,v.prototype.options=null,v.prototype.reservedRange=u.emptyArray,v.prototype.reservedName=u.emptyArray,v.create=function(e){return new v(e)},v.encode=function(e,t){if(t=t||r.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),null!=e.value&&e.value.length)for(var n=0;n>>3){case 1:o.name=e.string();break;case 2:o.value&&o.value.length||(o.value=[]),o.value.push(c.google.protobuf.EnumValueDescriptorProto.decode(e,e.uint32()));break;case 3:o.options=c.google.protobuf.EnumOptions.decode(e,e.uint32());break;case 4:o.reservedRange&&o.reservedRange.length||(o.reservedRange=[]),o.reservedRange.push(c.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(e,e.uint32()));break;case 5:o.reservedName&&o.reservedName.length||(o.reservedName=[]),o.reservedName.push(e.string());break;default:e.skipType(7&r)}}return o},v.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},v.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!u.isString(e.name))return\"name: string expected\";if(null!=e.value&&e.hasOwnProperty(\"value\")){if(!Array.isArray(e.value))return\"value: array expected\";for(var t=0;t>>3){case 1:o.start=e.int32();break;case 2:o.end=e.int32();break;default:e.skipType(7&r)}}return o},P.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},P.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.start&&e.hasOwnProperty(\"start\")&&!u.isInteger(e.start)?\"start: integer expected\":null!=e.end&&e.hasOwnProperty(\"end\")&&!u.isInteger(e.end)?\"end: integer expected\":null},P.fromObject=function(e){var t;return e instanceof c.google.protobuf.EnumDescriptorProto.EnumReservedRange?e:(t=new c.google.protobuf.EnumDescriptorProto.EnumReservedRange,null!=e.start&&(t.start=0|e.start),null!=e.end&&(t.end=0|e.end),t)},P.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.start=0,n.end=0),null!=e.start&&e.hasOwnProperty(\"start\")&&(n.start=e.start),null!=e.end&&e.hasOwnProperty(\"end\")&&(n.end=e.end),n},P.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},P),v),n.EnumValueDescriptorProto=(w.prototype.name=\"\",w.prototype.number=0,w.prototype.options=null,w.create=function(e){return new w(e)},w.encode=function(e,t){return t=t||r.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),null!=e.number&&Object.hasOwnProperty.call(e,\"number\")&&t.uint32(16).int32(e.number),null!=e.options&&Object.hasOwnProperty.call(e,\"options\")&&c.google.protobuf.EnumValueOptions.encode(e.options,t.uint32(26).fork()).ldelim(),t},w.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},w.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.google.protobuf.EnumValueDescriptorProto;e.pos>>3){case 1:o.name=e.string();break;case 2:o.number=e.int32();break;case 3:o.options=c.google.protobuf.EnumValueOptions.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},w.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},w.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!u.isString(e.name))return\"name: string expected\";if(null!=e.number&&e.hasOwnProperty(\"number\")&&!u.isInteger(e.number))return\"number: integer expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){e=c.google.protobuf.EnumValueOptions.verify(e.options);if(e)return\"options.\"+e}return null},w.fromObject=function(e){if(e instanceof c.google.protobuf.EnumValueDescriptorProto)return e;var t=new c.google.protobuf.EnumValueDescriptorProto;if(null!=e.name&&(t.name=String(e.name)),null!=e.number&&(t.number=0|e.number),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.protobuf.EnumValueDescriptorProto.options: object expected\");t.options=c.google.protobuf.EnumValueOptions.fromObject(e.options)}return t},w.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\",n.number=0,n.options=null),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),null!=e.number&&e.hasOwnProperty(\"number\")&&(n.number=e.number),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=c.google.protobuf.EnumValueOptions.toObject(e.options,t)),n},w.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},w),n.ServiceDescriptorProto=(j.prototype.name=\"\",j.prototype.method=u.emptyArray,j.prototype.options=null,j.create=function(e){return new j(e)},j.encode=function(e,t){if(t=t||r.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),null!=e.method&&e.method.length)for(var n=0;n>>3){case 1:o.name=e.string();break;case 2:o.method&&o.method.length||(o.method=[]),o.method.push(c.google.protobuf.MethodDescriptorProto.decode(e,e.uint32()));break;case 3:o.options=c.google.protobuf.ServiceOptions.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},j.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},j.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!u.isString(e.name))return\"name: string expected\";if(null!=e.method&&e.hasOwnProperty(\"method\")){if(!Array.isArray(e.method))return\"method: array expected\";for(var t=0;t>>3){case 1:o.name=e.string();break;case 2:o.inputType=e.string();break;case 3:o.outputType=e.string();break;case 4:o.options=c.google.protobuf.MethodOptions.decode(e,e.uint32());break;case 5:o.clientStreaming=e.bool();break;case 6:o.serverStreaming=e.bool();break;default:e.skipType(7&r)}}return o},x.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},x.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!u.isString(e.name))return\"name: string expected\";if(null!=e.inputType&&e.hasOwnProperty(\"inputType\")&&!u.isString(e.inputType))return\"inputType: string expected\";if(null!=e.outputType&&e.hasOwnProperty(\"outputType\")&&!u.isString(e.outputType))return\"outputType: string expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){var t=c.google.protobuf.MethodOptions.verify(e.options);if(t)return\"options.\"+t}return null!=e.clientStreaming&&e.hasOwnProperty(\"clientStreaming\")&&\"boolean\"!=typeof e.clientStreaming?\"clientStreaming: boolean expected\":null!=e.serverStreaming&&e.hasOwnProperty(\"serverStreaming\")&&\"boolean\"!=typeof e.serverStreaming?\"serverStreaming: boolean expected\":null},x.fromObject=function(e){if(e instanceof c.google.protobuf.MethodDescriptorProto)return e;var t=new c.google.protobuf.MethodDescriptorProto;if(null!=e.name&&(t.name=String(e.name)),null!=e.inputType&&(t.inputType=String(e.inputType)),null!=e.outputType&&(t.outputType=String(e.outputType)),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.protobuf.MethodDescriptorProto.options: object expected\");t.options=c.google.protobuf.MethodOptions.fromObject(e.options)}return null!=e.clientStreaming&&(t.clientStreaming=Boolean(e.clientStreaming)),null!=e.serverStreaming&&(t.serverStreaming=Boolean(e.serverStreaming)),t},x.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\",n.inputType=\"\",n.outputType=\"\",n.options=null,n.clientStreaming=!1,n.serverStreaming=!1),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),null!=e.inputType&&e.hasOwnProperty(\"inputType\")&&(n.inputType=e.inputType),null!=e.outputType&&e.hasOwnProperty(\"outputType\")&&(n.outputType=e.outputType),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=c.google.protobuf.MethodOptions.toObject(e.options,t)),null!=e.clientStreaming&&e.hasOwnProperty(\"clientStreaming\")&&(n.clientStreaming=e.clientStreaming),null!=e.serverStreaming&&e.hasOwnProperty(\"serverStreaming\")&&(n.serverStreaming=e.serverStreaming),n},x.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},x),n.FileOptions=(S.prototype.javaPackage=\"\",S.prototype.javaOuterClassname=\"\",S.prototype.javaMultipleFiles=!1,S.prototype.javaGenerateEqualsAndHash=!1,S.prototype.javaStringCheckUtf8=!1,S.prototype.optimizeFor=1,S.prototype.goPackage=\"\",S.prototype.ccGenericServices=!1,S.prototype.javaGenericServices=!1,S.prototype.pyGenericServices=!1,S.prototype.phpGenericServices=!1,S.prototype.deprecated=!1,S.prototype.ccEnableArenas=!0,S.prototype.objcClassPrefix=\"\",S.prototype.csharpNamespace=\"\",S.prototype.swiftPrefix=\"\",S.prototype.phpClassPrefix=\"\",S.prototype.phpNamespace=\"\",S.prototype.phpMetadataNamespace=\"\",S.prototype.rubyPackage=\"\",S.prototype.uninterpretedOption=u.emptyArray,S.create=function(e){return new S(e)},S.encode=function(e,t){if(t=t||r.create(),null!=e.javaPackage&&Object.hasOwnProperty.call(e,\"javaPackage\")&&t.uint32(10).string(e.javaPackage),null!=e.javaOuterClassname&&Object.hasOwnProperty.call(e,\"javaOuterClassname\")&&t.uint32(66).string(e.javaOuterClassname),null!=e.optimizeFor&&Object.hasOwnProperty.call(e,\"optimizeFor\")&&t.uint32(72).int32(e.optimizeFor),null!=e.javaMultipleFiles&&Object.hasOwnProperty.call(e,\"javaMultipleFiles\")&&t.uint32(80).bool(e.javaMultipleFiles),null!=e.goPackage&&Object.hasOwnProperty.call(e,\"goPackage\")&&t.uint32(90).string(e.goPackage),null!=e.ccGenericServices&&Object.hasOwnProperty.call(e,\"ccGenericServices\")&&t.uint32(128).bool(e.ccGenericServices),null!=e.javaGenericServices&&Object.hasOwnProperty.call(e,\"javaGenericServices\")&&t.uint32(136).bool(e.javaGenericServices),null!=e.pyGenericServices&&Object.hasOwnProperty.call(e,\"pyGenericServices\")&&t.uint32(144).bool(e.pyGenericServices),null!=e.javaGenerateEqualsAndHash&&Object.hasOwnProperty.call(e,\"javaGenerateEqualsAndHash\")&&t.uint32(160).bool(e.javaGenerateEqualsAndHash),null!=e.deprecated&&Object.hasOwnProperty.call(e,\"deprecated\")&&t.uint32(184).bool(e.deprecated),null!=e.javaStringCheckUtf8&&Object.hasOwnProperty.call(e,\"javaStringCheckUtf8\")&&t.uint32(216).bool(e.javaStringCheckUtf8),null!=e.ccEnableArenas&&Object.hasOwnProperty.call(e,\"ccEnableArenas\")&&t.uint32(248).bool(e.ccEnableArenas),null!=e.objcClassPrefix&&Object.hasOwnProperty.call(e,\"objcClassPrefix\")&&t.uint32(290).string(e.objcClassPrefix),null!=e.csharpNamespace&&Object.hasOwnProperty.call(e,\"csharpNamespace\")&&t.uint32(298).string(e.csharpNamespace),null!=e.swiftPrefix&&Object.hasOwnProperty.call(e,\"swiftPrefix\")&&t.uint32(314).string(e.swiftPrefix),null!=e.phpClassPrefix&&Object.hasOwnProperty.call(e,\"phpClassPrefix\")&&t.uint32(322).string(e.phpClassPrefix),null!=e.phpNamespace&&Object.hasOwnProperty.call(e,\"phpNamespace\")&&t.uint32(330).string(e.phpNamespace),null!=e.phpGenericServices&&Object.hasOwnProperty.call(e,\"phpGenericServices\")&&t.uint32(336).bool(e.phpGenericServices),null!=e.phpMetadataNamespace&&Object.hasOwnProperty.call(e,\"phpMetadataNamespace\")&&t.uint32(354).string(e.phpMetadataNamespace),null!=e.rubyPackage&&Object.hasOwnProperty.call(e,\"rubyPackage\")&&t.uint32(362).string(e.rubyPackage),null!=e.uninterpretedOption&&e.uninterpretedOption.length)for(var n=0;n>>3){case 1:o.javaPackage=e.string();break;case 8:o.javaOuterClassname=e.string();break;case 10:o.javaMultipleFiles=e.bool();break;case 20:o.javaGenerateEqualsAndHash=e.bool();break;case 27:o.javaStringCheckUtf8=e.bool();break;case 9:o.optimizeFor=e.int32();break;case 11:o.goPackage=e.string();break;case 16:o.ccGenericServices=e.bool();break;case 17:o.javaGenericServices=e.bool();break;case 18:o.pyGenericServices=e.bool();break;case 42:o.phpGenericServices=e.bool();break;case 23:o.deprecated=e.bool();break;case 31:o.ccEnableArenas=e.bool();break;case 36:o.objcClassPrefix=e.string();break;case 37:o.csharpNamespace=e.string();break;case 39:o.swiftPrefix=e.string();break;case 40:o.phpClassPrefix=e.string();break;case 41:o.phpNamespace=e.string();break;case 44:o.phpMetadataNamespace=e.string();break;case 45:o.rubyPackage=e.string();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(c.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},S.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},S.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.javaPackage&&e.hasOwnProperty(\"javaPackage\")&&!u.isString(e.javaPackage))return\"javaPackage: string expected\";if(null!=e.javaOuterClassname&&e.hasOwnProperty(\"javaOuterClassname\")&&!u.isString(e.javaOuterClassname))return\"javaOuterClassname: string expected\";if(null!=e.javaMultipleFiles&&e.hasOwnProperty(\"javaMultipleFiles\")&&\"boolean\"!=typeof e.javaMultipleFiles)return\"javaMultipleFiles: boolean expected\";if(null!=e.javaGenerateEqualsAndHash&&e.hasOwnProperty(\"javaGenerateEqualsAndHash\")&&\"boolean\"!=typeof e.javaGenerateEqualsAndHash)return\"javaGenerateEqualsAndHash: boolean expected\";if(null!=e.javaStringCheckUtf8&&e.hasOwnProperty(\"javaStringCheckUtf8\")&&\"boolean\"!=typeof e.javaStringCheckUtf8)return\"javaStringCheckUtf8: boolean expected\";if(null!=e.optimizeFor&&e.hasOwnProperty(\"optimizeFor\"))switch(e.optimizeFor){default:return\"optimizeFor: enum value expected\";case 1:case 2:case 3:}if(null!=e.goPackage&&e.hasOwnProperty(\"goPackage\")&&!u.isString(e.goPackage))return\"goPackage: string expected\";if(null!=e.ccGenericServices&&e.hasOwnProperty(\"ccGenericServices\")&&\"boolean\"!=typeof e.ccGenericServices)return\"ccGenericServices: boolean expected\";if(null!=e.javaGenericServices&&e.hasOwnProperty(\"javaGenericServices\")&&\"boolean\"!=typeof e.javaGenericServices)return\"javaGenericServices: boolean expected\";if(null!=e.pyGenericServices&&e.hasOwnProperty(\"pyGenericServices\")&&\"boolean\"!=typeof e.pyGenericServices)return\"pyGenericServices: boolean expected\";if(null!=e.phpGenericServices&&e.hasOwnProperty(\"phpGenericServices\")&&\"boolean\"!=typeof e.phpGenericServices)return\"phpGenericServices: boolean expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.ccEnableArenas&&e.hasOwnProperty(\"ccEnableArenas\")&&\"boolean\"!=typeof e.ccEnableArenas)return\"ccEnableArenas: boolean expected\";if(null!=e.objcClassPrefix&&e.hasOwnProperty(\"objcClassPrefix\")&&!u.isString(e.objcClassPrefix))return\"objcClassPrefix: string expected\";if(null!=e.csharpNamespace&&e.hasOwnProperty(\"csharpNamespace\")&&!u.isString(e.csharpNamespace))return\"csharpNamespace: string expected\";if(null!=e.swiftPrefix&&e.hasOwnProperty(\"swiftPrefix\")&&!u.isString(e.swiftPrefix))return\"swiftPrefix: string expected\";if(null!=e.phpClassPrefix&&e.hasOwnProperty(\"phpClassPrefix\")&&!u.isString(e.phpClassPrefix))return\"phpClassPrefix: string expected\";if(null!=e.phpNamespace&&e.hasOwnProperty(\"phpNamespace\")&&!u.isString(e.phpNamespace))return\"phpNamespace: string expected\";if(null!=e.phpMetadataNamespace&&e.hasOwnProperty(\"phpMetadataNamespace\")&&!u.isString(e.phpMetadataNamespace))return\"phpMetadataNamespace: string expected\";if(null!=e.rubyPackage&&e.hasOwnProperty(\"rubyPackage\")&&!u.isString(e.rubyPackage))return\"rubyPackage: string expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 1:o.messageSetWireFormat=e.bool();break;case 2:o.noStandardDescriptorAccessor=e.bool();break;case 3:o.deprecated=e.bool();break;case 7:o.mapEntry=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(c.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},k.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},k.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.messageSetWireFormat&&e.hasOwnProperty(\"messageSetWireFormat\")&&\"boolean\"!=typeof e.messageSetWireFormat)return\"messageSetWireFormat: boolean expected\";if(null!=e.noStandardDescriptorAccessor&&e.hasOwnProperty(\"noStandardDescriptorAccessor\")&&\"boolean\"!=typeof e.noStandardDescriptorAccessor)return\"noStandardDescriptorAccessor: boolean expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.mapEntry&&e.hasOwnProperty(\"mapEntry\")&&\"boolean\"!=typeof e.mapEntry)return\"mapEntry: boolean expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 1:o.ctype=e.int32();break;case 2:o.packed=e.bool();break;case 6:o.jstype=e.int32();break;case 5:o.lazy=e.bool();break;case 3:o.deprecated=e.bool();break;case 10:o.weak=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(c.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},D.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},D.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.ctype&&e.hasOwnProperty(\"ctype\"))switch(e.ctype){default:return\"ctype: enum value expected\";case 0:case 1:case 2:}if(null!=e.packed&&e.hasOwnProperty(\"packed\")&&\"boolean\"!=typeof e.packed)return\"packed: boolean expected\";if(null!=e.jstype&&e.hasOwnProperty(\"jstype\"))switch(e.jstype){default:return\"jstype: enum value expected\";case 0:case 1:case 2:}if(null!=e.lazy&&e.hasOwnProperty(\"lazy\")&&\"boolean\"!=typeof e.lazy)return\"lazy: boolean expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.weak&&e.hasOwnProperty(\"weak\")&&\"boolean\"!=typeof e.weak)return\"weak: boolean expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3==999?(o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(c.google.protobuf.UninterpretedOption.decode(e,e.uint32()))):e.skipType(7&r)}return o},M.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},M.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 2:o.allowAlias=e.bool();break;case 3:o.deprecated=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(c.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},T.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},T.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.allowAlias&&e.hasOwnProperty(\"allowAlias\")&&\"boolean\"!=typeof e.allowAlias)return\"allowAlias: boolean expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 1:o.deprecated=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(c.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},E.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},E.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 33:o.deprecated=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(c.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;case 1049:o[\".google.api.defaultHost\"]=e.string();break;case 1050:o[\".google.api.oauthScopes\"]=e.string();break;default:e.skipType(7&r)}}return o},A.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},A.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 33:o.deprecated=e.bool();break;case 34:o.idempotencyLevel=e.int32();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(c.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;case 72295728:o[\".google.api.http\"]=c.google.api.HttpRule.decode(e,e.uint32());break;case 1051:o[\".google.api.methodSignature\"]&&o[\".google.api.methodSignature\"].length||(o[\".google.api.methodSignature\"]=[]),o[\".google.api.methodSignature\"].push(e.string());break;default:e.skipType(7&r)}}return o},N.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},N.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.idempotencyLevel&&e.hasOwnProperty(\"idempotencyLevel\"))switch(e.idempotencyLevel){default:return\"idempotencyLevel: enum value expected\";case 0:case 1:case 2:}if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 2:o.name&&o.name.length||(o.name=[]),o.name.push(c.google.protobuf.UninterpretedOption.NamePart.decode(e,e.uint32()));break;case 3:o.identifierValue=e.string();break;case 4:o.positiveIntValue=e.uint64();break;case 5:o.negativeIntValue=e.int64();break;case 6:o.doubleValue=e.double();break;case 7:o.stringValue=e.bytes();break;case 8:o.aggregateValue=e.string();break;default:e.skipType(7&r)}}return o},I.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},I.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")){if(!Array.isArray(e.name))return\"name: array expected\";for(var t=0;t>>0,e.positiveIntValue.high>>>0).toNumber(!0))),null!=e.negativeIntValue&&(u.Long?(t.negativeIntValue=u.Long.fromValue(e.negativeIntValue)).unsigned=!1:\"string\"==typeof e.negativeIntValue?t.negativeIntValue=parseInt(e.negativeIntValue,10):\"number\"==typeof e.negativeIntValue?t.negativeIntValue=e.negativeIntValue:\"object\"==typeof e.negativeIntValue&&(t.negativeIntValue=new u.LongBits(e.negativeIntValue.low>>>0,e.negativeIntValue.high>>>0).toNumber())),null!=e.doubleValue&&(t.doubleValue=Number(e.doubleValue)),null!=e.stringValue&&(\"string\"==typeof e.stringValue?u.base64.decode(e.stringValue,t.stringValue=u.newBuffer(u.base64.length(e.stringValue)),0):e.stringValue.length&&(t.stringValue=e.stringValue)),null!=e.aggregateValue&&(t.aggregateValue=String(e.aggregateValue)),t},I.toObject=function(e,t){var n,o={};if(((t=t||{}).arrays||t.defaults)&&(o.name=[]),t.defaults&&(o.identifierValue=\"\",u.Long?(n=new u.Long(0,0,!0),o.positiveIntValue=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):o.positiveIntValue=t.longs===String?\"0\":0,u.Long?(n=new u.Long(0,0,!1),o.negativeIntValue=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):o.negativeIntValue=t.longs===String?\"0\":0,o.doubleValue=0,t.bytes===String?o.stringValue=\"\":(o.stringValue=[],t.bytes!==Array&&(o.stringValue=u.newBuffer(o.stringValue))),o.aggregateValue=\"\"),e.name&&e.name.length){o.name=[];for(var r=0;r>>0,e.positiveIntValue.high>>>0).toNumber(!0):e.positiveIntValue),null!=e.negativeIntValue&&e.hasOwnProperty(\"negativeIntValue\")&&(\"number\"==typeof e.negativeIntValue?o.negativeIntValue=t.longs===String?String(e.negativeIntValue):e.negativeIntValue:o.negativeIntValue=t.longs===String?u.Long.prototype.toString.call(e.negativeIntValue):t.longs===Number?new u.LongBits(e.negativeIntValue.low>>>0,e.negativeIntValue.high>>>0).toNumber():e.negativeIntValue),null!=e.doubleValue&&e.hasOwnProperty(\"doubleValue\")&&(o.doubleValue=t.json&&!isFinite(e.doubleValue)?String(e.doubleValue):e.doubleValue),null!=e.stringValue&&e.hasOwnProperty(\"stringValue\")&&(o.stringValue=t.bytes===String?u.base64.encode(e.stringValue,0,e.stringValue.length):t.bytes===Array?Array.prototype.slice.call(e.stringValue):e.stringValue),null!=e.aggregateValue&&e.hasOwnProperty(\"aggregateValue\")&&(o.aggregateValue=e.aggregateValue),o},I.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},I.NamePart=(R.prototype.namePart=\"\",R.prototype.isExtension=!1,R.create=function(e){return new R(e)},R.encode=function(e,t){return(t=t||r.create()).uint32(10).string(e.namePart),t.uint32(16).bool(e.isExtension),t},R.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},R.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.google.protobuf.UninterpretedOption.NamePart;e.pos>>3){case 1:o.namePart=e.string();break;case 2:o.isExtension=e.bool();break;default:e.skipType(7&r)}}if(!o.hasOwnProperty(\"namePart\"))throw u.ProtocolError(\"missing required 'namePart'\",{instance:o});if(o.hasOwnProperty(\"isExtension\"))return o;throw u.ProtocolError(\"missing required 'isExtension'\",{instance:o})},R.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},R.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":u.isString(e.namePart)?\"boolean\"!=typeof e.isExtension?\"isExtension: boolean expected\":null:\"namePart: string expected\"},R.fromObject=function(e){var t;return e instanceof c.google.protobuf.UninterpretedOption.NamePart?e:(t=new c.google.protobuf.UninterpretedOption.NamePart,null!=e.namePart&&(t.namePart=String(e.namePart)),null!=e.isExtension&&(t.isExtension=Boolean(e.isExtension)),t)},R.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.namePart=\"\",n.isExtension=!1),null!=e.namePart&&e.hasOwnProperty(\"namePart\")&&(n.namePart=e.namePart),null!=e.isExtension&&e.hasOwnProperty(\"isExtension\")&&(n.isExtension=e.isExtension),n},R.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},R),I),n.SourceCodeInfo=(_.prototype.location=u.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,t){if(t=t||r.create(),null!=e.location&&e.location.length)for(var n=0;n>>3==1?(o.location&&o.location.length||(o.location=[]),o.location.push(c.google.protobuf.SourceCodeInfo.Location.decode(e,e.uint32()))):e.skipType(7&r)}return o},_.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},_.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.location&&e.hasOwnProperty(\"location\")){if(!Array.isArray(e.location))return\"location: array expected\";for(var t=0;t>>3){case 1:if(o.path&&o.path.length||(o.path=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos>>3==1?(o.annotation&&o.annotation.length||(o.annotation=[]),o.annotation.push(c.google.protobuf.GeneratedCodeInfo.Annotation.decode(e,e.uint32()))):e.skipType(7&r)}return o},J.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},J.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.annotation&&e.hasOwnProperty(\"annotation\")){if(!Array.isArray(e.annotation))return\"annotation: array expected\";for(var t=0;t>>3){case 1:if(o.path&&o.path.length||(o.path=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos>>3){case 1:o.type_url=e.string();break;case 2:o.value=e.bytes();break;default:e.skipType(7&r)}}return o},H.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},H.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.type_url&&e.hasOwnProperty(\"type_url\")&&!u.isString(e.type_url)?\"type_url: string expected\":null!=e.value&&e.hasOwnProperty(\"value\")&&!(e.value&&\"number\"==typeof e.value.length||u.isString(e.value))?\"value: buffer expected\":null},H.fromObject=function(e){var t;return e instanceof c.google.protobuf.Any?e:(t=new c.google.protobuf.Any,null!=e.type_url&&(t.type_url=String(e.type_url)),null!=e.value&&(\"string\"==typeof e.value?u.base64.decode(e.value,t.value=u.newBuffer(u.base64.length(e.value)),0):e.value.length&&(t.value=e.value)),t)},H.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.type_url=\"\",t.bytes===String?n.value=\"\":(n.value=[],t.bytes!==Array&&(n.value=u.newBuffer(n.value)))),null!=e.type_url&&e.hasOwnProperty(\"type_url\")&&(n.type_url=e.type_url),null!=e.value&&e.hasOwnProperty(\"value\")&&(n.value=t.bytes===String?u.base64.encode(e.value,0,e.value.length):t.bytes===Array?Array.prototype.slice.call(e.value):e.value),n},H.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},H),n),F),c});","(e=>{\"function\"==typeof define&&define.amd?define([\"protobufjs/minimal\"],e):\"function\"==typeof require&&\"object\"==typeof module&&module&&module.exports&&(module.exports=e(require(\"protobufjs/minimal\")))})(function(o){var e,t,n,F,a=o.Reader,r=o.Writer,i=o.util,p=o.roots.operations_protos||(o.roots.operations_protos={});function G(e,t,n){o.rpc.Service.call(this,e,t,n)}function l(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:o.name=e.string();break;case 2:o.metadata=p.google.protobuf.Any.decode(e,e.uint32());break;case 3:o.done=e.bool();break;case 4:o.error=p.google.rpc.Status.decode(e,e.uint32());break;case 5:o.response=p.google.protobuf.Any.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},l.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},l.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";var t,n={};if(null!=e.name&&e.hasOwnProperty(\"name\")&&!i.isString(e.name))return\"name: string expected\";if(null!=e.metadata&&e.hasOwnProperty(\"metadata\")&&(t=p.google.protobuf.Any.verify(e.metadata)))return\"metadata.\"+t;if(null!=e.done&&e.hasOwnProperty(\"done\")&&\"boolean\"!=typeof e.done)return\"done: boolean expected\";if(null!=e.error&&e.hasOwnProperty(\"error\")&&(n.result=1,t=p.google.rpc.Status.verify(e.error)))return\"error.\"+t;if(null!=e.response&&e.hasOwnProperty(\"response\")){if(1===n.result)return\"result: multiple values\";if(n.result=1,t=p.google.protobuf.Any.verify(e.response))return\"response.\"+t}return null},l.fromObject=function(e){if(e instanceof p.google.longrunning.Operation)return e;var t=new p.google.longrunning.Operation;if(null!=e.name&&(t.name=String(e.name)),null!=e.metadata){if(\"object\"!=typeof e.metadata)throw TypeError(\".google.longrunning.Operation.metadata: object expected\");t.metadata=p.google.protobuf.Any.fromObject(e.metadata)}if(null!=e.done&&(t.done=Boolean(e.done)),null!=e.error){if(\"object\"!=typeof e.error)throw TypeError(\".google.longrunning.Operation.error: object expected\");t.error=p.google.rpc.Status.fromObject(e.error)}if(null!=e.response){if(\"object\"!=typeof e.response)throw TypeError(\".google.longrunning.Operation.response: object expected\");t.response=p.google.protobuf.Any.fromObject(e.response)}return t},l.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\",n.metadata=null,n.done=!1),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),null!=e.metadata&&e.hasOwnProperty(\"metadata\")&&(n.metadata=p.google.protobuf.Any.toObject(e.metadata,t)),null!=e.done&&e.hasOwnProperty(\"done\")&&(n.done=e.done),null!=e.error&&e.hasOwnProperty(\"error\")&&(n.error=p.google.rpc.Status.toObject(e.error,t),t.oneofs)&&(n.result=\"error\"),null!=e.response&&e.hasOwnProperty(\"response\")&&(n.response=p.google.protobuf.Any.toObject(e.response,t),t.oneofs)&&(n.result=\"response\"),n},l.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},l),t.GetOperationRequest=(B.prototype.name=\"\",B.create=function(e){return new B(e)},B.encode=function(e,t){return t=t||r.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),t},B.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},B.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new p.google.longrunning.GetOperationRequest;e.pos>>3==1?o.name=e.string():e.skipType(7&r)}return o},B.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},B.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.name&&e.hasOwnProperty(\"name\")&&!i.isString(e.name)?\"name: string expected\":null},B.fromObject=function(e){var t;return e instanceof p.google.longrunning.GetOperationRequest?e:(t=new p.google.longrunning.GetOperationRequest,null!=e.name&&(t.name=String(e.name)),t)},B.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\"),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),n},B.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},B),t.ListOperationsRequest=(s.prototype.name=\"\",s.prototype.filter=\"\",s.prototype.pageSize=0,s.prototype.pageToken=\"\",s.create=function(e){return new s(e)},s.encode=function(e,t){return t=t||r.create(),null!=e.filter&&Object.hasOwnProperty.call(e,\"filter\")&&t.uint32(10).string(e.filter),null!=e.pageSize&&Object.hasOwnProperty.call(e,\"pageSize\")&&t.uint32(16).int32(e.pageSize),null!=e.pageToken&&Object.hasOwnProperty.call(e,\"pageToken\")&&t.uint32(26).string(e.pageToken),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(34).string(e.name),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new p.google.longrunning.ListOperationsRequest;e.pos>>3){case 4:o.name=e.string();break;case 1:o.filter=e.string();break;case 2:o.pageSize=e.int32();break;case 3:o.pageToken=e.string();break;default:e.skipType(7&r)}}return o},s.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},s.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.name&&e.hasOwnProperty(\"name\")&&!i.isString(e.name)?\"name: string expected\":null!=e.filter&&e.hasOwnProperty(\"filter\")&&!i.isString(e.filter)?\"filter: string expected\":null!=e.pageSize&&e.hasOwnProperty(\"pageSize\")&&!i.isInteger(e.pageSize)?\"pageSize: integer expected\":null!=e.pageToken&&e.hasOwnProperty(\"pageToken\")&&!i.isString(e.pageToken)?\"pageToken: string expected\":null},s.fromObject=function(e){var t;return e instanceof p.google.longrunning.ListOperationsRequest?e:(t=new p.google.longrunning.ListOperationsRequest,null!=e.name&&(t.name=String(e.name)),null!=e.filter&&(t.filter=String(e.filter)),null!=e.pageSize&&(t.pageSize=0|e.pageSize),null!=e.pageToken&&(t.pageToken=String(e.pageToken)),t)},s.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.filter=\"\",n.pageSize=0,n.pageToken=\"\",n.name=\"\"),null!=e.filter&&e.hasOwnProperty(\"filter\")&&(n.filter=e.filter),null!=e.pageSize&&e.hasOwnProperty(\"pageSize\")&&(n.pageSize=e.pageSize),null!=e.pageToken&&e.hasOwnProperty(\"pageToken\")&&(n.pageToken=e.pageToken),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},s),t.ListOperationsResponse=(u.prototype.operations=i.emptyArray,u.prototype.nextPageToken=\"\",u.create=function(e){return new u(e)},u.encode=function(e,t){if(t=t||r.create(),null!=e.operations&&e.operations.length)for(var n=0;n>>3){case 1:o.operations&&o.operations.length||(o.operations=[]),o.operations.push(p.google.longrunning.Operation.decode(e,e.uint32()));break;case 2:o.nextPageToken=e.string();break;default:e.skipType(7&r)}}return o},u.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},u.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.operations&&e.hasOwnProperty(\"operations\")){if(!Array.isArray(e.operations))return\"operations: array expected\";for(var t=0;t>>3==1?o.name=e.string():e.skipType(7&r)}return o},L.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},L.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.name&&e.hasOwnProperty(\"name\")&&!i.isString(e.name)?\"name: string expected\":null},L.fromObject=function(e){var t;return e instanceof p.google.longrunning.CancelOperationRequest?e:(t=new p.google.longrunning.CancelOperationRequest,null!=e.name&&(t.name=String(e.name)),t)},L.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\"),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),n},L.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},L),t.DeleteOperationRequest=(U.prototype.name=\"\",U.create=function(e){return new U(e)},U.encode=function(e,t){return t=t||r.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),t},U.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},U.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new p.google.longrunning.DeleteOperationRequest;e.pos>>3==1?o.name=e.string():e.skipType(7&r)}return o},U.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},U.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.name&&e.hasOwnProperty(\"name\")&&!i.isString(e.name)?\"name: string expected\":null},U.fromObject=function(e){var t;return e instanceof p.google.longrunning.DeleteOperationRequest?e:(t=new p.google.longrunning.DeleteOperationRequest,null!=e.name&&(t.name=String(e.name)),t)},U.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\"),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),n},U.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},U),t.WaitOperationRequest=(c.prototype.name=\"\",c.prototype.timeout=null,c.create=function(e){return new c(e)},c.encode=function(e,t){return t=t||r.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),null!=e.timeout&&Object.hasOwnProperty.call(e,\"timeout\")&&p.google.protobuf.Duration.encode(e.timeout,t.uint32(18).fork()).ldelim(),t},c.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},c.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new p.google.longrunning.WaitOperationRequest;e.pos>>3){case 1:o.name=e.string();break;case 2:o.timeout=p.google.protobuf.Duration.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},c.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},c.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!i.isString(e.name))return\"name: string expected\";if(null!=e.timeout&&e.hasOwnProperty(\"timeout\")){e=p.google.protobuf.Duration.verify(e.timeout);if(e)return\"timeout.\"+e}return null},c.fromObject=function(e){if(e instanceof p.google.longrunning.WaitOperationRequest)return e;var t=new p.google.longrunning.WaitOperationRequest;if(null!=e.name&&(t.name=String(e.name)),null!=e.timeout){if(\"object\"!=typeof e.timeout)throw TypeError(\".google.longrunning.WaitOperationRequest.timeout: object expected\");t.timeout=p.google.protobuf.Duration.fromObject(e.timeout)}return t},c.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\",n.timeout=null),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),null!=e.timeout&&e.hasOwnProperty(\"timeout\")&&(n.timeout=p.google.protobuf.Duration.toObject(e.timeout,t)),n},c.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},c),t.OperationInfo=(d.prototype.responseType=\"\",d.prototype.metadataType=\"\",d.create=function(e){return new d(e)},d.encode=function(e,t){return t=t||r.create(),null!=e.responseType&&Object.hasOwnProperty.call(e,\"responseType\")&&t.uint32(10).string(e.responseType),null!=e.metadataType&&Object.hasOwnProperty.call(e,\"metadataType\")&&t.uint32(18).string(e.metadataType),t},d.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},d.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new p.google.longrunning.OperationInfo;e.pos>>3){case 1:o.responseType=e.string();break;case 2:o.metadataType=e.string();break;default:e.skipType(7&r)}}return o},d.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},d.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.responseType&&e.hasOwnProperty(\"responseType\")&&!i.isString(e.responseType)?\"responseType: string expected\":null!=e.metadataType&&e.hasOwnProperty(\"metadataType\")&&!i.isString(e.metadataType)?\"metadataType: string expected\":null},d.fromObject=function(e){var t;return e instanceof p.google.longrunning.OperationInfo?e:(t=new p.google.longrunning.OperationInfo,null!=e.responseType&&(t.responseType=String(e.responseType)),null!=e.metadataType&&(t.metadataType=String(e.metadataType)),t)},d.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.responseType=\"\",n.metadataType=\"\"),null!=e.responseType&&e.hasOwnProperty(\"responseType\")&&(n.responseType=e.responseType),null!=e.metadataType&&e.hasOwnProperty(\"metadataType\")&&(n.metadataType=e.metadataType),n},d.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},d),t),F.api=((n={}).Http=(g.prototype.rules=i.emptyArray,g.prototype.fullyDecodeReservedExpansion=!1,g.create=function(e){return new g(e)},g.encode=function(e,t){if(t=t||r.create(),null!=e.rules&&e.rules.length)for(var n=0;n>>3){case 1:o.rules&&o.rules.length||(o.rules=[]),o.rules.push(p.google.api.HttpRule.decode(e,e.uint32()));break;case 2:o.fullyDecodeReservedExpansion=e.bool();break;default:e.skipType(7&r)}}return o},g.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},g.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.rules&&e.hasOwnProperty(\"rules\")){if(!Array.isArray(e.rules))return\"rules: array expected\";for(var t=0;t>>3){case 1:o.selector=e.string();break;case 2:o.get=e.string();break;case 3:o.put=e.string();break;case 4:o.post=e.string();break;case 5:o.delete=e.string();break;case 6:o.patch=e.string();break;case 8:o.custom=p.google.api.CustomHttpPattern.decode(e,e.uint32());break;case 7:o.body=e.string();break;case 12:o.responseBody=e.string();break;case 11:o.additionalBindings&&o.additionalBindings.length||(o.additionalBindings=[]),o.additionalBindings.push(p.google.api.HttpRule.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},f.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},f.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";var t={};if(null!=e.selector&&e.hasOwnProperty(\"selector\")&&!i.isString(e.selector))return\"selector: string expected\";if(null!=e.get&&e.hasOwnProperty(\"get\")&&(t.pattern=1,!i.isString(e.get)))return\"get: string expected\";if(null!=e.put&&e.hasOwnProperty(\"put\")){if(1===t.pattern)return\"pattern: multiple values\";if(t.pattern=1,!i.isString(e.put))return\"put: string expected\"}if(null!=e.post&&e.hasOwnProperty(\"post\")){if(1===t.pattern)return\"pattern: multiple values\";if(t.pattern=1,!i.isString(e.post))return\"post: string expected\"}if(null!=e.delete&&e.hasOwnProperty(\"delete\")){if(1===t.pattern)return\"pattern: multiple values\";if(t.pattern=1,!i.isString(e.delete))return\"delete: string expected\"}if(null!=e.patch&&e.hasOwnProperty(\"patch\")){if(1===t.pattern)return\"pattern: multiple values\";if(t.pattern=1,!i.isString(e.patch))return\"patch: string expected\"}if(null!=e.custom&&e.hasOwnProperty(\"custom\")){if(1===t.pattern)return\"pattern: multiple values\";if(t.pattern=1,n=p.google.api.CustomHttpPattern.verify(e.custom))return\"custom.\"+n}if(null!=e.body&&e.hasOwnProperty(\"body\")&&!i.isString(e.body))return\"body: string expected\";if(null!=e.responseBody&&e.hasOwnProperty(\"responseBody\")&&!i.isString(e.responseBody))return\"responseBody: string expected\";if(null!=e.additionalBindings&&e.hasOwnProperty(\"additionalBindings\")){if(!Array.isArray(e.additionalBindings))return\"additionalBindings: array expected\";for(var n,o=0;o>>3){case 1:o.kind=e.string();break;case 2:o.path=e.string();break;default:e.skipType(7&r)}}return o},y.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},y.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.kind&&e.hasOwnProperty(\"kind\")&&!i.isString(e.kind)?\"kind: string expected\":null!=e.path&&e.hasOwnProperty(\"path\")&&!i.isString(e.path)?\"path: string expected\":null},y.fromObject=function(e){var t;return e instanceof p.google.api.CustomHttpPattern?e:(t=new p.google.api.CustomHttpPattern,null!=e.kind&&(t.kind=String(e.kind)),null!=e.path&&(t.path=String(e.path)),t)},y.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.kind=\"\",n.path=\"\"),null!=e.kind&&e.hasOwnProperty(\"kind\")&&(n.kind=e.kind),null!=e.path&&e.hasOwnProperty(\"path\")&&(n.path=e.path),n},y.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},y),n),F.protobuf=((t={}).FileDescriptorSet=(J.prototype.file=i.emptyArray,J.create=function(e){return new J(e)},J.encode=function(e,t){if(t=t||r.create(),null!=e.file&&e.file.length)for(var n=0;n>>3==1?(o.file&&o.file.length||(o.file=[]),o.file.push(p.google.protobuf.FileDescriptorProto.decode(e,e.uint32()))):e.skipType(7&r)}return o},J.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},J.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.file&&e.hasOwnProperty(\"file\")){if(!Array.isArray(e.file))return\"file: array expected\";for(var t=0;t>>3){case 1:o.name=e.string();break;case 2:o.package=e.string();break;case 3:o.dependency&&o.dependency.length||(o.dependency=[]),o.dependency.push(e.string());break;case 10:if(o.publicDependency&&o.publicDependency.length||(o.publicDependency=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos>>3){case 1:o.name=e.string();break;case 2:o.field&&o.field.length||(o.field=[]),o.field.push(p.google.protobuf.FieldDescriptorProto.decode(e,e.uint32()));break;case 6:o.extension&&o.extension.length||(o.extension=[]),o.extension.push(p.google.protobuf.FieldDescriptorProto.decode(e,e.uint32()));break;case 3:o.nestedType&&o.nestedType.length||(o.nestedType=[]),o.nestedType.push(p.google.protobuf.DescriptorProto.decode(e,e.uint32()));break;case 4:o.enumType&&o.enumType.length||(o.enumType=[]),o.enumType.push(p.google.protobuf.EnumDescriptorProto.decode(e,e.uint32()));break;case 5:o.extensionRange&&o.extensionRange.length||(o.extensionRange=[]),o.extensionRange.push(p.google.protobuf.DescriptorProto.ExtensionRange.decode(e,e.uint32()));break;case 8:o.oneofDecl&&o.oneofDecl.length||(o.oneofDecl=[]),o.oneofDecl.push(p.google.protobuf.OneofDescriptorProto.decode(e,e.uint32()));break;case 7:o.options=p.google.protobuf.MessageOptions.decode(e,e.uint32());break;case 9:o.reservedRange&&o.reservedRange.length||(o.reservedRange=[]),o.reservedRange.push(p.google.protobuf.DescriptorProto.ReservedRange.decode(e,e.uint32()));break;case 10:o.reservedName&&o.reservedName.length||(o.reservedName=[]),o.reservedName.push(e.string());break;default:e.skipType(7&r)}}return o},O.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},O.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!i.isString(e.name))return\"name: string expected\";if(null!=e.field&&e.hasOwnProperty(\"field\")){if(!Array.isArray(e.field))return\"field: array expected\";for(var t=0;t>>3){case 1:o.start=e.int32();break;case 2:o.end=e.int32();break;case 3:o.options=p.google.protobuf.ExtensionRangeOptions.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},b.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},b.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.start&&e.hasOwnProperty(\"start\")&&!i.isInteger(e.start))return\"start: integer expected\";if(null!=e.end&&e.hasOwnProperty(\"end\")&&!i.isInteger(e.end))return\"end: integer expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){e=p.google.protobuf.ExtensionRangeOptions.verify(e.options);if(e)return\"options.\"+e}return null},b.fromObject=function(e){if(e instanceof p.google.protobuf.DescriptorProto.ExtensionRange)return e;var t=new p.google.protobuf.DescriptorProto.ExtensionRange;if(null!=e.start&&(t.start=0|e.start),null!=e.end&&(t.end=0|e.end),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.protobuf.DescriptorProto.ExtensionRange.options: object expected\");t.options=p.google.protobuf.ExtensionRangeOptions.fromObject(e.options)}return t},b.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.start=0,n.end=0,n.options=null),null!=e.start&&e.hasOwnProperty(\"start\")&&(n.start=e.start),null!=e.end&&e.hasOwnProperty(\"end\")&&(n.end=e.end),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=p.google.protobuf.ExtensionRangeOptions.toObject(e.options,t)),n},b.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},b),O.ReservedRange=(m.prototype.start=0,m.prototype.end=0,m.create=function(e){return new m(e)},m.encode=function(e,t){return t=t||r.create(),null!=e.start&&Object.hasOwnProperty.call(e,\"start\")&&t.uint32(8).int32(e.start),null!=e.end&&Object.hasOwnProperty.call(e,\"end\")&&t.uint32(16).int32(e.end),t},m.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},m.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new p.google.protobuf.DescriptorProto.ReservedRange;e.pos>>3){case 1:o.start=e.int32();break;case 2:o.end=e.int32();break;default:e.skipType(7&r)}}return o},m.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},m.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.start&&e.hasOwnProperty(\"start\")&&!i.isInteger(e.start)?\"start: integer expected\":null!=e.end&&e.hasOwnProperty(\"end\")&&!i.isInteger(e.end)?\"end: integer expected\":null},m.fromObject=function(e){var t;return e instanceof p.google.protobuf.DescriptorProto.ReservedRange?e:(t=new p.google.protobuf.DescriptorProto.ReservedRange,null!=e.start&&(t.start=0|e.start),null!=e.end&&(t.end=0|e.end),t)},m.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.start=0,n.end=0),null!=e.start&&e.hasOwnProperty(\"start\")&&(n.start=e.start),null!=e.end&&e.hasOwnProperty(\"end\")&&(n.end=e.end),n},m.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},m),O),t.ExtensionRangeOptions=(M.prototype.uninterpretedOption=i.emptyArray,M.create=function(e){return new M(e)},M.encode=function(e,t){if(t=t||r.create(),null!=e.uninterpretedOption&&e.uninterpretedOption.length)for(var n=0;n>>3==999?(o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(p.google.protobuf.UninterpretedOption.decode(e,e.uint32()))):e.skipType(7&r)}return o},M.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},M.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 1:o.name=e.string();break;case 3:o.number=e.int32();break;case 4:o.label=e.int32();break;case 5:o.type=e.int32();break;case 6:o.typeName=e.string();break;case 2:o.extendee=e.string();break;case 7:o.defaultValue=e.string();break;case 9:o.oneofIndex=e.int32();break;case 10:o.jsonName=e.string();break;case 8:o.options=p.google.protobuf.FieldOptions.decode(e,e.uint32());break;case 17:o.proto3Optional=e.bool();break;default:e.skipType(7&r)}}return o},v.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},v.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!i.isString(e.name))return\"name: string expected\";if(null!=e.number&&e.hasOwnProperty(\"number\")&&!i.isInteger(e.number))return\"number: integer expected\";if(null!=e.label&&e.hasOwnProperty(\"label\"))switch(e.label){default:return\"label: enum value expected\";case 1:case 2:case 3:}if(null!=e.type&&e.hasOwnProperty(\"type\"))switch(e.type){default:return\"type: enum value expected\";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:}if(null!=e.typeName&&e.hasOwnProperty(\"typeName\")&&!i.isString(e.typeName))return\"typeName: string expected\";if(null!=e.extendee&&e.hasOwnProperty(\"extendee\")&&!i.isString(e.extendee))return\"extendee: string expected\";if(null!=e.defaultValue&&e.hasOwnProperty(\"defaultValue\")&&!i.isString(e.defaultValue))return\"defaultValue: string expected\";if(null!=e.oneofIndex&&e.hasOwnProperty(\"oneofIndex\")&&!i.isInteger(e.oneofIndex))return\"oneofIndex: integer expected\";if(null!=e.jsonName&&e.hasOwnProperty(\"jsonName\")&&!i.isString(e.jsonName))return\"jsonName: string expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){var t=p.google.protobuf.FieldOptions.verify(e.options);if(t)return\"options.\"+t}return null!=e.proto3Optional&&e.hasOwnProperty(\"proto3Optional\")&&\"boolean\"!=typeof e.proto3Optional?\"proto3Optional: boolean expected\":null},v.fromObject=function(e){if(e instanceof p.google.protobuf.FieldDescriptorProto)return e;var t=new p.google.protobuf.FieldDescriptorProto;switch(null!=e.name&&(t.name=String(e.name)),null!=e.number&&(t.number=0|e.number),e.label){case\"LABEL_OPTIONAL\":case 1:t.label=1;break;case\"LABEL_REQUIRED\":case 2:t.label=2;break;case\"LABEL_REPEATED\":case 3:t.label=3}switch(e.type){case\"TYPE_DOUBLE\":case 1:t.type=1;break;case\"TYPE_FLOAT\":case 2:t.type=2;break;case\"TYPE_INT64\":case 3:t.type=3;break;case\"TYPE_UINT64\":case 4:t.type=4;break;case\"TYPE_INT32\":case 5:t.type=5;break;case\"TYPE_FIXED64\":case 6:t.type=6;break;case\"TYPE_FIXED32\":case 7:t.type=7;break;case\"TYPE_BOOL\":case 8:t.type=8;break;case\"TYPE_STRING\":case 9:t.type=9;break;case\"TYPE_GROUP\":case 10:t.type=10;break;case\"TYPE_MESSAGE\":case 11:t.type=11;break;case\"TYPE_BYTES\":case 12:t.type=12;break;case\"TYPE_UINT32\":case 13:t.type=13;break;case\"TYPE_ENUM\":case 14:t.type=14;break;case\"TYPE_SFIXED32\":case 15:t.type=15;break;case\"TYPE_SFIXED64\":case 16:t.type=16;break;case\"TYPE_SINT32\":case 17:t.type=17;break;case\"TYPE_SINT64\":case 18:t.type=18}if(null!=e.typeName&&(t.typeName=String(e.typeName)),null!=e.extendee&&(t.extendee=String(e.extendee)),null!=e.defaultValue&&(t.defaultValue=String(e.defaultValue)),null!=e.oneofIndex&&(t.oneofIndex=0|e.oneofIndex),null!=e.jsonName&&(t.jsonName=String(e.jsonName)),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.protobuf.FieldDescriptorProto.options: object expected\");t.options=p.google.protobuf.FieldOptions.fromObject(e.options)}return null!=e.proto3Optional&&(t.proto3Optional=Boolean(e.proto3Optional)),t},v.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\",n.extendee=\"\",n.number=0,n.label=t.enums===String?\"LABEL_OPTIONAL\":1,n.type=t.enums===String?\"TYPE_DOUBLE\":1,n.typeName=\"\",n.defaultValue=\"\",n.options=null,n.oneofIndex=0,n.jsonName=\"\",n.proto3Optional=!1),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),null!=e.extendee&&e.hasOwnProperty(\"extendee\")&&(n.extendee=e.extendee),null!=e.number&&e.hasOwnProperty(\"number\")&&(n.number=e.number),null!=e.label&&e.hasOwnProperty(\"label\")&&(n.label=t.enums===String?p.google.protobuf.FieldDescriptorProto.Label[e.label]:e.label),null!=e.type&&e.hasOwnProperty(\"type\")&&(n.type=t.enums===String?p.google.protobuf.FieldDescriptorProto.Type[e.type]:e.type),null!=e.typeName&&e.hasOwnProperty(\"typeName\")&&(n.typeName=e.typeName),null!=e.defaultValue&&e.hasOwnProperty(\"defaultValue\")&&(n.defaultValue=e.defaultValue),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=p.google.protobuf.FieldOptions.toObject(e.options,t)),null!=e.oneofIndex&&e.hasOwnProperty(\"oneofIndex\")&&(n.oneofIndex=e.oneofIndex),null!=e.jsonName&&e.hasOwnProperty(\"jsonName\")&&(n.jsonName=e.jsonName),null!=e.proto3Optional&&e.hasOwnProperty(\"proto3Optional\")&&(n.proto3Optional=e.proto3Optional),n},v.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},v.Type=(n={},(e=Object.create(n))[n[1]=\"TYPE_DOUBLE\"]=1,e[n[2]=\"TYPE_FLOAT\"]=2,e[n[3]=\"TYPE_INT64\"]=3,e[n[4]=\"TYPE_UINT64\"]=4,e[n[5]=\"TYPE_INT32\"]=5,e[n[6]=\"TYPE_FIXED64\"]=6,e[n[7]=\"TYPE_FIXED32\"]=7,e[n[8]=\"TYPE_BOOL\"]=8,e[n[9]=\"TYPE_STRING\"]=9,e[n[10]=\"TYPE_GROUP\"]=10,e[n[11]=\"TYPE_MESSAGE\"]=11,e[n[12]=\"TYPE_BYTES\"]=12,e[n[13]=\"TYPE_UINT32\"]=13,e[n[14]=\"TYPE_ENUM\"]=14,e[n[15]=\"TYPE_SFIXED32\"]=15,e[n[16]=\"TYPE_SFIXED64\"]=16,e[n[17]=\"TYPE_SINT32\"]=17,e[n[18]=\"TYPE_SINT64\"]=18,e),v.Label=(n={},(e=Object.create(n))[n[1]=\"LABEL_OPTIONAL\"]=1,e[n[2]=\"LABEL_REQUIRED\"]=2,e[n[3]=\"LABEL_REPEATED\"]=3,e),v),t.OneofDescriptorProto=(w.prototype.name=\"\",w.prototype.options=null,w.create=function(e){return new w(e)},w.encode=function(e,t){return t=t||r.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),null!=e.options&&Object.hasOwnProperty.call(e,\"options\")&&p.google.protobuf.OneofOptions.encode(e.options,t.uint32(18).fork()).ldelim(),t},w.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},w.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new p.google.protobuf.OneofDescriptorProto;e.pos>>3){case 1:o.name=e.string();break;case 2:o.options=p.google.protobuf.OneofOptions.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},w.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},w.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!i.isString(e.name))return\"name: string expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){e=p.google.protobuf.OneofOptions.verify(e.options);if(e)return\"options.\"+e}return null},w.fromObject=function(e){if(e instanceof p.google.protobuf.OneofDescriptorProto)return e;var t=new p.google.protobuf.OneofDescriptorProto;if(null!=e.name&&(t.name=String(e.name)),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.protobuf.OneofDescriptorProto.options: object expected\");t.options=p.google.protobuf.OneofOptions.fromObject(e.options)}return t},w.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\",n.options=null),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=p.google.protobuf.OneofOptions.toObject(e.options,t)),n},w.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},w),t.EnumDescriptorProto=(P.prototype.name=\"\",P.prototype.value=i.emptyArray,P.prototype.options=null,P.prototype.reservedRange=i.emptyArray,P.prototype.reservedName=i.emptyArray,P.create=function(e){return new P(e)},P.encode=function(e,t){if(t=t||r.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),null!=e.value&&e.value.length)for(var n=0;n>>3){case 1:o.name=e.string();break;case 2:o.value&&o.value.length||(o.value=[]),o.value.push(p.google.protobuf.EnumValueDescriptorProto.decode(e,e.uint32()));break;case 3:o.options=p.google.protobuf.EnumOptions.decode(e,e.uint32());break;case 4:o.reservedRange&&o.reservedRange.length||(o.reservedRange=[]),o.reservedRange.push(p.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(e,e.uint32()));break;case 5:o.reservedName&&o.reservedName.length||(o.reservedName=[]),o.reservedName.push(e.string());break;default:e.skipType(7&r)}}return o},P.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},P.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!i.isString(e.name))return\"name: string expected\";if(null!=e.value&&e.hasOwnProperty(\"value\")){if(!Array.isArray(e.value))return\"value: array expected\";for(var t=0;t>>3){case 1:o.start=e.int32();break;case 2:o.end=e.int32();break;default:e.skipType(7&r)}}return o},_.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},_.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.start&&e.hasOwnProperty(\"start\")&&!i.isInteger(e.start)?\"start: integer expected\":null!=e.end&&e.hasOwnProperty(\"end\")&&!i.isInteger(e.end)?\"end: integer expected\":null},_.fromObject=function(e){var t;return e instanceof p.google.protobuf.EnumDescriptorProto.EnumReservedRange?e:(t=new p.google.protobuf.EnumDescriptorProto.EnumReservedRange,null!=e.start&&(t.start=0|e.start),null!=e.end&&(t.end=0|e.end),t)},_.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.start=0,n.end=0),null!=e.start&&e.hasOwnProperty(\"start\")&&(n.start=e.start),null!=e.end&&e.hasOwnProperty(\"end\")&&(n.end=e.end),n},_.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},_),P),t.EnumValueDescriptorProto=(j.prototype.name=\"\",j.prototype.number=0,j.prototype.options=null,j.create=function(e){return new j(e)},j.encode=function(e,t){return t=t||r.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),null!=e.number&&Object.hasOwnProperty.call(e,\"number\")&&t.uint32(16).int32(e.number),null!=e.options&&Object.hasOwnProperty.call(e,\"options\")&&p.google.protobuf.EnumValueOptions.encode(e.options,t.uint32(26).fork()).ldelim(),t},j.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},j.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new p.google.protobuf.EnumValueDescriptorProto;e.pos>>3){case 1:o.name=e.string();break;case 2:o.number=e.int32();break;case 3:o.options=p.google.protobuf.EnumValueOptions.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},j.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},j.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!i.isString(e.name))return\"name: string expected\";if(null!=e.number&&e.hasOwnProperty(\"number\")&&!i.isInteger(e.number))return\"number: integer expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){e=p.google.protobuf.EnumValueOptions.verify(e.options);if(e)return\"options.\"+e}return null},j.fromObject=function(e){if(e instanceof p.google.protobuf.EnumValueDescriptorProto)return e;var t=new p.google.protobuf.EnumValueDescriptorProto;if(null!=e.name&&(t.name=String(e.name)),null!=e.number&&(t.number=0|e.number),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.protobuf.EnumValueDescriptorProto.options: object expected\");t.options=p.google.protobuf.EnumValueOptions.fromObject(e.options)}return t},j.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\",n.number=0,n.options=null),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),null!=e.number&&e.hasOwnProperty(\"number\")&&(n.number=e.number),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=p.google.protobuf.EnumValueOptions.toObject(e.options,t)),n},j.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},j),t.ServiceDescriptorProto=(S.prototype.name=\"\",S.prototype.method=i.emptyArray,S.prototype.options=null,S.create=function(e){return new S(e)},S.encode=function(e,t){if(t=t||r.create(),null!=e.name&&Object.hasOwnProperty.call(e,\"name\")&&t.uint32(10).string(e.name),null!=e.method&&e.method.length)for(var n=0;n>>3){case 1:o.name=e.string();break;case 2:o.method&&o.method.length||(o.method=[]),o.method.push(p.google.protobuf.MethodDescriptorProto.decode(e,e.uint32()));break;case 3:o.options=p.google.protobuf.ServiceOptions.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},S.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},S.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!i.isString(e.name))return\"name: string expected\";if(null!=e.method&&e.hasOwnProperty(\"method\")){if(!Array.isArray(e.method))return\"method: array expected\";for(var t=0;t>>3){case 1:o.name=e.string();break;case 2:o.inputType=e.string();break;case 3:o.outputType=e.string();break;case 4:o.options=p.google.protobuf.MethodOptions.decode(e,e.uint32());break;case 5:o.clientStreaming=e.bool();break;case 6:o.serverStreaming=e.bool();break;default:e.skipType(7&r)}}return o},x.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},x.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")&&!i.isString(e.name))return\"name: string expected\";if(null!=e.inputType&&e.hasOwnProperty(\"inputType\")&&!i.isString(e.inputType))return\"inputType: string expected\";if(null!=e.outputType&&e.hasOwnProperty(\"outputType\")&&!i.isString(e.outputType))return\"outputType: string expected\";if(null!=e.options&&e.hasOwnProperty(\"options\")){var t=p.google.protobuf.MethodOptions.verify(e.options);if(t)return\"options.\"+t}return null!=e.clientStreaming&&e.hasOwnProperty(\"clientStreaming\")&&\"boolean\"!=typeof e.clientStreaming?\"clientStreaming: boolean expected\":null!=e.serverStreaming&&e.hasOwnProperty(\"serverStreaming\")&&\"boolean\"!=typeof e.serverStreaming?\"serverStreaming: boolean expected\":null},x.fromObject=function(e){if(e instanceof p.google.protobuf.MethodDescriptorProto)return e;var t=new p.google.protobuf.MethodDescriptorProto;if(null!=e.name&&(t.name=String(e.name)),null!=e.inputType&&(t.inputType=String(e.inputType)),null!=e.outputType&&(t.outputType=String(e.outputType)),null!=e.options){if(\"object\"!=typeof e.options)throw TypeError(\".google.protobuf.MethodDescriptorProto.options: object expected\");t.options=p.google.protobuf.MethodOptions.fromObject(e.options)}return null!=e.clientStreaming&&(t.clientStreaming=Boolean(e.clientStreaming)),null!=e.serverStreaming&&(t.serverStreaming=Boolean(e.serverStreaming)),t},x.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.name=\"\",n.inputType=\"\",n.outputType=\"\",n.options=null,n.clientStreaming=!1,n.serverStreaming=!1),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),null!=e.inputType&&e.hasOwnProperty(\"inputType\")&&(n.inputType=e.inputType),null!=e.outputType&&e.hasOwnProperty(\"outputType\")&&(n.outputType=e.outputType),null!=e.options&&e.hasOwnProperty(\"options\")&&(n.options=p.google.protobuf.MethodOptions.toObject(e.options,t)),null!=e.clientStreaming&&e.hasOwnProperty(\"clientStreaming\")&&(n.clientStreaming=e.clientStreaming),null!=e.serverStreaming&&e.hasOwnProperty(\"serverStreaming\")&&(n.serverStreaming=e.serverStreaming),n},x.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},x),t.FileOptions=(k.prototype.javaPackage=\"\",k.prototype.javaOuterClassname=\"\",k.prototype.javaMultipleFiles=!1,k.prototype.javaGenerateEqualsAndHash=!1,k.prototype.javaStringCheckUtf8=!1,k.prototype.optimizeFor=1,k.prototype.goPackage=\"\",k.prototype.ccGenericServices=!1,k.prototype.javaGenericServices=!1,k.prototype.pyGenericServices=!1,k.prototype.phpGenericServices=!1,k.prototype.deprecated=!1,k.prototype.ccEnableArenas=!0,k.prototype.objcClassPrefix=\"\",k.prototype.csharpNamespace=\"\",k.prototype.swiftPrefix=\"\",k.prototype.phpClassPrefix=\"\",k.prototype.phpNamespace=\"\",k.prototype.phpMetadataNamespace=\"\",k.prototype.rubyPackage=\"\",k.prototype.uninterpretedOption=i.emptyArray,k.create=function(e){return new k(e)},k.encode=function(e,t){if(t=t||r.create(),null!=e.javaPackage&&Object.hasOwnProperty.call(e,\"javaPackage\")&&t.uint32(10).string(e.javaPackage),null!=e.javaOuterClassname&&Object.hasOwnProperty.call(e,\"javaOuterClassname\")&&t.uint32(66).string(e.javaOuterClassname),null!=e.optimizeFor&&Object.hasOwnProperty.call(e,\"optimizeFor\")&&t.uint32(72).int32(e.optimizeFor),null!=e.javaMultipleFiles&&Object.hasOwnProperty.call(e,\"javaMultipleFiles\")&&t.uint32(80).bool(e.javaMultipleFiles),null!=e.goPackage&&Object.hasOwnProperty.call(e,\"goPackage\")&&t.uint32(90).string(e.goPackage),null!=e.ccGenericServices&&Object.hasOwnProperty.call(e,\"ccGenericServices\")&&t.uint32(128).bool(e.ccGenericServices),null!=e.javaGenericServices&&Object.hasOwnProperty.call(e,\"javaGenericServices\")&&t.uint32(136).bool(e.javaGenericServices),null!=e.pyGenericServices&&Object.hasOwnProperty.call(e,\"pyGenericServices\")&&t.uint32(144).bool(e.pyGenericServices),null!=e.javaGenerateEqualsAndHash&&Object.hasOwnProperty.call(e,\"javaGenerateEqualsAndHash\")&&t.uint32(160).bool(e.javaGenerateEqualsAndHash),null!=e.deprecated&&Object.hasOwnProperty.call(e,\"deprecated\")&&t.uint32(184).bool(e.deprecated),null!=e.javaStringCheckUtf8&&Object.hasOwnProperty.call(e,\"javaStringCheckUtf8\")&&t.uint32(216).bool(e.javaStringCheckUtf8),null!=e.ccEnableArenas&&Object.hasOwnProperty.call(e,\"ccEnableArenas\")&&t.uint32(248).bool(e.ccEnableArenas),null!=e.objcClassPrefix&&Object.hasOwnProperty.call(e,\"objcClassPrefix\")&&t.uint32(290).string(e.objcClassPrefix),null!=e.csharpNamespace&&Object.hasOwnProperty.call(e,\"csharpNamespace\")&&t.uint32(298).string(e.csharpNamespace),null!=e.swiftPrefix&&Object.hasOwnProperty.call(e,\"swiftPrefix\")&&t.uint32(314).string(e.swiftPrefix),null!=e.phpClassPrefix&&Object.hasOwnProperty.call(e,\"phpClassPrefix\")&&t.uint32(322).string(e.phpClassPrefix),null!=e.phpNamespace&&Object.hasOwnProperty.call(e,\"phpNamespace\")&&t.uint32(330).string(e.phpNamespace),null!=e.phpGenericServices&&Object.hasOwnProperty.call(e,\"phpGenericServices\")&&t.uint32(336).bool(e.phpGenericServices),null!=e.phpMetadataNamespace&&Object.hasOwnProperty.call(e,\"phpMetadataNamespace\")&&t.uint32(354).string(e.phpMetadataNamespace),null!=e.rubyPackage&&Object.hasOwnProperty.call(e,\"rubyPackage\")&&t.uint32(362).string(e.rubyPackage),null!=e.uninterpretedOption&&e.uninterpretedOption.length)for(var n=0;n>>3){case 1:o.javaPackage=e.string();break;case 8:o.javaOuterClassname=e.string();break;case 10:o.javaMultipleFiles=e.bool();break;case 20:o.javaGenerateEqualsAndHash=e.bool();break;case 27:o.javaStringCheckUtf8=e.bool();break;case 9:o.optimizeFor=e.int32();break;case 11:o.goPackage=e.string();break;case 16:o.ccGenericServices=e.bool();break;case 17:o.javaGenericServices=e.bool();break;case 18:o.pyGenericServices=e.bool();break;case 42:o.phpGenericServices=e.bool();break;case 23:o.deprecated=e.bool();break;case 31:o.ccEnableArenas=e.bool();break;case 36:o.objcClassPrefix=e.string();break;case 37:o.csharpNamespace=e.string();break;case 39:o.swiftPrefix=e.string();break;case 40:o.phpClassPrefix=e.string();break;case 41:o.phpNamespace=e.string();break;case 44:o.phpMetadataNamespace=e.string();break;case 45:o.rubyPackage=e.string();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(p.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},k.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},k.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.javaPackage&&e.hasOwnProperty(\"javaPackage\")&&!i.isString(e.javaPackage))return\"javaPackage: string expected\";if(null!=e.javaOuterClassname&&e.hasOwnProperty(\"javaOuterClassname\")&&!i.isString(e.javaOuterClassname))return\"javaOuterClassname: string expected\";if(null!=e.javaMultipleFiles&&e.hasOwnProperty(\"javaMultipleFiles\")&&\"boolean\"!=typeof e.javaMultipleFiles)return\"javaMultipleFiles: boolean expected\";if(null!=e.javaGenerateEqualsAndHash&&e.hasOwnProperty(\"javaGenerateEqualsAndHash\")&&\"boolean\"!=typeof e.javaGenerateEqualsAndHash)return\"javaGenerateEqualsAndHash: boolean expected\";if(null!=e.javaStringCheckUtf8&&e.hasOwnProperty(\"javaStringCheckUtf8\")&&\"boolean\"!=typeof e.javaStringCheckUtf8)return\"javaStringCheckUtf8: boolean expected\";if(null!=e.optimizeFor&&e.hasOwnProperty(\"optimizeFor\"))switch(e.optimizeFor){default:return\"optimizeFor: enum value expected\";case 1:case 2:case 3:}if(null!=e.goPackage&&e.hasOwnProperty(\"goPackage\")&&!i.isString(e.goPackage))return\"goPackage: string expected\";if(null!=e.ccGenericServices&&e.hasOwnProperty(\"ccGenericServices\")&&\"boolean\"!=typeof e.ccGenericServices)return\"ccGenericServices: boolean expected\";if(null!=e.javaGenericServices&&e.hasOwnProperty(\"javaGenericServices\")&&\"boolean\"!=typeof e.javaGenericServices)return\"javaGenericServices: boolean expected\";if(null!=e.pyGenericServices&&e.hasOwnProperty(\"pyGenericServices\")&&\"boolean\"!=typeof e.pyGenericServices)return\"pyGenericServices: boolean expected\";if(null!=e.phpGenericServices&&e.hasOwnProperty(\"phpGenericServices\")&&\"boolean\"!=typeof e.phpGenericServices)return\"phpGenericServices: boolean expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.ccEnableArenas&&e.hasOwnProperty(\"ccEnableArenas\")&&\"boolean\"!=typeof e.ccEnableArenas)return\"ccEnableArenas: boolean expected\";if(null!=e.objcClassPrefix&&e.hasOwnProperty(\"objcClassPrefix\")&&!i.isString(e.objcClassPrefix))return\"objcClassPrefix: string expected\";if(null!=e.csharpNamespace&&e.hasOwnProperty(\"csharpNamespace\")&&!i.isString(e.csharpNamespace))return\"csharpNamespace: string expected\";if(null!=e.swiftPrefix&&e.hasOwnProperty(\"swiftPrefix\")&&!i.isString(e.swiftPrefix))return\"swiftPrefix: string expected\";if(null!=e.phpClassPrefix&&e.hasOwnProperty(\"phpClassPrefix\")&&!i.isString(e.phpClassPrefix))return\"phpClassPrefix: string expected\";if(null!=e.phpNamespace&&e.hasOwnProperty(\"phpNamespace\")&&!i.isString(e.phpNamespace))return\"phpNamespace: string expected\";if(null!=e.phpMetadataNamespace&&e.hasOwnProperty(\"phpMetadataNamespace\")&&!i.isString(e.phpMetadataNamespace))return\"phpMetadataNamespace: string expected\";if(null!=e.rubyPackage&&e.hasOwnProperty(\"rubyPackage\")&&!i.isString(e.rubyPackage))return\"rubyPackage: string expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 1:o.messageSetWireFormat=e.bool();break;case 2:o.noStandardDescriptorAccessor=e.bool();break;case 3:o.deprecated=e.bool();break;case 7:o.mapEntry=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(p.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},D.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},D.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.messageSetWireFormat&&e.hasOwnProperty(\"messageSetWireFormat\")&&\"boolean\"!=typeof e.messageSetWireFormat)return\"messageSetWireFormat: boolean expected\";if(null!=e.noStandardDescriptorAccessor&&e.hasOwnProperty(\"noStandardDescriptorAccessor\")&&\"boolean\"!=typeof e.noStandardDescriptorAccessor)return\"noStandardDescriptorAccessor: boolean expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.mapEntry&&e.hasOwnProperty(\"mapEntry\")&&\"boolean\"!=typeof e.mapEntry)return\"mapEntry: boolean expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 1:o.ctype=e.int32();break;case 2:o.packed=e.bool();break;case 6:o.jstype=e.int32();break;case 5:o.lazy=e.bool();break;case 3:o.deprecated=e.bool();break;case 10:o.weak=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(p.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},T.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},T.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.ctype&&e.hasOwnProperty(\"ctype\"))switch(e.ctype){default:return\"ctype: enum value expected\";case 0:case 1:case 2:}if(null!=e.packed&&e.hasOwnProperty(\"packed\")&&\"boolean\"!=typeof e.packed)return\"packed: boolean expected\";if(null!=e.jstype&&e.hasOwnProperty(\"jstype\"))switch(e.jstype){default:return\"jstype: enum value expected\";case 0:case 1:case 2:}if(null!=e.lazy&&e.hasOwnProperty(\"lazy\")&&\"boolean\"!=typeof e.lazy)return\"lazy: boolean expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.weak&&e.hasOwnProperty(\"weak\")&&\"boolean\"!=typeof e.weak)return\"weak: boolean expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3==999?(o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(p.google.protobuf.UninterpretedOption.decode(e,e.uint32()))):e.skipType(7&r)}return o},H.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},H.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 2:o.allowAlias=e.bool();break;case 3:o.deprecated=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(p.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},E.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},E.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.allowAlias&&e.hasOwnProperty(\"allowAlias\")&&\"boolean\"!=typeof e.allowAlias)return\"allowAlias: boolean expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 1:o.deprecated=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(p.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},z.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},z.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 33:o.deprecated=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(p.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;case 1049:o[\".google.api.defaultHost\"]=e.string();break;case 1050:o[\".google.api.oauthScopes\"]=e.string();break;default:e.skipType(7&r)}}return o},A.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},A.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 33:o.deprecated=e.bool();break;case 34:o.idempotencyLevel=e.int32();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(p.google.protobuf.UninterpretedOption.decode(e,e.uint32()));break;case 1049:o[\".google.longrunning.operationInfo\"]=p.google.longrunning.OperationInfo.decode(e,e.uint32());break;case 72295728:o[\".google.api.http\"]=p.google.api.HttpRule.decode(e,e.uint32());break;case 1051:o[\".google.api.methodSignature\"]&&o[\".google.api.methodSignature\"].length||(o[\".google.api.methodSignature\"]=[]),o[\".google.api.methodSignature\"].push(e.string());break;default:e.skipType(7&r)}}return o},N.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},N.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.deprecated&&e.hasOwnProperty(\"deprecated\")&&\"boolean\"!=typeof e.deprecated)return\"deprecated: boolean expected\";if(null!=e.idempotencyLevel&&e.hasOwnProperty(\"idempotencyLevel\"))switch(e.idempotencyLevel){default:return\"idempotencyLevel: enum value expected\";case 0:case 1:case 2:}if(null!=e.uninterpretedOption&&e.hasOwnProperty(\"uninterpretedOption\")){if(!Array.isArray(e.uninterpretedOption))return\"uninterpretedOption: array expected\";for(var t=0;t>>3){case 2:o.name&&o.name.length||(o.name=[]),o.name.push(p.google.protobuf.UninterpretedOption.NamePart.decode(e,e.uint32()));break;case 3:o.identifierValue=e.string();break;case 4:o.positiveIntValue=e.uint64();break;case 5:o.negativeIntValue=e.int64();break;case 6:o.doubleValue=e.double();break;case 7:o.stringValue=e.bytes();break;case 8:o.aggregateValue=e.string();break;default:e.skipType(7&r)}}return o},I.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},I.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.name&&e.hasOwnProperty(\"name\")){if(!Array.isArray(e.name))return\"name: array expected\";for(var t=0;t>>0,e.positiveIntValue.high>>>0).toNumber(!0))),null!=e.negativeIntValue&&(i.Long?(t.negativeIntValue=i.Long.fromValue(e.negativeIntValue)).unsigned=!1:\"string\"==typeof e.negativeIntValue?t.negativeIntValue=parseInt(e.negativeIntValue,10):\"number\"==typeof e.negativeIntValue?t.negativeIntValue=e.negativeIntValue:\"object\"==typeof e.negativeIntValue&&(t.negativeIntValue=new i.LongBits(e.negativeIntValue.low>>>0,e.negativeIntValue.high>>>0).toNumber())),null!=e.doubleValue&&(t.doubleValue=Number(e.doubleValue)),null!=e.stringValue&&(\"string\"==typeof e.stringValue?i.base64.decode(e.stringValue,t.stringValue=i.newBuffer(i.base64.length(e.stringValue)),0):e.stringValue.length&&(t.stringValue=e.stringValue)),null!=e.aggregateValue&&(t.aggregateValue=String(e.aggregateValue)),t},I.toObject=function(e,t){var n,o={};if(((t=t||{}).arrays||t.defaults)&&(o.name=[]),t.defaults&&(o.identifierValue=\"\",i.Long?(n=new i.Long(0,0,!0),o.positiveIntValue=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):o.positiveIntValue=t.longs===String?\"0\":0,i.Long?(n=new i.Long(0,0,!1),o.negativeIntValue=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):o.negativeIntValue=t.longs===String?\"0\":0,o.doubleValue=0,t.bytes===String?o.stringValue=\"\":(o.stringValue=[],t.bytes!==Array&&(o.stringValue=i.newBuffer(o.stringValue))),o.aggregateValue=\"\"),e.name&&e.name.length){o.name=[];for(var r=0;r>>0,e.positiveIntValue.high>>>0).toNumber(!0):e.positiveIntValue),null!=e.negativeIntValue&&e.hasOwnProperty(\"negativeIntValue\")&&(\"number\"==typeof e.negativeIntValue?o.negativeIntValue=t.longs===String?String(e.negativeIntValue):e.negativeIntValue:o.negativeIntValue=t.longs===String?i.Long.prototype.toString.call(e.negativeIntValue):t.longs===Number?new i.LongBits(e.negativeIntValue.low>>>0,e.negativeIntValue.high>>>0).toNumber():e.negativeIntValue),null!=e.doubleValue&&e.hasOwnProperty(\"doubleValue\")&&(o.doubleValue=t.json&&!isFinite(e.doubleValue)?String(e.doubleValue):e.doubleValue),null!=e.stringValue&&e.hasOwnProperty(\"stringValue\")&&(o.stringValue=t.bytes===String?i.base64.encode(e.stringValue,0,e.stringValue.length):t.bytes===Array?Array.prototype.slice.call(e.stringValue):e.stringValue),null!=e.aggregateValue&&e.hasOwnProperty(\"aggregateValue\")&&(o.aggregateValue=e.aggregateValue),o},I.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},I.NamePart=(q.prototype.namePart=\"\",q.prototype.isExtension=!1,q.create=function(e){return new q(e)},q.encode=function(e,t){return(t=t||r.create()).uint32(10).string(e.namePart),t.uint32(16).bool(e.isExtension),t},q.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},q.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new p.google.protobuf.UninterpretedOption.NamePart;e.pos>>3){case 1:o.namePart=e.string();break;case 2:o.isExtension=e.bool();break;default:e.skipType(7&r)}}if(!o.hasOwnProperty(\"namePart\"))throw i.ProtocolError(\"missing required 'namePart'\",{instance:o});if(o.hasOwnProperty(\"isExtension\"))return o;throw i.ProtocolError(\"missing required 'isExtension'\",{instance:o})},q.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},q.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":i.isString(e.namePart)?\"boolean\"!=typeof e.isExtension?\"isExtension: boolean expected\":null:\"namePart: string expected\"},q.fromObject=function(e){var t;return e instanceof p.google.protobuf.UninterpretedOption.NamePart?e:(t=new p.google.protobuf.UninterpretedOption.NamePart,null!=e.namePart&&(t.namePart=String(e.namePart)),null!=e.isExtension&&(t.isExtension=Boolean(e.isExtension)),t)},q.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.namePart=\"\",n.isExtension=!1),null!=e.namePart&&e.hasOwnProperty(\"namePart\")&&(n.namePart=e.namePart),null!=e.isExtension&&e.hasOwnProperty(\"isExtension\")&&(n.isExtension=e.isExtension),n},q.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},q),I),t.SourceCodeInfo=(Y.prototype.location=i.emptyArray,Y.create=function(e){return new Y(e)},Y.encode=function(e,t){if(t=t||r.create(),null!=e.location&&e.location.length)for(var n=0;n>>3==1?(o.location&&o.location.length||(o.location=[]),o.location.push(p.google.protobuf.SourceCodeInfo.Location.decode(e,e.uint32()))):e.skipType(7&r)}return o},Y.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},Y.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.location&&e.hasOwnProperty(\"location\")){if(!Array.isArray(e.location))return\"location: array expected\";for(var t=0;t>>3){case 1:if(o.path&&o.path.length||(o.path=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos>>3==1?(o.annotation&&o.annotation.length||(o.annotation=[]),o.annotation.push(p.google.protobuf.GeneratedCodeInfo.Annotation.decode(e,e.uint32()))):e.skipType(7&r)}return o},W.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},W.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.annotation&&e.hasOwnProperty(\"annotation\")){if(!Array.isArray(e.annotation))return\"annotation: array expected\";for(var t=0;t>>3){case 1:if(o.path&&o.path.length||(o.path=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos>>3){case 1:o.type_url=e.string();break;case 2:o.value=e.bytes();break;default:e.skipType(7&r)}}return o},X.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},X.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.type_url&&e.hasOwnProperty(\"type_url\")&&!i.isString(e.type_url)?\"type_url: string expected\":null!=e.value&&e.hasOwnProperty(\"value\")&&!(e.value&&\"number\"==typeof e.value.length||i.isString(e.value))?\"value: buffer expected\":null},X.fromObject=function(e){var t;return e instanceof p.google.protobuf.Any?e:(t=new p.google.protobuf.Any,null!=e.type_url&&(t.type_url=String(e.type_url)),null!=e.value&&(\"string\"==typeof e.value?i.base64.decode(e.value,t.value=i.newBuffer(i.base64.length(e.value)),0):e.value.length&&(t.value=e.value)),t)},X.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.type_url=\"\",t.bytes===String?n.value=\"\":(n.value=[],t.bytes!==Array&&(n.value=i.newBuffer(n.value)))),null!=e.type_url&&e.hasOwnProperty(\"type_url\")&&(n.type_url=e.type_url),null!=e.value&&e.hasOwnProperty(\"value\")&&(n.value=t.bytes===String?i.base64.encode(e.value,0,e.value.length):t.bytes===Array?Array.prototype.slice.call(e.value):e.value),n},X.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},X),t.Duration=(K.prototype.seconds=i.Long?i.Long.fromBits(0,0,!1):0,K.prototype.nanos=0,K.create=function(e){return new K(e)},K.encode=function(e,t){return t=t||r.create(),null!=e.seconds&&Object.hasOwnProperty.call(e,\"seconds\")&&t.uint32(8).int64(e.seconds),null!=e.nanos&&Object.hasOwnProperty.call(e,\"nanos\")&&t.uint32(16).int32(e.nanos),t},K.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},K.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new p.google.protobuf.Duration;e.pos>>3){case 1:o.seconds=e.int64();break;case 2:o.nanos=e.int32();break;default:e.skipType(7&r)}}return o},K.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},K.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.seconds&&e.hasOwnProperty(\"seconds\")&&!(i.isInteger(e.seconds)||e.seconds&&i.isInteger(e.seconds.low)&&i.isInteger(e.seconds.high))?\"seconds: integer|Long expected\":null!=e.nanos&&e.hasOwnProperty(\"nanos\")&&!i.isInteger(e.nanos)?\"nanos: integer expected\":null},K.fromObject=function(e){var t;return e instanceof p.google.protobuf.Duration?e:(t=new p.google.protobuf.Duration,null!=e.seconds&&(i.Long?(t.seconds=i.Long.fromValue(e.seconds)).unsigned=!1:\"string\"==typeof e.seconds?t.seconds=parseInt(e.seconds,10):\"number\"==typeof e.seconds?t.seconds=e.seconds:\"object\"==typeof e.seconds&&(t.seconds=new i.LongBits(e.seconds.low>>>0,e.seconds.high>>>0).toNumber())),null!=e.nanos&&(t.nanos=0|e.nanos),t)},K.toObject=function(e,t){var n,o={};return(t=t||{}).defaults&&(i.Long?(n=new i.Long(0,0,!1),o.seconds=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):o.seconds=t.longs===String?\"0\":0,o.nanos=0),null!=e.seconds&&e.hasOwnProperty(\"seconds\")&&(\"number\"==typeof e.seconds?o.seconds=t.longs===String?String(e.seconds):e.seconds:o.seconds=t.longs===String?i.Long.prototype.toString.call(e.seconds):t.longs===Number?new i.LongBits(e.seconds.low>>>0,e.seconds.high>>>0).toNumber():e.seconds),null!=e.nanos&&e.hasOwnProperty(\"nanos\")&&(o.nanos=e.nanos),o},K.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},K),t.Empty=(Q.create=function(e){return new Q(e)},Q.encode=function(e,t){return t=t||r.create()},Q.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},Q.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,t=new p.google.protobuf.Empty;e.pos>>3){case 1:o.code=e.int32();break;case 2:o.message=e.string();break;case 3:o.details&&o.details.length||(o.details=[]),o.details.push(p.google.protobuf.Any.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return o},V.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},V.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.code&&e.hasOwnProperty(\"code\")&&!i.isInteger(e.code))return\"code: integer expected\";if(null!=e.message&&e.hasOwnProperty(\"message\")&&!i.isString(e.message))return\"message: string expected\";if(null!=e.details&&e.hasOwnProperty(\"details\")){if(!Array.isArray(e.details))return\"details: array expected\";for(var t=0;t googleProtobufValueFromProto3JSON(element)),\n };\n}\nfunction googleProtobufValueFromProto3JSON(json) {\n if (json === null) {\n return { nullValue: 'NULL_VALUE' };\n }\n if (typeof json === 'number') {\n return { numberValue: json };\n }\n if (typeof json === 'string') {\n return { stringValue: json };\n }\n if (typeof json === 'boolean') {\n return { boolValue: json };\n }\n if (Array.isArray(json)) {\n return {\n listValue: googleProtobufListValueFromProto3JSON(json),\n };\n }\n if (typeof json === 'object') {\n return {\n structValue: googleProtobufStructFromProto3JSON(json),\n };\n }\n throw new Error(`googleProtobufValueFromProto3JSON: incorrect parameter type: ${typeof json}`);\n}\n//# sourceMappingURL=value.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.googleProtobufDurationToProto3JSON = googleProtobufDurationToProto3JSON;\nexports.googleProtobufDurationFromProto3JSON = googleProtobufDurationFromProto3JSON;\nfunction googleProtobufDurationToProto3JSON(obj) {\n // seconds is an instance of Long so it won't be undefined\n let durationSeconds = obj.seconds.toString();\n if (typeof obj.nanos === 'number' && obj.nanos > 0) {\n // nanosStr should contain 3, 6, or 9 fractional digits.\n const nanosStr = obj.nanos\n .toString()\n .padStart(9, '0')\n .replace(/^((?:\\d\\d\\d)+?)(?:0*)$/, '$1');\n durationSeconds += '.' + nanosStr;\n }\n durationSeconds += 's';\n return durationSeconds;\n}\nfunction googleProtobufDurationFromProto3JSON(json) {\n const match = json.match(/^(\\d*)(?:\\.(\\d*))?s$/);\n if (!match) {\n throw new Error(`googleProtobufDurationFromProto3JSON: incorrect value ${json} passed as google.protobuf.Duration`);\n }\n let seconds = 0;\n let nanos = 0;\n if (typeof match[1] === 'string' && match[1].length > 0) {\n seconds = parseInt(match[1]);\n }\n if (typeof match[2] === 'string' && match[2].length > 0) {\n nanos = parseInt(match[2].padEnd(9, '0'));\n }\n const result = {};\n if (seconds !== 0) {\n result.seconds = seconds;\n }\n if (nanos !== 0) {\n result.nanos = nanos;\n }\n return result;\n}\n//# sourceMappingURL=duration.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.googleProtobufTimestampToProto3JSON = googleProtobufTimestampToProto3JSON;\nexports.googleProtobufTimestampFromProto3JSON = googleProtobufTimestampFromProto3JSON;\nfunction googleProtobufTimestampToProto3JSON(obj) {\n // seconds is an instance of Long so it won't be undefined\n const durationSeconds = obj.seconds;\n const date = new Date(durationSeconds * 1000).toISOString();\n // Pad leading zeros if nano string length is less than 9.\n let nanos = obj.nanos?.toString().padStart(9, '0');\n // Trim the unsignificant zeros and keep 3, 6, or 9 decimal digits.\n while (nanos && nanos.length > 3 && nanos.endsWith('000')) {\n nanos = nanos.slice(0, -3);\n }\n return date.replace(/(?:\\.\\d{0,9})/, '.' + nanos);\n}\nfunction googleProtobufTimestampFromProto3JSON(json) {\n const match = json.match(/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?/);\n if (!match) {\n throw new Error(`googleProtobufDurationFromProto3JSON: incorrect value ${json} passed as google.protobuf.Duration`);\n }\n const date = new Date(json);\n const millisecondsSinceEpoch = date.getTime();\n const seconds = Math.floor(millisecondsSinceEpoch / 1000);\n // The fractional seconds in the JSON timestamps can go up to 9 digits (i.e. up to 1 nanosecond resolution).\n // However, Javascript Date object represent any date and time to millisecond precision.\n // To keep the precision, we extract the fractional seconds and append 0 until the length is equal to 9.\n let nanos = 0;\n const secondsFromDate = json.split('.')[1];\n if (secondsFromDate) {\n nanos = parseInt(secondsFromDate.slice(0, -1).padEnd(9, '0'));\n }\n const result = {};\n if (seconds !== 0) {\n result.seconds = seconds;\n }\n if (nanos !== 0) {\n result.nanos = nanos;\n }\n return result;\n}\n//# sourceMappingURL=timestamp.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.wrapperToProto3JSON = wrapperToProto3JSON;\nexports.wrapperFromProto3JSON = wrapperFromProto3JSON;\nconst bytes_1 = require(\"./bytes\");\nconst util_1 = require(\"./util\");\nfunction wrapperToProto3JSON(obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, 'value')) {\n return null;\n }\n if (Buffer.isBuffer(obj.value) || obj.value instanceof Uint8Array) {\n return (0, bytes_1.bytesToProto3JSON)(obj.value);\n }\n if (typeof obj.value === 'object') {\n (0, util_1.assert)(obj.value.constructor.name === 'Long', `wrapperToProto3JSON: expected to see a number, a string, a boolean, or a Long, but got ${obj.value}`);\n return obj.value.toString();\n }\n // JSON accept special string values \"NaN\", \"Infinity\", and \"-Infinity\".\n if (typeof obj.value === 'number' && !Number.isFinite(obj.value)) {\n return obj.value.toString();\n }\n return obj.value;\n}\nfunction wrapperFromProto3JSON(typeName, json) {\n if (json === null) {\n return {\n value: null,\n };\n }\n if (typeName === '.google.protobuf.BytesValue') {\n if (typeof json !== 'string') {\n throw new Error(`numberWrapperFromProto3JSON: expected to get a string for google.protobuf.BytesValue but got ${typeof json}`);\n }\n return {\n value: (0, bytes_1.bytesFromProto3JSON)(json),\n };\n }\n return {\n value: json,\n };\n}\n//# sourceMappingURL=wrappers.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.googleProtobufFieldMaskToProto3JSON = googleProtobufFieldMaskToProto3JSON;\nexports.googleProtobufFieldMaskFromProto3JSON = googleProtobufFieldMaskFromProto3JSON;\nfunction googleProtobufFieldMaskToProto3JSON(obj) {\n return obj.paths.join(',');\n}\nfunction googleProtobufFieldMaskFromProto3JSON(json) {\n return {\n paths: json.split(','),\n };\n}\n//# sourceMappingURL=fieldmask.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromProto3JSONToInternalRepresentation = fromProto3JSONToInternalRepresentation;\nexports.fromProto3JSON = fromProto3JSON;\nconst any_1 = require(\"./any\");\nconst bytes_1 = require(\"./bytes\");\nconst enum_1 = require(\"./enum\");\nconst value_1 = require(\"./value\");\nconst util_1 = require(\"./util\");\nconst duration_1 = require(\"./duration\");\nconst timestamp_1 = require(\"./timestamp\");\nconst wrappers_1 = require(\"./wrappers\");\nconst fieldmask_1 = require(\"./fieldmask\");\nfunction fromProto3JSONToInternalRepresentation(type, json) {\n const fullyQualifiedTypeName = typeof type === 'string' ? type : (0, util_1.getFullyQualifiedTypeName)(type);\n if (typeof type !== 'string' && 'values' in type) {\n // type is an Enum\n if (fullyQualifiedTypeName === '.google.protobuf.NullValue') {\n return 'NULL_VALUE';\n }\n return (0, enum_1.resolveEnumValueToString)(type, json);\n }\n if (typeof type !== 'string') {\n type.resolveAll();\n }\n if (typeof type === 'string') {\n return json;\n }\n // Types that require special handling according to\n // https://developers.google.com/protocol-buffers/docs/proto3#json\n // Types that can have meaningful \"null\" value\n if (fullyQualifiedTypeName === '.google.protobuf.Value') {\n return (0, value_1.googleProtobufValueFromProto3JSON)(json);\n }\n if (util_1.wrapperTypes.has(fullyQualifiedTypeName)) {\n if ((json !== null && typeof json === 'object') || Array.isArray(json)) {\n throw new Error(`fromProto3JSONToInternalRepresentation: JSON representation for ${fullyQualifiedTypeName} expects a string, a number, or a boolean, but got ${typeof json}`);\n }\n return (0, wrappers_1.wrapperFromProto3JSON)(fullyQualifiedTypeName, json);\n }\n if (json === null) {\n return null;\n }\n // Types that cannot be \"null\"\n if (fullyQualifiedTypeName === '.google.protobuf.Any') {\n return (0, any_1.googleProtobufAnyFromProto3JSON)(type.root, json);\n }\n if (fullyQualifiedTypeName === '.google.protobuf.Struct') {\n if (typeof json !== 'object') {\n throw new Error(`fromProto3JSONToInternalRepresentation: google.protobuf.Struct must be an object but got ${typeof json}`);\n }\n if (Array.isArray(json)) {\n throw new Error('fromProto3JSONToInternalRepresentation: google.protobuf.Struct must be an object but got an array');\n }\n return (0, value_1.googleProtobufStructFromProto3JSON)(json);\n }\n if (fullyQualifiedTypeName === '.google.protobuf.ListValue') {\n if (!Array.isArray(json)) {\n throw new Error(`fromProto3JSONToInternalRepresentation: google.protobuf.ListValue must be an array but got ${typeof json}`);\n }\n return (0, value_1.googleProtobufListValueFromProto3JSON)(json);\n }\n if (fullyQualifiedTypeName === '.google.protobuf.Duration') {\n if (typeof json !== 'string') {\n throw new Error(`fromProto3JSONToInternalRepresentation: google.protobuf.Duration must be a string but got ${typeof json}`);\n }\n return (0, duration_1.googleProtobufDurationFromProto3JSON)(json);\n }\n if (fullyQualifiedTypeName === '.google.protobuf.Timestamp') {\n if (typeof json !== 'string') {\n throw new Error(`fromProto3JSONToInternalRepresentation: google.protobuf.Timestamp must be a string but got ${typeof json}`);\n }\n return (0, timestamp_1.googleProtobufTimestampFromProto3JSON)(json);\n }\n if (fullyQualifiedTypeName === '.google.protobuf.FieldMask') {\n if (typeof json !== 'string') {\n throw new Error(`fromProto3JSONToInternalRepresentation: google.protobuf.FieldMask must be a string but got ${typeof json}`);\n }\n return (0, fieldmask_1.googleProtobufFieldMaskFromProto3JSON)(json);\n }\n const result = {};\n for (const [key, value] of Object.entries(json)) {\n const field = type.fields[key];\n if (!field) {\n continue;\n }\n const resolvedType = field.resolvedType;\n const fieldType = field.type;\n if (field.repeated) {\n if (value === null) {\n result[key] = [];\n }\n else {\n if (!Array.isArray(value)) {\n throw new Error(`fromProto3JSONToInternalRepresentation: expected an array for field ${key}`);\n }\n result[key] = value.map(element => fromProto3JSONToInternalRepresentation(resolvedType || fieldType, element));\n }\n }\n else if (field.map) {\n const map = {};\n for (const [mapKey, mapValue] of Object.entries(value)) {\n map[mapKey] = fromProto3JSONToInternalRepresentation(resolvedType || fieldType, mapValue);\n }\n result[key] = map;\n }\n else if (fieldType.match(/^(?:(?:(?:u?int|fixed)(?:32|64))|float|double)$/)) {\n if (typeof value !== 'number' && typeof value !== 'string') {\n throw new Error(`fromProto3JSONToInternalRepresentation: field ${key} of type ${field.type} cannot contain value ${value}`);\n }\n result[key] = value;\n }\n else if (fieldType === 'string') {\n if (typeof value !== 'string') {\n throw new Error(`fromProto3JSONToInternalRepresentation: field ${key} of type ${field.type} cannot contain value ${value}`);\n }\n result[key] = value;\n }\n else if (fieldType === 'bool') {\n if (typeof value !== 'boolean') {\n throw new Error(`fromProto3JSONToInternalRepresentation: field ${key} of type ${field.type} cannot contain value ${value}`);\n }\n result[key] = value;\n }\n else if (fieldType === 'bytes') {\n if (typeof value !== 'string') {\n throw new Error(`fromProto3JSONToInternalRepresentation: field ${key} of type ${field.type} cannot contain value ${value}`);\n }\n result[key] = (0, bytes_1.bytesFromProto3JSON)(value);\n }\n else {\n // Message type\n (0, util_1.assert)(resolvedType !== null, `Expected to be able to resolve type for field ${field.name}`);\n const deserializedValue = fromProto3JSONToInternalRepresentation(resolvedType, value);\n result[key] = deserializedValue;\n }\n }\n return result;\n}\nfunction fromProto3JSON(type, json) {\n const internalRepr = fromProto3JSONToInternalRepresentation(type, json);\n if (internalRepr === null) {\n return null;\n }\n // We only expect a real object here sine all special cases should be already resolved. Everything else is an internal error\n (0, util_1.assert)(typeof internalRepr === 'object' && !Array.isArray(internalRepr), `fromProto3JSON: expected an object, not ${json}`);\n return type.fromObject(internalRepr);\n}\n//# sourceMappingURL=fromproto3json.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.googleProtobufAnyToProto3JSON = googleProtobufAnyToProto3JSON;\nexports.googleProtobufAnyFromProto3JSON = googleProtobufAnyFromProto3JSON;\nconst fromproto3json_1 = require(\"./fromproto3json\");\nconst toproto3json_1 = require(\"./toproto3json\");\n// https://github.com/protocolbuffers/protobuf/blob/ba3836703b4a9e98e474aea2bac8c5b49b6d3b5c/python/google/protobuf/json_format.py#L850\nconst specialJSON = new Set([\n 'google.protobuf.Any',\n 'google.protobuf.Duration',\n 'google.protobuf.FieldMask',\n 'google.protobuf.ListValue',\n 'google.protobuf.Struct',\n 'google.protobuf.Timestamp',\n 'google.protobuf.Value',\n]);\nfunction googleProtobufAnyToProto3JSON(obj, options) {\n // https://developers.google.com/protocol-buffers/docs/proto3#json\n // If the Any contains a value that has a special JSON mapping, it will be converted as follows:\n // {\"@type\": xxx, \"value\": yyy}.\n // Otherwise, the value will be converted into a JSON object, and the \"@type\" field will be inserted\n // to indicate the actual data type.\n const typeName = obj.type_url.replace(/^.*\\//, '');\n let type;\n try {\n type = obj.$type.root.lookupType(typeName);\n }\n catch (err) {\n throw new Error(`googleProtobufAnyToProto3JSON: cannot find type ${typeName}: ${err}`);\n }\n const valueMessage = type.decode(obj.value);\n const valueProto3JSON = (0, toproto3json_1.toProto3JSON)(valueMessage, options);\n if (specialJSON.has(typeName)) {\n return {\n '@type': obj.type_url,\n value: valueProto3JSON,\n };\n }\n valueProto3JSON['@type'] = obj.type_url;\n return valueProto3JSON;\n}\nfunction googleProtobufAnyFromProto3JSON(root, json) {\n // Not all possible JSON values can hold Any, only real objects.\n if (json === null || typeof json !== 'object' || Array.isArray(json)) {\n throw new Error('googleProtobufAnyFromProto3JSON: must be an object to decode google.protobuf.Any');\n }\n const typeUrl = json['@type'];\n if (!typeUrl || typeof typeUrl !== 'string') {\n throw new Error('googleProtobufAnyFromProto3JSON: JSON serialization of google.protobuf.Any must contain @type field');\n }\n const typeName = typeUrl.replace(/^.*\\//, '');\n let type;\n try {\n type = root.lookupType(typeName);\n }\n catch (err) {\n throw new Error(`googleProtobufAnyFromProto3JSON: cannot find type ${typeName}: ${err}`);\n }\n let value = json;\n if (specialJSON.has(typeName)) {\n if (!('value' in json)) {\n throw new Error(`googleProtobufAnyFromProto3JSON: JSON representation of google.protobuf.Any with type ${typeName} must contain the value field`);\n }\n value = json.value;\n }\n const valueMessage = (0, fromproto3json_1.fromProto3JSON)(type, value);\n if (valueMessage === null) {\n return {\n type_url: typeUrl,\n value: null,\n };\n }\n const uint8array = type.encode(valueMessage).finish();\n const buffer = Buffer.from(uint8array, 0, uint8array.byteLength);\n const base64 = buffer.toString('base64');\n return {\n type_url: typeUrl,\n value: base64,\n };\n}\n//# sourceMappingURL=any.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toProto3JSON = toProto3JSON;\nconst any_1 = require(\"./any\");\nconst bytes_1 = require(\"./bytes\");\nconst util_1 = require(\"./util\");\nconst enum_1 = require(\"./enum\");\nconst value_1 = require(\"./value\");\nconst duration_1 = require(\"./duration\");\nconst timestamp_1 = require(\"./timestamp\");\nconst wrappers_1 = require(\"./wrappers\");\nconst fieldmask_1 = require(\"./fieldmask\");\n// Convert a single value, which might happen to be an instance of Long, to JSONValue\nfunction convertSingleValue(value) {\n if (typeof value === 'object') {\n if (value?.constructor?.name === 'Long') {\n return value.toString();\n }\n throw new Error(`toProto3JSON: don't know how to convert value ${value}`);\n }\n return value;\n}\nfunction toProto3JSON(obj, options) {\n const objType = obj.$type;\n if (!objType) {\n throw new Error('Cannot serialize object to proto3 JSON since its .$type is unknown. Use Type.fromObject(obj) before calling toProto3JSON.');\n }\n objType.resolveAll();\n const typeName = (0, util_1.getFullyQualifiedTypeName)(objType);\n // Types that require special handling according to\n // https://developers.google.com/protocol-buffers/docs/proto3#json\n if (typeName === '.google.protobuf.Any') {\n return (0, any_1.googleProtobufAnyToProto3JSON)(obj, options);\n }\n if (typeName === '.google.protobuf.Value') {\n return (0, value_1.googleProtobufValueToProto3JSON)(obj);\n }\n if (typeName === '.google.protobuf.Struct') {\n return (0, value_1.googleProtobufStructToProto3JSON)(obj);\n }\n if (typeName === '.google.protobuf.ListValue') {\n return (0, value_1.googleProtobufListValueToProto3JSON)(obj);\n }\n if (typeName === '.google.protobuf.Duration') {\n return (0, duration_1.googleProtobufDurationToProto3JSON)(obj);\n }\n if (typeName === '.google.protobuf.Timestamp') {\n return (0, timestamp_1.googleProtobufTimestampToProto3JSON)(obj);\n }\n if (typeName === '.google.protobuf.FieldMask') {\n return (0, fieldmask_1.googleProtobufFieldMaskToProto3JSON)(obj);\n }\n if (util_1.wrapperTypes.has(typeName)) {\n return (0, wrappers_1.wrapperToProto3JSON)(obj);\n }\n const result = {};\n for (const [key, value] of Object.entries(obj)) {\n const field = objType.fields[key];\n const fieldResolvedType = field.resolvedType;\n const fieldFullyQualifiedTypeName = fieldResolvedType\n ? (0, util_1.getFullyQualifiedTypeName)(fieldResolvedType)\n : null;\n if (value === null) {\n result[key] = null;\n continue;\n }\n if (Array.isArray(value)) {\n if (value.length === 0) {\n // ignore repeated fields with no values\n continue;\n }\n // if the repeated value has a complex type, convert it to proto3 JSON, otherwise use as is\n result[key] = value.map(fieldResolvedType\n ? element => {\n return toProto3JSON(element, options);\n }\n : convertSingleValue);\n continue;\n }\n if (field.map) {\n const map = {};\n for (const [mapKey, mapValue] of Object.entries(value)) {\n // if the map value has a complex type, convert it to proto3 JSON, otherwise use as is\n map[mapKey] = fieldResolvedType\n ? toProto3JSON(mapValue, options)\n : convertSingleValue(mapValue);\n }\n result[key] = map;\n continue;\n }\n if (fieldFullyQualifiedTypeName === '.google.protobuf.NullValue') {\n result[key] = null;\n continue;\n }\n if (fieldResolvedType && 'values' in fieldResolvedType && value !== null) {\n if (options?.numericEnums) {\n result[key] = (0, enum_1.resolveEnumValueToNumber)(fieldResolvedType, value);\n }\n else {\n result[key] = (0, enum_1.resolveEnumValueToString)(fieldResolvedType, value);\n }\n continue;\n }\n if (fieldResolvedType) {\n result[key] = toProto3JSON(value, options);\n continue;\n }\n if (typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n value === null) {\n if (typeof value === 'number' && !Number.isFinite(value)) {\n result[key] = value.toString();\n continue;\n }\n result[key] = value;\n continue;\n }\n if (Buffer.isBuffer(value) || value instanceof Uint8Array) {\n result[key] = (0, bytes_1.bytesToProto3JSON)(value);\n continue;\n }\n result[key] = convertSingleValue(value);\n continue;\n }\n return result;\n}\n//# sourceMappingURL=toproto3json.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromProto3JSON = exports.toProto3JSON = void 0;\nvar toproto3json_1 = require(\"./toproto3json\");\nObject.defineProperty(exports, \"toProto3JSON\", { enumerable: true, get: function () { return toproto3json_1.toProto3JSON; } });\nvar fromproto3json_1 = require(\"./fromproto3json\");\nObject.defineProperty(exports, \"fromProto3JSON\", { enumerable: true, get: function () { return fromproto3json_1.fromProto3JSON; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromParams = fromParams;\nconst querystring = __importStar(require(\"querystring\"));\n/**\n * Helpers for constructing routing headers.\n *\n * These headers are used by Google infrastructure to determine how to route\n * requests, especially for services that are regional.\n *\n * Generally, these headers are specified as gRPC metadata.\n */\n/**\n * Constructs the routing header from the given params\n *\n * @param {Object} params - the request header parameters.\n * @return {string} the routing header value.\n */\nfunction fromParams(params) {\n return querystring.stringify(params);\n}\n//# sourceMappingURL=routingHeader.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getField = getField;\nexports.deepCopyWithoutMatchedFields = deepCopyWithoutMatchedFields;\nexports.deleteField = deleteField;\nexports.buildQueryStringComponents = buildQueryStringComponents;\nexports.encodeWithSlashes = encodeWithSlashes;\nexports.encodeWithoutSlashes = encodeWithoutSlashes;\nexports.applyPattern = applyPattern;\nexports.match = match;\nexports.flattenObject = flattenObject;\nexports.isProto3OptionalField = isProto3OptionalField;\nexports.transcode = transcode;\nexports.overrideHttpRules = overrideHttpRules;\nconst util_1 = require(\"./util\");\nconst httpOptionName = '(google.api.http)';\nconst proto3OptionalName = 'proto3_optional';\n// List of methods as defined in google/api/http.proto (see HttpRule)\nconst supportedHttpMethods = ['get', 'post', 'put', 'patch', 'delete'];\nfunction getField(request, field, allowObjects = false) {\n const parts = field.split('.');\n let value = request;\n for (const part of parts) {\n if (typeof value !== 'object') {\n return undefined;\n }\n value = value[part];\n }\n if (!allowObjects &&\n typeof value === 'object' &&\n !Array.isArray(value) &&\n value !== null) {\n return undefined;\n }\n return value;\n}\nfunction deepCopyWithoutMatchedFields(request, fieldsToSkip, fullNamePrefix = '') {\n if (typeof request !== 'object' || request === null) {\n return request;\n }\n const copy = Object.assign({}, request);\n for (const key in copy) {\n if (fieldsToSkip.has(`${fullNamePrefix}${key}`)) {\n delete copy[key];\n continue;\n }\n const nextFullNamePrefix = `${fullNamePrefix}${key}.`;\n if (Array.isArray(copy[key])) {\n // a field of an array cannot be addressed as \"request.field\", so we omit the skipping logic for array descendants\n copy[key] = copy[key].map(value => deepCopyWithoutMatchedFields(value, new Set()));\n }\n else if (typeof copy[key] === 'object' && copy[key] !== null) {\n copy[key] = deepCopyWithoutMatchedFields(copy[key], fieldsToSkip, nextFullNamePrefix);\n }\n }\n return copy;\n}\nfunction deleteField(request, field) {\n const parts = field.split('.');\n while (parts.length > 1) {\n if (typeof request !== 'object') {\n return;\n }\n const part = parts.shift();\n request = request[part];\n }\n const part = parts.shift();\n if (typeof request !== 'object') {\n return;\n }\n delete request[part];\n}\nfunction buildQueryStringComponents(request, prefix = '') {\n const resultList = [];\n for (const key in request) {\n if (Array.isArray(request[key])) {\n for (const value of request[key]) {\n resultList.push(`${prefix}${encodeWithoutSlashes(key)}=${encodeWithoutSlashes(value.toString())}`);\n }\n }\n else if (typeof request[key] === 'object' && request[key] !== null) {\n resultList.push(...buildQueryStringComponents(request[key], `${key}.`));\n }\n else {\n resultList.push(`${prefix}${encodeWithoutSlashes(key)}=${encodeWithoutSlashes(request[key] === null ? 'null' : request[key].toString())}`);\n }\n }\n return resultList;\n}\nfunction encodeWithSlashes(str) {\n return str\n .split('')\n .map(c => (c.match(/[-_.~0-9a-zA-Z]/) ? c : encodeURIComponent(c)))\n .join('');\n}\nfunction encodeWithoutSlashes(str) {\n return str\n .split('')\n .map(c => (c.match(/[-_.~0-9a-zA-Z/]/) ? c : encodeURIComponent(c)))\n .join('');\n}\nfunction escapeRegExp(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\nfunction applyPattern(pattern, fieldValue) {\n if (!pattern || pattern === '*') {\n return encodeWithSlashes(fieldValue);\n }\n if (!pattern.includes('*') && pattern !== fieldValue) {\n return undefined;\n }\n // since we're converting the pattern to a regex, make necessary precautions:\n const regex = new RegExp('^' +\n escapeRegExp(pattern)\n .replace(/\\\\\\*\\\\\\*/g, '(.+)')\n .replace(/\\\\\\*/g, '([^/]+)') +\n '$');\n if (!fieldValue.match(regex)) {\n return undefined;\n }\n return encodeWithoutSlashes(fieldValue);\n}\nfunction fieldToCamelCase(field) {\n const parts = field.split('.');\n return parts.map(part => (0, util_1.toCamelCase)(part)).join('.');\n}\nfunction match(request, pattern) {\n let url = pattern;\n const matchedFields = [];\n for (;;) {\n const match = url.match(/^(.*)\\{([^}=]+)(?:=([^}]*))?\\}(.*)/);\n if (!match) {\n break;\n }\n const [, before, field, pattern, after] = match;\n const camelCasedField = fieldToCamelCase(field);\n matchedFields.push(fieldToCamelCase(camelCasedField));\n const fieldValue = getField(request, camelCasedField);\n if (fieldValue === undefined) {\n return undefined;\n }\n const appliedPattern = applyPattern(pattern, fieldValue === null ? 'null' : fieldValue.toString());\n if (appliedPattern === undefined) {\n return undefined;\n }\n url = before + appliedPattern + after;\n }\n return { matchedFields, url };\n}\nfunction flattenObject(request) {\n const result = {};\n for (const key in request) {\n if (request[key] === undefined) {\n continue;\n }\n if (Array.isArray(request[key])) {\n // According to the http.proto comments, a repeated field may only\n // contain primitive types, so no extra recursion here.\n result[key] = request[key];\n continue;\n }\n if (typeof request[key] === 'object' && request[key] !== null) {\n const nested = flattenObject(request[key]);\n for (const nestedKey in nested) {\n result[`${key}.${nestedKey}`] = nested[nestedKey];\n }\n continue;\n }\n result[key] = request[key];\n }\n return result;\n}\nfunction isProto3OptionalField(field) {\n return field && field.options && field.options[proto3OptionalName];\n}\nfunction transcode(request, parsedOptions) {\n const httpRules = [];\n for (const option of parsedOptions) {\n if (!(httpOptionName in option)) {\n continue;\n }\n const httpRule = option[httpOptionName];\n httpRules.push(httpRule);\n if (httpRule?.additional_bindings) {\n const additionalBindings = Array.isArray(httpRule.additional_bindings)\n ? httpRule.additional_bindings\n : [httpRule.additional_bindings];\n httpRules.push(...additionalBindings);\n }\n }\n for (const httpRule of httpRules) {\n for (const httpMethod of supportedHttpMethods) {\n if (!(httpMethod in httpRule)) {\n continue;\n }\n const pathTemplate = httpRule[httpMethod];\n const matchResult = match(request, pathTemplate);\n if (matchResult === undefined) {\n continue;\n }\n const { url, matchedFields } = matchResult;\n let data = deepCopyWithoutMatchedFields(request, new Set(matchedFields));\n if (httpRule.body === '*') {\n return { httpMethod, url, queryString: '', data };\n }\n // one field possibly goes to request data, others go to query string\n const queryStringObject = data;\n if (httpRule.body) {\n data = getField(queryStringObject, fieldToCamelCase(httpRule.body), \n /*allowObjects:*/ true);\n deleteField(queryStringObject, fieldToCamelCase(httpRule.body));\n }\n else {\n data = '';\n }\n const queryStringComponents = buildQueryStringComponents(queryStringObject);\n const queryString = queryStringComponents.join('&');\n if (!data ||\n (typeof data === 'object' && Object.keys(data).length === 0)) {\n data = '';\n }\n return { httpMethod, url, queryString, data };\n }\n }\n return undefined;\n}\n// Override the protobuf json's the http rules.\nfunction overrideHttpRules(httpRules, protoJson) {\n for (const rule of httpRules) {\n if (!rule.selector) {\n continue;\n }\n const rpc = protoJson.lookup(rule.selector);\n // Not support override on non-exist RPC or a RPC without an annotation.\n // We could reconsider if we have the use case later.\n if (!rpc || !rpc.parsedOptions) {\n continue;\n }\n for (const item of rpc.parsedOptions) {\n if (!(httpOptionName in item)) {\n continue;\n }\n const httpOptions = item[httpOptionName];\n for (const httpMethod in httpOptions) {\n if (httpMethod in rule) {\n if (httpMethod === 'additional_bindings') {\n continue;\n }\n httpOptions[httpMethod] =\n rule[httpMethod];\n }\n if (rule.additional_bindings) {\n httpOptions['additional_bindings'] = !httpOptions['additional_bindings']\n ? []\n : Array.isArray(httpOptions['additional_bindings'])\n ? httpOptions['additional_bindings']\n : [httpOptions['additional_bindings']];\n // Make the additional_binding to be an array if it is not.\n httpOptions['additional_bindings'].push(...rule.additional_bindings);\n }\n }\n }\n }\n}\n//# sourceMappingURL=transcoding.js.map","\"use strict\";\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.encodeRequest = encodeRequest;\nexports.decodeResponse = decodeResponse;\n// proto-over-HTTP request encoding and decoding\nconst serializer = __importStar(require(\"proto3-json-serializer\"));\nconst fallback_1 = require(\"./fallback\");\nconst googleError_1 = require(\"./googleError\");\nconst transcoding_1 = require(\"./transcoding\");\nfunction encodeRequest(rpc, protocol, servicePath, servicePort, request, numericEnums, minifyJson) {\n const headers = {\n 'Content-Type': 'application/json',\n };\n const message = rpc.resolvedRequestType.fromObject(request);\n const json = serializer.toProto3JSON(message, {\n numericEnums,\n });\n if (!json) {\n throw new Error(`Cannot send null request to RPC ${rpc.name}.`);\n }\n if (typeof json !== 'object' || Array.isArray(json)) {\n throw new Error(`Request to RPC ${rpc.name} must be an object.`);\n }\n const transcoded = (0, transcoding_1.transcode)(json, rpc.parsedOptions);\n if (!transcoded) {\n throw new Error(`Cannot build HTTP request for ${JSON.stringify(json)}, method: ${rpc.name}`);\n }\n // If numeric enums feature is requested, add extra parameter to the query string\n if (numericEnums) {\n transcoded.queryString =\n (transcoded.queryString ? `${transcoded.queryString}&` : '') +\n '$alt=json%3Benum-encoding=int';\n }\n // If minifyJson feature is requested, disable pretty-print JSON responses\n if (minifyJson) {\n transcoded.queryString =\n (transcoded.queryString ? `${transcoded.queryString}&` : '') +\n '$prettyPrint=0';\n }\n // Converts httpMethod to method that permitted in standard Fetch API spec\n // https://fetch.spec.whatwg.org/#methods\n const method = transcoded.httpMethod.toUpperCase();\n const body = JSON.stringify(transcoded.data);\n const url = `${protocol}://${servicePath}:${servicePort}/${transcoded.url.replace(/^\\//, '')}?${transcoded.queryString}`;\n return {\n method,\n url,\n headers,\n body,\n };\n}\nfunction decodeResponse(rpc, ok, response) {\n // eslint-disable-next-line n/no-unsupported-features/node-builtins\n const decodedString = new TextDecoder().decode(response);\n if (!decodedString) {\n throw new Error(`Received null response from RPC ${rpc.name}`);\n }\n const json = JSON.parse(decodedString);\n if (!ok) {\n const error = googleError_1.GoogleError.parseHttpError(json);\n throw error;\n }\n const message = serializer.fromProto3JSON(rpc.resolvedResponseType, json);\n if (!message) {\n throw new Error(`Received null or malformed response from JSON serializer from RPC ${rpc.name}`);\n }\n return rpc.resolvedResponseType.toObject(message, fallback_1.defaultToObjectOptions);\n}\n//# sourceMappingURL=fallbackRest.js.map","/**\n * @author Toru Nagashima \n * @copyright 2015 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\n/**\n * @typedef {object} PrivateData\n * @property {EventTarget} eventTarget The event target.\n * @property {{type:string}} event The original event object.\n * @property {number} eventPhase The current event phase.\n * @property {EventTarget|null} currentTarget The current event target.\n * @property {boolean} canceled The flag to prevent default.\n * @property {boolean} stopped The flag to stop propagation.\n * @property {boolean} immediateStopped The flag to stop propagation immediately.\n * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.\n * @property {number} timeStamp The unix time.\n * @private\n */\n\n/**\n * Private data for event wrappers.\n * @type {WeakMap}\n * @private\n */\nconst privateData = new WeakMap();\n\n/**\n * Cache for wrapper classes.\n * @type {WeakMap}\n * @private\n */\nconst wrappers = new WeakMap();\n\n/**\n * Get private data.\n * @param {Event} event The event object to get private data.\n * @returns {PrivateData} The private data of the event.\n * @private\n */\nfunction pd(event) {\n const retv = privateData.get(event);\n console.assert(\n retv != null,\n \"'this' is expected an Event object, but got\",\n event\n );\n return retv\n}\n\n/**\n * https://dom.spec.whatwg.org/#set-the-canceled-flag\n * @param data {PrivateData} private data.\n */\nfunction setCancelFlag(data) {\n if (data.passiveListener != null) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(\n \"Unable to preventDefault inside passive event listener invocation.\",\n data.passiveListener\n );\n }\n return\n }\n if (!data.event.cancelable) {\n return\n }\n\n data.canceled = true;\n if (typeof data.event.preventDefault === \"function\") {\n data.event.preventDefault();\n }\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#interface-event\n * @private\n */\n/**\n * The event wrapper.\n * @constructor\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Event|{type:string}} event The original event to wrap.\n */\nfunction Event(eventTarget, event) {\n privateData.set(this, {\n eventTarget,\n event,\n eventPhase: 2,\n currentTarget: eventTarget,\n canceled: false,\n stopped: false,\n immediateStopped: false,\n passiveListener: null,\n timeStamp: event.timeStamp || Date.now(),\n });\n\n // https://heycam.github.io/webidl/#Unforgeable\n Object.defineProperty(this, \"isTrusted\", { value: false, enumerable: true });\n\n // Define accessors\n const keys = Object.keys(event);\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(key));\n }\n }\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEvent.prototype = {\n /**\n * The type of this event.\n * @type {string}\n */\n get type() {\n return pd(this).event.type\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get target() {\n return pd(this).eventTarget\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get currentTarget() {\n return pd(this).currentTarget\n },\n\n /**\n * @returns {EventTarget[]} The composed path of this event.\n */\n composedPath() {\n const currentTarget = pd(this).currentTarget;\n if (currentTarget == null) {\n return []\n }\n return [currentTarget]\n },\n\n /**\n * Constant of NONE.\n * @type {number}\n */\n get NONE() {\n return 0\n },\n\n /**\n * Constant of CAPTURING_PHASE.\n * @type {number}\n */\n get CAPTURING_PHASE() {\n return 1\n },\n\n /**\n * Constant of AT_TARGET.\n * @type {number}\n */\n get AT_TARGET() {\n return 2\n },\n\n /**\n * Constant of BUBBLING_PHASE.\n * @type {number}\n */\n get BUBBLING_PHASE() {\n return 3\n },\n\n /**\n * The target of this event.\n * @type {number}\n */\n get eventPhase() {\n return pd(this).eventPhase\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopPropagation() {\n const data = pd(this);\n\n data.stopped = true;\n if (typeof data.event.stopPropagation === \"function\") {\n data.event.stopPropagation();\n }\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopImmediatePropagation() {\n const data = pd(this);\n\n data.stopped = true;\n data.immediateStopped = true;\n if (typeof data.event.stopImmediatePropagation === \"function\") {\n data.event.stopImmediatePropagation();\n }\n },\n\n /**\n * The flag to be bubbling.\n * @type {boolean}\n */\n get bubbles() {\n return Boolean(pd(this).event.bubbles)\n },\n\n /**\n * The flag to be cancelable.\n * @type {boolean}\n */\n get cancelable() {\n return Boolean(pd(this).event.cancelable)\n },\n\n /**\n * Cancel this event.\n * @returns {void}\n */\n preventDefault() {\n setCancelFlag(pd(this));\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n */\n get defaultPrevented() {\n return pd(this).canceled\n },\n\n /**\n * The flag to be composed.\n * @type {boolean}\n */\n get composed() {\n return Boolean(pd(this).event.composed)\n },\n\n /**\n * The unix time of this event.\n * @type {number}\n */\n get timeStamp() {\n return pd(this).timeStamp\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n * @deprecated\n */\n get srcElement() {\n return pd(this).eventTarget\n },\n\n /**\n * The flag to stop event bubbling.\n * @type {boolean}\n * @deprecated\n */\n get cancelBubble() {\n return pd(this).stopped\n },\n set cancelBubble(value) {\n if (!value) {\n return\n }\n const data = pd(this);\n\n data.stopped = true;\n if (typeof data.event.cancelBubble === \"boolean\") {\n data.event.cancelBubble = true;\n }\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n * @deprecated\n */\n get returnValue() {\n return !pd(this).canceled\n },\n set returnValue(value) {\n if (!value) {\n setCancelFlag(pd(this));\n }\n },\n\n /**\n * Initialize this event object. But do nothing under event dispatching.\n * @param {string} type The event type.\n * @param {boolean} [bubbles=false] The flag to be possible to bubble up.\n * @param {boolean} [cancelable=false] The flag to be possible to cancel.\n * @deprecated\n */\n initEvent() {\n // Do nothing.\n },\n};\n\n// `constructor` is not enumerable.\nObject.defineProperty(Event.prototype, \"constructor\", {\n value: Event,\n configurable: true,\n writable: true,\n});\n\n// Ensure `event instanceof window.Event` is `true`.\nif (typeof window !== \"undefined\" && typeof window.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, window.Event.prototype);\n\n // Make association for wrappers.\n wrappers.set(window.Event.prototype, Event);\n}\n\n/**\n * Get the property descriptor to redirect a given property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to redirect the property.\n * @private\n */\nfunction defineRedirectDescriptor(key) {\n return {\n get() {\n return pd(this).event[key]\n },\n set(value) {\n pd(this).event[key] = value;\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Get the property descriptor to call a given method property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to call the method property.\n * @private\n */\nfunction defineCallDescriptor(key) {\n return {\n value() {\n const event = pd(this).event;\n return event[key].apply(event, arguments)\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define new wrapper class.\n * @param {Function} BaseEvent The base wrapper class.\n * @param {Object} proto The prototype of the original event.\n * @returns {Function} The defined wrapper class.\n * @private\n */\nfunction defineWrapper(BaseEvent, proto) {\n const keys = Object.keys(proto);\n if (keys.length === 0) {\n return BaseEvent\n }\n\n /** CustomEvent */\n function CustomEvent(eventTarget, event) {\n BaseEvent.call(this, eventTarget, event);\n }\n\n CustomEvent.prototype = Object.create(BaseEvent.prototype, {\n constructor: { value: CustomEvent, configurable: true, writable: true },\n });\n\n // Define accessors.\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!(key in BaseEvent.prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key);\n const isFunc = typeof descriptor.value === \"function\";\n Object.defineProperty(\n CustomEvent.prototype,\n key,\n isFunc\n ? defineCallDescriptor(key)\n : defineRedirectDescriptor(key)\n );\n }\n }\n\n return CustomEvent\n}\n\n/**\n * Get the wrapper class of a given prototype.\n * @param {Object} proto The prototype of the original event to get its wrapper.\n * @returns {Function} The wrapper class.\n * @private\n */\nfunction getWrapper(proto) {\n if (proto == null || proto === Object.prototype) {\n return Event\n }\n\n let wrapper = wrappers.get(proto);\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto);\n wrappers.set(proto, wrapper);\n }\n return wrapper\n}\n\n/**\n * Wrap a given event to management a dispatching.\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Object} event The event to wrap.\n * @returns {Event} The wrapper instance.\n * @private\n */\nfunction wrapEvent(eventTarget, event) {\n const Wrapper = getWrapper(Object.getPrototypeOf(event));\n return new Wrapper(eventTarget, event)\n}\n\n/**\n * Get the immediateStopped flag of a given event.\n * @param {Event} event The event to get.\n * @returns {boolean} The flag to stop propagation immediately.\n * @private\n */\nfunction isStopped(event) {\n return pd(event).immediateStopped\n}\n\n/**\n * Set the current event phase of a given event.\n * @param {Event} event The event to set current target.\n * @param {number} eventPhase New event phase.\n * @returns {void}\n * @private\n */\nfunction setEventPhase(event, eventPhase) {\n pd(event).eventPhase = eventPhase;\n}\n\n/**\n * Set the current target of a given event.\n * @param {Event} event The event to set current target.\n * @param {EventTarget|null} currentTarget New current target.\n * @returns {void}\n * @private\n */\nfunction setCurrentTarget(event, currentTarget) {\n pd(event).currentTarget = currentTarget;\n}\n\n/**\n * Set a passive listener of a given event.\n * @param {Event} event The event to set current target.\n * @param {Function|null} passiveListener New passive listener.\n * @returns {void}\n * @private\n */\nfunction setPassiveListener(event, passiveListener) {\n pd(event).passiveListener = passiveListener;\n}\n\n/**\n * @typedef {object} ListenerNode\n * @property {Function} listener\n * @property {1|2|3} listenerType\n * @property {boolean} passive\n * @property {boolean} once\n * @property {ListenerNode|null} next\n * @private\n */\n\n/**\n * @type {WeakMap>}\n * @private\n */\nconst listenersMap = new WeakMap();\n\n// Listener types\nconst CAPTURE = 1;\nconst BUBBLE = 2;\nconst ATTRIBUTE = 3;\n\n/**\n * Check whether a given value is an object or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an object.\n */\nfunction isObject(x) {\n return x !== null && typeof x === \"object\" //eslint-disable-line no-restricted-syntax\n}\n\n/**\n * Get listeners.\n * @param {EventTarget} eventTarget The event target to get.\n * @returns {Map} The listeners.\n * @private\n */\nfunction getListeners(eventTarget) {\n const listeners = listenersMap.get(eventTarget);\n if (listeners == null) {\n throw new TypeError(\n \"'this' is expected an EventTarget object, but got another value.\"\n )\n }\n return listeners\n}\n\n/**\n * Get the property descriptor for the event attribute of a given event.\n * @param {string} eventName The event name to get property descriptor.\n * @returns {PropertyDescriptor} The property descriptor.\n * @private\n */\nfunction defineEventAttributeDescriptor(eventName) {\n return {\n get() {\n const listeners = getListeners(this);\n let node = listeners.get(eventName);\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n return node.listener\n }\n node = node.next;\n }\n return null\n },\n\n set(listener) {\n if (typeof listener !== \"function\" && !isObject(listener)) {\n listener = null; // eslint-disable-line no-param-reassign\n }\n const listeners = getListeners(this);\n\n // Traverse to the tail while removing old value.\n let prev = null;\n let node = listeners.get(eventName);\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n // Remove old value.\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n } else {\n prev = node;\n }\n\n node = node.next;\n }\n\n // Add new value.\n if (listener !== null) {\n const newNode = {\n listener,\n listenerType: ATTRIBUTE,\n passive: false,\n once: false,\n next: null,\n };\n if (prev === null) {\n listeners.set(eventName, newNode);\n } else {\n prev.next = newNode;\n }\n }\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define an event attribute (e.g. `eventTarget.onclick`).\n * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.\n * @param {string} eventName The event name to define.\n * @returns {void}\n */\nfunction defineEventAttribute(eventTargetPrototype, eventName) {\n Object.defineProperty(\n eventTargetPrototype,\n `on${eventName}`,\n defineEventAttributeDescriptor(eventName)\n );\n}\n\n/**\n * Define a custom EventTarget with event attributes.\n * @param {string[]} eventNames Event names for event attributes.\n * @returns {EventTarget} The custom EventTarget.\n * @private\n */\nfunction defineCustomEventTarget(eventNames) {\n /** CustomEventTarget */\n function CustomEventTarget() {\n EventTarget.call(this);\n }\n\n CustomEventTarget.prototype = Object.create(EventTarget.prototype, {\n constructor: {\n value: CustomEventTarget,\n configurable: true,\n writable: true,\n },\n });\n\n for (let i = 0; i < eventNames.length; ++i) {\n defineEventAttribute(CustomEventTarget.prototype, eventNames[i]);\n }\n\n return CustomEventTarget\n}\n\n/**\n * EventTarget.\n *\n * - This is constructor if no arguments.\n * - This is a function which returns a CustomEventTarget constructor if there are arguments.\n *\n * For example:\n *\n * class A extends EventTarget {}\n * class B extends EventTarget(\"message\") {}\n * class C extends EventTarget(\"message\", \"error\") {}\n * class D extends EventTarget([\"message\", \"error\"]) {}\n */\nfunction EventTarget() {\n /*eslint-disable consistent-return */\n if (this instanceof EventTarget) {\n listenersMap.set(this, new Map());\n return\n }\n if (arguments.length === 1 && Array.isArray(arguments[0])) {\n return defineCustomEventTarget(arguments[0])\n }\n if (arguments.length > 0) {\n const types = new Array(arguments.length);\n for (let i = 0; i < arguments.length; ++i) {\n types[i] = arguments[i];\n }\n return defineCustomEventTarget(types)\n }\n throw new TypeError(\"Cannot call a class as a function\")\n /*eslint-enable consistent-return */\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEventTarget.prototype = {\n /**\n * Add a given listener to this event target.\n * @param {string} eventName The event name to add.\n * @param {Function} listener The listener to add.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n addEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n if (typeof listener !== \"function\" && !isObject(listener)) {\n throw new TypeError(\"'listener' should be a function or an object.\")\n }\n\n const listeners = getListeners(this);\n const optionsIsObj = isObject(options);\n const capture = optionsIsObj\n ? Boolean(options.capture)\n : Boolean(options);\n const listenerType = capture ? CAPTURE : BUBBLE;\n const newNode = {\n listener,\n listenerType,\n passive: optionsIsObj && Boolean(options.passive),\n once: optionsIsObj && Boolean(options.once),\n next: null,\n };\n\n // Set it as the first node if the first node is null.\n let node = listeners.get(eventName);\n if (node === undefined) {\n listeners.set(eventName, newNode);\n return\n }\n\n // Traverse to the tail while checking duplication..\n let prev = null;\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n // Should ignore duplication.\n return\n }\n prev = node;\n node = node.next;\n }\n\n // Add it.\n prev.next = newNode;\n },\n\n /**\n * Remove a given listener from this event target.\n * @param {string} eventName The event name to remove.\n * @param {Function} listener The listener to remove.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n removeEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n\n const listeners = getListeners(this);\n const capture = isObject(options)\n ? Boolean(options.capture)\n : Boolean(options);\n const listenerType = capture ? CAPTURE : BUBBLE;\n\n let prev = null;\n let node = listeners.get(eventName);\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n return\n }\n\n prev = node;\n node = node.next;\n }\n },\n\n /**\n * Dispatch a given event.\n * @param {Event|{type:string}} event The event to dispatch.\n * @returns {boolean} `false` if canceled.\n */\n dispatchEvent(event) {\n if (event == null || typeof event.type !== \"string\") {\n throw new TypeError('\"event.type\" should be a string.')\n }\n\n // If listeners aren't registered, terminate.\n const listeners = getListeners(this);\n const eventName = event.type;\n let node = listeners.get(eventName);\n if (node == null) {\n return true\n }\n\n // Since we cannot rewrite several properties, so wrap object.\n const wrappedEvent = wrapEvent(this, event);\n\n // This doesn't process capturing phase and bubbling phase.\n // This isn't participating in a tree.\n let prev = null;\n while (node != null) {\n // Remove this listener if it's once\n if (node.once) {\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n } else {\n prev = node;\n }\n\n // Call this listener\n setPassiveListener(\n wrappedEvent,\n node.passive ? node.listener : null\n );\n if (typeof node.listener === \"function\") {\n try {\n node.listener.call(this, wrappedEvent);\n } catch (err) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(err);\n }\n }\n } else if (\n node.listenerType !== ATTRIBUTE &&\n typeof node.listener.handleEvent === \"function\"\n ) {\n node.listener.handleEvent(wrappedEvent);\n }\n\n // Break if `event.stopImmediatePropagation` was called.\n if (isStopped(wrappedEvent)) {\n break\n }\n\n node = node.next;\n }\n setPassiveListener(wrappedEvent, null);\n setEventPhase(wrappedEvent, 0);\n setCurrentTarget(wrappedEvent, null);\n\n return !wrappedEvent.defaultPrevented\n },\n};\n\n// `constructor` is not enumerable.\nObject.defineProperty(EventTarget.prototype, \"constructor\", {\n value: EventTarget,\n configurable: true,\n writable: true,\n});\n\n// Ensure `eventTarget instanceof window.EventTarget` is `true`.\nif (\n typeof window !== \"undefined\" &&\n typeof window.EventTarget !== \"undefined\"\n) {\n Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype);\n}\n\nexport default EventTarget;\nexport { defineEventAttribute, EventTarget };\n//# sourceMappingURL=event-target-shim.mjs.map\n","/**\n * @author Toru Nagashima \n * See LICENSE file in root directory for full license.\n */\nimport { EventTarget, defineEventAttribute } from 'event-target-shim';\n\n/**\n * The signal class.\n * @see https://dom.spec.whatwg.org/#abortsignal\n */\nclass AbortSignal extends EventTarget {\n /**\n * AbortSignal cannot be constructed directly.\n */\n constructor() {\n super();\n throw new TypeError(\"AbortSignal cannot be constructed directly\");\n }\n /**\n * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise.\n */\n get aborted() {\n const aborted = abortedFlags.get(this);\n if (typeof aborted !== \"boolean\") {\n throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? \"null\" : typeof this}`);\n }\n return aborted;\n }\n}\ndefineEventAttribute(AbortSignal.prototype, \"abort\");\n/**\n * Create an AbortSignal object.\n */\nfunction createAbortSignal() {\n const signal = Object.create(AbortSignal.prototype);\n EventTarget.call(signal);\n abortedFlags.set(signal, false);\n return signal;\n}\n/**\n * Abort a given signal.\n */\nfunction abortSignal(signal) {\n if (abortedFlags.get(signal) !== false) {\n return;\n }\n abortedFlags.set(signal, true);\n signal.dispatchEvent({ type: \"abort\" });\n}\n/**\n * Aborted flag for each instances.\n */\nconst abortedFlags = new WeakMap();\n// Properties should be enumerable.\nObject.defineProperties(AbortSignal.prototype, {\n aborted: { enumerable: true },\n});\n// `toString()` should return `\"[object AbortSignal]\"`\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, {\n configurable: true,\n value: \"AbortSignal\",\n });\n}\n\n/**\n * The AbortController.\n * @see https://dom.spec.whatwg.org/#abortcontroller\n */\nclass AbortController {\n /**\n * Initialize this controller.\n */\n constructor() {\n signals.set(this, createAbortSignal());\n }\n /**\n * Returns the `AbortSignal` object associated with this object.\n */\n get signal() {\n return getSignal(this);\n }\n /**\n * Abort and signal to any observers that the associated activity is to be aborted.\n */\n abort() {\n abortSignal(getSignal(this));\n }\n}\n/**\n * Associated signals.\n */\nconst signals = new WeakMap();\n/**\n * Get the associated signal of a given controller.\n */\nfunction getSignal(controller) {\n const signal = signals.get(controller);\n if (signal == null) {\n throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? \"null\" : typeof controller}`);\n }\n return signal;\n}\n// Properties should be enumerable.\nObject.defineProperties(AbortController.prototype, {\n signal: { enumerable: true },\n abort: { enumerable: true },\n});\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortController.prototype, Symbol.toStringTag, {\n configurable: true,\n value: \"AbortController\",\n });\n}\n\nexport default AbortController;\nexport { AbortController, AbortSignal };\n//# sourceMappingURL=abort-controller.mjs.map\n","\"use strict\";\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StreamArrayParser = void 0;\nconst abort_controller_1 = require(\"abort-controller\");\nconst stream_1 = require(\"stream\");\nconst fallbackRest_1 = require(\"./fallbackRest\");\nconst featureDetection_1 = require(\"./featureDetection\");\nclass StreamArrayParser extends stream_1.Transform {\n _done;\n _prevBlock;\n _isInString;\n _isSkipped;\n _level;\n rpc;\n cancelController;\n cancelSignal;\n cancelRequested;\n /**\n * StreamArrayParser processes array of valid JSON objects in random chunks\n * through readable stream, and produces a stream of plain Javascript objects\n * where it converted from the corresponding protobuf message instance.\n *\n * The default JSON parser decodes the input stream under the\n * following rules:\n * 1. The stream represents a valid JSON array (must start with a \"[\" and\n * close with the corresponding \"]\"). Each element of this array is assumed to\n * be either an array or an object, and will be decoded as a JS object and\n * delivered.\n * 2. All JSON elements in the buffer will be decoded and delivered in a\n * stream.\n *\n * @private\n * @constructor\n * @param {protobuf.Method} rpc - the protobuf method produce array of JSON.\n * @param {Object} options - the options pass to Transform Stream. See more\n * details\n * https://nodejs.org/api/stream.html#stream_new_stream_transform_options.\n */\n constructor(rpc, options) {\n super(Object.assign({}, options, { readableObjectMode: true }));\n this._done = false;\n this._prevBlock = Buffer.from('');\n this._isInString = false;\n this._isSkipped = false;\n this._level = 0;\n this.rpc = rpc;\n this.cancelController = (0, featureDetection_1.hasAbortController)()\n ? new AbortController()\n : new abort_controller_1.AbortController();\n this.cancelSignal = this.cancelController.signal;\n this.cancelRequested = false;\n }\n _transform(chunk, _, callback) {\n let objectStart = 0;\n let curIndex = 0;\n if (this._level === 0 && curIndex === 0) {\n if (String.fromCharCode(chunk[0]) !== '[') {\n this.emit('error', new Error(`Internal Error: API service stream data must start with a '[' and close with the corresponding ']', but it start with ${String.fromCharCode(chunk[0])}`));\n }\n curIndex++;\n this._level++;\n }\n while (curIndex < chunk.length) {\n const curValue = String.fromCharCode(chunk[curIndex]);\n if (!this._isSkipped) {\n switch (curValue) {\n case '{':\n // Check if it's in string, we ignore the curly brace in string.\n // Otherwise the object level++.\n if (!this._isInString) {\n this._level++;\n }\n if (!this._isInString && this._level === 2) {\n objectStart = curIndex;\n }\n break;\n case '\"':\n // Flip the string status\n this._isInString = !this._isInString;\n break;\n case '}':\n // check if it's in string\n // if true, do nothing\n // if false and level = 0, push data\n if (!this._isInString) {\n this._level--;\n }\n if (!this._isInString && this._level === 1) {\n // find a object\n const objBuff = Buffer.concat([\n this._prevBlock,\n chunk.slice(objectStart, curIndex + 1),\n ]);\n try {\n // HTTP response.ok is true.\n const msgObj = (0, fallbackRest_1.decodeResponse)(this.rpc, true, objBuff);\n this.push(msgObj);\n }\n catch (err) {\n this.emit('error', err);\n }\n objectStart = curIndex + 1;\n this._prevBlock = Buffer.from('');\n }\n break;\n case ']':\n if (!this._isInString && this._level === 1) {\n this._done = true;\n this.push(null);\n }\n break;\n case '\\\\':\n // Escaping escape character.\n this._isSkipped = true;\n break;\n default:\n break;\n }\n }\n else {\n this._isSkipped = false;\n }\n curIndex++;\n }\n if (this._level > 1) {\n this._prevBlock = Buffer.concat([\n this._prevBlock,\n chunk.slice(objectStart, curIndex),\n ]);\n }\n callback();\n }\n _flush(callback) {\n callback();\n }\n cancel() {\n this._done = true;\n this.cancelRequested = true;\n this.cancelController.abort();\n this.end();\n }\n}\nexports.StreamArrayParser = StreamArrayParser;\n//# sourceMappingURL=streamArrayParser.js.map","\"use strict\";\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateServiceStub = generateServiceStub;\nconst abort_controller_1 = require(\"abort-controller\");\nconst google_auth_library_1 = require(\"google-auth-library\");\nconst featureDetection_1 = require(\"./featureDetection\");\nconst streamArrayParser_1 = require(\"./streamArrayParser\");\nconst stream_1 = require(\"stream\");\nconst fetchNode = (...args) => import('node-fetch').then(({ default: fetch }) => fetch(...args));\n// Node.js before v19 does not enable keepalive by default.\n// We'll try to enable it very carefully to make sure we don't break possible non-Node use cases.\n// TODO: remove this after Node 18 is EOL.\n// More info:\n// - https://github.com/node-fetch/node-fetch#custom-agent\n// - https://github.com/googleapis/gax-nodejs/pull/1534\nlet agentOption = null;\nif ((0, featureDetection_1.isNodeJS)()) {\n const http = require('http');\n const https = require('https');\n const httpAgent = new http.Agent({ keepAlive: true });\n const httpsAgent = new https.Agent({ keepAlive: true });\n agentOption = (parsedUrl) => {\n if (parsedUrl.protocol === 'http:') {\n return httpAgent;\n }\n return httpsAgent;\n };\n}\nfunction generateServiceStub(rpcs, protocol, servicePath, servicePort, auth, requestEncoder, responseDecoder, numericEnums, minifyJson) {\n const fetch = (0, featureDetection_1.hasWindowFetch)()\n ? window.fetch\n : fetchNode;\n const serviceStub = {\n // close method should close all cancel controllers. If this feature request in the future, we can have a cancelControllerFactory that tracks created cancel controllers, and abort them all in close method.\n close: () => {\n return { cancel: () => { } };\n },\n };\n for (const [rpcName, rpc] of Object.entries(rpcs)) {\n serviceStub[rpcName] = (request, options, _metadata, callback) => {\n options ??= {};\n // We cannot use async-await in this function because we need to return the canceller object as soon as possible.\n // Using plain old promises instead.\n let fetchParameters;\n try {\n fetchParameters = requestEncoder(rpc, protocol, servicePath, servicePort, request, numericEnums, minifyJson);\n }\n catch (err) {\n // we could not encode parameters; pass error to the callback\n // and return a no-op canceler object.\n if (callback) {\n callback(err);\n }\n return {\n cancel() { },\n };\n }\n const cancelController = (0, featureDetection_1.hasAbortController)()\n ? new AbortController()\n : new abort_controller_1.AbortController();\n const cancelSignal = cancelController.signal;\n let cancelRequested = false;\n const url = fetchParameters.url;\n const headers = new Headers(fetchParameters.headers);\n for (const key of Object.keys(options)) {\n headers.set(key, options[key][0]);\n }\n const streamArrayParser = new streamArrayParser_1.StreamArrayParser(rpc);\n auth\n .getRequestHeaders()\n .then(authHeader => {\n const fetchRequest = {\n headers: google_auth_library_1.gaxios.Gaxios.mergeHeaders(authHeader, headers),\n body: fetchParameters.body,\n method: fetchParameters.method,\n signal: cancelSignal,\n };\n if (agentOption) {\n fetchRequest.agent = agentOption;\n }\n if (fetchParameters.method === 'GET' ||\n fetchParameters.method === 'DELETE') {\n delete fetchRequest['body'];\n }\n return fetch(url, fetchRequest);\n })\n .then((response) => {\n if (response.ok && rpc.responseStream) {\n (0, stream_1.pipeline)(response.body, streamArrayParser, (err) => {\n if (err &&\n (!cancelRequested ||\n (err instanceof Error && err.name !== 'AbortError'))) {\n if (callback) {\n callback(err);\n }\n streamArrayParser.emit('error', err);\n }\n });\n return;\n }\n else {\n return Promise.all([\n Promise.resolve(response.ok),\n response.arrayBuffer(),\n ])\n .then(([ok, buffer]) => {\n const response = responseDecoder(rpc, ok, buffer);\n callback(null, response);\n })\n .catch((err) => {\n if (!cancelRequested || err.name !== 'AbortError') {\n if (rpc.responseStream) {\n if (callback) {\n callback(err);\n }\n streamArrayParser.emit('error', err);\n }\n else if (callback) {\n callback(err);\n }\n else {\n throw err;\n }\n }\n });\n }\n })\n .catch((err) => {\n if (rpc.responseStream) {\n if (callback) {\n callback(err);\n }\n streamArrayParser.emit('error', err);\n }\n else if (callback) {\n callback(err);\n }\n else {\n throw err;\n }\n });\n if (rpc.responseStream) {\n return streamArrayParser;\n }\n return {\n cancel: () => {\n cancelRequested = true;\n cancelController.abort();\n },\n };\n };\n }\n return serviceStub;\n}\n//# sourceMappingURL=fallbackServiceStub.js.map","module.exports = require('stream');\n","'use strict';\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { 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; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar _require = require('buffer'),\n Buffer = _require.Buffer;\nvar _require2 = require('util'),\n inspect = _require2.inspect;\nvar custom = inspect && inspect.custom || 'inspect';\nfunction copyBuffer(src, target, offset) {\n Buffer.prototype.copy.call(src, target, offset);\n}\nmodule.exports = /*#__PURE__*/function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n _createClass(BufferList, [{\n key: \"push\",\n value: function push(v) {\n var entry = {\n data: v,\n next: null\n };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n }\n }, {\n key: \"unshift\",\n value: function unshift(v) {\n var entry = {\n data: v,\n next: this.head\n };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n }\n }, {\n key: \"shift\",\n value: function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.head = this.tail = null;\n this.length = 0;\n }\n }, {\n key: \"join\",\n value: function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) ret += s + p.data;\n return ret;\n }\n }, {\n key: \"concat\",\n value: function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n }\n\n // Consumes a specified amount of bytes or characters from the buffered data.\n }, {\n key: \"consume\",\n value: function consume(n, hasStrings) {\n var ret;\n if (n < this.head.data.length) {\n // `slice` is the same for buffers and strings.\n ret = this.head.data.slice(0, n);\n this.head.data = this.head.data.slice(n);\n } else if (n === this.head.data.length) {\n // First chunk is a perfect match.\n ret = this.shift();\n } else {\n // Result spans more than one buffer.\n ret = hasStrings ? this._getString(n) : this._getBuffer(n);\n }\n return ret;\n }\n }, {\n key: \"first\",\n value: function first() {\n return this.head.data;\n }\n\n // Consumes a specified amount of characters from the buffered data.\n }, {\n key: \"_getString\",\n value: function _getString(n) {\n var p = this.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) this.head = p.next;else this.head = this.tail = null;\n } else {\n this.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n this.length -= c;\n return ret;\n }\n\n // Consumes a specified amount of bytes from the buffered data.\n }, {\n key: \"_getBuffer\",\n value: function _getBuffer(n) {\n var ret = Buffer.allocUnsafe(n);\n var p = this.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) this.head = p.next;else this.head = this.tail = null;\n } else {\n this.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n this.length -= c;\n return ret;\n }\n\n // Make sure the linked list only shows the minimal necessary information.\n }, {\n key: custom,\n value: function value(_, options) {\n return inspect(this, _objectSpread(_objectSpread({}, options), {}, {\n // Only inspect one level.\n depth: 0,\n // It should not recurse.\n customInspect: false\n }));\n }\n }]);\n return BufferList;\n}();","'use strict';\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err) {\n if (!this._writableState) {\n process.nextTick(emitErrorNT, this, err);\n } else if (!this._writableState.errorEmitted) {\n this._writableState.errorEmitted = true;\n process.nextTick(emitErrorNT, this, err);\n }\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n if (!_this._writableState) {\n process.nextTick(emitErrorAndCloseNT, _this, err);\n } else if (!_this._writableState.errorEmitted) {\n _this._writableState.errorEmitted = true;\n process.nextTick(emitErrorAndCloseNT, _this, err);\n } else {\n process.nextTick(emitCloseNT, _this);\n }\n } else if (cb) {\n process.nextTick(emitCloseNT, _this);\n cb(err);\n } else {\n process.nextTick(emitCloseNT, _this);\n }\n });\n return this;\n}\nfunction emitErrorAndCloseNT(self, err) {\n emitErrorNT(self, err);\n emitCloseNT(self);\n}\nfunction emitCloseNT(self) {\n if (self._writableState && !self._writableState.emitClose) return;\n if (self._readableState && !self._readableState.emitClose) return;\n self.emit('close');\n}\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finalCalled = false;\n this._writableState.prefinished = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\nfunction errorOrDestroy(stream, err) {\n // We have tests that rely on errors being emitted\n // in the same tick, so changing this is semver major.\n // For now when you opt-in to autoDestroy we allow\n // the error to be emitted nextTick. In a future\n // semver major update we should change the default to this.\n\n var rState = stream._readableState;\n var wState = stream._writableState;\n if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);\n}\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy,\n errorOrDestroy: errorOrDestroy\n};","'use strict';\n\nconst codes = {};\n\nfunction createErrorType(code, message, Base) {\n if (!Base) {\n Base = Error\n }\n\n function getMessage (arg1, arg2, arg3) {\n if (typeof message === 'string') {\n return message\n } else {\n return message(arg1, arg2, arg3)\n }\n }\n\n class NodeError extends Base {\n constructor (arg1, arg2, arg3) {\n super(getMessage(arg1, arg2, arg3));\n }\n }\n\n NodeError.prototype.name = Base.name;\n NodeError.prototype.code = code;\n\n codes[code] = NodeError;\n}\n\n// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\nfunction oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n const len = expected.length;\n expected = expected.map((i) => String(i));\n if (len > 2) {\n return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` +\n expected[len - 1];\n } else if (len === 2) {\n return `one of ${thing} ${expected[0]} or ${expected[1]}`;\n } else {\n return `of ${thing} ${expected[0]}`;\n }\n } else {\n return `of ${thing} ${String(expected)}`;\n }\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\nfunction startsWith(str, search, pos) {\n\treturn str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction endsWith(str, search, this_len) {\n\tif (this_len === undefined || this_len > str.length) {\n\t\tthis_len = str.length;\n\t}\n\treturn str.substring(this_len - search.length, this_len) === search;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\nfunction includes(str, search, start) {\n if (typeof start !== 'number') {\n start = 0;\n }\n\n if (start + search.length > str.length) {\n return false;\n } else {\n return str.indexOf(search, start) !== -1;\n }\n}\n\ncreateErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {\n return 'The value \"' + value + '\" is invalid for option \"' + name + '\"'\n}, TypeError);\ncreateErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {\n // determiner: 'must be' or 'must not be'\n let determiner;\n if (typeof expected === 'string' && startsWith(expected, 'not ')) {\n determiner = 'must not be';\n expected = expected.replace(/^not /, '');\n } else {\n determiner = 'must be';\n }\n\n let msg;\n if (endsWith(name, ' argument')) {\n // For cases like 'first argument'\n msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`;\n } else {\n const type = includes(name, '.') ? 'property' : 'argument';\n msg = `The \"${name}\" ${type} ${determiner} ${oneOf(expected, 'type')}`;\n }\n\n msg += `. Received type ${typeof actual}`;\n return msg;\n}, TypeError);\ncreateErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');\ncreateErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {\n return 'The ' + name + ' method is not implemented'\n});\ncreateErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');\ncreateErrorType('ERR_STREAM_DESTROYED', function (name) {\n return 'Cannot call ' + name + ' after a stream was destroyed';\n});\ncreateErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');\ncreateErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');\ncreateErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');\ncreateErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);\ncreateErrorType('ERR_UNKNOWN_ENCODING', function (arg) {\n return 'Unknown encoding: ' + arg\n}, TypeError);\ncreateErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');\n\nmodule.exports.codes = codes;\n","'use strict';\n\nvar ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE;\nfunction highWaterMarkFrom(options, isDuplex, duplexKey) {\n return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;\n}\nfunction getHighWaterMark(state, options, duplexKey, isDuplex) {\n var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);\n if (hwm != null) {\n if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {\n var name = isDuplex ? duplexKey : 'highWaterMark';\n throw new ERR_INVALID_OPT_VALUE(name, hwm);\n }\n return Math.floor(hwm);\n }\n\n // Default value\n return state.objectMode ? 16 : 16 * 1024;\n}\nmodule.exports = {\n getHighWaterMark: getHighWaterMark\n};","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","try {\n var util = require('util');\n /* istanbul ignore next */\n if (typeof util.inherits !== 'function') throw '';\n module.exports = util.inherits;\n} catch (e) {\n /* istanbul ignore next */\n module.exports = require('./inherits_browser.js');\n}\n","\n/**\n * For Node.js, simply re-export the core `util.deprecate` function.\n */\n\nmodule.exports = require('util').deprecate;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict';\n\nmodule.exports = Writable;\n\n/* */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* */\n\n/**/\nvar Duplex;\n/**/\n\nWritable.WritableState = WritableState;\n\n/**/\nvar internalUtil = {\n deprecate: require('util-deprecate')\n};\n/**/\n\n/**/\nvar Stream = require('./internal/streams/stream');\n/**/\n\nvar Buffer = require('buffer').Buffer;\nvar OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\nvar destroyImpl = require('./internal/streams/destroy');\nvar _require = require('./internal/streams/state'),\n getHighWaterMark = _require.getHighWaterMark;\nvar _require$codes = require('../errors').codes,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,\n ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE,\n ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED,\n ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES,\n ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END,\n ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;\nvar errorOrDestroy = destroyImpl.errorOrDestroy;\nrequire('inherits')(Writable, Stream);\nfunction nop() {}\nfunction WritableState(options, stream, isDuplex) {\n Duplex = Duplex || require('./_stream_duplex');\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream,\n // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // Should close be emitted on destroy. Defaults to true.\n this.emitClose = options.emitClose !== false;\n\n // Should .destroy() be called after 'finish' (and potentially 'end')\n this.autoDestroy = !!options.autoDestroy;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function writableStateBufferGetter() {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function value(object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function realHasInstance(object) {\n return object instanceof this;\n };\n}\nfunction Writable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n\n // Checking for a Stream.Duplex instance is faster here instead of inside\n // the WritableState constructor, at least with V8 6.5\n var isDuplex = this instanceof Duplex;\n if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);\n this._writableState = new WritableState(options, this, isDuplex);\n\n // legacy.\n this.writable = true;\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n if (typeof options.writev === 'function') this._writev = options.writev;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n if (typeof options.final === 'function') this._final = options.final;\n }\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());\n};\nfunction writeAfterEnd(stream, cb) {\n var er = new ERR_STREAM_WRITE_AFTER_END();\n // TODO: defer error events consistently everywhere, not just the cb\n errorOrDestroy(stream, er);\n process.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var er;\n if (chunk === null) {\n er = new ERR_STREAM_NULL_VALUES();\n } else if (typeof chunk !== 'string' && !state.objectMode) {\n er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk);\n }\n if (er) {\n errorOrDestroy(stream, er);\n process.nextTick(cb, er);\n return false;\n }\n return true;\n}\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n if (typeof cb !== 'function') cb = nop;\n if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n return ret;\n};\nWritable.prototype.cork = function () {\n this._writableState.corked++;\n};\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n if (state.corked) {\n state.corked--;\n if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\nObject.defineProperty(Writable.prototype, 'writableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState && this._writableState.getBuffer();\n }\n});\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n state.length += len;\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n return ret;\n}\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n process.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n process.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n errorOrDestroy(stream, er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n errorOrDestroy(stream, er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK();\n onwriteStateUpdate(state);\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state) || stream.destroyed;\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n if (sync) {\n process.nextTick(afterWrite, stream, state, finished, cb);\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n if (entry === null) state.lastBufferedRequest = null;\n }\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()'));\n};\nWritable.prototype._writev = null;\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending) endWritable(this, state, cb);\n return this;\n};\nObject.defineProperty(Writable.prototype, 'writableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.length;\n }\n});\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n errorOrDestroy(stream, err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function' && !state.destroyed) {\n state.pendingcb++;\n state.finalCalled = true;\n process.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the readable side is ready for autoDestroy as well\n var rState = stream._readableState;\n if (!rState || rState.autoDestroy && rState.endEmitted) {\n stream.destroy();\n }\n }\n }\n }\n return need;\n}\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) process.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n\n // reuse the free corkReq.\n state.corkedRequestsFree.next = corkReq;\n}\nObject.defineProperty(Writable.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n cb(err);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict';\n\n/**/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n};\n/**/\n\nmodule.exports = Duplex;\nvar Readable = require('./_stream_readable');\nvar Writable = require('./_stream_writable');\nrequire('inherits')(Duplex, Readable);\n{\n // Allow the keys array to be GC'ed.\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n Readable.call(this, options);\n Writable.call(this, options);\n this.allowHalfOpen = true;\n if (options) {\n if (options.readable === false) this.readable = false;\n if (options.writable === false) this.writable = false;\n if (options.allowHalfOpen === false) {\n this.allowHalfOpen = false;\n this.once('end', onend);\n }\n }\n}\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.highWaterMark;\n }\n});\nObject.defineProperty(Duplex.prototype, 'writableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState && this._writableState.getBuffer();\n }\n});\nObject.defineProperty(Duplex.prototype, 'writableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.length;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // If the writable side ended, then we're ok.\n if (this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n process.nextTick(onEndNT, this);\n}\nfunction onEndNT(self) {\n self.end();\n}\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\n/**/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n encoding = '' + encoding;\n switch (encoding && encoding.toLowerCase()) {\n case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':\n return true;\n default:\n return false;\n }\n};\n\nfunction _normalizeEncoding(enc) {\n if (!enc) return 'utf8';\n var retried;\n while (true) {\n switch (enc) {\n case 'utf8':\n case 'utf-8':\n return 'utf8';\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return 'utf16le';\n case 'latin1':\n case 'binary':\n return 'latin1';\n case 'base64':\n case 'ascii':\n case 'hex':\n return enc;\n default:\n if (retried) return; // undefined\n enc = ('' + enc).toLowerCase();\n retried = true;\n }\n }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n this.encoding = normalizeEncoding(encoding);\n var nb;\n switch (this.encoding) {\n case 'utf16le':\n this.text = utf16Text;\n this.end = utf16End;\n nb = 4;\n break;\n case 'utf8':\n this.fillLast = utf8FillLast;\n nb = 4;\n break;\n case 'base64':\n this.text = base64Text;\n this.end = base64End;\n nb = 3;\n break;\n default:\n this.write = simpleWrite;\n this.end = simpleEnd;\n return;\n }\n this.lastNeed = 0;\n this.lastTotal = 0;\n this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n if (buf.length === 0) return '';\n var r;\n var i;\n if (this.lastNeed) {\n r = this.fillLast(buf);\n if (r === undefined) return '';\n i = this.lastNeed;\n this.lastNeed = 0;\n } else {\n i = 0;\n }\n if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n var p = this.lastTotal - this.lastNeed;\n var r = utf8CheckExtraBytes(this, buf, p);\n if (r !== undefined) return r;\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, p, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, p, 0, buf.length);\n this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + '\\ufffd';\n return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n return r.slice(0, -1);\n }\n }\n return r;\n }\n this.lastNeed = 1;\n this.lastTotal = 2;\n this.lastChar[0] = buf[buf.length - 1];\n return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n}\n\nfunction base64Text(buf, i) {\n var n = (buf.length - i) % 3;\n if (n === 0) return buf.toString('base64', i);\n this.lastNeed = 3 - n;\n this.lastTotal = 3;\n if (n === 1) {\n this.lastChar[0] = buf[buf.length - 1];\n } else {\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n }\n return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n return buf && buf.length ? this.write(buf) : '';\n}","// Ported from https://github.com/mafintosh/end-of-stream with\n// permission from the author, Mathias Buus (@mafintosh).\n\n'use strict';\n\nvar ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE;\nfunction once(callback) {\n var called = false;\n return function () {\n if (called) return;\n called = true;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n callback.apply(this, args);\n };\n}\nfunction noop() {}\nfunction isRequest(stream) {\n return stream.setHeader && typeof stream.abort === 'function';\n}\nfunction eos(stream, opts, callback) {\n if (typeof opts === 'function') return eos(stream, null, opts);\n if (!opts) opts = {};\n callback = once(callback || noop);\n var readable = opts.readable || opts.readable !== false && stream.readable;\n var writable = opts.writable || opts.writable !== false && stream.writable;\n var onlegacyfinish = function onlegacyfinish() {\n if (!stream.writable) onfinish();\n };\n var writableEnded = stream._writableState && stream._writableState.finished;\n var onfinish = function onfinish() {\n writable = false;\n writableEnded = true;\n if (!readable) callback.call(stream);\n };\n var readableEnded = stream._readableState && stream._readableState.endEmitted;\n var onend = function onend() {\n readable = false;\n readableEnded = true;\n if (!writable) callback.call(stream);\n };\n var onerror = function onerror(err) {\n callback.call(stream, err);\n };\n var onclose = function onclose() {\n var err;\n if (readable && !readableEnded) {\n if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();\n return callback.call(stream, err);\n }\n if (writable && !writableEnded) {\n if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();\n return callback.call(stream, err);\n }\n };\n var onrequest = function onrequest() {\n stream.req.on('finish', onfinish);\n };\n if (isRequest(stream)) {\n stream.on('complete', onfinish);\n stream.on('abort', onclose);\n if (stream.req) onrequest();else stream.on('request', onrequest);\n } else if (writable && !stream._writableState) {\n // legacy streams\n stream.on('end', onlegacyfinish);\n stream.on('close', onlegacyfinish);\n }\n stream.on('end', onend);\n stream.on('finish', onfinish);\n if (opts.error !== false) stream.on('error', onerror);\n stream.on('close', onclose);\n return function () {\n stream.removeListener('complete', onfinish);\n stream.removeListener('abort', onclose);\n stream.removeListener('request', onrequest);\n if (stream.req) stream.req.removeListener('finish', onfinish);\n stream.removeListener('end', onlegacyfinish);\n stream.removeListener('close', onlegacyfinish);\n stream.removeListener('finish', onfinish);\n stream.removeListener('end', onend);\n stream.removeListener('error', onerror);\n stream.removeListener('close', onclose);\n };\n}\nmodule.exports = eos;","'use strict';\n\nvar _Object$setPrototypeO;\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar finished = require('./end-of-stream');\nvar kLastResolve = Symbol('lastResolve');\nvar kLastReject = Symbol('lastReject');\nvar kError = Symbol('error');\nvar kEnded = Symbol('ended');\nvar kLastPromise = Symbol('lastPromise');\nvar kHandlePromise = Symbol('handlePromise');\nvar kStream = Symbol('stream');\nfunction createIterResult(value, done) {\n return {\n value: value,\n done: done\n };\n}\nfunction readAndResolve(iter) {\n var resolve = iter[kLastResolve];\n if (resolve !== null) {\n var data = iter[kStream].read();\n // we defer if data is null\n // we can be expecting either 'end' or\n // 'error'\n if (data !== null) {\n iter[kLastPromise] = null;\n iter[kLastResolve] = null;\n iter[kLastReject] = null;\n resolve(createIterResult(data, false));\n }\n }\n}\nfunction onReadable(iter) {\n // we wait for the next tick, because it might\n // emit an error with process.nextTick\n process.nextTick(readAndResolve, iter);\n}\nfunction wrapForNext(lastPromise, iter) {\n return function (resolve, reject) {\n lastPromise.then(function () {\n if (iter[kEnded]) {\n resolve(createIterResult(undefined, true));\n return;\n }\n iter[kHandlePromise](resolve, reject);\n }, reject);\n };\n}\nvar AsyncIteratorPrototype = Object.getPrototypeOf(function () {});\nvar ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {\n get stream() {\n return this[kStream];\n },\n next: function next() {\n var _this = this;\n // if we have detected an error in the meanwhile\n // reject straight away\n var error = this[kError];\n if (error !== null) {\n return Promise.reject(error);\n }\n if (this[kEnded]) {\n return Promise.resolve(createIterResult(undefined, true));\n }\n if (this[kStream].destroyed) {\n // We need to defer via nextTick because if .destroy(err) is\n // called, the error will be emitted via nextTick, and\n // we cannot guarantee that there is no error lingering around\n // waiting to be emitted.\n return new Promise(function (resolve, reject) {\n process.nextTick(function () {\n if (_this[kError]) {\n reject(_this[kError]);\n } else {\n resolve(createIterResult(undefined, true));\n }\n });\n });\n }\n\n // if we have multiple next() calls\n // we will wait for the previous Promise to finish\n // this logic is optimized to support for await loops,\n // where next() is only called once at a time\n var lastPromise = this[kLastPromise];\n var promise;\n if (lastPromise) {\n promise = new Promise(wrapForNext(lastPromise, this));\n } else {\n // fast path needed to support multiple this.push()\n // without triggering the next() queue\n var data = this[kStream].read();\n if (data !== null) {\n return Promise.resolve(createIterResult(data, false));\n }\n promise = new Promise(this[kHandlePromise]);\n }\n this[kLastPromise] = promise;\n return promise;\n }\n}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () {\n return this;\n}), _defineProperty(_Object$setPrototypeO, \"return\", function _return() {\n var _this2 = this;\n // destroy(err, cb) is a private API\n // we can guarantee we have that here, because we control the\n // Readable class this is attached to\n return new Promise(function (resolve, reject) {\n _this2[kStream].destroy(null, function (err) {\n if (err) {\n reject(err);\n return;\n }\n resolve(createIterResult(undefined, true));\n });\n });\n}), _Object$setPrototypeO), AsyncIteratorPrototype);\nvar createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) {\n var _Object$create;\n var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {\n value: stream,\n writable: true\n }), _defineProperty(_Object$create, kLastResolve, {\n value: null,\n writable: true\n }), _defineProperty(_Object$create, kLastReject, {\n value: null,\n writable: true\n }), _defineProperty(_Object$create, kError, {\n value: null,\n writable: true\n }), _defineProperty(_Object$create, kEnded, {\n value: stream._readableState.endEmitted,\n writable: true\n }), _defineProperty(_Object$create, kHandlePromise, {\n value: function value(resolve, reject) {\n var data = iterator[kStream].read();\n if (data) {\n iterator[kLastPromise] = null;\n iterator[kLastResolve] = null;\n iterator[kLastReject] = null;\n resolve(createIterResult(data, false));\n } else {\n iterator[kLastResolve] = resolve;\n iterator[kLastReject] = reject;\n }\n },\n writable: true\n }), _Object$create));\n iterator[kLastPromise] = null;\n finished(stream, function (err) {\n if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {\n var reject = iterator[kLastReject];\n // reject if we are waiting for data in the Promise\n // returned by next() and store the error\n if (reject !== null) {\n iterator[kLastPromise] = null;\n iterator[kLastResolve] = null;\n iterator[kLastReject] = null;\n reject(err);\n }\n iterator[kError] = err;\n return;\n }\n var resolve = iterator[kLastResolve];\n if (resolve !== null) {\n iterator[kLastPromise] = null;\n iterator[kLastResolve] = null;\n iterator[kLastReject] = null;\n resolve(createIterResult(undefined, true));\n }\n iterator[kEnded] = true;\n });\n stream.on('readable', onReadable.bind(null, iterator));\n return iterator;\n};\nmodule.exports = createReadableStreamAsyncIterator;","'use strict';\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { 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; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar ERR_INVALID_ARG_TYPE = require('../../../errors').codes.ERR_INVALID_ARG_TYPE;\nfunction from(Readable, iterable, opts) {\n var iterator;\n if (iterable && typeof iterable.next === 'function') {\n iterator = iterable;\n } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable);\n var readable = new Readable(_objectSpread({\n objectMode: true\n }, opts));\n // Reading boolean to protect against _read\n // being called before last iteration completion.\n var reading = false;\n readable._read = function () {\n if (!reading) {\n reading = true;\n next();\n }\n };\n function next() {\n return _next2.apply(this, arguments);\n }\n function _next2() {\n _next2 = _asyncToGenerator(function* () {\n try {\n var _yield$iterator$next = yield iterator.next(),\n value = _yield$iterator$next.value,\n done = _yield$iterator$next.done;\n if (done) {\n readable.push(null);\n } else if (readable.push(yield value)) {\n next();\n } else {\n reading = false;\n }\n } catch (err) {\n readable.destroy(err);\n }\n });\n return _next2.apply(this, arguments);\n }\n return readable;\n}\nmodule.exports = from;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nmodule.exports = Readable;\n\n/**/\nvar Duplex;\n/**/\n\nReadable.ReadableState = ReadableState;\n\n/**/\nvar EE = require('events').EventEmitter;\nvar EElistenerCount = function EElistenerCount(emitter, type) {\n return emitter.listeners(type).length;\n};\n/**/\n\n/**/\nvar Stream = require('./internal/streams/stream');\n/**/\n\nvar Buffer = require('buffer').Buffer;\nvar OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/**/\nvar debugUtil = require('util');\nvar debug;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function debug() {};\n}\n/**/\n\nvar BufferList = require('./internal/streams/buffer_list');\nvar destroyImpl = require('./internal/streams/destroy');\nvar _require = require('./internal/streams/state'),\n getHighWaterMark = _require.getHighWaterMark;\nvar _require$codes = require('../errors').codes,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;\n\n// Lazy loaded to improve the startup performance.\nvar StringDecoder;\nvar createReadableStreamAsyncIterator;\nvar from;\nrequire('inherits')(Readable, Stream);\nvar errorOrDestroy = destroyImpl.errorOrDestroy;\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\nfunction ReadableState(options, stream, isDuplex) {\n Duplex = Duplex || require('./_stream_duplex');\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n this.paused = true;\n\n // Should close be emitted on destroy. Defaults to true.\n this.emitClose = options.emitClose !== false;\n\n // Should .destroy() be called after 'end' (and potentially 'finish')\n this.autoDestroy = !!options.autoDestroy;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n if (!(this instanceof Readable)) return new Readable(options);\n\n // Checking for a Stream.Duplex instance is faster here instead of inside\n // the ReadableState constructor, at least with V8 6.5\n var isDuplex = this instanceof Duplex;\n this._readableState = new ReadableState(options, this, isDuplex);\n\n // legacy\n this.readable = true;\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n Stream.call(this);\n}\nObject.defineProperty(Readable.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n debug('readableAddChunk', chunk);\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n errorOrDestroy(stream, er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n if (addToFront) {\n if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());\n } else if (state.destroyed) {\n return false;\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n maybeReadMore(stream, state);\n }\n }\n\n // We can push more data if we are below the highWaterMark.\n // Also, if we have no data yet, we can stand some more bytes.\n // This is to work around cases where hwm=0, such as the repl.\n return !state.ended && (state.length < state.highWaterMark || state.length === 0);\n}\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n state.awaitDrain = 0;\n stream.emit('data', chunk);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);\n }\n return er;\n}\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n var decoder = new StringDecoder(enc);\n this._readableState.decoder = decoder;\n // If setEncoding(null), decoder.encoding equals utf8\n this._readableState.encoding = this._readableState.decoder.encoding;\n\n // Iterate over current buffer to convert already stored Buffers:\n var p = this._readableState.buffer.head;\n var content = '';\n while (p !== null) {\n content += decoder.write(p.data);\n p = p.next;\n }\n this._readableState.buffer.clear();\n if (content !== '') this._readableState.buffer.push(content);\n this._readableState.length = content.length;\n return this;\n};\n\n// Don't raise the hwm > 1GB\nvar MAX_HWM = 0x40000000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n if (ret === null) {\n state.needReadable = state.length <= state.highWaterMark;\n n = 0;\n } else {\n state.length -= n;\n state.awaitDrain = 0;\n }\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n if (ret !== null) this.emit('data', ret);\n return ret;\n};\nfunction onEofChunk(stream, state) {\n debug('onEofChunk');\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n if (state.sync) {\n // if we are sync, wait until next tick to emit the data.\n // Otherwise we risk emitting data in the flow()\n // the readable code triggers during a read() call\n emitReadable(stream);\n } else {\n // emit 'readable' now to make sure it gets picked up.\n state.needReadable = false;\n if (!state.emittedReadable) {\n state.emittedReadable = true;\n emitReadable_(stream);\n }\n }\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}\nfunction emitReadable_(stream) {\n var state = stream._readableState;\n debug('emitReadable_', state.destroyed, state.length, state.ended);\n if (!state.destroyed && (state.length || state.ended)) {\n stream.emit('readable');\n state.emittedReadable = false;\n }\n\n // The stream needs another readable event if\n // 1. It is not flowing, as the flow mechanism will take\n // care of it.\n // 2. It is not ended.\n // 3. It is below the highWaterMark, so we can schedule\n // another readable later.\n state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n process.nextTick(maybeReadMore_, stream, state);\n }\n}\nfunction maybeReadMore_(stream, state) {\n // Attempt to read more data if we should.\n //\n // The conditions for reading more data are (one of):\n // - Not enough data buffered (state.length < state.highWaterMark). The loop\n // is responsible for filling the buffer with enough data if such data\n // is available. If highWaterMark is 0 and we are not in the flowing mode\n // we should _not_ attempt to buffer any extra data. We'll get more data\n // when the stream consumer calls read() instead.\n // - No data in the buffer, and the stream is in flowing mode. In this mode\n // the loop below is responsible for ensuring read() is called. Failing to\n // call read here would abort the flow and there's no other mechanism for\n // continuing the flow if the stream consumer has just subscribed to the\n // 'data' event.\n //\n // In addition to the above conditions to keep reading data, the following\n // conditions prevent the data from being read:\n // - The stream has ended (state.ended).\n // - There is already a pending 'read' operation (state.reading). This is a\n // case where the the stream has called the implementation defined _read()\n // method, but they are processing the call asynchronously and have _not_\n // called push() with new data. In this case we skip performing more\n // read()s. The execution ends in this method again after the _read() ends\n // up calling push() with more data.\n while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {\n var len = state.length;\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));\n};\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n var ret = dest.write(chunk);\n debug('dest.write', ret);\n if (ret === false) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', state.awaitDrain);\n state.awaitDrain++;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n return dest;\n};\nfunction pipeOnDrain(src) {\n return function pipeOnDrainFunctionResult() {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = {\n hasUnpiped: false\n };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, {\n hasUnpiped: false\n });\n return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n dest.emit('unpipe', this, unpipeInfo);\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n var state = this._readableState;\n if (ev === 'data') {\n // update readableListening so that resume() may be a no-op\n // a few lines down. This is needed to support once('readable').\n state.readableListening = this.listenerCount('readable') > 0;\n\n // Try start flowing on next tick if stream isn't explicitly paused\n if (state.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.flowing = false;\n state.emittedReadable = false;\n debug('on readable', state.length, state.reading);\n if (state.length) {\n emitReadable(this);\n } else if (!state.reading) {\n process.nextTick(nReadingNextTick, this);\n }\n }\n }\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\nReadable.prototype.removeListener = function (ev, fn) {\n var res = Stream.prototype.removeListener.call(this, ev, fn);\n if (ev === 'readable') {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n return res;\n};\nReadable.prototype.removeAllListeners = function (ev) {\n var res = Stream.prototype.removeAllListeners.apply(this, arguments);\n if (ev === 'readable' || ev === undefined) {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n return res;\n};\nfunction updateReadableListening(self) {\n var state = self._readableState;\n state.readableListening = self.listenerCount('readable') > 0;\n if (state.resumeScheduled && !state.paused) {\n // flowing needs to be set to true now, otherwise\n // the upcoming resume will not flow.\n state.flowing = true;\n\n // crude way to check if we should resume\n } else if (self.listenerCount('data') > 0) {\n self.resume();\n }\n}\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n // we flow only if there is no one listening\n // for readable, but we still have to call\n // resume()\n state.flowing = !state.readableListening;\n resume(this, state);\n }\n state.paused = false;\n return this;\n};\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n process.nextTick(resume_, stream, state);\n }\n}\nfunction resume_(stream, state) {\n debug('resume', state.reading);\n if (!state.reading) {\n stream.read(0);\n }\n state.resumeScheduled = false;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (this._readableState.flowing !== false) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n this._readableState.paused = true;\n return this;\n};\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null);\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n var state = this._readableState;\n var paused = false;\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n _this.push(null);\n });\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function methodWrap(method) {\n return function methodWrapReturnFunction() {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n return this;\n};\nif (typeof Symbol === 'function') {\n Readable.prototype[Symbol.asyncIterator] = function () {\n if (createReadableStreamAsyncIterator === undefined) {\n createReadableStreamAsyncIterator = require('./internal/streams/async_iterator');\n }\n return createReadableStreamAsyncIterator(this);\n };\n}\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.highWaterMark;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState && this._readableState.buffer;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableFlowing', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.flowing;\n },\n set: function set(state) {\n if (this._readableState) {\n this._readableState.flowing = state;\n }\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\nObject.defineProperty(Readable.prototype, 'readableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.length;\n }\n});\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = state.buffer.consume(n, state.decoder);\n }\n return ret;\n}\nfunction endReadable(stream) {\n var state = stream._readableState;\n debug('endReadable', state.endEmitted);\n if (!state.endEmitted) {\n state.ended = true;\n process.nextTick(endReadableNT, state, stream);\n }\n}\nfunction endReadableNT(state, stream) {\n debug('endReadableNT', state.endEmitted, state.length);\n\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the writable side is ready for autoDestroy as well\n var wState = stream._writableState;\n if (!wState || wState.autoDestroy && wState.finished) {\n stream.destroy();\n }\n }\n }\n}\nif (typeof Symbol === 'function') {\n Readable.from = function (iterable, opts) {\n if (from === undefined) {\n from = require('./internal/streams/from');\n }\n return from(Readable, iterable, opts);\n };\n}\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict';\n\nmodule.exports = Transform;\nvar _require$codes = require('../errors').codes,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,\n ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,\n ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;\nvar Duplex = require('./_stream_duplex');\nrequire('inherits')(Transform, Duplex);\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n var cb = ts.writecb;\n if (cb === null) {\n return this.emit('error', new ERR_MULTIPLE_CALLBACK());\n }\n ts.writechunk = null;\n ts.writecb = null;\n if (data != null)\n // single equals check for both `null` and `undefined`\n this.push(data);\n cb(er);\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n Duplex.call(this, options);\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\nfunction prefinish() {\n var _this = this;\n if (typeof this._flush === 'function' && !this._readableState.destroyed) {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()'));\n};\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n if (ts.writechunk !== null && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\nTransform.prototype._destroy = function (err, cb) {\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n });\n};\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n if (data != null)\n // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // TODO(BridgeAR): Write a test for these two error cases\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();\n if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();\n return stream.push(null);\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\nvar Transform = require('./_stream_transform');\nrequire('inherits')(PassThrough, Transform);\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n Transform.call(this, options);\n}\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};","// Ported from https://github.com/mafintosh/pump with\n// permission from the author, Mathias Buus (@mafintosh).\n\n'use strict';\n\nvar eos;\nfunction once(callback) {\n var called = false;\n return function () {\n if (called) return;\n called = true;\n callback.apply(void 0, arguments);\n };\n}\nvar _require$codes = require('../../../errors').codes,\n ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,\n ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;\nfunction noop(err) {\n // Rethrow the error if it exists to avoid swallowing it\n if (err) throw err;\n}\nfunction isRequest(stream) {\n return stream.setHeader && typeof stream.abort === 'function';\n}\nfunction destroyer(stream, reading, writing, callback) {\n callback = once(callback);\n var closed = false;\n stream.on('close', function () {\n closed = true;\n });\n if (eos === undefined) eos = require('./end-of-stream');\n eos(stream, {\n readable: reading,\n writable: writing\n }, function (err) {\n if (err) return callback(err);\n closed = true;\n callback();\n });\n var destroyed = false;\n return function (err) {\n if (closed) return;\n if (destroyed) return;\n destroyed = true;\n\n // request.destroy just do .end - .abort is what we want\n if (isRequest(stream)) return stream.abort();\n if (typeof stream.destroy === 'function') return stream.destroy();\n callback(err || new ERR_STREAM_DESTROYED('pipe'));\n };\n}\nfunction call(fn) {\n fn();\n}\nfunction pipe(from, to) {\n return from.pipe(to);\n}\nfunction popCallback(streams) {\n if (!streams.length) return noop;\n if (typeof streams[streams.length - 1] !== 'function') return noop;\n return streams.pop();\n}\nfunction pipeline() {\n for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {\n streams[_key] = arguments[_key];\n }\n var callback = popCallback(streams);\n if (Array.isArray(streams[0])) streams = streams[0];\n if (streams.length < 2) {\n throw new ERR_MISSING_ARGS('streams');\n }\n var error;\n var destroys = streams.map(function (stream, i) {\n var reading = i < streams.length - 1;\n var writing = i > 0;\n return destroyer(stream, reading, writing, function (err) {\n if (!error) error = err;\n if (err) destroys.forEach(call);\n if (reading) return;\n destroys.forEach(call);\n callback(error);\n });\n });\n return streams.reduce(pipe);\n}\nmodule.exports = pipeline;","var Stream = require('stream');\nif (process.env.READABLE_STREAM === 'disable' && Stream) {\n module.exports = Stream.Readable;\n Object.assign(module.exports, Stream);\n module.exports.Stream = Stream;\n} else {\n exports = module.exports = require('./lib/_stream_readable.js');\n exports.Stream = Stream || exports;\n exports.Readable = exports;\n exports.Writable = require('./lib/_stream_writable.js');\n exports.Duplex = require('./lib/_stream_duplex.js');\n exports.Transform = require('./lib/_stream_transform.js');\n exports.PassThrough = require('./lib/_stream_passthrough.js');\n exports.finished = require('./lib/internal/streams/end-of-stream.js');\n exports.pipeline = require('./lib/internal/streams/pipeline.js');\n}\n","var once = require('once');\n\nvar noop = function() {};\n\nvar isRequest = function(stream) {\n\treturn stream.setHeader && typeof stream.abort === 'function';\n};\n\nvar isChildProcess = function(stream) {\n\treturn stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3\n};\n\nvar eos = function(stream, opts, callback) {\n\tif (typeof opts === 'function') return eos(stream, null, opts);\n\tif (!opts) opts = {};\n\n\tcallback = once(callback || noop);\n\n\tvar ws = stream._writableState;\n\tvar rs = stream._readableState;\n\tvar readable = opts.readable || (opts.readable !== false && stream.readable);\n\tvar writable = opts.writable || (opts.writable !== false && stream.writable);\n\tvar cancelled = false;\n\n\tvar onlegacyfinish = function() {\n\t\tif (!stream.writable) onfinish();\n\t};\n\n\tvar onfinish = function() {\n\t\twritable = false;\n\t\tif (!readable) callback.call(stream);\n\t};\n\n\tvar onend = function() {\n\t\treadable = false;\n\t\tif (!writable) callback.call(stream);\n\t};\n\n\tvar onexit = function(exitCode) {\n\t\tcallback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);\n\t};\n\n\tvar onerror = function(err) {\n\t\tcallback.call(stream, err);\n\t};\n\n\tvar onclose = function() {\n\t\tprocess.nextTick(onclosenexttick);\n\t};\n\n\tvar onclosenexttick = function() {\n\t\tif (cancelled) return;\n\t\tif (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));\n\t\tif (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));\n\t};\n\n\tvar onrequest = function() {\n\t\tstream.req.on('finish', onfinish);\n\t};\n\n\tif (isRequest(stream)) {\n\t\tstream.on('complete', onfinish);\n\t\tstream.on('abort', onclose);\n\t\tif (stream.req) onrequest();\n\t\telse stream.on('request', onrequest);\n\t} else if (writable && !ws) { // legacy streams\n\t\tstream.on('end', onlegacyfinish);\n\t\tstream.on('close', onlegacyfinish);\n\t}\n\n\tif (isChildProcess(stream)) stream.on('exit', onexit);\n\n\tstream.on('end', onend);\n\tstream.on('finish', onfinish);\n\tif (opts.error !== false) stream.on('error', onerror);\n\tstream.on('close', onclose);\n\n\treturn function() {\n\t\tcancelled = true;\n\t\tstream.removeListener('complete', onfinish);\n\t\tstream.removeListener('abort', onclose);\n\t\tstream.removeListener('request', onrequest);\n\t\tif (stream.req) stream.req.removeListener('finish', onfinish);\n\t\tstream.removeListener('end', onlegacyfinish);\n\t\tstream.removeListener('close', onlegacyfinish);\n\t\tstream.removeListener('finish', onfinish);\n\t\tstream.removeListener('exit', onexit);\n\t\tstream.removeListener('end', onend);\n\t\tstream.removeListener('error', onerror);\n\t\tstream.removeListener('close', onclose);\n\t};\n};\n\nmodule.exports = eos;\n","module.exports = shift\n\nfunction shift (stream) {\n var rs = stream._readableState\n if (!rs) return null\n return (rs.objectMode || typeof stream._duplexState === 'number') ? stream.read() : stream.read(getStateLength(rs))\n}\n\nfunction getStateLength (state) {\n if (state.buffer.length) {\n var idx = state.bufferIndex || 0\n // Since node 6.3.0 state.buffer is a BufferList not an array\n if (state.buffer.head) {\n return state.buffer.head.data.length\n } else if (state.buffer.length - idx > 0 && state.buffer[idx]) {\n return state.buffer[idx].length\n }\n }\n\n return state.length\n}\n","var stream = require('readable-stream')\nvar eos = require('end-of-stream')\nvar inherits = require('inherits')\nvar shift = require('stream-shift')\n\nvar SIGNAL_FLUSH = (Buffer.from && Buffer.from !== Uint8Array.from)\n ? Buffer.from([0])\n : new Buffer([0])\n\nvar onuncork = function(self, fn) {\n if (self._corked) self.once('uncork', fn)\n else fn()\n}\n\nvar autoDestroy = function (self, err) {\n if (self._autoDestroy) self.destroy(err)\n}\n\nvar destroyer = function(self, end) {\n return function(err) {\n if (err) autoDestroy(self, err.message === 'premature close' ? null : err)\n else if (end && !self._ended) self.end()\n }\n}\n\nvar end = function(ws, fn) {\n if (!ws) return fn()\n if (ws._writableState && ws._writableState.finished) return fn()\n if (ws._writableState) return ws.end(fn)\n ws.end()\n fn()\n}\n\nvar noop = function() {}\n\nvar toStreams2 = function(rs) {\n return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs)\n}\n\nvar Duplexify = function(writable, readable, opts) {\n if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts)\n stream.Duplex.call(this, opts)\n\n this._writable = null\n this._readable = null\n this._readable2 = null\n\n this._autoDestroy = !opts || opts.autoDestroy !== false\n this._forwardDestroy = !opts || opts.destroy !== false\n this._forwardEnd = !opts || opts.end !== false\n this._corked = 1 // start corked\n this._ondrain = null\n this._drained = false\n this._forwarding = false\n this._unwrite = null\n this._unread = null\n this._ended = false\n\n this.destroyed = false\n\n if (writable) this.setWritable(writable)\n if (readable) this.setReadable(readable)\n}\n\ninherits(Duplexify, stream.Duplex)\n\nDuplexify.obj = function(writable, readable, opts) {\n if (!opts) opts = {}\n opts.objectMode = true\n opts.highWaterMark = 16\n return new Duplexify(writable, readable, opts)\n}\n\nDuplexify.prototype.cork = function() {\n if (++this._corked === 1) this.emit('cork')\n}\n\nDuplexify.prototype.uncork = function() {\n if (this._corked && --this._corked === 0) this.emit('uncork')\n}\n\nDuplexify.prototype.setWritable = function(writable) {\n if (this._unwrite) this._unwrite()\n\n if (this.destroyed) {\n if (writable && writable.destroy) writable.destroy()\n return\n }\n\n if (writable === null || writable === false) {\n this.end()\n return\n }\n\n var self = this\n var unend = eos(writable, {writable:true, readable:false}, destroyer(this, this._forwardEnd))\n\n var ondrain = function() {\n var ondrain = self._ondrain\n self._ondrain = null\n if (ondrain) ondrain()\n }\n\n var clear = function() {\n self._writable.removeListener('drain', ondrain)\n unend()\n }\n\n if (this._unwrite) process.nextTick(ondrain) // force a drain on stream reset to avoid livelocks\n\n this._writable = writable\n this._writable.on('drain', ondrain)\n this._unwrite = clear\n\n this.uncork() // always uncork setWritable\n}\n\nDuplexify.prototype.setReadable = function(readable) {\n if (this._unread) this._unread()\n\n if (this.destroyed) {\n if (readable && readable.destroy) readable.destroy()\n return\n }\n\n if (readable === null || readable === false) {\n this.push(null)\n this.resume()\n return\n }\n\n var self = this\n var unend = eos(readable, {writable:false, readable:true}, destroyer(this))\n\n var onreadable = function() {\n self._forward()\n }\n\n var onend = function() {\n self.push(null)\n }\n\n var clear = function() {\n self._readable2.removeListener('readable', onreadable)\n self._readable2.removeListener('end', onend)\n unend()\n }\n\n this._drained = true\n this._readable = readable\n this._readable2 = readable._readableState ? readable : toStreams2(readable)\n this._readable2.on('readable', onreadable)\n this._readable2.on('end', onend)\n this._unread = clear\n\n this._forward()\n}\n\nDuplexify.prototype._read = function() {\n this._drained = true\n this._forward()\n}\n\nDuplexify.prototype._forward = function() {\n if (this._forwarding || !this._readable2 || !this._drained) return\n this._forwarding = true\n\n var data\n\n while (this._drained && (data = shift(this._readable2)) !== null) {\n if (this.destroyed) continue\n this._drained = this.push(data)\n }\n\n this._forwarding = false\n}\n\nDuplexify.prototype.destroy = function(err, cb) {\n if (!cb) cb = noop\n if (this.destroyed) return cb(null)\n this.destroyed = true\n\n var self = this\n process.nextTick(function() {\n self._destroy(err)\n cb(null)\n })\n}\n\nDuplexify.prototype._destroy = function(err) {\n if (err) {\n var ondrain = this._ondrain\n this._ondrain = null\n if (ondrain) ondrain(err)\n else this.emit('error', err)\n }\n\n if (this._forwardDestroy) {\n if (this._readable && this._readable.destroy) this._readable.destroy()\n if (this._writable && this._writable.destroy) this._writable.destroy()\n }\n\n this.emit('close')\n}\n\nDuplexify.prototype._write = function(data, enc, cb) {\n if (this.destroyed) return\n if (this._corked) return onuncork(this, this._write.bind(this, data, enc, cb))\n if (data === SIGNAL_FLUSH) return this._finish(cb)\n if (!this._writable) return cb()\n\n if (this._writable.write(data) === false) this._ondrain = cb\n else if (!this.destroyed) cb()\n}\n\nDuplexify.prototype._finish = function(cb) {\n var self = this\n this.emit('preend')\n onuncork(this, function() {\n end(self._forwardEnd && self._writable, function() {\n // haxx to not emit prefinish twice\n if (self._writableState.prefinished === false) self._writableState.prefinished = true\n self.emit('prefinish')\n onuncork(self, cb)\n })\n })\n}\n\nDuplexify.prototype.end = function(data, enc, cb) {\n if (typeof data === 'function') return this.end(null, null, data)\n if (typeof enc === 'function') return this.end(data, null, enc)\n this._ended = true\n if (data) this.write(data)\n if (!this._writableState.ending && !this._writableState.destroyed) this.write(SIGNAL_FLUSH)\n return stream.Writable.prototype.end.call(this, cb)\n}\n\nmodule.exports = Duplexify\n","'use strict';\n\nconst {PassThrough} = require('stream');\nconst extend = require('extend');\n\nlet debug = () => {};\nif (\n typeof process !== 'undefined' &&\n 'env' in process &&\n typeof process.env === 'object' &&\n process.env.DEBUG === 'retry-request'\n) {\n debug = message => {\n console.log('retry-request:', message);\n };\n}\n\nconst DEFAULTS = {\n objectMode: false,\n retries: 2,\n\n /*\n The maximum time to delay in seconds. If retryDelayMultiplier results in a\n delay greater than maxRetryDelay, retries should delay by maxRetryDelay\n seconds instead.\n */\n maxRetryDelay: 64,\n\n /*\n The multiplier by which to increase the delay time between the completion of\n failed requests, and the initiation of the subsequent retrying request.\n */\n retryDelayMultiplier: 2,\n\n /*\n The length of time to keep retrying in seconds. The last sleep period will\n be shortened as necessary, so that the last retry runs at deadline (and not\n considerably beyond it). The total time starting from when the initial\n request is sent, after which an error will be returned, regardless of the\n retrying attempts made meanwhile.\n */\n totalTimeout: 600,\n\n noResponseRetries: 2,\n currentRetryAttempt: 0,\n shouldRetryFn: function (response) {\n const retryRanges = [\n // https://en.wikipedia.org/wiki/List_of_HTTP_status_codes\n // 1xx - Retry (Informational, request still processing)\n // 2xx - Do not retry (Success)\n // 3xx - Do not retry (Redirect)\n // 4xx - Do not retry (Client errors)\n // 429 - Retry (\"Too Many Requests\")\n // 5xx - Retry (Server errors)\n [100, 199],\n [429, 429],\n [500, 599],\n ];\n\n const statusCode = response.statusCode;\n debug(`Response status: ${statusCode}`);\n\n let range;\n while ((range = retryRanges.shift())) {\n if (statusCode >= range[0] && statusCode <= range[1]) {\n // Not a successful status or redirect.\n return true;\n }\n }\n },\n};\n\nfunction retryRequest(requestOpts, opts, callback) {\n if (typeof requestOpts === 'string') {\n requestOpts = {url: requestOpts};\n }\n\n const streamMode = typeof arguments[arguments.length - 1] !== 'function';\n\n if (typeof opts === 'function') {\n callback = opts;\n }\n\n const manualCurrentRetryAttemptWasSet =\n opts && typeof opts.currentRetryAttempt === 'number';\n opts = extend({}, DEFAULTS, opts);\n\n if (typeof opts.request === 'undefined') {\n throw new Error('A request library must be provided to retry-request.');\n }\n\n let currentRetryAttempt = opts.currentRetryAttempt;\n\n let numNoResponseAttempts = 0;\n let streamResponseHandled = false;\n\n let retryStream;\n let requestStream;\n let delayStream;\n\n let activeRequest;\n const retryRequest = {\n abort: function () {\n if (activeRequest && activeRequest.abort) {\n activeRequest.abort();\n }\n },\n };\n\n if (streamMode) {\n retryStream = new PassThrough({objectMode: opts.objectMode});\n retryStream.abort = resetStreams;\n }\n\n const timeOfFirstRequest = Date.now();\n if (currentRetryAttempt > 0) {\n retryAfterDelay(currentRetryAttempt);\n } else {\n makeRequest();\n }\n\n if (streamMode) {\n return retryStream;\n } else {\n return retryRequest;\n }\n\n function resetStreams() {\n delayStream = null;\n\n if (requestStream) {\n requestStream.abort && requestStream.abort();\n requestStream.cancel && requestStream.cancel();\n\n if (requestStream.destroy) {\n requestStream.destroy();\n } else if (requestStream.end) {\n requestStream.end();\n }\n }\n }\n\n function makeRequest() {\n let finishHandled = false;\n currentRetryAttempt++;\n debug(`Current retry attempt: ${currentRetryAttempt}`);\n\n function handleFinish(args = []) {\n if (!finishHandled) {\n finishHandled = true;\n retryStream.emit('complete', ...args);\n }\n }\n\n if (streamMode) {\n streamResponseHandled = false;\n\n delayStream = new PassThrough({objectMode: opts.objectMode});\n requestStream = opts.request(requestOpts);\n\n setImmediate(() => {\n retryStream.emit('request');\n });\n\n requestStream\n // gRPC via google-cloud-node can emit an `error` as well as a `response`\n // Whichever it emits, we run with-- we can't run with both. That's what\n // is up with the `streamResponseHandled` tracking.\n .on('error', err => {\n if (streamResponseHandled) {\n return;\n }\n\n streamResponseHandled = true;\n onResponse(err);\n })\n .on('response', (resp, body) => {\n if (streamResponseHandled) {\n return;\n }\n\n streamResponseHandled = true;\n onResponse(null, resp, body);\n })\n .on('complete', (...params) => handleFinish(params))\n .on('finish', (...params) => handleFinish(params));\n\n requestStream.pipe(delayStream);\n } else {\n activeRequest = opts.request(requestOpts, onResponse);\n }\n }\n\n function retryAfterDelay(currentRetryAttempt) {\n if (streamMode) {\n resetStreams();\n }\n\n const nextRetryDelay = getNextRetryDelay({\n maxRetryDelay: opts.maxRetryDelay,\n retryDelayMultiplier: opts.retryDelayMultiplier,\n retryNumber: currentRetryAttempt,\n timeOfFirstRequest,\n totalTimeout: opts.totalTimeout,\n });\n debug(`Next retry delay: ${nextRetryDelay}`);\n\n if (nextRetryDelay <= 0) {\n numNoResponseAttempts = opts.noResponseRetries + 1;\n return;\n }\n\n setTimeout(makeRequest, nextRetryDelay);\n }\n\n function onResponse(err, response, body) {\n // An error such as DNS resolution.\n if (err) {\n numNoResponseAttempts++;\n\n if (numNoResponseAttempts <= opts.noResponseRetries) {\n retryAfterDelay(numNoResponseAttempts);\n } else {\n if (streamMode) {\n retryStream.emit('error', err);\n retryStream.end();\n } else {\n callback(err, response, body);\n }\n }\n\n return;\n }\n\n // Send the response to see if we should try again.\n // NOTE: \"currentRetryAttempt\" isn't accurate by default, as it counts\n // the very first request sent as the first \"retry\". It is only accurate\n // when a user provides their own \"currentRetryAttempt\" option at\n // instantiation.\n const adjustedCurrentRetryAttempt = manualCurrentRetryAttemptWasSet\n ? currentRetryAttempt\n : currentRetryAttempt - 1;\n if (\n adjustedCurrentRetryAttempt < opts.retries &&\n opts.shouldRetryFn(response)\n ) {\n retryAfterDelay(currentRetryAttempt);\n return;\n }\n\n // No more attempts need to be made, just continue on.\n if (streamMode) {\n retryStream.emit('response', response);\n delayStream.pipe(retryStream);\n requestStream.on('error', err => {\n retryStream.destroy(err);\n });\n } else {\n callback(err, response, body);\n }\n }\n}\n\nmodule.exports = retryRequest;\n\nfunction getNextRetryDelay(config) {\n const {\n maxRetryDelay,\n retryDelayMultiplier,\n retryNumber,\n timeOfFirstRequest,\n totalTimeout,\n } = config;\n\n const maxRetryDelayMs = maxRetryDelay * 1000;\n const totalTimeoutMs = totalTimeout * 1000;\n\n const jitter = Math.floor(Math.random() * 1000);\n const calculatedNextRetryDelay =\n Math.pow(retryDelayMultiplier, retryNumber) * 1000 + jitter;\n\n const maxAllowableDelayMs =\n totalTimeoutMs - (Date.now() - timeOfFirstRequest);\n\n return Math.min(\n calculatedNextRetryDelay,\n maxAllowableDelayMs,\n maxRetryDelayMs,\n );\n}\n\nmodule.exports.defaults = DEFAULTS;\nmodule.exports.getNextRetryDelay = getNextRetryDelay;\n","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StreamProxy = exports.StreamType = void 0;\nconst gax_1 = require(\"../gax\");\nconst googleError_1 = require(\"../googleError\");\nconst status_1 = require(\"../status\");\nconst stream_1 = require(\"stream\");\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst duplexify = require('duplexify');\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst retryRequest = require('retry-request');\n/**\n * The type of gRPC streaming.\n * @enum {number}\n */\nvar StreamType;\n(function (StreamType) {\n /** Client sends a single request, server streams responses. */\n StreamType[StreamType[\"SERVER_STREAMING\"] = 1] = \"SERVER_STREAMING\";\n /** Client streams requests, server returns a single response. */\n StreamType[StreamType[\"CLIENT_STREAMING\"] = 2] = \"CLIENT_STREAMING\";\n /** Both client and server stream objects. */\n StreamType[StreamType[\"BIDI_STREAMING\"] = 3] = \"BIDI_STREAMING\";\n})(StreamType || (exports.StreamType = StreamType = {}));\n// In retry-request, you could pass parameters to request using the requestOpts parameter\n// when we called retry-request from gax, we always passed null\n// passing null here removes an unnecessary parameter from this implementation\nconst requestOps = null;\nclass StreamProxy extends duplexify {\n type;\n _callback;\n _isCancelCalled;\n stream;\n _responseHasSent;\n rest;\n gaxServerStreamingRetries;\n apiCall;\n argument;\n /**\n * StreamProxy is a proxy to gRPC-streaming method.\n *\n * @private\n * @constructor\n * @param {StreamType} type - the type of gRPC stream.\n * @param {ApiCallback} callback - the callback for further API call.\n */\n constructor(type, callback, rest, gaxServerStreamingRetries) {\n super(undefined, undefined, {\n objectMode: true,\n readable: type !== StreamType.CLIENT_STREAMING,\n writable: type !== StreamType.SERVER_STREAMING,\n });\n this.type = type;\n this._callback = callback;\n this._isCancelCalled = false;\n this._responseHasSent = false;\n this.rest = rest;\n this.gaxServerStreamingRetries = gaxServerStreamingRetries;\n }\n shouldRetryRequest(error, retry) {\n const e = googleError_1.GoogleError.parseGRPCStatusDetails(error);\n let shouldRetry = this.defaultShouldRetry(e, retry);\n if (retry.shouldRetryFn) {\n shouldRetry = retry.shouldRetryFn(e);\n }\n return shouldRetry;\n }\n cancel() {\n if (this.stream) {\n this.stream.cancel();\n }\n else {\n this._isCancelCalled = true;\n }\n }\n /**\n * Helper function to handle total timeout + max retry check for server streaming retries\n * @param {number} deadline - the current retry deadline\n * @param {number} maxRetries - maximum total number of retries\n * @param {number} totalTimeoutMillis - total timeout in milliseconds used in timeout calculation\n * @param {GoogleError} originalError - underlying error received by the stream\n * @param {originalTimeout} originalTimeout - the original Timeout set in backoff settings\n * @param {retries} retries - the number of retries the call has made so far\n */\n throwIfMaxRetriesOrTotalTimeoutExceeded(deadline, maxRetries, totalTimeoutMillis, originalError, originalTimeout, retries) {\n const now = new Date();\n const nowTime = now.getTime();\n if (originalTimeout &&\n (totalTimeoutMillis === 0 ||\n totalTimeoutMillis < 0 ||\n (deadline && nowTime >= deadline))) {\n const error = new googleError_1.GoogleError(`Total timeout of API exceeded ${originalTimeout} milliseconds ${originalError ? `retrying error ${originalError} ` : ''} before any response was received.`);\n error.code = status_1.Status.DEADLINE_EXCEEDED;\n throw error;\n }\n if (maxRetries === 0) {\n const error = originalError;\n error.note = 'Max retries is set to zero.';\n throw error;\n }\n if (retries && retries >= maxRetries) {\n const error = new googleError_1.GoogleError('Exceeded maximum number of retries ' +\n (originalError ? `retrying error ${originalError} ` : '') +\n 'before any response was received');\n error.code = status_1.Status.DEADLINE_EXCEEDED;\n throw error;\n }\n }\n /**\n * Forwards events from an API request stream to the user's stream.\n * @param {Stream} stream - The API request stream.\n */\n eventForwardHelper(stream) {\n const eventsToForward = ['metadata', 'response', 'status'];\n eventsToForward.forEach(event => {\n stream.on(event, this.emit.bind(this, event));\n });\n }\n /**\n * Helper function that emits a response on the stream after either a 'metadata'\n * or a 'status' event - this helps streams to behave more like http consumers expect\n * @param {Stream} stream - The API request stream.\n */\n statusMetadataHelper(stream) {\n // gRPC is guaranteed emit the 'status' event but not 'metadata', and 'status' is the last event to emit.\n // Emit the 'response' event if stream has no 'metadata' event.\n // This avoids the stream swallowing the other events, such as 'end'.\n stream.on('status', () => {\n if (!this._responseHasSent) {\n stream.emit('response', {\n code: 200,\n details: '',\n message: 'OK',\n });\n }\n });\n // We also want to supply the status data as 'response' event to support\n // the behavior of google-cloud-node expects.\n // see:\n // https://github.com/GoogleCloudPlatform/google-cloud-node/pull/1775#issuecomment-259141029\n // https://github.com/GoogleCloudPlatform/google-cloud-node/blob/116436fa789d8b0f7fc5100b19b424e3ec63e6bf/packages/common/src/grpc-service.js#L355\n stream.on('metadata', metadata => {\n // Create a response object with succeeds.\n // TODO: unify this logic with the decoration of gRPC response when it's\n // added. see: https://github.com/googleapis/gax-nodejs/issues/65\n stream.emit('response', {\n code: 200,\n details: '',\n message: 'OK',\n metadata,\n });\n this._responseHasSent = true;\n });\n }\n /**\n * Forward events from an API request stream to the user's stream.\n * gRPC is guaranteed emit the 'status' event but not 'metadata'\n * 'status' is the last event to emit; if 'metadata' emits, it will\n * be the first event to emit. It should only emit once; if it emits\n * more than once, unexpected side effects will occur.\n *\n * @param {Stream} stream - The API request stream.\n * @param {RetryOptions} retry - Configures the exceptions upon which the\n * function should retry, and the parameters to the exponential backoff retry\n * algorithm.\n */\n forwardEvents(stream) {\n this.eventForwardHelper(stream);\n this.statusMetadataHelper(stream);\n stream.on('error', error => {\n googleError_1.GoogleError.parseGRPCStatusDetails(error);\n });\n }\n /**\n * Default mechanism for determining whether a streaming call should retry\n * If a user passes in a \"shouldRetryFn\", this will not be used\n * @param {GoogleError} errpr - The error we need to determine is retryable or not\n * @param {RetryOptions} retry - Configures the exceptions upon which the\n * function should retry, and the parameters to the exponential backoff retry\n * algorithm.\n */\n defaultShouldRetry(error, retry) {\n if ((retry.retryCodes.length > 0 &&\n retry.retryCodes.indexOf(error.code) < 0) ||\n retry.retryCodes.length === 0) {\n return false;\n }\n return true;\n }\n /**\n * Specifies the target stream.\n * @param {ApiCall} apiCall - the API function to be called.\n * @param {Object} argument - the argument to be passed to the apiCall.\n * @param {RetryOptions} retry - Configures the exceptions upon which the\n * function should retry, and the parameters to the exponential backoff retry\n * algorithm.\n */\n setStream(apiCall, argument, retryRequestOptions = {}, retry) {\n this.apiCall = apiCall;\n this.argument = argument;\n if (this.type === StreamType.SERVER_STREAMING) {\n if (this.rest) {\n const stream = apiCall(argument, this._callback);\n this.stream = stream;\n this.setReadable(stream);\n }\n else if (this.gaxServerStreamingRetries) {\n const request = () => {\n if (this._isCancelCalled) {\n if (this.stream) {\n this.stream.cancel();\n }\n return;\n }\n const stream = apiCall(argument, this._callback);\n return stream;\n };\n const retryStream = this.newStreamingRetryRequest({ request, retry });\n this.stream = retryStream;\n this.eventForwardHelper(retryStream);\n this.setReadable(retryStream);\n }\n else {\n const retryStream = retryRequest(null, {\n objectMode: true,\n request: () => {\n if (this._isCancelCalled) {\n if (this.stream) {\n this.stream.cancel();\n }\n return;\n }\n const stream = apiCall(argument, this._callback);\n this.stream = stream;\n this.forwardEvents(stream);\n return stream;\n },\n retries: retryRequestOptions.retries,\n currentRetryAttempt: retryRequestOptions.currentRetryAttempt,\n noResponseRetries: retryRequestOptions.noResponseRetries,\n shouldRetryFn: retryRequestOptions.shouldRetryFn,\n });\n this.setReadable(retryStream);\n }\n return;\n }\n const stream = apiCall(argument, this._callback);\n this.stream = stream;\n this.forwardEvents(stream);\n if (this.type === StreamType.CLIENT_STREAMING) {\n this.setWritable(stream);\n }\n if (this.type === StreamType.BIDI_STREAMING) {\n this.setReadable(stream);\n this.setWritable(stream);\n }\n if (this._isCancelCalled && this.stream) {\n this.stream.cancel();\n }\n }\n /**\n * Creates a new retry request stream -\n *inner arrow function \"newMakeRequest\" handles retrying and resumption\n * @param {streamingRetryRequestOptions} opts\n * {request} - the request to be made if the stream errors\n * {retry} - the retry options associated with the call\n * @returns {CancellableStream} - the stream that handles retry logic\n */\n newStreamingRetryRequest(opts) {\n // at this point, it would be unexpected if retry were undefined\n // but if it is, provide a logical default so we don't run into trouble\n const retry = opts.retry ?? {\n retryCodes: [],\n backoffSettings: (0, gax_1.createDefaultBackoffSettings)(),\n };\n let retries = 0;\n const retryStream = new stream_1.PassThrough({\n objectMode: true,\n });\n const totalTimeout = retry.backoffSettings.totalTimeoutMillis ?? undefined;\n const maxRetries = retry.backoffSettings.maxRetries ?? undefined;\n let timeout = retry.backoffSettings.initialRpcTimeoutMillis ?? undefined;\n let now = new Date();\n let deadline = 0;\n if (totalTimeout) {\n deadline = now.getTime() + totalTimeout;\n }\n const transientErrorHelper = (error, requestStream) => {\n const e = googleError_1.GoogleError.parseGRPCStatusDetails(error);\n e.note =\n 'Exception occurred in retry method that was ' +\n 'not classified as transient';\n // clean up the request stream and retryStreams, silently destroy it on the request stream\n // but do raise it on destructin of the retryStream so the consumer can see it\n requestStream.destroy();\n retryStream.destroy(e);\n return retryStream;\n };\n const newMakeRequest = (newopts) => {\n let dataEnd = false;\n let statusReceived = false;\n let enteredError = false;\n // make the request\n const requestStream = newopts.request(requestOps);\n retryStream.cancel = requestStream.cancel; // make sure the retryStream is also cancellable by the user\n const eventsToForward = ['metadata', 'response', 'status'];\n eventsToForward.forEach(event => {\n requestStream.on(event, retryStream.emit.bind(retryStream, event));\n });\n this.statusMetadataHelper(requestStream);\n // TODO - b/353262542 address buffer stuff\n requestStream.on('data', (data) => {\n retries = 0;\n this.emit.bind(this, 'data')(data);\n });\n /* in retry-request, which previously handled retries,\n * \"end\" could be emitted on a request stream before other gRPC events.\n * To ensure it doesn't reach the consumer stream prematurely, retry-request piped\n * two streams together (delayStream and retryStream)\n * to ensure that \"end\" only emitted after a \"response\" event\n *\n * We are consciously NOT using pipeline or .pipe as part of similar logic here\n * because we want more control over what happens during event handoff and we want to\n * avoid the undesired behavior that can happen with error events\n * if consumers in client libraries are also using pipes\n *\n * Since \"status\" is guaranteed to be the last event emitted by gRPC.\n * If we have seen an \"end\" event, the dataEnd boolean will be true and we can safely\n * end the stream.\n *\n * The \"statusReceived\" boolean covers the opposite case - that we receive the \"status\" event before\n * a successful stream end event - this signals the .on('end') event handler that it's okay to end the stream\n *\n *\n */\n requestStream.on('status', () => {\n statusReceived = true;\n if (dataEnd) {\n retryStream.end();\n }\n return retryStream;\n });\n requestStream.on('end', () => {\n if (!enteredError) {\n dataEnd = true;\n // in this case, we've already received \"status\"\n // which is the last event from gRPC, so it's cool to end the stream\n if (statusReceived) {\n retryStream.end();\n }\n }\n return retryStream;\n // there is no else case because if enteredError\n // is true, we will handle stream destruction as part of\n // either retrying (where we don't want to end the stream)\n // or as part of error handling, which will take care of stream destruction\n });\n requestStream.on('error', (error) => {\n enteredError = true;\n // type check for undefined instead of for truthiness in case maxRetries or timeout is equal to zero\n if (typeof maxRetries !== undefined ||\n typeof totalTimeout !== undefined) {\n if (this.shouldRetryRequest(error, retry)) {\n if (maxRetries && totalTimeout) {\n const newError = new googleError_1.GoogleError('Cannot set both totalTimeoutMillis and maxRetries ' +\n 'in backoffSettings.');\n newError.code = status_1.Status.INVALID_ARGUMENT;\n // clean up the request stream and retryStreams, silently destroy it on the request stream\n // but do raise it on destructin of the retryStream so the consumer can see it\n requestStream.destroy();\n retryStream.destroy(newError);\n return retryStream;\n }\n else {\n // check for exceeding timeout or max retries\n try {\n this.throwIfMaxRetriesOrTotalTimeoutExceeded(deadline, maxRetries, timeout, error, totalTimeout, retries);\n }\n catch (error) {\n const e = googleError_1.GoogleError.parseGRPCStatusDetails(error);\n // clean up the request stream and retryStreams, silently destroy it on the request stream\n // but do raise it on destruction of the retryStream so the consumer can see it\n requestStream.destroy();\n retryStream.destroy(e);\n return retryStream;\n }\n const delayMult = retry.backoffSettings.retryDelayMultiplier;\n const maxDelay = retry.backoffSettings.maxRetryDelayMillis;\n const timeoutMult = retry.backoffSettings.rpcTimeoutMultiplier;\n const maxTimeout = retry.backoffSettings.maxRpcTimeoutMillis;\n let delay = retry.backoffSettings.initialRetryDelayMillis;\n // calculate new deadlines\n const toSleep = Math.random() * delay;\n const calculateTimeoutAndResumptionFunction = () => {\n setTimeout(() => {\n // only do timeout calculations if not using maxRetries\n if (timeout) {\n now = new Date();\n delay = Math.min(delay * delayMult, maxDelay);\n const timeoutCal = timeout && timeoutMult ? timeout * timeoutMult : 0;\n const rpcTimeout = maxTimeout ? maxTimeout : 0;\n const newDeadline = deadline ? deadline - now.getTime() : 0;\n timeout = Math.min(timeoutCal, rpcTimeout, newDeadline);\n }\n retries++;\n let retryArgument = this.argument;\n // if resumption logic is passed, use it to determined the\n // new argument for the new request made to the server\n // otherwise, the original argument will be passed\n if (retry.getResumptionRequestFn !== undefined) {\n retryArgument = retry.getResumptionRequestFn(retryArgument);\n }\n const newRequest = () => {\n if (this._isCancelCalled) {\n if (this.stream) {\n this.stream.cancel();\n }\n return;\n }\n const newStream = this.apiCall(retryArgument, this._callback);\n return newStream;\n };\n opts.request = newRequest;\n // make a request with the updated parameters\n // based on the resumption strategy\n return newMakeRequest(opts);\n }, toSleep);\n };\n return calculateTimeoutAndResumptionFunction();\n }\n }\n else {\n // non retryable error\n return transientErrorHelper(error, requestStream);\n }\n }\n else {\n // neither timeout nor maxRetries are defined, surface the error to the caller\n return transientErrorHelper(error, requestStream);\n }\n });\n // return the stream if we didn't return it as\n // part of an error state\n return retryStream;\n };\n // this is the first make request call with the options the user passed in\n return newMakeRequest(opts);\n }\n}\nexports.StreamProxy = StreamProxy;\n//# sourceMappingURL=streaming.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PathTemplate = void 0;\nclass PathTemplate {\n data;\n bindings = {};\n segments;\n size;\n /**\n * @param {String} data the of the template\n *\n * @constructor\n */\n constructor(data) {\n this.data = data;\n this.segments = this.parsePathTemplate(data);\n this.size = this.segments.length;\n }\n /**\n * Matches a fully-qualified path template string.\n *\n * @param {String} path a fully-qualified path template string\n * @return {Object} contains const names matched to binding values\n * @throws {TypeError} if path can't be matched to this template\n */\n match(path) {\n let pathSegments = path.split('/');\n const bindings = {};\n if (pathSegments.length !== this.segments.length) {\n // if the path contains a wildcard, then the length may differ by 1.\n if (!this.data.includes('**')) {\n throw new TypeError(`This path ${path} does not match path template ${this.data}, the number of parameters is not same.`);\n }\n else if (pathSegments.length !== this.segments.length + 1) {\n throw new TypeError(`This path ${path} does not match path template ${this.data}, the number of parameters is not same with one wildcard.`);\n }\n }\n for (let index = 0; index < this.segments.length && pathSegments.length > 0; index++) {\n if (this.segments[index] !== pathSegments[0]) {\n if (!this.segments[index].includes('*')) {\n throw new TypeError(`segment does not match, ${this.segments[index]} and ${pathSegments[index]}.`);\n }\n else {\n let segment = this.segments[index];\n const matches = segment.match(/\\{[$0-9a-zA-Z_]+=.*?\\}/g);\n if (!matches) {\n throw new Error(`Error processing path template segment ${segment}`);\n }\n const variables = matches.map(str => str.replace(/^\\{/, '').replace(/=.*/, ''));\n if (segment.includes('**')) {\n bindings[variables[0]] = pathSegments[0] + '/' + pathSegments[1];\n pathSegments = pathSegments.slice(2);\n }\n else {\n // atomic resource\n if (variables.length === 1) {\n bindings[variables[0]] = pathSegments[0];\n }\n else {\n // non-slash resource\n // segment: {blurb_id=*}.{legacy_user=*} to match pathSegments: ['bar.user2']\n // split the match pathSegments[0] -> value: ['bar', 'user2']\n // compare the length of two arrays, and compare array items\n const value = pathSegments[0].split(/[-_.~]/);\n if (value.length !== variables.length) {\n throw new Error(`segment ${segment} does not match ${pathSegments[0]}`);\n }\n for (const v of variables) {\n bindings[v] = value[0];\n segment = segment.replace(`{${v}=*}`, `${value[0]}`);\n value.shift();\n }\n // segment: {blurb_id=*}.{legacy_user=*} matching pathSegments: ['bar~user2'] should fail\n if (segment !== pathSegments[0]) {\n throw new TypeError(`non slash resource pattern ${this.segments[index]} and ${pathSegments[0]} should have same separator`);\n }\n }\n pathSegments.shift();\n }\n }\n }\n else {\n pathSegments.shift();\n }\n }\n return bindings;\n }\n /**\n * Renders a path template using the provided bindings.\n *\n * @param {Object} bindings a mapping of const names to binding strings\n * @return {String} a rendered representation of the path template\n * @throws {TypeError} if a key is missing, or if a sub-template cannot be\n * parsed\n */\n render(bindings) {\n if (Object.keys(bindings).length !== Object.keys(this.bindings).length) {\n throw new TypeError(`The number of variables ${Object.keys(bindings).length} does not match the number of needed variables ${Object.keys(this.bindings).length}`);\n }\n let path = this.inspect();\n for (const key of Object.keys(bindings)) {\n const b = bindings[key].toString();\n if (!this.bindings[key]) {\n throw new TypeError(`render fails for not matching ${bindings[key]}`);\n }\n const variable = this.bindings[key];\n if (variable === '*') {\n if (!b.match(/[^/{}]+/)) {\n throw new TypeError(`render fails for not matching ${b}`);\n }\n path = path.replace(`{${key}=*}`, `${b}`);\n }\n else if (variable === '**') {\n if (!b.match(/[^{}]+/)) {\n throw new TypeError(`render fails for not matching ${b}`);\n }\n path = path.replace(`{${key}=**}`, `${b}`);\n }\n }\n return path;\n }\n /**\n * Renders the path template.\n *\n * @return {string} contains const names matched to binding values\n */\n inspect() {\n return this.segments.join('/');\n }\n /**\n * Parse the path template.\n *\n * @return {string[]} return segments of the input path.\n * For example: 'buckets/{hello}'' will give back ['buckets', {hello=*}]\n */\n parsePathTemplate(data) {\n const pathSegments = splitPathTemplate(data);\n let index = 0;\n let wildCardCount = 0;\n const segments = [];\n let matches;\n pathSegments.forEach(segment => {\n // * or ** -> segments.push('{$0=*}');\n // -> bindings['$0'] = '*'\n if (segment === '*' || segment === '**') {\n this.bindings[`$${index}`] = segment;\n segments.push(`{$${index}=${segment}}`);\n index = index + 1;\n if (segment === '**') {\n ++wildCardCount;\n }\n }\n else if ((matches = segment.match(/\\{[0-9a-zA-Z-.~_]+(?:=.*?)?\\}/g))) {\n for (const subsegment of matches) {\n const pairMatch = subsegment.match(/^\\{([0-9a-zA-Z-.~_]+)(?:=(.*?))?\\}$/);\n if (!pairMatch) {\n throw new Error(`Cannot process path template segment ${subsegment}`);\n }\n const key = pairMatch[1];\n let value = pairMatch[2];\n if (!value) {\n value = '*';\n segment = segment.replace(key, key + '=*');\n this.bindings[key] = value;\n }\n else if (value === '*') {\n this.bindings[key] = value;\n }\n else if (value === '**') {\n ++wildCardCount;\n this.bindings[key] = value;\n }\n }\n segments.push(segment);\n }\n else if (segment.match(/[0-9a-zA-Z-.~_]+/)) {\n segments.push(segment);\n }\n });\n if (wildCardCount > 1) {\n throw new TypeError('Can not have more than one wildcard.');\n }\n return segments;\n }\n}\nexports.PathTemplate = PathTemplate;\n/**\n * Split the path template by `/`.\n * It can not be simply splitted by `/` because there might be `/` in the segments.\n * For example: 'a/b/{a=hello/world}' we do not want to break the brackets pair\n * so above path will be splitted as ['a', 'b', '{a=hello/world}']\n */\nfunction splitPathTemplate(data) {\n let left = 0;\n let right = 0;\n let bracketCount = 0;\n const segments = [];\n while (right >= left && right < data.length) {\n if (data.charAt(right) === '{') {\n bracketCount = bracketCount + 1;\n }\n else if (data.charAt(right) === '}') {\n bracketCount = bracketCount - 1;\n }\n else if (data.charAt(right) === '/') {\n if (right === data.length - 1) {\n throw new TypeError('Invalid path, it can not be ended by /');\n }\n if (bracketCount === 0) {\n // complete bracket, to avoid the case a/b/**/*/{a=hello/world}\n segments.push(data.substring(left, right));\n left = right + 1;\n }\n }\n if (right === data.length - 1) {\n if (bracketCount !== 0) {\n throw new TypeError('Brackets are invalid.');\n }\n segments.push(data.substring(left));\n }\n right = right + 1;\n }\n return segments;\n}\n//# sourceMappingURL=pathTemplate.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Operation = void 0;\nexports.operation = operation;\nconst events_1 = require(\"events\");\nconst status_1 = require(\"../status\");\nconst googleError_1 = require(\"../googleError\");\nconst operationProtos = __importStar(require(\"../../protos/operations\"));\nclass Operation extends events_1.EventEmitter {\n completeListeners;\n hasActiveListeners;\n latestResponse;\n longrunningDescriptor;\n result;\n metadata;\n backoffSettings;\n _callOptions;\n currentCallPromise_;\n name;\n done;\n error;\n response;\n /**\n * Wrapper for a google.longrunnung.Operation.\n *\n * @constructor\n *\n * @param {google.longrunning.Operation} grpcOp - The operation to be wrapped.\n * @param {LongRunningDescriptor} longrunningDescriptor - This defines the\n * operations service client and unpacking mechanisms for the operation.\n * @param {BackoffSettings} backoffSettings - The backoff settings used in\n * in polling the operation.\n * @param {CallOptions} callOptions - CallOptions used in making get operation\n * requests.\n */\n constructor(grpcOp, longrunningDescriptor, backoffSettings, callOptions) {\n super();\n this.completeListeners = 0;\n this.hasActiveListeners = false;\n this.latestResponse = grpcOp;\n this.name = this.latestResponse.name;\n this.done = this.latestResponse.done;\n this.error = this.latestResponse.error;\n this.longrunningDescriptor = longrunningDescriptor;\n this.result = null;\n this.metadata = null;\n this.backoffSettings = backoffSettings;\n this._unpackResponse(grpcOp);\n this._listenForEvents();\n this._callOptions = callOptions;\n }\n /**\n * Begin listening for events on the operation. This method keeps track of how\n * many \"complete\" listeners are registered and removed, making sure polling\n * is handled automatically.\n *\n * As long as there is one active \"complete\" listener, the connection is open.\n * When there are no more listeners, the polling stops.\n *\n * @private\n */\n _listenForEvents() {\n this.on('newListener', event => {\n if (event === 'complete') {\n this.completeListeners++;\n if (!this.hasActiveListeners) {\n this.hasActiveListeners = true;\n this.startPolling_();\n }\n }\n });\n this.on('removeListener', event => {\n if (event === 'complete' && --this.completeListeners === 0) {\n this.hasActiveListeners = false;\n }\n });\n }\n /**\n * Cancels current polling api call and cancels the operation.\n *\n * @return {Promise} the promise of the OperationsClient#cancelOperation api\n * request.\n */\n cancel() {\n if (this.currentCallPromise_) {\n this.currentCallPromise_.cancel();\n }\n const operationsClient = this.longrunningDescriptor.operationsClient;\n const cancelRequest = new operationProtos.google.longrunning.CancelOperationRequest();\n cancelRequest.name = this.latestResponse.name;\n return operationsClient.cancelOperation(cancelRequest);\n }\n getOperation(callback) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n const operationsClient = this.longrunningDescriptor.operationsClient;\n function promisifyResponse() {\n if (!callback) {\n return new Promise((resolve, reject) => {\n if (self.latestResponse.error) {\n const error = new googleError_1.GoogleError(self.latestResponse.error.message);\n error.code = self.latestResponse.error.code;\n reject(error);\n }\n else {\n resolve([self.result, self.metadata, self.latestResponse]);\n }\n });\n }\n return;\n }\n if (this.latestResponse.done) {\n this._unpackResponse(this.latestResponse, callback);\n return promisifyResponse();\n }\n const request = new operationProtos.google.longrunning.GetOperationRequest();\n request.name = this.latestResponse.name;\n this.currentCallPromise_ = operationsClient.getOperationInternal(request, this._callOptions);\n const noCallbackPromise = this.currentCallPromise_.then(responses => {\n self.latestResponse = responses[0];\n self._unpackResponse(responses[0], callback);\n return promisifyResponse();\n }, (err) => {\n if (callback) {\n callback(err);\n return;\n }\n return Promise.reject(err);\n });\n if (!callback) {\n return noCallbackPromise;\n }\n }\n _unpackResponse(op, callback) {\n const responseDecoder = this.longrunningDescriptor.responseDecoder;\n const metadataDecoder = this.longrunningDescriptor.metadataDecoder;\n let response;\n let metadata;\n if (op.done) {\n if (op.result === 'error') {\n const error = new googleError_1.GoogleError(op.error.message);\n error.code = op.error.code;\n this.error = error;\n if (callback) {\n callback(error);\n }\n return;\n }\n if (responseDecoder && op.response) {\n this.response = op.response;\n response = responseDecoder(op.response.value);\n this.result = response;\n this.done = true;\n }\n }\n if (metadataDecoder && op.metadata) {\n metadata = metadataDecoder(op.metadata.value);\n this.metadata = metadata;\n }\n if (callback) {\n callback(null, response, metadata, op);\n }\n }\n /**\n * Poll `getOperation` to check the operation's status. This runs a loop to\n * ping using the backoff strategy specified at initialization.\n *\n * Note: This method is automatically called once a \"complete\" event handler\n * is registered on the operation.\n *\n * @private\n */\n startPolling_() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n let now = new Date();\n const delayMult = this.backoffSettings.retryDelayMultiplier;\n const maxDelay = this.backoffSettings.maxRetryDelayMillis;\n let delay = this.backoffSettings.initialRetryDelayMillis;\n let deadline = Infinity;\n if (this.backoffSettings.totalTimeoutMillis) {\n deadline = now.getTime() + this.backoffSettings.totalTimeoutMillis;\n }\n let previousMetadataBytes;\n if (this.latestResponse.metadata) {\n previousMetadataBytes = this.latestResponse.metadata.value;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function emit(event, ...args) {\n self.emit(event, ...args);\n }\n // Helper function to replace nodejs buffer's equals()\n function arrayEquals(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n for (let i = 0; i < a.byteLength; ++i) {\n if (a[i] !== b[i])\n return false;\n }\n return true;\n }\n function retry() {\n if (!self.hasActiveListeners) {\n return;\n }\n if (now.getTime() >= deadline) {\n const error = new googleError_1.GoogleError('Total timeout exceeded before any response was received');\n error.code = status_1.Status.DEADLINE_EXCEEDED;\n setImmediate(emit, 'error', error);\n return;\n }\n self.getOperation((err, result, metadata, rawResponse) => {\n if (err) {\n setImmediate(emit, 'error', err);\n return;\n }\n if (!result) {\n if (rawResponse.metadata &&\n (!previousMetadataBytes ||\n (rawResponse &&\n !arrayEquals(rawResponse.metadata.value, previousMetadataBytes)))) {\n setImmediate(emit, 'progress', metadata, rawResponse);\n previousMetadataBytes = rawResponse.metadata.value;\n }\n // special case: some APIs fail to set either result or error\n // but set done = true (e.g. speech with silent file).\n // Some APIs just use this for the normal completion\n // (e.g. nodejs-contact-center-insights), so let's just return\n // an empty response in this case.\n if (rawResponse.done) {\n setImmediate(emit, 'complete', {}, metadata, rawResponse);\n return;\n }\n setTimeout(() => {\n now = new Date();\n delay = Math.min(delay * delayMult, maxDelay);\n retry();\n }, delay);\n return;\n }\n setImmediate(emit, 'complete', result, metadata, rawResponse);\n });\n }\n retry();\n }\n /**\n * Wraps the `complete` and `error` events in a Promise.\n *\n * @return {promise} - Promise that resolves on operation completion and rejects\n * on operation error.\n */\n promise() {\n return new Promise((resolve, reject) => {\n this.on('error', reject).on('complete', (result, metadata, rawResponse) => {\n resolve([result, metadata, rawResponse]);\n });\n });\n }\n}\nexports.Operation = Operation;\n/**\n * Method used to create Operation objects.\n *\n * @constructor\n *\n * @param {google.longrunning.Operation} op - The operation to be wrapped.\n * @param {LongRunningDescriptor} longrunningDescriptor - This defines the\n * operations service client and unpacking mechanisms for the operation.\n * @param {BackoffSettings} backoffSettings - The backoff settings used in\n * in polling the operation.\n * @param {CallOptions=} callOptions - CallOptions used in making get operation\n * requests.\n */\nfunction operation(op, longrunningDescriptor, backoffSettings, callOptions) {\n return new Operation(op, longrunningDescriptor, backoffSettings, callOptions);\n}\n//# sourceMappingURL=longrunning.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LongrunningApiCaller = void 0;\nconst call_1 = require(\"../call\");\nconst gax_1 = require(\"../gax\");\nconst longrunning_1 = require(\"./longrunning\");\nclass LongrunningApiCaller {\n longrunningDescriptor;\n /**\n * Creates an API caller that performs polling on a long running operation.\n *\n * @private\n * @constructor\n * @param {LongRunningDescriptor} longrunningDescriptor - Holds the\n * decoders used for unpacking responses and the operationsClient\n * used for polling the operation.\n */\n constructor(longrunningDescriptor) {\n this.longrunningDescriptor = longrunningDescriptor;\n }\n init(callback) {\n if (callback) {\n return new call_1.OngoingCall(callback);\n }\n return new call_1.OngoingCallPromise();\n }\n wrap(func) {\n return func;\n }\n call(apiCall, argument, settings, canceller) {\n canceller.call((argument, callback) => {\n return this._wrapOperation(apiCall, settings, argument, callback);\n }, argument);\n }\n _wrapOperation(apiCall, settings, argument, callback) {\n let backoffSettings = settings.longrunning;\n if (!backoffSettings) {\n backoffSettings = (0, gax_1.createDefaultBackoffSettings)();\n }\n const longrunningDescriptor = this.longrunningDescriptor;\n return apiCall(argument, (err, rawResponse) => {\n if (err) {\n callback(err, null, null, rawResponse);\n return;\n }\n const operation = new longrunning_1.Operation(rawResponse, longrunningDescriptor, backoffSettings, settings);\n callback(null, operation, rawResponse);\n });\n }\n fail(canceller, err) {\n canceller.callback(err);\n }\n result(canceller) {\n return canceller.promise;\n }\n}\nexports.LongrunningApiCaller = LongrunningApiCaller;\n//# sourceMappingURL=longRunningApiCaller.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LongRunningDescriptor = void 0;\nconst longRunningApiCaller_1 = require(\"./longRunningApiCaller\");\n/**\n * A descriptor for long-running operations.\n */\nclass LongRunningDescriptor {\n operationsClient;\n responseDecoder;\n metadataDecoder;\n constructor(operationsClient, responseDecoder, metadataDecoder) {\n this.operationsClient = operationsClient;\n this.responseDecoder = responseDecoder;\n this.metadataDecoder = metadataDecoder;\n }\n getApiCaller() {\n return new longRunningApiCaller_1.LongrunningApiCaller(this);\n }\n}\nexports.LongRunningDescriptor = LongRunningDescriptor;\n//# sourceMappingURL=longRunningDescriptor.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ResourceCollector = void 0;\n/**\n * ResourceCollector class implements asynchronous logic of calling the API call that supports pagination,\n * page by page, collecting all resources (up to `maxResults`) in the array.\n *\n * Usage:\n * const resourceCollector = new ResourceCollector(apiCall, maxResults); // -1 for unlimited\n * resourceCollector.processAllPages(request).then(resources => ...);\n */\nclass ResourceCollector {\n apiCall;\n resources;\n maxResults;\n resolveCallback;\n rejectCallback;\n constructor(apiCall, maxResults = -1) {\n this.apiCall = apiCall;\n this.resources = [];\n this.maxResults = maxResults;\n }\n callback(err, resources, nextPageRequest) {\n if (err) {\n // Something went wrong with this request - failing everything\n this.rejectCallback(err);\n return;\n }\n // Process one page\n for (const resource of resources) {\n this.resources.push(resource);\n if (this.resources.length === this.maxResults) {\n nextPageRequest = null;\n break;\n }\n }\n // All done?\n if (!nextPageRequest) {\n this.resolveCallback(this.resources);\n return;\n }\n // Schedule the next call\n const callback = (...args) => this.callback(...args);\n setImmediate(this.apiCall, nextPageRequest, callback);\n }\n processAllPages(firstRequest) {\n return new Promise((resolve, reject) => {\n this.resolveCallback = resolve;\n this.rejectCallback = reject;\n // Schedule the first call\n const callback = (...args) => this.callback(...args);\n setImmediate(this.apiCall, firstRequest, callback);\n });\n }\n}\nexports.ResourceCollector = ResourceCollector;\n//# sourceMappingURL=resourceCollector.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PagedApiCaller = void 0;\nconst call_1 = require(\"../call\");\nconst googleError_1 = require(\"../googleError\");\nconst resourceCollector_1 = require(\"./resourceCollector\");\nconst warnings_1 = require(\".././warnings\");\nclass PagedApiCaller {\n pageDescriptor;\n /**\n * Creates an API caller that returns a stream to performs page-streaming.\n *\n * @private\n * @constructor\n * @param {PageDescriptor} pageDescriptor - indicates the structure\n * of page streaming to be performed.\n */\n constructor(pageDescriptor) {\n this.pageDescriptor = pageDescriptor;\n }\n /**\n * This function translates between regular gRPC calls (that accepts a request and returns a response,\n * and does not know anything about pages and page tokens) and the users' callback (that expects\n * to see resources from one page, a request to get the next page, and the raw response from the server).\n *\n * It generates a function that can be passed as a callback function to a gRPC call, will understand\n * pagination-specific fields in the response, and call the users' callback after having those fields\n * parsed.\n *\n * @param request Request object. It needs to be passed to all subsequent next page requests\n * (the main content of the request object stays unchanged, only the next page token changes)\n * @param callback The user's callback that expects the page content, next page request, and raw response.\n */\n generateParseResponseCallback(request, callback) {\n const resourceFieldName = this.pageDescriptor.resourceField;\n const responsePageTokenFieldName = this.pageDescriptor.responsePageTokenField;\n const requestPageTokenFieldName = this.pageDescriptor.requestPageTokenField;\n return (err, response) => {\n if (err) {\n callback(err);\n return;\n }\n if (!request) {\n callback(new googleError_1.GoogleError('Undefined request in pagination method callback.'));\n return;\n }\n if (!response) {\n callback(new googleError_1.GoogleError('Undefined response in pagination method callback.'));\n return;\n }\n const resources = response[resourceFieldName] || [];\n const pageToken = response[responsePageTokenFieldName];\n let nextPageRequest = null;\n if (pageToken) {\n nextPageRequest = Object.assign({}, request);\n nextPageRequest[requestPageTokenFieldName] = pageToken;\n }\n callback(err, resources, nextPageRequest, response);\n };\n }\n /**\n * Adds a special ability to understand pagination-specific fields to the existing gRPC call.\n * The original gRPC call just calls callback(err, result).\n * The wrapped one will call callback(err, resources, nextPageRequest, rawResponse) instead.\n *\n * @param func gRPC call (normally, a service stub call). The gRPC call is expected to accept four parameters:\n * request, metadata, call options, and callback.\n */\n wrap(func) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n return function wrappedCall(argument, metadata, options, callback) {\n return func(argument, metadata, options, self.generateParseResponseCallback(argument, callback));\n };\n }\n /**\n * Makes it possible to use both callback-based and promise-based calls.\n * Returns an OngoingCall or OngoingCallPromise object.\n * Regardless of which one is returned, it always has a `.callback` to call.\n *\n * @param settings Call settings. Can only be used to replace Promise with another promise implementation.\n * @param [callback] Callback to be called, if any.\n */\n init(callback) {\n if (callback) {\n return new call_1.OngoingCall(callback);\n }\n return new call_1.OngoingCallPromise();\n }\n /**\n * Implements auto-pagination logic.\n *\n * @param apiCall A function that performs gRPC request and calls its callback with a response or an error.\n * It's supposed to be a gRPC service stub function wrapped into several layers of wrappers that make it\n * accept just two parameters: (request, callback).\n * @param request A request object that came from the user.\n * @param settings Call settings. We are interested in `maxResults` and `autoPaginate` (they are optional).\n * @param ongoingCall An instance of OngoingCall or OngoingCallPromise that can be used for call cancellation,\n * and is used to return results to the user.\n */\n call(apiCall, request, settings, ongoingCall) {\n request = Object.assign({}, request);\n if (!settings.autoPaginate) {\n // they don't want auto-pagination this time - okay, just call once\n ongoingCall.call(apiCall, request);\n return;\n }\n if (request.pageSize && settings.autoPaginate) {\n (0, warnings_1.warn)('autoPaginate true', 'Providing a pageSize without setting autoPaginate to false will still return all results. See https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure manual paging', 'AutopaginateTrueWarning');\n }\n const maxResults = settings.maxResults || -1;\n const resourceCollector = new resourceCollector_1.ResourceCollector(apiCall, maxResults);\n resourceCollector.processAllPages(request).then(resources => ongoingCall.callback(null, resources), err => ongoingCall.callback(err));\n }\n fail(ongoingCall, err) {\n ongoingCall.callback(err);\n }\n result(ongoingCall) {\n return ongoingCall.promise;\n }\n}\nexports.PagedApiCaller = PagedApiCaller;\n//# sourceMappingURL=pagedApiCaller.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PageDescriptor = void 0;\nconst stream_1 = require(\"stream\");\nconst normalApiCaller_1 = require(\"../normalCalls/normalApiCaller\");\nconst warnings_1 = require(\".././warnings\");\nconst pagedApiCaller_1 = require(\"./pagedApiCaller\");\nconst maxAttemptsEmptyResponse = 10;\n/**\n * A descriptor for methods that support pagination.\n */\nclass PageDescriptor {\n requestPageTokenField;\n responsePageTokenField;\n requestPageSizeField;\n resourceField;\n constructor(requestPageTokenField, responsePageTokenField, resourceField) {\n this.requestPageTokenField = requestPageTokenField;\n this.responsePageTokenField = responsePageTokenField;\n this.resourceField = resourceField;\n }\n /**\n * Creates a new object Stream which emits the resource on 'data' event.\n */\n createStream(apiCall, request, options) {\n if (options?.autoPaginate) {\n (0, warnings_1.warn)('autoPaginate true', 'Autopaginate will always be set to false in stream paging methods. See more info at https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure paging calls', 'AutopaginateTrueWarning');\n }\n const stream = new stream_1.PassThrough({ objectMode: true });\n options = Object.assign({}, options, { autoPaginate: false });\n const maxResults = 'maxResults' in options ? options.maxResults : -1;\n let pushCount = 0;\n let started = false;\n function callback(err, resources, next, apiResp) {\n if (err) {\n stream.emit('error', err);\n return;\n }\n // emit full api response with every page.\n stream.emit('response', apiResp);\n for (let i = 0; i < resources.length; ++i) {\n // TODO: rewrite without accessing stream internals\n if (stream\n ._readableState.ended) {\n return;\n }\n if (resources[i] === null) {\n continue;\n }\n stream.push(resources[i]);\n pushCount++;\n if (pushCount === maxResults) {\n stream.end();\n }\n }\n // TODO: rewrite without accessing stream internals\n if (stream._readableState\n .ended) {\n return;\n }\n if (!next) {\n stream.end();\n return;\n }\n // When pageToken is specified in the original options, it will overwrite\n // the page token field in the next request. Therefore it must be cleared.\n if ('pageToken' in options) {\n delete options.pageToken;\n }\n if (stream.isPaused()) {\n request = next;\n started = false;\n }\n else {\n setImmediate(apiCall, next, options, callback);\n }\n }\n stream.on('resume', async () => {\n if (!started) {\n started = true;\n await apiCall(request, options, callback);\n }\n });\n return stream;\n }\n /**\n * Create an async iterable which can be recursively called for data on-demand.\n */\n asyncIterate(apiCall, request, options) {\n if (options?.autoPaginate) {\n (0, warnings_1.warn)('autoPaginate true', 'Autopaginate will always be set to false in Async paging methods. See more info at https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure paging calls', 'AutopaginateTrueWarning');\n }\n options = Object.assign({}, options, { autoPaginate: false });\n const iterable = this.createIterator(apiCall, request, options);\n return iterable;\n }\n createIterator(apiCall, request, options) {\n const asyncIterable = {\n [Symbol.asyncIterator]() {\n let nextPageRequest = request;\n const cache = [];\n return {\n async next() {\n if (cache.length > 0) {\n return Promise.resolve({\n done: false,\n value: cache.shift(),\n });\n }\n let attempts = 0;\n while (cache.length === 0 && nextPageRequest) {\n let result;\n [result, nextPageRequest] = (await apiCall(nextPageRequest, options));\n // For pagination response with protobuf map type, use tuple as representation.\n if (result && !Array.isArray(result)) {\n for (const [key, value] of Object.entries(result)) {\n cache.push([key, value]);\n }\n }\n else {\n cache.push(...result);\n }\n if (cache.length === 0) {\n ++attempts;\n if (attempts > maxAttemptsEmptyResponse) {\n break;\n }\n }\n }\n if (cache.length === 0) {\n return Promise.resolve({ done: true, value: undefined });\n }\n return Promise.resolve({ done: false, value: cache.shift() });\n },\n };\n },\n };\n return asyncIterable;\n }\n getApiCaller(settings) {\n if (!settings.autoPaginate) {\n return new normalApiCaller_1.NormalApiCaller();\n }\n return new pagedApiCaller_1.PagedApiCaller(this);\n }\n}\nexports.PageDescriptor = PageDescriptor;\n//# sourceMappingURL=pageDescriptor.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StreamingApiCaller = void 0;\nconst warnings_1 = require(\"../warnings\");\nconst streaming_1 = require(\"./streaming\");\nclass StreamingApiCaller {\n descriptor;\n /**\n * An API caller for methods of gRPC streaming.\n * @private\n * @constructor\n * @param {StreamDescriptor} descriptor - the descriptor of the method structure.\n */\n constructor(descriptor) {\n this.descriptor = descriptor;\n }\n init(callback) {\n return new streaming_1.StreamProxy(this.descriptor.type, callback, this.descriptor.rest, this.descriptor.gaxStreamingRetries);\n }\n wrap(func) {\n switch (this.descriptor.type) {\n case streaming_1.StreamType.SERVER_STREAMING:\n return (argument, metadata, options) => {\n return func(argument, metadata, options);\n };\n case streaming_1.StreamType.CLIENT_STREAMING:\n return (argument, metadata, options, callback) => {\n return func(metadata, options, callback);\n };\n case streaming_1.StreamType.BIDI_STREAMING:\n return (argument, metadata, options) => {\n return func(metadata, options);\n };\n default:\n (0, warnings_1.warn)('streaming_wrap_unknown_stream_type', `Unknown stream type: ${this.descriptor.type}`);\n }\n return func;\n }\n call(apiCall, argument, settings, stream) {\n stream.setStream(apiCall, argument, settings.retryRequestOptions, settings.retry);\n }\n fail(stream, err) {\n stream.emit('error', err);\n }\n result(stream) {\n return stream;\n }\n}\nexports.StreamingApiCaller = StreamingApiCaller;\n//# sourceMappingURL=streamingApiCaller.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StreamDescriptor = void 0;\nconst streamingApiCaller_1 = require(\"./streamingApiCaller\");\n/**\n * A descriptor for streaming calls.\n */\nclass StreamDescriptor {\n type;\n streaming; // needed for browser support\n rest;\n gaxStreamingRetries;\n constructor(streamType, rest, gaxStreamingRetries) {\n this.type = streamType;\n this.streaming = true;\n this.rest = rest;\n this.gaxStreamingRetries = gaxStreamingRetries;\n }\n getApiCaller() {\n // Right now retrying does not work with gRPC-streaming, because retryable\n // assumes an API call returns an event emitter while gRPC-streaming methods\n // return Stream.\n return new streamingApiCaller_1.StreamingApiCaller(this);\n }\n}\nexports.StreamDescriptor = StreamDescriptor;\n//# sourceMappingURL=streamDescriptor.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BundleApiCaller = void 0;\nconst call_1 = require(\"../call\");\nconst googleError_1 = require(\"../googleError\");\n/**\n * An implementation of APICaller for bundled calls.\n * Uses BundleExecutor to do bundling.\n */\nclass BundleApiCaller {\n bundler;\n constructor(bundler) {\n this.bundler = bundler;\n }\n init(callback) {\n if (callback) {\n return new call_1.OngoingCall(callback);\n }\n return new call_1.OngoingCallPromise();\n }\n wrap(func) {\n return func;\n }\n call(apiCall, argument, settings, status) {\n if (!settings.isBundling) {\n throw new googleError_1.GoogleError('Bundling enabled with no isBundling!');\n }\n status.call((argument, callback) => {\n this.bundler.schedule(apiCall, argument, callback);\n return status;\n }, argument);\n }\n fail(canceller, err) {\n canceller.callback(err);\n }\n result(canceller) {\n return canceller.promise;\n }\n}\nexports.BundleApiCaller = BundleApiCaller;\n//# sourceMappingURL=bundleApiCaller.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.computeBundleId = computeBundleId;\n/**\n * Compute the identifier of the `obj`. The objects of the same ID\n * will be bundled together.\n *\n * @param {RequestType} obj - The request object.\n * @param {String[]} discriminatorFields - The array of field names.\n * A field name may include '.' as a separator, which is used to\n * indicate object traversal.\n * @return {String|undefined} - the identifier string, or undefined if any\n * discriminator fields do not exist.\n */\nfunction computeBundleId(obj, discriminatorFields) {\n const ids = [];\n let hasIds = false;\n for (const field of discriminatorFields) {\n const id = at(obj, field);\n if (id === undefined) {\n ids.push(null);\n }\n else {\n hasIds = true;\n ids.push(id);\n }\n }\n if (!hasIds) {\n return undefined;\n }\n return JSON.stringify(ids);\n}\n/**\n * Given an object field path that may contain dots, dig into the obj and find\n * the value at the given path.\n * @example\n * const obj = {\n * a: {\n * b: 5\n * }\n * }\n * const id = at(obj, 'a.b');\n * // id = 5\n * @param field Path to the property with `.` notation\n * @param obj The object to traverse\n * @returns the value at the given path\n */\nfunction at(obj, field) {\n const pathParts = field.split('.');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let currentObj = obj;\n for (const pathPart of pathParts) {\n currentObj = currentObj?.[pathPart];\n }\n return currentObj;\n}\n//# sourceMappingURL=bundlingUtils.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Task = void 0;\nexports.deepCopyForResponse = deepCopyForResponse;\nconst status_1 = require(\"../status\");\nconst googleError_1 = require(\"../googleError\");\n/**\n * Creates a deep copy of the object with the consideration of subresponse\n * fields for bundling.\n *\n * @param {Object} obj - The source object.\n * @param {Object?} subresponseInfo - The information to copy the subset of\n * the field for the response. Do nothing if it's null.\n * @param {String} subresponseInfo.field - The field name.\n * @param {number} subresponseInfo.start - The offset where the copying\n * element should starts with.\n * @param {number} subresponseInfo.end - The ending index where the copying\n * region of the elements ends.\n * @return {Object} The copied object.\n * @private\n */\nfunction deepCopyForResponse(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nobj, subresponseInfo) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let result;\n if (obj === null) {\n return null;\n }\n if (obj === undefined) {\n return undefined;\n }\n if (Array.isArray(obj)) {\n result = [];\n obj.forEach(element => {\n result.push(deepCopyForResponse(element, null));\n });\n return result;\n }\n // Some objects (such as ByteBuffer) have copy method.\n if (obj.copy !== undefined) {\n return obj.copy();\n }\n // ArrayBuffer should be copied through slice().\n if (obj instanceof ArrayBuffer) {\n return obj.slice(0);\n }\n if (typeof obj === 'object') {\n result = {};\n Object.keys(obj).forEach(key => {\n if (subresponseInfo &&\n key === subresponseInfo.field &&\n Array.isArray(obj[key])) {\n // Note that subresponses are not deep-copied. This is safe because\n // those subresponses are not shared among callbacks.\n result[key] = obj[key].slice(subresponseInfo.start, subresponseInfo.end);\n }\n else {\n result[key] = deepCopyForResponse(obj[key], null);\n }\n });\n return result;\n }\n return obj;\n}\nclass Task {\n _apiCall;\n _request;\n _bundledField;\n _subresponseField;\n _data;\n callCanceller;\n /**\n * A task coordinates the execution of a single bundle.\n *\n * @param {function} apiCall - The function to conduct calling API.\n * @param {Object} bundlingRequest - The base request object to be used\n * for the actual API call.\n * @param {string} bundledField - The name of the field in bundlingRequest\n * to be bundled.\n * @param {string=} subresponseField - The name of the field in the response\n * to be passed to the callback.\n * @constructor\n * @private\n */\n constructor(apiCall, bundlingRequest, bundledField, subresponseField) {\n this._apiCall = apiCall;\n this._request = bundlingRequest;\n this._bundledField = bundledField;\n this._subresponseField = subresponseField;\n this._data = [];\n }\n /**\n * Returns the number of elements in a task.\n * @return {number} The number of elements.\n */\n getElementCount() {\n let count = 0;\n for (let i = 0; i < this._data.length; ++i) {\n count += this._data[i].elements.length;\n }\n return count;\n }\n /**\n * Returns the total byte size of the elements in a task.\n * @return {number} The byte size.\n */\n getRequestByteSize() {\n let size = 0;\n for (let i = 0; i < this._data.length; ++i) {\n size += this._data[i].bytes;\n }\n return size;\n }\n /**\n * Invokes the actual API call with current elements.\n * @return {string[]} - the list of ids for invocations to be run.\n */\n run() {\n if (this._data.length === 0) {\n return [];\n }\n const request = this._request;\n const elements = [];\n const ids = [];\n for (let i = 0; i < this._data.length; ++i) {\n elements.push(...this._data[i].elements);\n ids.push(this._data[i].callback.id);\n }\n request[this._bundledField] = elements;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n this.callCanceller = this._apiCall(request, (err, response) => {\n const responses = [];\n if (err) {\n self._data.forEach(() => {\n responses.push(undefined);\n });\n }\n else {\n let subresponseInfo = null;\n if (self._subresponseField) {\n subresponseInfo = {\n field: self._subresponseField,\n start: 0,\n };\n }\n self._data.forEach(data => {\n if (subresponseInfo) {\n subresponseInfo.end =\n subresponseInfo.start + data.elements.length;\n }\n responses.push(deepCopyForResponse(response, subresponseInfo));\n if (subresponseInfo) {\n subresponseInfo.start = subresponseInfo.end;\n }\n });\n }\n for (let i = 0; i < self._data.length; ++i) {\n if (self._data[i].cancelled) {\n const error = new googleError_1.GoogleError('cancelled');\n error.code = status_1.Status.CANCELLED;\n self._data[i].callback(error);\n }\n else {\n self._data[i].callback(err, responses[i]);\n }\n }\n });\n return ids;\n }\n /**\n * Appends the list of elements into the task.\n * @param {Object[]} elements - the new list of elements.\n * @param {number} bytes - the byte size required to encode elements in the API.\n * @param {APICallback} callback - the callback of the method call.\n */\n extend(elements, bytes, callback) {\n this._data.push({\n elements,\n bytes,\n callback,\n });\n }\n /**\n * Cancels a part of elements.\n * @param {string} id - The identifier of the part of elements.\n * @return {boolean} Whether the entire task will be canceled or not.\n */\n cancel(id) {\n if (this.callCanceller) {\n let allCancelled = true;\n this._data.forEach(d => {\n if (d.callback.id === id) {\n d.cancelled = true;\n }\n if (!d.cancelled) {\n allCancelled = false;\n }\n });\n if (allCancelled) {\n this.callCanceller.cancel();\n }\n return allCancelled;\n }\n for (let i = 0; i < this._data.length; ++i) {\n if (this._data[i].callback.id === id) {\n const error = new googleError_1.GoogleError('cancelled');\n error.code = status_1.Status.CANCELLED;\n this._data[i].callback(error);\n this._data.splice(i, 1);\n break;\n }\n }\n return this._data.length === 0;\n }\n}\nexports.Task = Task;\n//# sourceMappingURL=task.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BundleExecutor = void 0;\nconst status_1 = require(\"../status\");\nconst googleError_1 = require(\"../googleError\");\nconst warnings_1 = require(\"../warnings\");\nconst bundlingUtils_1 = require(\"./bundlingUtils\");\nconst task_1 = require(\"./task\");\nfunction noop() { }\n/**\n * BundleExecutor stores several timers for each bundle (calls are bundled based\n * on the options passed, each bundle has unique ID that is calculated based on\n * field values). Each timer fires and sends a call after certain amount of\n * time, and if a new request comes to the same bundle, the timer can be\n * restarted.\n */\nclass BundleExecutor {\n _options;\n _descriptor;\n _tasks;\n _timers;\n _invocations;\n _invocationId;\n /**\n * Organizes requests for an api service that requires to bundle them.\n *\n * @param {BundleOptions} bundleOptions - configures strategy this instance\n * uses when executing bundled functions.\n * @param {BundleDescriptor} bundleDescriptor - the description of the bundling.\n * @constructor\n */\n constructor(bundleOptions, bundleDescriptor) {\n this._options = bundleOptions;\n this._descriptor = bundleDescriptor;\n this._tasks = {};\n this._timers = {};\n this._invocations = {};\n this._invocationId = 0;\n }\n /**\n * Schedule a method call.\n *\n * @param {function} apiCall - the function for an API call.\n * @param {Object} request - the request object to be bundled with others.\n * @param {APICallback} callback - the callback to be called when the method finished.\n * @return {function()} - the function to cancel the scheduled invocation.\n */\n schedule(apiCall, request, callback) {\n const bundleId = (0, bundlingUtils_1.computeBundleId)(request, this._descriptor.requestDiscriminatorFields);\n callback = (callback || noop);\n if (bundleId === undefined) {\n (0, warnings_1.warn)('bundling_schedule_bundleid_undefined', 'The request does not have enough information for request bundling. ' +\n `Invoking immediately. Request: ${JSON.stringify(request)} ` +\n `discriminator fields: ${this._descriptor.requestDiscriminatorFields}`);\n return apiCall(request, callback);\n }\n if (request[this._descriptor.bundledField] === undefined) {\n (0, warnings_1.warn)('bundling_no_bundled_field', `Request does not contain field ${this._descriptor.bundledField} that must present for bundling. ` +\n `Invoking immediately. Request: ${JSON.stringify(request)}`);\n return apiCall(request, callback);\n }\n if (!(bundleId in this._tasks)) {\n this._tasks[bundleId] = new task_1.Task(apiCall, request, this._descriptor.bundledField, this._descriptor.subresponseField);\n }\n let task = this._tasks[bundleId];\n callback.id = String(this._invocationId++);\n this._invocations[callback.id] = bundleId;\n const bundledField = request[this._descriptor.bundledField];\n const elementCount = bundledField.length;\n let requestBytes = 0;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n bundledField.forEach(obj => {\n requestBytes += this._descriptor.byteLengthFunction(obj);\n });\n const countLimit = this._options.elementCountLimit || 0;\n const byteLimit = this._options.requestByteLimit || 0;\n if ((countLimit > 0 && elementCount > countLimit) ||\n (byteLimit > 0 && requestBytes >= byteLimit)) {\n let message;\n if (countLimit > 0 && elementCount > countLimit) {\n message =\n 'The number of elements ' +\n elementCount +\n ' exceeds the limit ' +\n this._options.elementCountLimit;\n }\n else {\n message =\n 'The required bytes ' +\n requestBytes +\n ' exceeds the limit ' +\n this._options.requestByteLimit;\n }\n const error = new googleError_1.GoogleError(message);\n error.code = status_1.Status.INVALID_ARGUMENT;\n callback(error);\n return {\n cancel: noop,\n };\n }\n const existingCount = task.getElementCount();\n const existingBytes = task.getRequestByteSize();\n if ((countLimit > 0 && elementCount + existingCount >= countLimit) ||\n (byteLimit > 0 && requestBytes + existingBytes >= byteLimit)) {\n this._runNow(bundleId);\n this._tasks[bundleId] = new task_1.Task(apiCall, request, this._descriptor.bundledField, this._descriptor.subresponseField);\n task = this._tasks[bundleId];\n }\n task.extend(bundledField, requestBytes, callback);\n const ret = {\n cancel() {\n self._cancel(callback.id);\n },\n };\n const countThreshold = this._options.elementCountThreshold || 0;\n const sizeThreshold = this._options.requestByteThreshold || 0;\n if ((countThreshold > 0 && task.getElementCount() >= countThreshold) ||\n (sizeThreshold > 0 && task.getRequestByteSize() >= sizeThreshold)) {\n this._runNow(bundleId);\n return ret;\n }\n if (!(bundleId in this._timers) && this._options.delayThreshold > 0) {\n this._timers[bundleId] = setTimeout(() => {\n delete this._timers[bundleId];\n this._runNow(bundleId);\n }, this._options.delayThreshold);\n }\n return ret;\n }\n /**\n * Clears scheduled timeout if it exists.\n *\n * @param {String} bundleId - the id for the task whose timeout needs to be\n * cleared.\n * @private\n */\n _maybeClearTimeout(bundleId) {\n if (bundleId in this._timers) {\n const timerId = this._timers[bundleId];\n delete this._timers[bundleId];\n clearTimeout(timerId);\n }\n }\n /**\n * Cancels an event.\n *\n * @param {String} id - The id for the event in the task.\n * @private\n */\n _cancel(id) {\n if (!(id in this._invocations)) {\n return;\n }\n const bundleId = this._invocations[id];\n if (!(bundleId in this._tasks)) {\n return;\n }\n const task = this._tasks[bundleId];\n delete this._invocations[id];\n if (task.cancel(id)) {\n this._maybeClearTimeout(bundleId);\n delete this._tasks[bundleId];\n }\n }\n /**\n * Invokes a task.\n *\n * @param {String} bundleId - The id for the task.\n * @private\n */\n _runNow(bundleId) {\n if (!(bundleId in this._tasks)) {\n (0, warnings_1.warn)('bundle_runnow_bundleid_unknown', `No such bundleid: ${bundleId}`);\n return;\n }\n this._maybeClearTimeout(bundleId);\n const task = this._tasks[bundleId];\n delete this._tasks[bundleId];\n task.run().forEach(id => {\n delete this._invocations[id];\n });\n }\n}\nexports.BundleExecutor = BundleExecutor;\n//# sourceMappingURL=bundleExecutor.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BundleDescriptor = void 0;\nconst normalApiCaller_1 = require(\"../normalCalls/normalApiCaller\");\nconst bundleApiCaller_1 = require(\"./bundleApiCaller\");\nconst bundleExecutor_1 = require(\"./bundleExecutor\");\nconst util_1 = require(\"../util\");\n/**\n * A descriptor for calls that can be bundled into one call.\n */\nclass BundleDescriptor {\n bundledField;\n requestDiscriminatorFields;\n subresponseField;\n byteLengthFunction;\n /**\n * Describes the structure of bundled call.\n *\n * requestDiscriminatorFields may include '.' as a separator, which is used to\n * indicate object traversal. This allows fields in nested objects to be used\n * to determine what request to bundle.\n *\n * @property {String} bundledField\n * @property {String} requestDiscriminatorFields\n * @property {String} subresponseField\n * @property {Function} byteLengthFunction\n *\n * @param {String} bundledField - the repeated field in the request message\n * that will have its elements aggregated by bundling.\n * @param {String} requestDiscriminatorFields - a list of fields in the\n * target request message class that are used to detemrine which request\n * messages should be bundled together.\n * @param {String} subresponseField - an optional field, when present it\n * indicates the field in the response message that should be used to\n * demultiplex the response into multiple response messages.\n * @param {Function} byteLengthFunction - a function to obtain the byte\n * length to be consumed for the bundled field messages. Because Node.JS\n * protobuf.js/gRPC uses builtin Objects for the user-visible data and\n * internally they are encoded/decoded in protobuf manner, this function\n * is actually necessary to calculate the byte length.\n * @constructor\n */\n constructor(bundledField, requestDiscriminatorFields, subresponseField, byteLengthFunction) {\n if (!byteLengthFunction && typeof subresponseField === 'function') {\n byteLengthFunction = subresponseField;\n subresponseField = null;\n }\n this.bundledField = bundledField;\n this.requestDiscriminatorFields =\n requestDiscriminatorFields.map(util_1.toCamelCase);\n this.subresponseField = subresponseField;\n this.byteLengthFunction = byteLengthFunction;\n }\n getApiCaller(settings) {\n if (settings.isBundling === false) {\n return new normalApiCaller_1.NormalApiCaller();\n }\n return new bundleApiCaller_1.BundleApiCaller(new bundleExecutor_1.BundleExecutor(settings.bundleOptions, this));\n }\n}\nexports.BundleDescriptor = BundleDescriptor;\n//# sourceMappingURL=bundleDescriptor.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BundleDescriptor = exports.StreamDescriptor = exports.PageDescriptor = exports.LongrunningDescriptor = void 0;\nvar longRunningDescriptor_1 = require(\"./longRunningCalls/longRunningDescriptor\");\nObject.defineProperty(exports, \"LongrunningDescriptor\", { enumerable: true, get: function () { return longRunningDescriptor_1.LongRunningDescriptor; } });\nvar pageDescriptor_1 = require(\"./paginationCalls/pageDescriptor\");\nObject.defineProperty(exports, \"PageDescriptor\", { enumerable: true, get: function () { return pageDescriptor_1.PageDescriptor; } });\nvar streamDescriptor_1 = require(\"./streamingCalls/streamDescriptor\");\nObject.defineProperty(exports, \"StreamDescriptor\", { enumerable: true, get: function () { return streamDescriptor_1.StreamDescriptor; } });\nvar bundleDescriptor_1 = require(\"./bundlingCalls/bundleDescriptor\");\nObject.defineProperty(exports, \"BundleDescriptor\", { enumerable: true, get: function () { return bundleDescriptor_1.BundleDescriptor; } });\n//# sourceMappingURL=descriptor.js.map","\"use strict\";\n// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// ** This file is automatically generated by gapic-generator-typescript. **\n// ** https://github.com/googleapis/gapic-generator-typescript **\n// ** All changes to this file may be overwritten. **\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IamClient = void 0;\nconst createApiCall_1 = require(\"./createApiCall\");\nconst routingHeader = __importStar(require(\"./routingHeader\"));\nconst gapicConfig = __importStar(require(\"./iam_policy_service_client_config.json\"));\nconst fallback = __importStar(require(\"./fallback\"));\nlet version = require('../../package.json').version;\nconst jsonProtos = require(\"../protos/iam_service.json\");\n/**\n * Google Cloud IAM Client.\n * This is manually written for providing methods [setIamPolicy, getIamPolicy, testIamPerssion] to the generated client.\n */\nclass IamClient {\n _terminated = false;\n _opts;\n _defaults;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _protos;\n auth;\n descriptors = { page: {}, stream: {}, longrunning: {} };\n innerApiCalls = {};\n iamPolicyStub;\n gaxGrpc;\n constructor(gaxGrpc, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n options) {\n this.gaxGrpc = gaxGrpc;\n // Ensure that options include the service address and port.\n const opts = Object.assign({\n servicePath: options.servicePath,\n port: options.port,\n clientConfig: options.clientConfig,\n apiEndpoint: options.apiEndpoint,\n fallback: options.fallback,\n }, options);\n version = opts.fallback ? fallback.version : version;\n opts.scopes = this.constructor.scopes;\n // Save options to use in initialize() method.\n this._opts = opts;\n // Save the auth object to the client, for use by other methods.\n this.auth = gaxGrpc.auth;\n // Determine the client header string.\n const clientHeader = [`gax/${version}`, `gapic/${version}`];\n if (typeof process !== 'undefined' && 'versions' in process) {\n clientHeader.push(`gl-node/${process.versions.node}`);\n }\n else {\n clientHeader.push(`gl-web/${version}`);\n }\n if (!opts.fallback) {\n clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`);\n }\n if (opts.libName && opts.libVersion) {\n clientHeader.push(`${opts.libName}/${opts.libVersion}`);\n }\n // Load the applicable protos.\n this._protos = this.gaxGrpc.loadProtoJSON(jsonProtos);\n // Put together the default options sent with requests.\n this._defaults = gaxGrpc.constructSettings('google.iam.v1.IAMPolicy', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });\n this.innerApiCalls = {};\n }\n /**\n * Initialize the client.\n * Performs asynchronous operations (such as authentication) and prepares the client.\n * This function will be called automatically when any class method is called for the\n * first time, but if you need to initialize it before calling an actual method,\n * feel free to call initialize() directly.\n *\n * You can await on this method if you want to make sure the client is initialized.\n *\n * @returns {Promise} A promise that resolves to an authenticated service stub.\n */\n initialize() {\n // If the client stub promise is already initialized, return immediately.\n if (this.iamPolicyStub) {\n return this.iamPolicyStub;\n }\n // Put together the \"service stub\" for\n // google.iam.v1.IAMPolicy.\n this.iamPolicyStub = this.gaxGrpc.createStub(this._opts.fallback\n ? this._protos.lookupService('google.iam.v1.IAMPolicy')\n : this._protos.google.iam.v1.IAMPolicy, this._opts);\n // Iterate over each of the methods that the service provides\n // and create an API call method for each.\n const iamPolicyStubMethods = [\n 'getIamPolicy',\n 'setIamPolicy',\n 'testIamPermissions',\n ];\n for (const methodName of iamPolicyStubMethods) {\n const innerCallPromise = this.iamPolicyStub.then(stub => (...args) => {\n if (this._terminated) {\n return Promise.reject('The client has already been closed.');\n }\n const func = stub[methodName];\n return func.apply(stub, args);\n }, (err) => () => {\n throw err;\n });\n this.innerApiCalls[methodName] = (0, createApiCall_1.createApiCall)(innerCallPromise, this._defaults[methodName], this.descriptors.page[methodName]);\n }\n return this.iamPolicyStub;\n }\n /**\n * The DNS address for this API service.\n */\n static get servicePath() {\n return 'cloudkms.googleapis.com';\n }\n /**\n * The DNS address for this API service - same as servicePath(),\n * exists for compatibility reasons.\n */\n static get apiEndpoint() {\n return 'cloudkms.googleapis.com';\n }\n /**\n * The port for this API service.\n */\n static get port() {\n return 443;\n }\n /**\n * The scopes needed to make gRPC calls for every method defined\n * in this service.\n */\n static get scopes() {\n return [\n 'https://www.googleapis.com/auth/cloud-platform',\n 'https://www.googleapis.com/auth/cloudkms',\n ];\n }\n getProjectId(callback) {\n if (this.auth && 'getProjectId' in this.auth) {\n return this.auth.getProjectId(callback);\n }\n if (callback) {\n callback(new Error('Cannot determine project ID.'));\n }\n else {\n return Promise.reject('Cannot determine project ID.');\n }\n }\n getIamPolicy(request, optionsOrCallback, callback) {\n let options;\n if (optionsOrCallback instanceof Function && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n routingHeader.fromParams({\n resource: request.resource,\n });\n this.initialize().catch(console.error);\n return this.innerApiCalls.getIamPolicy(request, options, callback);\n }\n setIamPolicy(request, optionsOrCallback, callback) {\n let options;\n if (optionsOrCallback instanceof Function && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n routingHeader.fromParams({\n resource: request.resource,\n });\n this.initialize().catch(console.error);\n return this.innerApiCalls.setIamPolicy(request, options, callback);\n }\n testIamPermissions(request, optionsOrCallback, callback) {\n let options;\n if (optionsOrCallback instanceof Function && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n routingHeader.fromParams({\n resource: request.resource,\n });\n this.initialize().catch(console.error);\n return this.innerApiCalls.testIamPermissions(request, options, callback);\n }\n /**\n * Terminate the GRPC channel and close the client.\n *\n * The client will no longer be usable and all future behavior is undefined.\n */\n close() {\n this.initialize().catch(console.error);\n if (!this._terminated) {\n return this.iamPolicyStub.then(stub => {\n this._terminated = true;\n stub.close();\n });\n }\n return Promise.resolve();\n }\n}\nexports.IamClient = IamClient;\n//# sourceMappingURL=iamService.js.map","\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LocationsClient = void 0;\n/* global window */\nconst gax = __importStar(require(\"./gax\"));\nconst warnings_1 = require(\"./warnings\");\nconst createApiCall_1 = require(\"./createApiCall\");\nconst routingHeader = __importStar(require(\"./routingHeader\"));\nconst pageDescriptor_1 = require(\"./paginationCalls/pageDescriptor\");\nconst jsonProtos = require(\"../protos/locations.json\");\n/**\n * This file defines retry strategy and timeouts for all API methods in this library.\n */\nconst gapicConfig = __importStar(require(\"./locations_client_config.json\"));\nconst version = require('../../package.json').version;\n/**\n * Google Cloud Locations Client.\n * This is manually written for providing methods [listLocations, getLocations] to the generated client.\n */\nclass LocationsClient {\n _terminated = false;\n _opts;\n _providedCustomServicePath;\n _protos;\n _defaults;\n auth;\n descriptors = {\n page: {},\n stream: {},\n longrunning: {},\n batching: {},\n };\n warn;\n innerApiCalls;\n locationsStub;\n gaxGrpc;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n PageDescriptor;\n /**\n * Construct an instance of LocationsClient.\n *\n * @param {object} [options] - The configuration object.\n * The options accepted by the constructor are described in detail\n * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).\n * The common options are:\n * @param {object} [options.credentials] - Credentials object.\n * @param {string} [options.credentials.client_email]\n * @param {string} [options.credentials.private_key]\n * @param {string} [options.email] - Account email address. Required when\n * using a .pem or .p12 keyFilename.\n * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or\n * .p12 key downloaded from the Google Developers Console. If you provide\n * a path to a JSON file, the projectId option below is not necessary.\n * NOTE: .pem and .p12 require you to specify options.email as well.\n * @param {number} [options.port] - The port on which to connect to\n * the remote host.\n * @param {string} [options.projectId] - The project ID from the Google\n * Developer's Console, e.g. 'grape-spaceship-123'. We will also check\n * the environment variable GCLOUD_PROJECT for your project ID. If your\n * app is running in an environment which supports\n * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},\n * your project ID will be detected automatically.\n * @param {string} [options.apiEndpoint] - The domain name of the\n * API remote host.\n * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.\n * Follows the structure of {@link gapicConfig}.\n * @param {boolean} [options.fallback] - Use HTTP fallback mode.\n * In fallback mode, a special browser-compatible transport implementation is used\n * instead of gRPC transport. In browser context (if the `window` object is defined)\n * the fallback mode is enabled automatically; set `options.fallback` to `false`\n * if you need to override this behavior.\n */\n constructor(gaxGrpc, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n opts) {\n // Ensure that options include all the required fields.\n this.gaxGrpc = gaxGrpc;\n const staticMembers = this.constructor;\n const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;\n this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);\n const port = opts?.port || staticMembers.port;\n const clientConfig = opts?.clientConfig ?? {};\n const fallback = opts?.fallback ??\n (typeof window !== 'undefined' && typeof window?.fetch === 'function');\n opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);\n // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.\n if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {\n opts['scopes'] = staticMembers.scopes;\n }\n // Save options to use in initialize() method.\n this._opts = opts;\n // Save the auth object to the client, for use by other methods.\n this.auth = gaxGrpc.auth;\n // Set the default scopes in auth client if needed.\n if (servicePath === staticMembers.servicePath) {\n this.auth.defaultScopes = staticMembers.scopes;\n }\n // Determine the client header string.\n const clientHeader = [`gax/${version}`, `gapic/${version}`];\n if (typeof process !== 'undefined' && 'versions' in process) {\n clientHeader.push(`gl-node/${process.versions.node}`);\n }\n else {\n clientHeader.push(`gl-web/${version}`);\n }\n if (!opts.fallback) {\n clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`);\n }\n else if (opts.fallback === 'rest') {\n clientHeader.push(`rest/${gaxGrpc.grpcVersion}`);\n }\n if (opts.libName && opts.libVersion) {\n clientHeader.push(`${opts.libName}/${opts.libVersion}`);\n }\n // Load the applicable protos.\n this._protos = gaxGrpc.loadProtoJSON(jsonProtos);\n // Some of the methods on this service return \"paged\" results,\n // (e.g. 50 results at a time, with tokens to get subsequent\n // pages). Denote the keys used for pagination and results.\n this.descriptors.page = {\n listLocations: new pageDescriptor_1.PageDescriptor('pageToken', 'nextPageToken', 'locations'),\n };\n // Put together the default options sent with requests.\n this._defaults = gaxGrpc.constructSettings('google.cloud.location.Locations', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });\n // Set up a dictionary of \"inner API calls\"; the core implementation\n // of calling the API is handled in `google-gax`, with this code\n // merely providing the destination and request information.\n this.innerApiCalls = {};\n // Add a warn function to the client constructor so it can be easily tested.\n this.warn = warnings_1.warn;\n }\n /**\n * Initialize the client.\n * Performs asynchronous operations (such as authentication) and prepares the client.\n * This function will be called automatically when any class method is called for the\n * first time, but if you need to initialize it before calling an actual method,\n * feel free to call initialize() directly.\n *\n * You can await on this method if you want to make sure the client is initialized.\n *\n * @returns {Promise} A promise that resolves to an authenticated service stub.\n */\n initialize() {\n // If the client stub promise is already initialized, return immediately.\n if (this.locationsStub) {\n return this.locationsStub;\n }\n // Put together the \"service stub\" for\n // google.cloud.location.Locations.\n this.locationsStub = this.gaxGrpc.createStub(this._opts.fallback\n ? this._protos.lookupService('google.cloud.location.Locations')\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._protos.google.cloud.location.Locations, this._opts, this._providedCustomServicePath);\n // Iterate over each of the methods that the service provides\n // and create an API call method for each.\n const locationsStubMethods = ['listLocations', 'getLocation'];\n for (const methodName of locationsStubMethods) {\n const callPromise = this.locationsStub.then(stub => (...args) => {\n if (this._terminated) {\n return Promise.reject('The client has already been closed.');\n }\n const func = stub[methodName];\n return func.apply(stub, args);\n }, (err) => () => {\n throw err;\n });\n const descriptor = this.descriptors.page[methodName] || undefined;\n const apiCall = (0, createApiCall_1.createApiCall)(callPromise, this._defaults[methodName], descriptor);\n this.innerApiCalls[methodName] = apiCall;\n }\n return this.locationsStub;\n }\n /**\n * The DNS address for this API service.\n * @returns {string} The DNS address for this service.\n */\n static get servicePath() {\n return 'cloud.googleapis.com';\n }\n /**\n * The DNS address for this API service - same as servicePath(),\n * exists for compatibility reasons.\n * @returns {string} The DNS address for this service.\n */\n static get apiEndpoint() {\n return 'cloud.googleapis.com';\n }\n /**\n * The port for this API service.\n * @returns {number} The default port for this service.\n */\n static get port() {\n return 443;\n }\n /**\n * The scopes needed to make gRPC calls for every method defined\n * in this service.\n * @returns {string[]} List of default scopes.\n */\n static get scopes() {\n return ['https://www.googleapis.com/auth/cloud-platform'];\n }\n getProjectId(callback) {\n if (callback) {\n this.auth.getProjectId(callback);\n return;\n }\n return this.auth.getProjectId();\n }\n /**\n * Gets information about a location.\n *\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.name\n * Resource name for the location.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Promise} - The promise which resolves to an array.\n * The first element of the array is an object representing [Location]{@link google.cloud.location.Location}.\n * Please see the\n * [documentation](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#regular-methods)\n * for more details and examples.\n * @example\n * const [response] = await client.getLocation(request);\n */\n getLocation(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n routingHeader.fromParams({\n name: request.name || '',\n });\n this.initialize().catch(console.error);\n return this.innerApiCalls.getLocation(request, options, callback);\n }\n /**\n * Lists information about the supported locations for this service.\n *\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.name\n * The resource that owns the locations collection, if applicable.\n * @param {string} request.filter\n * The standard list filter.\n * @param {number} request.pageSize\n * The standard list page size.\n * @param {string} request.pageToken\n * The standard list page token.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Promise} - The promise which resolves to an array.\n * The first element of the array is Array of [Location]{@link google.cloud.location.Location}.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed and will merge results from all the pages into this array.\n * Note that it can affect your quota.\n * We recommend using `listLocationsAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the\n * [documentation](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination)\n * for more details and examples.\n */\n listLocations(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n routingHeader.fromParams({\n name: request.name || '',\n });\n this.initialize().catch(console.error);\n return this.innerApiCalls.listLocations(request, options, callback);\n }\n /**\n * Equivalent to `listLocations`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.name\n * The resource that owns the locations collection, if applicable.\n * @param {string} request.filter\n * The standard list filter.\n * @param {number} request.pageSize\n * The standard list page size.\n * @param {string} request.pageToken\n * The standard list page token.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).\n * When you iterate the returned iterable, each element will be an object representing\n * [Location]{@link google.cloud.location.Location}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the\n * [documentation](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination)\n * for more details and examples.\n * @example\n * const iterable = client.listLocationsAsync(request);\n * for await (const response of iterable) {\n * // process response\n * }\n */\n listLocationsAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n routingHeader.fromParams({\n name: request.name || '',\n });\n options = options || {};\n const callSettings = new gax.CallSettings(options);\n this.initialize().catch(console.error);\n return this.descriptors.page.listLocations.asyncIterate(this.innerApiCalls['listLocations'], request, callSettings);\n }\n /**\n * Terminate the gRPC channel and close the client.\n *\n * The client will no longer be usable and all future behavior is undefined.\n * @returns {Promise} A promise that resolves when the client is closed.\n */\n close() {\n this.initialize().catch(console.error);\n if (!this._terminated) {\n return this.locationsStub.then(stub => {\n this._terminated = true;\n stub.close();\n });\n }\n return Promise.resolve();\n }\n}\nexports.LocationsClient = LocationsClient;\n//# sourceMappingURL=locationService.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fallback = exports.GoogleError = exports.operation = exports.Operation = exports.warn = exports.protobufMinimal = exports.protobuf = exports.LocationProtos = exports.IamProtos = exports.operationsProtos = exports.GrpcClient = exports.defaultToObjectOptions = exports.makeUUID = exports.LocationsClient = exports.IamClient = exports.OperationsClient = exports.StreamType = exports.StreamDescriptor = exports.PageDescriptor = exports.LongrunningDescriptor = exports.BundleDescriptor = exports.version = exports.createDefaultBackoffSettings = exports.RetryOptions = exports.constructSettings = exports.CallSettings = exports.routingHeader = exports.PathTemplate = void 0;\nexports.lro = lro;\nexports.createApiCall = createApiCall;\nconst object_hash_1 = __importDefault(require(\"object-hash\"));\nconst protobuf = __importStar(require(\"protobufjs\"));\nexports.protobuf = protobuf;\nconst gax = __importStar(require(\"./gax\"));\nconst routingHeader = __importStar(require(\"./routingHeader\"));\nexports.routingHeader = routingHeader;\nconst status_1 = require(\"./status\");\nconst google_auth_library_1 = require(\"google-auth-library\");\nconst operationsClient_1 = require(\"./operationsClient\");\nconst createApiCall_1 = require(\"./createApiCall\");\nconst fallbackRest = __importStar(require(\"./fallbackRest\"));\nconst featureDetection_1 = require(\"./featureDetection\");\nconst fallbackServiceStub_1 = require(\"./fallbackServiceStub\");\nconst streaming_1 = require(\"./streamingCalls/streaming\");\nconst util_1 = require(\"./util\");\nconst IamProtos = __importStar(require(\"../protos/iam_service\"));\nexports.IamProtos = IamProtos;\nconst LocationProtos = __importStar(require(\"../protos/locations\"));\nexports.LocationProtos = LocationProtos;\nconst operationsProtos = __importStar(require(\"../protos/operations\"));\nexports.operationsProtos = operationsProtos;\nvar pathTemplate_1 = require(\"./pathTemplate\");\nObject.defineProperty(exports, \"PathTemplate\", { enumerable: true, get: function () { return pathTemplate_1.PathTemplate; } });\nvar gax_1 = require(\"./gax\");\nObject.defineProperty(exports, \"CallSettings\", { enumerable: true, get: function () { return gax_1.CallSettings; } });\nObject.defineProperty(exports, \"constructSettings\", { enumerable: true, get: function () { return gax_1.constructSettings; } });\nObject.defineProperty(exports, \"RetryOptions\", { enumerable: true, get: function () { return gax_1.RetryOptions; } });\nObject.defineProperty(exports, \"createDefaultBackoffSettings\", { enumerable: true, get: function () { return gax_1.createDefaultBackoffSettings; } });\nexports.version = require('../../package.json').version + '-fallback';\nvar descriptor_1 = require(\"./descriptor\");\nObject.defineProperty(exports, \"BundleDescriptor\", { enumerable: true, get: function () { return descriptor_1.BundleDescriptor; } });\nObject.defineProperty(exports, \"LongrunningDescriptor\", { enumerable: true, get: function () { return descriptor_1.LongrunningDescriptor; } });\nObject.defineProperty(exports, \"PageDescriptor\", { enumerable: true, get: function () { return descriptor_1.PageDescriptor; } });\nObject.defineProperty(exports, \"StreamDescriptor\", { enumerable: true, get: function () { return descriptor_1.StreamDescriptor; } });\nvar streaming_2 = require(\"./streamingCalls/streaming\");\nObject.defineProperty(exports, \"StreamType\", { enumerable: true, get: function () { return streaming_2.StreamType; } });\nvar operationsClient_2 = require(\"./operationsClient\");\nObject.defineProperty(exports, \"OperationsClient\", { enumerable: true, get: function () { return operationsClient_2.OperationsClient; } });\nvar iamService_1 = require(\"./iamService\");\nObject.defineProperty(exports, \"IamClient\", { enumerable: true, get: function () { return iamService_1.IamClient; } });\nvar locationService_1 = require(\"./locationService\");\nObject.defineProperty(exports, \"LocationsClient\", { enumerable: true, get: function () { return locationService_1.LocationsClient; } });\nvar util_2 = require(\"./util\");\nObject.defineProperty(exports, \"makeUUID\", { enumerable: true, get: function () { return util_2.makeUUID; } });\nexports.defaultToObjectOptions = {\n keepCase: false,\n longs: String,\n enums: String,\n defaults: true,\n oneofs: true,\n};\nconst CLIENT_VERSION_HEADER = 'x-goog-api-client';\nclass GrpcClient {\n auth;\n /**\n * @deprecated use {@link GrpcClient.auth} instead\n */\n authClient;\n fallback;\n grpcVersion;\n static protoCache = new Map();\n httpRules;\n numericEnums;\n minifyJson;\n /**\n * In rare cases users might need to deallocate all memory consumed by loaded protos.\n * This method will delete the proto cache content.\n */\n static clearProtoCache() {\n GrpcClient.protoCache.clear();\n }\n /**\n * gRPC-fallback version of GrpcClient\n * Implements GrpcClient API for a browser using grpc-fallback protocol (sends serialized protobuf to HTTP/1 $rpc endpoint).\n *\n * @param options {@link GrpcClientOptions}\n */\n constructor(options = {}) {\n if (options.auth) {\n this.auth = options.auth;\n }\n else if ('authClient' in options) {\n this.auth = options.authClient;\n }\n else {\n this.auth = new google_auth_library_1.GoogleAuth({\n authClient: options.auth,\n ...options,\n });\n }\n this.fallback = options.fallback ? true : false;\n this.grpcVersion = require('../../package.json').version;\n this.httpRules = options.httpRules;\n this.numericEnums = options.numericEnums ?? false;\n this.minifyJson = options.minifyJson ?? false;\n }\n /**\n * gRPC-fallback version of loadProto\n * Loads the protobuf root object from a JSON object created from a proto file\n * @param {Object} jsonObject - A JSON version of a protofile created usin protobuf.js\n * @returns {Object} Root namespace of proto JSON\n */\n loadProto(jsonObject) {\n const rootObject = protobuf.Root.fromJSON(jsonObject);\n return rootObject;\n }\n loadProtoJSON(json, ignoreCache = false) {\n const hash = (0, object_hash_1.default)(JSON.stringify(json)).toString();\n const cached = GrpcClient.protoCache.get(hash);\n if (cached && !ignoreCache) {\n return cached;\n }\n const root = protobuf.Root.fromJSON(json);\n GrpcClient.protoCache.set(hash, root);\n return root;\n }\n static getServiceMethods(service) {\n const methods = {};\n for (const [methodName, methodObject] of Object.entries(service.methods)) {\n const methodNameLowerCamelCase = (0, util_1.toLowerCamelCase)(methodName);\n methods[methodNameLowerCamelCase] = methodObject;\n }\n return methods;\n }\n /**\n * gRPC-fallback version of constructSettings\n * A wrapper of {@link constructSettings} function under the gRPC context.\n *\n * Most of parameters are common among constructSettings, please take a look.\n * @param {string} serviceName - The fullly-qualified name of the service.\n * @param {Object} clientConfig - A dictionary of the client config.\n * @param {Object} configOverrides - A dictionary of overriding configs.\n * @param {Object} headers - A dictionary of additional HTTP header name to\n * its value.\n * @return {Object} A mapping of method names to CallSettings.\n */\n constructSettings(serviceName, clientConfig, configOverrides, headers) {\n function buildMetadata(abTests, moreHeaders) {\n const metadata = {};\n if (!headers) {\n headers = {};\n }\n // Since gRPC expects each header to be an array,\n // we are doing the same for fallback here.\n for (const key in headers) {\n metadata[key] = Array.isArray(headers[key])\n ? headers[key]\n : [headers[key]];\n }\n // gRPC-fallback request must have 'grpc-web/' in 'x-goog-api-client'\n const clientVersions = [];\n if (metadata[CLIENT_VERSION_HEADER] &&\n metadata[CLIENT_VERSION_HEADER][0]) {\n clientVersions.push(...metadata[CLIENT_VERSION_HEADER][0].split(' '));\n }\n clientVersions.push(`grpc-web/${exports.version}`);\n metadata[CLIENT_VERSION_HEADER] = [clientVersions.join(' ')];\n if (!moreHeaders) {\n return metadata;\n }\n for (const key in moreHeaders) {\n if (key.toLowerCase() !== CLIENT_VERSION_HEADER) {\n const value = moreHeaders[key];\n if (Array.isArray(value)) {\n if (metadata[key] === undefined) {\n metadata[key] = value;\n }\n else {\n if (Array.isArray(metadata[key])) {\n metadata[key].push(...value);\n }\n else {\n throw new Error(`Can not add value ${value} to the call metadata.`);\n }\n }\n }\n else {\n metadata[key] = [value];\n }\n }\n }\n return metadata;\n }\n return gax.constructSettings(serviceName, clientConfig, configOverrides, status_1.Status, { metadataBuilder: buildMetadata });\n }\n /**\n * gRPC-fallback version of createStub\n * Creates a gRPC-fallback stub with authentication headers built from supplied `AuthClient` instance\n *\n * @param {function} CreateStub - The constructor function of the stub.\n * @param {Object} service - A protobufjs Service object (as returned by lookupService)\n * @param {Object} opts - Connection options, as described below.\n * @param {string} opts.servicePath - The hostname of the API endpoint service.\n * @param {number} opts.port - The port of the service.\n * @return {Promise} A promise which resolves to a gRPC-fallback service stub, which is a protobuf.js service stub instance modified to match the gRPC stub API\n */\n async createStub(service, opts, \n // For consistency with createStub in grpc.ts, customServicePath is defined:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n customServicePath) {\n if (!this.authClient) {\n if (this.auth && 'getClient' in this.auth) {\n this.authClient = await this.auth.getClient();\n }\n else if (this.auth && 'getRequestHeaders' in this.auth) {\n this.authClient = this.auth;\n }\n }\n if (!this.authClient) {\n throw new Error('No authentication was provided');\n }\n if (!opts.universeDomain) {\n opts.universeDomain = 'googleapis.com';\n }\n if (opts.universeDomain) {\n const universeFromAuth = this.authClient.universeDomain;\n if (universeFromAuth && opts.universeDomain !== universeFromAuth) {\n throw new Error(`The configured universe domain (${opts.universeDomain}) does not match the universe domain found in the credentials (${universeFromAuth}). ` +\n \"If you haven't configured the universe domain explicitly, googleapis.com is the default.\");\n }\n }\n service.resolveAll();\n const methods = GrpcClient.getServiceMethods(service);\n const protocol = opts.protocol || 'https';\n let servicePath = opts.servicePath;\n if (!servicePath &&\n service.options &&\n service.options['(google.api.default_host)']) {\n servicePath = service.options['(google.api.default_host)'];\n }\n if (!servicePath) {\n throw new Error(`Cannot determine service API path for service ${service.name}.`);\n }\n let servicePort;\n const match = servicePath.match(/^(.*):(\\d+)$/);\n if (match) {\n servicePath = match[1];\n servicePort = parseInt(match[2]);\n }\n if (opts.port) {\n servicePort = opts.port;\n }\n else if (!servicePort) {\n servicePort = 443;\n }\n const encoder = fallbackRest.encodeRequest;\n const decoder = fallbackRest.decodeResponse;\n const serviceStub = (0, fallbackServiceStub_1.generateServiceStub)(methods, protocol, servicePath, servicePort, this.auth || this.authClient, encoder, decoder, this.numericEnums, this.minifyJson);\n return serviceStub;\n }\n /**\n * Creates a 'bytelength' function for a given proto message class.\n *\n * See {@link BundleDescriptor} about the meaning of the return value.\n *\n * @param {function} message - a constructor function that is generated by\n * protobuf.js. Assumes 'encoder' field in the message.\n * @return {function(Object):number} - a function to compute the byte length\n * for an object.\n */\n static createByteLengthFunction(message) {\n return gax.createByteLengthFunction(message);\n }\n}\nexports.GrpcClient = GrpcClient;\n/**\n * gRPC-fallback version of lro\n *\n * @param {Object=} options.auth - An instance of google-auth-library.\n * @return {Object} A OperationsClientBuilder that will return a OperationsClient\n */\nfunction lro(options) {\n options = Object.assign({ scopes: [] }, options);\n if (options.protoJson) {\n options = Object.assign(options, { fallback: true });\n }\n const gaxGrpc = new GrpcClient(options);\n return new operationsClient_1.OperationsClientBuilder(gaxGrpc, options.protoJson);\n}\n/**\n * gRPC-fallback version of createApiCall\n *\n * Converts an rpc call into an API call governed by the settings.\n *\n * In typical usage, `func` will be a promise to a callable used to make an rpc\n * request. This will mostly likely be a bound method from a request stub used\n * to make an rpc call. It is not a direct function but a Promise instance,\n * because of its asynchronism (typically, obtaining the auth information).\n *\n * The result is a function which manages the API call with the given settings\n * and the options on the invocation.\n *\n * Throws exception on unsupported streaming calls\n *\n * @param {Promise|GRPCCall} func - is either a promise to be used to make\n * a bare RPC call, or just a bare RPC call.\n * @param {CallSettings} settings - provides the settings for this call\n * @param {Descriptor} descriptor - optionally specify the descriptor for\n * the method call.\n * @return {GaxCall} func - a bound method on a request stub used\n * to make an rpc call.\n */\nfunction createApiCall(func, settings, descriptor, \n// eslint-disable-next-line @typescript-eslint/no-unused-vars\n_fallback) {\n if (descriptor &&\n 'streaming' in descriptor &&\n descriptor.type !== streaming_1.StreamType.SERVER_STREAMING) {\n return () => {\n throw new Error('The REST transport currently does not support client-streaming or bidi-stream calls.');\n };\n }\n if (descriptor && 'streaming' in descriptor && !(0, featureDetection_1.isNodeJS)()) {\n // TODO: with `fetch` this functionality is available in the browser...\n return () => {\n throw new Error('Server streaming over the REST transport is only supported in Node.js.');\n };\n }\n return (0, createApiCall_1.createApiCall)(func, settings, descriptor);\n}\nexports.protobufMinimal = __importStar(require(\"protobufjs/minimal\"));\nvar warnings_1 = require(\"./warnings\");\nObject.defineProperty(exports, \"warn\", { enumerable: true, get: function () { return warnings_1.warn; } });\nvar longrunning_1 = require(\"./longRunningCalls/longrunning\");\nObject.defineProperty(exports, \"Operation\", { enumerable: true, get: function () { return longrunning_1.Operation; } });\nObject.defineProperty(exports, \"operation\", { enumerable: true, get: function () { return longrunning_1.operation; } });\nvar googleError_1 = require(\"./googleError\");\nObject.defineProperty(exports, \"GoogleError\", { enumerable: true, get: function () { return googleError_1.GoogleError; } });\n// Different environments or bundlers may or may not respect \"browser\" field\n// in package.json (e.g. Electron does not respect it, but if you run the code\n// through webpack first, it will follow the \"browser\" field).\n// To make it safer and more compatible, let's make sure that if you do\n// const gax = require(\"google-gax\");\n// you can always ask for gax.fallback, regardless of \"browser\" field being\n// understood or not.\nconst fallback = module.exports;\nexports.fallback = fallback;\n//# sourceMappingURL=fallback.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GoogleErrorDecoder = exports.GoogleError = void 0;\nconst status_1 = require(\"./status\");\nconst protobuf = __importStar(require(\"protobufjs\"));\nconst serializer = __importStar(require(\"proto3-json-serializer\"));\nconst fallback_1 = require(\"./fallback\");\nclass GoogleError extends Error {\n code;\n note;\n metadata;\n statusDetails;\n reason;\n domain;\n errorInfoMetadata;\n // Parse details field in google.rpc.status wire over gRPC medatadata.\n // Promote google.rpc.ErrorInfo if exist.\n static parseGRPCStatusDetails(err) {\n const decoder = new GoogleErrorDecoder();\n try {\n if (err.metadata && err.metadata.get('grpc-status-details-bin')) {\n const statusDetailsObj = decoder.decodeGRPCStatusDetails(err.metadata.get('grpc-status-details-bin'));\n if (statusDetailsObj &&\n statusDetailsObj.details &&\n statusDetailsObj.details.length > 0) {\n err.statusDetails = statusDetailsObj.details;\n }\n if (statusDetailsObj && statusDetailsObj.errorInfo) {\n err.reason = statusDetailsObj.errorInfo.reason;\n err.domain = statusDetailsObj.errorInfo.domain;\n err.errorInfoMetadata = statusDetailsObj.errorInfo.metadata;\n }\n }\n }\n catch (decodeErr) {\n // ignoring the error\n }\n return err;\n }\n // Parse http JSON error and promote google.rpc.ErrorInfo if exist.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static parseHttpError(json) {\n if (Array.isArray(json)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n json = json.find((obj) => {\n return 'error' in obj;\n });\n }\n // fallback logic.\n // related issue: https://github.com/googleapis/gax-nodejs/issues/1303\n // google error mapping: https://cloud.google.com/apis/design/errors\n // if input json doesn't have 'error' fields, wrap the whole object with 'error' field\n if (!json['error']) {\n json['error'] = {};\n Object.keys(json)\n .filter(key => key !== 'error')\n .forEach(key => {\n json['error'][key] = json[key];\n delete json[key];\n });\n }\n const decoder = new GoogleErrorDecoder();\n const proto3Error = decoder.decodeHTTPError(json['error']);\n const error = Object.assign(new GoogleError(json['error']['message']), proto3Error);\n // Get gRPC Status Code\n if (json['error']['status'] &&\n status_1.Status[json['error']['status']]) {\n error.code = status_1.Status[json['error']['status']];\n }\n else if (json['error']['code']) {\n // Map Http Status Code to gRPC Status Code\n error.code = (0, status_1.rpcCodeFromHttpStatusCode)(json['error']['code']);\n }\n else {\n // If error code is absent, proto3 message default value is 0. We should\n // keep error code as undefined.\n delete error.code;\n }\n // Keep consistency with gRPC statusDetails fields. gRPC details has been occupied before.\n // Rename \"details\" to \"statusDetails\".\n if (error.details) {\n try {\n const statusDetailsObj = decoder.decodeHttpStatusDetails(error.details);\n if (statusDetailsObj &&\n statusDetailsObj.details &&\n statusDetailsObj.details.length > 0) {\n error.statusDetails = statusDetailsObj.details;\n }\n if (statusDetailsObj && statusDetailsObj.errorInfo) {\n error.reason = statusDetailsObj.errorInfo.reason;\n error.domain = statusDetailsObj.errorInfo.domain;\n // error.metadata has been occupied for gRPC metadata, so we use\n // errorInfoMetadata to represent ErrorInfo' metadata field. Keep\n // consistency with gRPC ErrorInfo metadata field name.\n error.errorInfoMetadata = statusDetailsObj.errorInfo.metadata;\n }\n }\n catch (decodeErr) {\n // ignoring the error\n }\n }\n return error;\n }\n}\nexports.GoogleError = GoogleError;\nclass GoogleErrorDecoder {\n root;\n anyType;\n statusType;\n constructor() {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const errorProtoJson = require('../../build/protos/status.json');\n this.root = protobuf.Root.fromJSON(errorProtoJson);\n this.anyType = this.root.lookupType('google.protobuf.Any');\n this.statusType = this.root.lookupType('google.rpc.Status');\n }\n decodeProtobufAny(anyValue) {\n const match = anyValue.type_url.match(/^type.googleapis.com\\/(.*)/);\n if (!match) {\n throw new Error(`Unknown type encoded in google.protobuf.any: ${anyValue.type_url}`);\n }\n const typeName = match[1];\n const type = this.root.lookupType(typeName);\n if (!type) {\n throw new Error(`Cannot lookup type ${typeName}`);\n }\n return type.decode(anyValue.value);\n }\n // Decodes gRPC-fallback error which is an instance of google.rpc.Status.\n decodeRpcStatus(buffer) {\n const uint8array = new Uint8Array(buffer);\n const status = this.statusType.decode(uint8array);\n // google.rpc.Status contains an array of google.protobuf.Any\n // which need a special treatment\n const details = [];\n let errorInfo;\n for (const detail of status.details) {\n try {\n const decodedDetail = this.decodeProtobufAny(detail);\n details.push(decodedDetail);\n if (detail.type_url === 'type.googleapis.com/google.rpc.ErrorInfo') {\n errorInfo = decodedDetail;\n }\n }\n catch (err) {\n // cannot decode detail, likely because of the unknown type - just skip it\n }\n }\n const result = {\n code: status.code,\n message: status.message,\n statusDetails: details,\n reason: errorInfo?.reason,\n domain: errorInfo?.domain,\n errorInfoMetadata: errorInfo?.metadata,\n };\n return result;\n }\n // Construct an Error from a StatusObject.\n // Adapted from https://github.com/grpc/grpc-node/blob/main/packages/grpc-js/src/call.ts#L79\n callErrorFromStatus(status) {\n status.message = `${status.code} ${status_1.Status[status.code]}: ${status.message}`;\n return Object.assign(new GoogleError(status.message), status);\n }\n // Decodes gRPC-fallback error which is an instance of google.rpc.Status,\n // and puts it into the object similar to gRPC ServiceError object.\n decodeErrorFromBuffer(buffer) {\n return this.callErrorFromStatus(this.decodeRpcStatus(buffer));\n }\n // Decodes gRPC metadata error details which is an instance of google.rpc.Status.\n decodeGRPCStatusDetails(bufferArr) {\n const details = [];\n let errorInfo;\n bufferArr.forEach(buffer => {\n const uint8array = new Uint8Array(buffer);\n const rpcStatus = this.statusType.decode(uint8array);\n for (const detail of rpcStatus.details) {\n try {\n const decodedDetail = this.decodeProtobufAny(detail);\n details.push(decodedDetail);\n if (detail.type_url === 'type.googleapis.com/google.rpc.ErrorInfo') {\n errorInfo = decodedDetail;\n }\n }\n catch (err) {\n // cannot decode detail, likely because of the unknown type - just skip it\n }\n }\n });\n const result = {\n details,\n errorInfo,\n };\n return result;\n }\n // Decodes http error which is an instance of google.rpc.Status.\n decodeHTTPError(json) {\n const errorMessage = serializer.fromProto3JSON(this.statusType, json);\n if (!errorMessage) {\n throw new Error(`Received error message ${json}, but failed to serialize as proto3 message`);\n }\n return this.statusType.toObject(errorMessage, fallback_1.defaultToObjectOptions);\n }\n // Decodes http error details which is an instance of Array.\n decodeHttpStatusDetails(rawDetails) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const details = [];\n let errorInfo;\n for (const detail of rawDetails) {\n try {\n const decodedDetail = this.decodeProtobufAny(detail);\n details.push(decodedDetail);\n if (detail.type_url === 'type.googleapis.com/google.rpc.ErrorInfo') {\n errorInfo = decodedDetail;\n }\n }\n catch (err) {\n // cannot decode detail, likely because of the unknown type - just skip it\n }\n }\n return { details, errorInfo };\n }\n}\nexports.GoogleErrorDecoder = GoogleErrorDecoder;\n//# sourceMappingURL=googleError.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OngoingCallPromise = exports.OngoingCall = void 0;\nconst status_1 = require(\"./status\");\nconst googleError_1 = require(\"./googleError\");\nclass OngoingCall {\n callback;\n cancelFunc;\n completed;\n /**\n * OngoingCall manages callback, API calls, and cancellation\n * of the API calls.\n * @param {APICallback=} callback\n * The callback to be called asynchronously when the API call\n * finishes.\n * @constructor\n * @property {APICallback} callback\n * The callback function to be called.\n * @private\n */\n constructor(callback) {\n this.callback = callback;\n this.completed = false;\n }\n /**\n * Cancels the ongoing promise.\n */\n cancel() {\n if (this.completed) {\n return;\n }\n this.completed = true;\n if (this.cancelFunc) {\n this.cancelFunc();\n }\n else {\n const error = new googleError_1.GoogleError('cancelled');\n error.code = status_1.Status.CANCELLED;\n this.callback(error);\n }\n }\n /**\n * Call calls the specified function. Result will be used to fulfill\n * the promise.\n *\n * @param {SimpleCallbackFunction} func\n * A function for an API call.\n * @param {Object} argument\n * A request object.\n */\n call(func, argument) {\n if (this.completed) {\n return;\n }\n const canceller = func(argument, (err, response, next, rawResponse) => {\n this.completed = true;\n setImmediate(this.callback, err, response, next, rawResponse);\n });\n if (canceller instanceof Promise) {\n canceller.catch(err => {\n setImmediate(this.callback, new googleError_1.GoogleError(err), null, null, null);\n });\n }\n this.cancelFunc = () => canceller.cancel();\n }\n}\nexports.OngoingCall = OngoingCall;\nclass OngoingCallPromise extends OngoingCall {\n promise;\n /**\n * GaxPromise is GRPCCallbackWrapper, but it holds a promise when\n * the API call finishes.\n * @constructor\n * @private\n */\n constructor() {\n let resolveCallback;\n let rejectCallback;\n const callback = (err, response, next, rawResponse) => {\n if (err) {\n // If gRPC metadata exist, parsed google.rpc.status details.\n if (err.metadata) {\n rejectCallback(googleError_1.GoogleError.parseGRPCStatusDetails(err));\n }\n else {\n rejectCallback(err);\n }\n }\n else if (response !== undefined) {\n resolveCallback([response, next || null, rawResponse || null]);\n }\n else {\n throw new googleError_1.GoogleError('Neither error nor response are defined');\n }\n };\n const promise = new Promise((resolve, reject) => {\n resolveCallback = resolve;\n rejectCallback = reject;\n });\n super(callback);\n this.promise = promise;\n this.promise.cancel = () => {\n this.cancel();\n };\n }\n}\nexports.OngoingCallPromise = OngoingCallPromise;\n//# sourceMappingURL=call.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NormalApiCaller = void 0;\nconst call_1 = require(\"../call\");\n/**\n * Creates an API caller for regular unary methods.\n */\nclass NormalApiCaller {\n init(callback) {\n if (callback) {\n return new call_1.OngoingCall(callback);\n }\n return new call_1.OngoingCallPromise();\n }\n wrap(func) {\n return func;\n }\n call(apiCall, argument, settings, canceller) {\n canceller.call(apiCall, argument);\n }\n fail(canceller, err) {\n canceller.callback(err);\n }\n result(canceller) {\n return canceller.promise;\n }\n}\nexports.NormalApiCaller = NormalApiCaller;\n//# sourceMappingURL=normalApiCaller.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createAPICaller = createAPICaller;\nconst normalApiCaller_1 = require(\"./normalCalls/normalApiCaller\");\nfunction createAPICaller(settings, descriptor) {\n if (!descriptor) {\n return new normalApiCaller_1.NormalApiCaller();\n }\n return descriptor.getApiCaller(settings);\n}\n//# sourceMappingURL=apiCaller.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.addTimeoutArg = addTimeoutArg;\n/**\n * Updates func so that it gets called with the timeout as its final arg.\n *\n * This converts a function, func, into another function with updated deadline.\n *\n * @private\n *\n * @param {GRPCCall} func - a function to be updated.\n * @param {number} timeout - to be added to the original function as it final\n * positional arg.\n * @param {Object} otherArgs - the additional arguments to be passed to func.\n * @param {Object=} abTests - the A/B testing key/value pairs.\n * @return {function(Object, APICallback)}\n * the function with other arguments and the timeout.\n */\nfunction addTimeoutArg(func, timeout, otherArgs, abTests) {\n // TODO: this assumes the other arguments consist of metadata and options,\n // which is specific to gRPC calls. Remove the hidden dependency on gRPC.\n return (argument, callback) => {\n const now = new Date();\n const options = otherArgs.options || {};\n options.deadline = new Date(now.getTime() + timeout);\n const metadata = otherArgs.metadataBuilder\n ? otherArgs.metadataBuilder(abTests, otherArgs.headers || {})\n : null;\n return func(argument, metadata, options, callback);\n };\n}\n//# sourceMappingURL=timeout.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.retryable = retryable;\nconst status_1 = require(\"../status\");\nconst googleError_1 = require(\"../googleError\");\nconst timeout_1 = require(\"./timeout\");\n/**\n * Creates a function equivalent to func, but that retries on certain\n * exceptions.\n *\n * @private\n *\n * @param {GRPCCall} func - A function.\n * @param {RetryOptions} retry - Configures the exceptions upon which the\n * function eshould retry, and the parameters to the exponential backoff retry\n * algorithm.\n * @param {GRPCCallOtherArgs} otherArgs - the additional arguments to be passed to func.\n * @return {SimpleCallbackFunction} A function that will retry.\n */\nfunction retryable(func, retry, otherArgs, apiName) {\n const delayMult = retry.backoffSettings.retryDelayMultiplier;\n const maxDelay = retry.backoffSettings.maxRetryDelayMillis;\n const timeoutMult = retry.backoffSettings.rpcTimeoutMultiplier;\n const maxTimeout = retry.backoffSettings.maxRpcTimeoutMillis;\n let delay = retry.backoffSettings.initialRetryDelayMillis;\n let timeout = retry.backoffSettings.initialRpcTimeoutMillis;\n /**\n * Equivalent to ``func``, but retries upon transient failure.\n *\n * Retrying is done through an exponential backoff algorithm configured\n * by the options in ``retry``.\n * @param {RequestType} argument The request object.\n * @param {APICallback} callback The callback.\n * @return {GRPCCall}\n */\n return (argument, callback) => {\n let canceller;\n let timeoutId;\n let now = new Date();\n let deadline;\n if (retry.backoffSettings.totalTimeoutMillis) {\n deadline = now.getTime() + retry.backoffSettings.totalTimeoutMillis;\n }\n let retries = 0;\n const maxRetries = retry.backoffSettings.maxRetries;\n // TODO: define A/B testing values for retry behaviors.\n /** Repeat the API call as long as necessary. */\n function repeat(err) {\n timeoutId = null;\n if (deadline && now.getTime() >= deadline) {\n const error = new googleError_1.GoogleError(`Total timeout of API ${apiName} exceeded ${retry.backoffSettings.totalTimeoutMillis} milliseconds ${err ? `retrying error ${err} ` : ''} before any response was received.`);\n error.code = status_1.Status.DEADLINE_EXCEEDED;\n callback(error);\n return;\n }\n if (retries && retries >= maxRetries) {\n const error = new googleError_1.GoogleError('Exceeded maximum number of retries ' +\n (err ? `retrying error ${err} ` : '') +\n 'before any response was received');\n error.code = status_1.Status.DEADLINE_EXCEEDED;\n callback(error);\n return;\n }\n retries++;\n let lastError = err;\n const toCall = (0, timeout_1.addTimeoutArg)(func, timeout, otherArgs);\n canceller = toCall(argument, (err, response, next, rawResponse) => {\n // Save only the error before deadline exceeded\n if (err && err.code !== 4) {\n lastError = err;\n }\n if (!err) {\n callback(null, response, next, rawResponse);\n return;\n }\n canceller = null;\n if (retry.retryCodes.length > 0 &&\n retry.retryCodes.indexOf(err.code) < 0) {\n err.note =\n 'Exception occurred in retry method that was ' +\n 'not classified as transient';\n callback(err);\n }\n else {\n const toSleep = Math.random() * delay;\n timeoutId = setTimeout(() => {\n now = new Date();\n delay = Math.min(delay * delayMult, maxDelay);\n const timeoutCal = timeout && timeoutMult ? timeout * timeoutMult : 0;\n const rpcTimeout = maxTimeout ? maxTimeout : 0;\n const newDeadline = deadline ? deadline - now.getTime() : 0;\n timeout = Math.min(timeoutCal, rpcTimeout, newDeadline);\n repeat(lastError);\n }, toSleep);\n }\n });\n if (canceller instanceof Promise) {\n canceller.catch(err => {\n callback(new googleError_1.GoogleError(err));\n });\n }\n }\n if (maxRetries && deadline) {\n const error = new googleError_1.GoogleError('Cannot set both totalTimeoutMillis and maxRetries ' +\n 'in backoffSettings.');\n error.code = status_1.Status.INVALID_ARGUMENT;\n callback(error);\n }\n else {\n repeat();\n }\n return {\n cancel() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (canceller) {\n canceller.cancel();\n }\n else {\n const error = new googleError_1.GoogleError('cancelled');\n error.code = status_1.Status.CANCELLED;\n callback(error);\n }\n },\n };\n };\n}\n//# sourceMappingURL=retries.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createApiCall = createApiCall;\n/**\n * Provides function wrappers that implement page streaming and retrying.\n */\nconst apiCaller_1 = require(\"./apiCaller\");\nconst gax_1 = require(\"./gax\");\nconst retries_1 = require(\"./normalCalls/retries\");\nconst timeout_1 = require(\"./normalCalls/timeout\");\nconst streamingApiCaller_1 = require(\"./streamingCalls/streamingApiCaller\");\nconst warnings_1 = require(\"./warnings\");\n/**\n * Converts an rpc call into an API call governed by the settings.\n *\n * In typical usage, `func` will be a promise to a callable used to make an rpc\n * request. This will mostly likely be a bound method from a request stub used\n * to make an rpc call. It is not a direct function but a Promise instance,\n * because of its asynchronism (typically, obtaining the auth information).\n *\n * The result is a function which manages the API call with the given settings\n * and the options on the invocation.\n *\n * @param {Promise|GRPCCall} func - is either a promise to be used to make\n * a bare RPC call, or just a bare RPC call.\n * @param {CallSettings} settings - provides the settings for this call\n * @param {Descriptor} descriptor - optionally specify the descriptor for\n * the method call.\n * @return {GaxCall} func - a bound method on a request stub used\n * to make an rpc call.\n */\nfunction createApiCall(func, settings, descriptor, \n// eslint-disable-next-line @typescript-eslint/no-unused-vars\n_fallback) {\n // we want to be able to accept both promise resolving to a function and a\n // function. Currently client librares are only calling this method with a\n // promise, but it will change.\n const funcPromise = typeof func === 'function' ? Promise.resolve(func) : func;\n // the following apiCaller will be used for all calls of this function...\n const apiCaller = (0, apiCaller_1.createAPICaller)(settings, descriptor);\n return (request, callOptions, callback) => {\n let currentApiCaller = apiCaller;\n let thisSettings;\n if (currentApiCaller instanceof streamingApiCaller_1.StreamingApiCaller) {\n const gaxStreamingRetries = currentApiCaller.descriptor?.gaxStreamingRetries ?? false;\n // If Gax streaming retries are enabled, check settings passed at call time and convert parameters if needed\n const convertedRetryOptions = (0, gax_1.convertRetryOptions)(callOptions, gaxStreamingRetries);\n thisSettings = settings.merge(convertedRetryOptions);\n }\n else {\n thisSettings = settings.merge(callOptions);\n }\n // special case: if bundling is disabled for this one call,\n // use default API caller instead\n if (settings.isBundling && !thisSettings.isBundling) {\n currentApiCaller = (0, apiCaller_1.createAPICaller)(settings, undefined);\n }\n const ongoingCall = currentApiCaller.init(callback);\n funcPromise\n .then((func) => {\n // Initially, the function is just what gRPC server stub contains.\n func = currentApiCaller.wrap(func);\n const streaming = currentApiCaller.descriptor\n ?.streaming;\n const retry = thisSettings.retry;\n if (streaming && retry) {\n if (retry.retryCodes.length > 0 && retry.shouldRetryFn) {\n (0, warnings_1.warn)('either_retrycodes_or_shouldretryfn', 'Only one of retryCodes or shouldRetryFn may be defined. Ignoring retryCodes.');\n retry.retryCodes = [];\n }\n if (!currentApiCaller.descriptor\n .gaxStreamingRetries &&\n retry.getResumptionRequestFn) {\n throw new Error('getResumptionRequestFn can only be used when gaxStreamingRetries is set to true.');\n }\n }\n if (!streaming && retry) {\n if (retry.shouldRetryFn) {\n throw new Error('Using a function to determine retry eligibility is only supported with server streaming calls');\n }\n if (retry.getResumptionRequestFn) {\n throw new Error('Resumption strategy can only be used with server streaming retries');\n }\n if (retry.retryCodes && retry.retryCodes.length > 0) {\n retry.backoffSettings.initialRpcTimeoutMillis ??=\n thisSettings.timeout;\n return (0, retries_1.retryable)(func, thisSettings.retry, thisSettings.otherArgs, thisSettings.apiName);\n }\n }\n return (0, timeout_1.addTimeoutArg)(func, thisSettings.timeout, thisSettings.otherArgs);\n })\n .then((apiCall) => {\n // After adding retries / timeouts, the call function becomes simpler:\n // it only accepts request and callback.\n currentApiCaller.call(apiCall, request, thisSettings, ongoingCall);\n })\n .catch(err => {\n currentApiCaller.fail(ongoingCall, err);\n });\n // Calls normally return a \"cancellable promise\" that can be used to `await` for the actual result,\n // or to cancel the ongoing call.\n return currentApiCaller.result(ongoingCall);\n };\n}\n//# sourceMappingURL=createApiCall.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OperationsClientBuilder = exports.OperationsClient = exports.ALL_SCOPES = exports.SERVICE_ADDRESS = void 0;\nconst createApiCall_1 = require(\"./createApiCall\");\nconst descriptor_1 = require(\"./descriptor\");\nconst gax = __importStar(require(\"./gax\"));\nconst configData = require(\"./operations_client_config.json\");\nconst operationProtoJson = require(\"../protos/operations.json\");\nconst transcoding_1 = require(\"./transcoding\");\nexports.SERVICE_ADDRESS = 'longrunning.googleapis.com';\nconst version = require('../../package.json').version;\nconst DEFAULT_SERVICE_PORT = 443;\nconst CODE_GEN_NAME_VERSION = 'gapic/0.7.1';\n/**\n * The scopes needed to make gRPC calls to all of the methods defined in\n * this service.\n */\nexports.ALL_SCOPES = [];\n/**\n * Manages long-running operations with an API service.\n *\n * When an API method normally takes long time to complete, it can be designed\n * to return {@link Operation} to the client, and the client can use this\n * interface to receive the real response asynchronously by polling the\n * operation resource, or pass the operation resource to another API (such as\n * Google Cloud Pub/Sub API) to receive the response. Any API service that\n * returns long-running operations should implement the `Operations` interface\n * so developers can have a consistent client experience.\n *\n * This will be created through a builder function which can be obtained by the\n * module. See the following example of how to initialize the module and how to\n * access to the builder.\n * @see {@link operationsClient}\n *\n * @class\n */\nclass OperationsClient {\n auth;\n innerApiCalls;\n descriptor;\n operationsStub;\n constructor(gaxGrpc, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n operationsProtos, options) {\n const opts = Object.assign({\n servicePath: exports.SERVICE_ADDRESS,\n port: DEFAULT_SERVICE_PORT,\n clientConfig: {},\n }, options);\n const googleApiClient = ['gl-node/' + process.versions.node];\n if (opts.libName && opts.libVersion) {\n googleApiClient.push(opts.libName + '/' + opts.libVersion);\n }\n googleApiClient.push(CODE_GEN_NAME_VERSION, 'gax/' + version);\n if (opts.fallback) {\n googleApiClient.push('gl-web/' + version);\n }\n else {\n googleApiClient.push('grpc/' + gaxGrpc.grpcVersion);\n }\n const defaults = gaxGrpc.constructSettings('google.longrunning.Operations', configData, opts.clientConfig || {}, { 'x-goog-api-client': googleApiClient.join(' ') });\n this.auth = gaxGrpc.auth;\n // Set up a dictionary of \"inner API calls\"; the core implementation\n // of calling the API is handled in `google-gax`, with this code\n // merely providing the destination and request information.\n this.innerApiCalls = {};\n this.descriptor = {\n listOperations: new descriptor_1.PageDescriptor('pageToken', 'nextPageToken', 'operations'),\n };\n // Put together the \"service stub\" for\n // google.longrunning.Operations.\n this.operationsStub = gaxGrpc.createStub(opts.fallback\n ? operationsProtos.lookupService('google.longrunning.Operations')\n : operationsProtos.google.longrunning.Operations, opts);\n const operationsStubMethods = [\n 'getOperation',\n 'listOperations',\n 'cancelOperation',\n 'deleteOperation',\n ];\n for (const methodName of operationsStubMethods) {\n const innerCallPromise = this.operationsStub.then(stub => (...args) => {\n const func = stub[methodName];\n return func.apply(stub, args);\n }, err => () => {\n throw err;\n });\n this.innerApiCalls[methodName] = (0, createApiCall_1.createApiCall)(innerCallPromise, defaults[methodName], this.descriptor[methodName]);\n }\n }\n /** Closes this operations client. */\n close() {\n this.operationsStub.then(stub => stub.close()).catch(console.error);\n }\n getProjectId(callback) {\n if (this.auth && 'getProjectId' in this.auth) {\n return this.auth.getProjectId(callback);\n }\n if (callback) {\n callback(new Error('Cannot determine project ID.'));\n }\n else {\n return Promise.reject('Cannot determine project ID.');\n }\n }\n // Service calls\n getOperationInternal(request, options, callback) {\n request = request || {};\n options = options || {};\n return this.innerApiCalls.getOperation(request, options, callback);\n }\n /**\n * Gets the latest state of a long-running operation. Clients can use this\n * method to poll the operation result at intervals as recommended by the API\n * service.\n *\n * @param {Object} request - The request object that will be sent.\n * @param {string} request.name - The name of the operation resource.\n * @param {Object=} options\n * Optional parameters. You can override the default settings for this call,\n * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link\n * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the\n * details.\n * @param {function(?Error, ?Object)=} callback\n * The function which will be called with the result of the API call.\n *\n * The second parameter to the callback is an object representing\n * [google.longrunning.Operation]{@link\n * external:\"google.longrunning.Operation\"}.\n * @return {Promise} - The promise which resolves to an array.\n * The first element of the array is an object representing\n * [google.longrunning.Operation]{@link\n * external:\"google.longrunning.Operation\"}. The promise has a method named\n * \"cancel\" which cancels the ongoing API call.\n *\n * @example\n *\n * const client = longrunning.operationsClient();\n * const name = '';\n * const [response] = await client.getOperation({name});\n * // doThingsWith(response)\n */\n getOperation(request, optionsOrCallback, callback) {\n let options;\n if (optionsOrCallback instanceof Function && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n request = request || {};\n options = options || {};\n return this.innerApiCalls.getOperation(request, options, callback);\n }\n /**\n * Lists operations that match the specified filter in the request. If the\n * server doesn't support this method, it returns `UNIMPLEMENTED`.\n *\n * NOTE: the `name` binding below allows API services to override the binding\n * to use different resource name schemes.\n *\n * @param {Object} request - The request object that will be sent.\n * @param {string} request.name - The name of the operation collection.\n * @param {string} request.filter - The standard list filter.\n * @param {number=} request.pageSize\n * The maximum number of resources contained in the underlying API\n * response. If page streaming is performed per-resource, this\n * parameter does not affect the return value. If page streaming is\n * performed per-page, this determines the maximum number of\n * resources in a page.\n * @param {Object=} options\n * Optional parameters. You can override the default settings for this call,\n * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link\n * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the\n * details.\n * @param {function(?Error, ?Array, ?Object, ?Object)=} callback\n * The function which will be called with the result of the API call.\n *\n * The second parameter to the callback is Array of\n * [google.longrunning.Operation]{@link\n * external:\"google.longrunning.Operation\"}.\n *\n * When autoPaginate: false is specified through options, it contains the\n * result in a single response. If the response indicates the next page\n * exists, the third parameter is set to be used for the next request object.\n * The fourth parameter keeps the raw response object of an object\n * representing [google.longrunning.ListOperationsResponse]{@link\n * external:\"google.longrunning.ListOperationsResponse\"}.\n * @return {Promise} - The promise which resolves to an array.\n * The first element of the array is Array of\n * [google.longrunning.Operation]{@link\n * external:\"google.longrunning.Operation\"}.\n *\n * When autoPaginate: false is specified through options, the array has\n * three elements. The first element is Array of\n * [google.longrunning.Operation]{@link\n * external:\"google.longrunning.Operation\"} in a single response. The second\n * element is the next request object if the response indicates the next page\n * exists, or null. The third element is an object representing\n * [google.longrunning.ListOperationsResponse]{@link\n * external:\"google.longrunning.ListOperationsResponse\"}.\n *\n * The promise has a method named \"cancel\" which cancels the ongoing API\n * call.\n *\n * @example\n *\n * const client = longrunning.operationsClient();\n * const request = {\n * name: '',\n * filter: ''\n * };\n * // Iterate over all elements.\n * const [resources] = await client.listOperations(request);\n * for (const resource of resources) {\n * console.log(resources);\n * }\n *\n * // Or obtain the paged response.\n * const options = {autoPaginate: false};\n * let nextRequest = request;\n * while(nextRequest) {\n * const response = await client.listOperations(nextRequest, options);\n * const resources = response[0];\n * nextRequest = response[1];\n * const rawResponse = response[2];\n * for (const resource of resources) {\n * // doThingsWith(resource);\n * }\n * };\n */\n listOperations(request, optionsOrCallback, callback) {\n let options;\n if (optionsOrCallback instanceof Function && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n request = request || {};\n options = options || {};\n return this.innerApiCalls.listOperations(request, options, callback);\n }\n /**\n * Equivalent to {@link listOperations}, but returns a NodeJS Stream object.\n *\n * This fetches the paged responses for {@link listOperations} continuously\n * and invokes the callback registered for 'data' event for each element in\n * the responses.\n *\n * The returned object has 'end' method when no more elements are required.\n *\n * autoPaginate option will be ignored.\n *\n * @see {@link https://nodejs.org/api/stream.html}\n *\n * @param {Object} request - The request object that will be sent.\n * @param {string} request.name - The name of the operation collection.\n * @param {string} request.filter - The standard list filter.\n * @param {number=} request.pageSize -\n * The maximum number of resources contained in the underlying API\n * response. If page streaming is performed per-resource, this\n * parameter does not affect the return value. If page streaming is\n * performed per-page, this determines the maximum number of\n * resources in a page.\n * @param {Object=} options\n * Optional parameters. You can override the default settings for this call,\n * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link\n * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the\n * details.\n * @return {Stream} - An object stream which emits an object representing [google.longrunning.Operation]{@link external:\"google.longrunning.Operation\"} on 'data' event.\n *\n * @example\n *\n * const client = longrunning.operationsClient();\n * const request = {\n * name: '',\n * filter: ''\n * };\n * client.listOperationsStream(request)\n * .on('data', element => {\n * // doThingsWith(element)\n * })\n * .on('error', err => {\n * console.error(err);\n * });\n */\n listOperationsStream(request, options) {\n const callSettings = new gax.CallSettings(options);\n return this.descriptor.listOperations.createStream(this.innerApiCalls.listOperations, request, callSettings);\n }\n /**\n * Equivalent to {@link listOperations}, but returns an iterable object.\n *\n * for-await-of syntax is used with the iterable to recursively get response element on-demand.\n *\n * @param {Object} request - The request object that will be sent.\n * @param {string} request.name - The name of the operation collection.\n * @param {string} request.filter - The standard list filter.\n * @param {number=} request.pageSize -\n * The maximum number of resources contained in the underlying API\n * response. If page streaming is performed per-resource, this\n * parameter does not affect the return value. If page streaming is\n * performed per-page, this determines the maximum number of\n * resources in a page.\n * @param {Object=} options\n * Optional parameters. You can override the default settings for this call,\n * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link\n * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the\n * details.\n * @returns {Object}\n * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.\n */\n listOperationsAsync(request, options) {\n request = request || {};\n options = options || {};\n const callSettings = new gax.CallSettings(options);\n return this.descriptor.listOperations.asyncIterate(this.innerApiCalls.listOperations, request, callSettings);\n }\n /**\n * Starts asynchronous cancellation on a long-running operation. The server\n * makes a best effort to cancel the operation, but success is not\n * guaranteed. If the server doesn't support this method, it returns\n * `google.rpc.Code.UNIMPLEMENTED`. Clients can use\n * {@link Operations.GetOperation} or\n * other methods to check whether the cancellation succeeded or whether the\n * operation completed despite cancellation. On successful cancellation,\n * the operation is not deleted; instead, it becomes an operation with\n * an {@link Operation.error} value with a {@link google.rpc.Status.code} of\n * 1, corresponding to `Code.CANCELLED`.\n *\n * @param {Object} request - The request object that will be sent.\n * @param {string} request.name - The name of the operation resource to be cancelled.\n * @param {Object=} options\n * Optional parameters. You can override the default settings for this call,\n * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link\n * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the\n * details.\n * @param {function(?Error)=} callback\n * The function which will be called with the result of the API call.\n * @return {Promise} - The promise which resolves when API call finishes.\n * The promise has a method named \"cancel\" which cancels the ongoing API\n * call.\n *\n * @example\n *\n * const client = longrunning.operationsClient();\n * await client.cancelOperation({name: ''});\n */\n cancelOperation(request, optionsOrCallback, callback) {\n let options;\n if (optionsOrCallback instanceof Function && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n request = request || {};\n options = options || {};\n return this.innerApiCalls.cancelOperation(request, options, callback);\n }\n /**\n * Deletes a long-running operation. This method indicates that the client is\n * no longer interested in the operation result. It does not cancel the\n * operation. If the server doesn't support this method, it returns\n * `google.rpc.Code.UNIMPLEMENTED`.\n *\n * @param {Object} request - The request object that will be sent.\n * @param {string} request.name - The name of the operation resource to be deleted.\n * @param {Object=} options\n * Optional parameters. You can override the default settings for this call,\n * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link\n * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the\n * details.\n * @param {function(?Error)=} callback\n * The function which will be called with the result of the API call.\n * @return {Promise} - The promise which resolves when API call finishes.\n * The promise has a method named \"cancel\" which cancels the ongoing API\n * call.\n *\n * @example\n *\n * const client = longrunning.operationsClient();\n * await client.deleteOperation({name: ''});\n */\n deleteOperation(request, optionsOrCallback, callback) {\n let options;\n if (optionsOrCallback instanceof Function && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n request = request || {};\n options = options || {};\n return this.innerApiCalls.deleteOperation(request, options, callback);\n }\n}\nexports.OperationsClient = OperationsClient;\nclass OperationsClientBuilder {\n operationsClient;\n /**\n * Builds a new Operations Client\n * @param gaxGrpc {GrpcClient}\n */\n constructor(gaxGrpc, protoJson) {\n if (protoJson && gaxGrpc.httpRules) {\n // overwrite the http rules if provide in service yaml.\n (0, transcoding_1.overrideHttpRules)(gaxGrpc.httpRules, protoJson);\n }\n const operationsProtos = protoJson ?? gaxGrpc.loadProtoJSON(operationProtoJson);\n /**\n * Build a new instance of {@link OperationsClient}.\n *\n * @param {Object=} opts - The optional parameters.\n * @param {String=} opts.servicePath - Domain name of the API remote host.\n * @param {number=} opts.port - The port on which to connect to the remote host.\n * @param {grpc.ClientCredentials=} opts.sslCreds - A ClientCredentials for use with an SSL-enabled channel.\n * @param {Object=} opts.clientConfig - The customized config to build the call settings. See {@link gax.constructSettings} for the format.\n */\n this.operationsClient = opts => {\n if (gaxGrpc.fallback) {\n opts.fallback = gaxGrpc.fallback;\n }\n return new OperationsClient(gaxGrpc, operationsProtos, opts);\n };\n Object.assign(this.operationsClient, OperationsClient);\n }\n}\nexports.OperationsClientBuilder = OperationsClientBuilder;\n//# sourceMappingURL=operationsClient.js.map","\"use strict\";\n/**\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.serializer = exports.warn = exports.ChannelCredentials = exports.makeUUID = exports.fallback = exports.protobufMinimal = exports.protobuf = exports.version = exports.createByteLengthFunction = exports.LocationsClient = exports.IamClient = exports.OperationsClient = exports.LocationProtos = exports.IamProtos = exports.operationsProtos = exports.routingHeader = exports.StreamType = exports.Status = exports.PathTemplate = exports.operation = exports.Operation = exports.GrpcClient = exports.GoogleProtoFilesRoot = exports.ClientStub = exports.GoogleError = exports.createMaxRetriesBackoffSettings = exports.createDefaultBackoffSettings = exports.createBackoffSettings = exports.createBundleOptions = exports.createRetryOptions = exports.RetryOptions = exports.constructSettings = exports.CallSettings = exports.StreamDescriptor = exports.PageDescriptor = exports.LongrunningDescriptor = exports.BundleDescriptor = exports.createApiCall = exports.OngoingCall = exports.grpc = exports.loggingUtils = exports.googleAuthLibrary = exports.GoogleAuth = void 0;\nexports.lro = lro;\nconst grpc = __importStar(require(\"@grpc/grpc-js\"));\nexports.grpc = grpc;\nconst grpc_1 = require(\"./grpc\");\nconst IamProtos = __importStar(require(\"../protos/iam_service\"));\nexports.IamProtos = IamProtos;\nconst LocationProtos = __importStar(require(\"../protos/locations\"));\nexports.LocationProtos = LocationProtos;\nconst operationsProtos = __importStar(require(\"../protos/operations\"));\nexports.operationsProtos = operationsProtos;\nconst operationsClient = __importStar(require(\"./operationsClient\"));\nconst routingHeader = __importStar(require(\"./routingHeader\"));\nexports.routingHeader = routingHeader;\nvar google_auth_library_1 = require(\"google-auth-library\");\nObject.defineProperty(exports, \"GoogleAuth\", { enumerable: true, get: function () { return google_auth_library_1.GoogleAuth; } });\nexports.googleAuthLibrary = __importStar(require(\"google-auth-library\"));\nexports.loggingUtils = __importStar(require(\"google-logging-utils\"));\nvar call_1 = require(\"./call\");\nObject.defineProperty(exports, \"OngoingCall\", { enumerable: true, get: function () { return call_1.OngoingCall; } });\nvar createApiCall_1 = require(\"./createApiCall\");\nObject.defineProperty(exports, \"createApiCall\", { enumerable: true, get: function () { return createApiCall_1.createApiCall; } });\nvar descriptor_1 = require(\"./descriptor\");\nObject.defineProperty(exports, \"BundleDescriptor\", { enumerable: true, get: function () { return descriptor_1.BundleDescriptor; } });\nObject.defineProperty(exports, \"LongrunningDescriptor\", { enumerable: true, get: function () { return descriptor_1.LongrunningDescriptor; } });\nObject.defineProperty(exports, \"PageDescriptor\", { enumerable: true, get: function () { return descriptor_1.PageDescriptor; } });\nObject.defineProperty(exports, \"StreamDescriptor\", { enumerable: true, get: function () { return descriptor_1.StreamDescriptor; } });\nvar gax_1 = require(\"./gax\");\nObject.defineProperty(exports, \"CallSettings\", { enumerable: true, get: function () { return gax_1.CallSettings; } });\nObject.defineProperty(exports, \"constructSettings\", { enumerable: true, get: function () { return gax_1.constructSettings; } });\nObject.defineProperty(exports, \"RetryOptions\", { enumerable: true, get: function () { return gax_1.RetryOptions; } });\nObject.defineProperty(exports, \"createRetryOptions\", { enumerable: true, get: function () { return gax_1.createRetryOptions; } });\nObject.defineProperty(exports, \"createBundleOptions\", { enumerable: true, get: function () { return gax_1.createBundleOptions; } });\nObject.defineProperty(exports, \"createBackoffSettings\", { enumerable: true, get: function () { return gax_1.createBackoffSettings; } });\nObject.defineProperty(exports, \"createDefaultBackoffSettings\", { enumerable: true, get: function () { return gax_1.createDefaultBackoffSettings; } });\nObject.defineProperty(exports, \"createMaxRetriesBackoffSettings\", { enumerable: true, get: function () { return gax_1.createMaxRetriesBackoffSettings; } });\nvar googleError_1 = require(\"./googleError\");\nObject.defineProperty(exports, \"GoogleError\", { enumerable: true, get: function () { return googleError_1.GoogleError; } });\nvar grpc_2 = require(\"./grpc\");\nObject.defineProperty(exports, \"ClientStub\", { enumerable: true, get: function () { return grpc_2.ClientStub; } });\nObject.defineProperty(exports, \"GoogleProtoFilesRoot\", { enumerable: true, get: function () { return grpc_2.GoogleProtoFilesRoot; } });\nObject.defineProperty(exports, \"GrpcClient\", { enumerable: true, get: function () { return grpc_2.GrpcClient; } });\nvar longrunning_1 = require(\"./longRunningCalls/longrunning\");\nObject.defineProperty(exports, \"Operation\", { enumerable: true, get: function () { return longrunning_1.Operation; } });\nObject.defineProperty(exports, \"operation\", { enumerable: true, get: function () { return longrunning_1.operation; } });\nvar pathTemplate_1 = require(\"./pathTemplate\");\nObject.defineProperty(exports, \"PathTemplate\", { enumerable: true, get: function () { return pathTemplate_1.PathTemplate; } });\nvar status_1 = require(\"./status\");\nObject.defineProperty(exports, \"Status\", { enumerable: true, get: function () { return status_1.Status; } });\nvar streaming_1 = require(\"./streamingCalls/streaming\");\nObject.defineProperty(exports, \"StreamType\", { enumerable: true, get: function () { return streaming_1.StreamType; } });\nfunction lro(options) {\n options = Object.assign({ scopes: lro.ALL_SCOPES }, options);\n const gaxGrpc = new grpc_1.GrpcClient(options);\n return new operationsClient.OperationsClientBuilder(gaxGrpc);\n}\nlro.SERVICE_ADDRESS = operationsClient.SERVICE_ADDRESS;\nlro.ALL_SCOPES = operationsClient.ALL_SCOPES;\nvar operationsClient_1 = require(\"./operationsClient\");\nObject.defineProperty(exports, \"OperationsClient\", { enumerable: true, get: function () { return operationsClient_1.OperationsClient; } });\nvar iamService_1 = require(\"./iamService\");\nObject.defineProperty(exports, \"IamClient\", { enumerable: true, get: function () { return iamService_1.IamClient; } });\nvar locationService_1 = require(\"./locationService\");\nObject.defineProperty(exports, \"LocationsClient\", { enumerable: true, get: function () { return locationService_1.LocationsClient; } });\nexports.createByteLengthFunction = grpc_1.GrpcClient?.createByteLengthFunction;\nexports.version = require('../../package.json').version;\nconst protobuf = __importStar(require(\"protobufjs\"));\nexports.protobuf = protobuf;\nexports.protobufMinimal = __importStar(require(\"protobufjs/minimal\"));\nconst fallback = __importStar(require(\"./fallback\"));\nexports.fallback = fallback;\nvar util_1 = require(\"./util\");\nObject.defineProperty(exports, \"makeUUID\", { enumerable: true, get: function () { return util_1.makeUUID; } });\nvar grpc_js_1 = require(\"@grpc/grpc-js\");\nObject.defineProperty(exports, \"ChannelCredentials\", { enumerable: true, get: function () { return grpc_js_1.ChannelCredentials; } });\nvar warnings_1 = require(\"./warnings\");\nObject.defineProperty(exports, \"warn\", { enumerable: true, get: function () { return warnings_1.warn; } });\nconst serializer = __importStar(require(\"proto3-json-serializer\"));\nexports.serializer = serializer;\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// ** This file is automatically generated by gapic-generator-typescript. **\n// ** https://github.com/googleapis/gapic-generator-typescript **\n// ** All changes to this file may be overwritten. **\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ArtifactRegistryClient = void 0;\nconst jsonProtos = require(\"../../protos/protos.json\");\nconst google_gax_1 = require(\"google-gax\");\n/**\n * Client JSON configuration object, loaded from\n * `src/v1/artifact_registry_client_config.json`.\n * This file defines retry strategy and timeouts for all API methods in this library.\n */\nconst gapicConfig = require(\"./artifact_registry_client_config.json\");\nconst version = require('../../../package.json').version;\n/**\n * The Artifact Registry API service.\n *\n * Artifact Registry is an artifact management system for storing artifacts\n * from different package management systems.\n *\n * The resources managed by this API are:\n *\n * * Repositories, which group packages and their data.\n * * Packages, which group versions and their tags.\n * * Versions, which are specific forms of a package.\n * * Tags, which represent alternative names for versions.\n * * Files, which contain content and are optionally associated with a Package\n * or Version.\n * @class\n * @memberof v1\n */\nclass ArtifactRegistryClient {\n _terminated = false;\n _opts;\n _providedCustomServicePath;\n _gaxModule;\n _gaxGrpc;\n _protos;\n _defaults;\n _universeDomain;\n _servicePath;\n _log = google_gax_1.loggingUtils.log('artifact-registry');\n auth;\n descriptors = {\n page: {},\n stream: {},\n longrunning: {},\n batching: {},\n };\n warn;\n innerApiCalls;\n locationsClient;\n pathTemplates;\n operationsClient;\n artifactRegistryStub;\n /**\n * Construct an instance of ArtifactRegistryClient.\n *\n * @param {object} [options] - The configuration object.\n * The options accepted by the constructor are described in detail\n * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).\n * The common options are:\n * @param {object} [options.credentials] - Credentials object.\n * @param {string} [options.credentials.client_email]\n * @param {string} [options.credentials.private_key]\n * @param {string} [options.email] - Account email address. Required when\n * using a .pem or .p12 keyFilename.\n * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or\n * .p12 key downloaded from the Google Developers Console. If you provide\n * a path to a JSON file, the projectId option below is not necessary.\n * NOTE: .pem and .p12 require you to specify options.email as well.\n * @param {number} [options.port] - The port on which to connect to\n * the remote host.\n * @param {string} [options.projectId] - The project ID from the Google\n * Developer's Console, e.g. 'grape-spaceship-123'. We will also check\n * the environment variable GCLOUD_PROJECT for your project ID. If your\n * app is running in an environment which supports\n * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},\n * your project ID will be detected automatically.\n * @param {string} [options.apiEndpoint] - The domain name of the\n * API remote host.\n * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.\n * Follows the structure of {@link gapicConfig}.\n * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.\n * For more information, please check the\n * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.\n * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you\n * need to avoid loading the default gRPC version and want to use the fallback\n * HTTP implementation. Load only fallback version and pass it to the constructor:\n * ```\n * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC\n * const client = new ArtifactRegistryClient({fallback: true}, gax);\n * ```\n */\n constructor(opts, gaxInstance) {\n // Ensure that options include all the required fields.\n const staticMembers = this.constructor;\n if (opts?.universe_domain &&\n opts?.universeDomain &&\n opts?.universe_domain !== opts?.universeDomain) {\n throw new Error('Please set either universe_domain or universeDomain, but not both.');\n }\n const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'\n ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']\n : undefined;\n this._universeDomain =\n opts?.universeDomain ??\n opts?.universe_domain ??\n universeDomainEnvVar ??\n 'googleapis.com';\n this._servicePath = 'artifactregistry.' + this._universeDomain;\n const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;\n this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);\n const port = opts?.port || staticMembers.port;\n const clientConfig = opts?.clientConfig ?? {};\n const fallback = opts?.fallback ??\n (typeof window !== 'undefined' && typeof window?.fetch === 'function');\n opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);\n // Request numeric enum values if REST transport is used.\n opts.numericEnums = true;\n // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.\n if (servicePath !== this._servicePath && !('scopes' in opts)) {\n opts['scopes'] = staticMembers.scopes;\n }\n // Load google-gax module synchronously if needed\n if (!gaxInstance) {\n gaxInstance = require('google-gax');\n }\n // Choose either gRPC or proto-over-HTTP implementation of google-gax.\n this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;\n // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.\n this._gaxGrpc = new this._gaxModule.GrpcClient(opts);\n // Save options to use in initialize() method.\n this._opts = opts;\n // Save the auth object to the client, for use by other methods.\n this.auth = this._gaxGrpc.auth;\n // Set useJWTAccessWithScope on the auth object.\n this.auth.useJWTAccessWithScope = true;\n // Set defaultServicePath on the auth object.\n this.auth.defaultServicePath = this._servicePath;\n // Set the default scopes in auth client if needed.\n if (servicePath === this._servicePath) {\n this.auth.defaultScopes = staticMembers.scopes;\n }\n this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);\n // Determine the client header string.\n const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];\n if (typeof process === 'object' && 'versions' in process) {\n clientHeader.push(`gl-node/${process.versions.node}`);\n }\n else {\n clientHeader.push(`gl-web/${this._gaxModule.version}`);\n }\n if (!opts.fallback) {\n clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);\n }\n else {\n clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);\n }\n if (opts.libName && opts.libVersion) {\n clientHeader.push(`${opts.libName}/${opts.libVersion}`);\n }\n // Load the applicable protos.\n this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);\n // This API contains \"path templates\"; forward-slash-separated\n // identifiers to uniquely identify resources within the API.\n // Create useful helper objects for these.\n this.pathTemplates = {\n aptArtifactPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/aptArtifacts/{apt_artifact}'),\n attachmentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/attachments/{attachment}'),\n dockerImagePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/dockerImages/{docker_image}'),\n filePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/files/{file}'),\n genericArtifactPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/genericArtifacts/{generic_artifact}'),\n mavenArtifactPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/mavenArtifacts/{maven_artifact}'),\n npmPackagePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/npmPackages/{npm_package}'),\n packagePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/packages/{package}'),\n projectSettingsPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/projectSettings'),\n pythonPackagePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/pythonPackages/{python_package}'),\n repositoryPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}'),\n rulePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/rules/{rule}'),\n tagPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag}'),\n versionPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/versions/{version}'),\n vpcscConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/vpcscConfig'),\n yumArtifactPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/yumArtifacts/{yum_artifact}'),\n };\n // Some of the methods on this service return \"paged\" results,\n // (e.g. 50 results at a time, with tokens to get subsequent\n // pages). Denote the keys used for pagination and results.\n this.descriptors.page = {\n listDockerImages: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dockerImages'),\n listMavenArtifacts: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'mavenArtifacts'),\n listNpmPackages: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'npmPackages'),\n listPythonPackages: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'pythonPackages'),\n listRepositories: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'repositories'),\n listPackages: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'packages'),\n listVersions: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'versions'),\n listFiles: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'files'),\n listTags: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tags'),\n listRules: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'rules'),\n listAttachments: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'attachments'),\n };\n const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);\n // This API contains \"long-running operations\", which return a\n // an Operation object that allows for tracking of the operation,\n // rather than holding a request open.\n const lroOptions = {\n auth: this.auth,\n grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,\n };\n if (opts.fallback) {\n lroOptions.protoJson = protoFilesRoot;\n lroOptions.httpRules = [\n {\n selector: 'google.cloud.location.Locations.GetLocation',\n get: '/v1/{name=projects/*/locations/*}',\n },\n {\n selector: 'google.cloud.location.Locations.ListLocations',\n get: '/v1/{name=projects/*}/locations',\n },\n {\n selector: 'google.longrunning.Operations.GetOperation',\n get: '/v1/{name=projects/*/locations/*/operations/*}',\n },\n ];\n }\n this.operationsClient = this._gaxModule\n .lro(lroOptions)\n .operationsClient(opts);\n const importAptArtifactsResponse = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1.ImportAptArtifactsResponse');\n const importAptArtifactsMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata');\n const importYumArtifactsResponse = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1.ImportYumArtifactsResponse');\n const importYumArtifactsMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata');\n const createRepositoryResponse = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1.Repository');\n const createRepositoryMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1.OperationMetadata');\n const deleteRepositoryResponse = protoFilesRoot.lookup('.google.protobuf.Empty');\n const deleteRepositoryMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1.OperationMetadata');\n const deletePackageResponse = protoFilesRoot.lookup('.google.protobuf.Empty');\n const deletePackageMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1.OperationMetadata');\n const deleteVersionResponse = protoFilesRoot.lookup('.google.protobuf.Empty');\n const deleteVersionMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1.OperationMetadata');\n const batchDeleteVersionsResponse = protoFilesRoot.lookup('.google.protobuf.Empty');\n const batchDeleteVersionsMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata');\n const deleteFileResponse = protoFilesRoot.lookup('.google.protobuf.Empty');\n const deleteFileMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1.OperationMetadata');\n const createAttachmentResponse = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1.Attachment');\n const createAttachmentMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1.OperationMetadata');\n const deleteAttachmentResponse = protoFilesRoot.lookup('.google.protobuf.Empty');\n const deleteAttachmentMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1.OperationMetadata');\n this.descriptors.longrunning = {\n importAptArtifacts: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importAptArtifactsResponse.decode.bind(importAptArtifactsResponse), importAptArtifactsMetadata.decode.bind(importAptArtifactsMetadata)),\n importYumArtifacts: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importYumArtifactsResponse.decode.bind(importYumArtifactsResponse), importYumArtifactsMetadata.decode.bind(importYumArtifactsMetadata)),\n createRepository: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createRepositoryResponse.decode.bind(createRepositoryResponse), createRepositoryMetadata.decode.bind(createRepositoryMetadata)),\n deleteRepository: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteRepositoryResponse.decode.bind(deleteRepositoryResponse), deleteRepositoryMetadata.decode.bind(deleteRepositoryMetadata)),\n deletePackage: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deletePackageResponse.decode.bind(deletePackageResponse), deletePackageMetadata.decode.bind(deletePackageMetadata)),\n deleteVersion: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteVersionResponse.decode.bind(deleteVersionResponse), deleteVersionMetadata.decode.bind(deleteVersionMetadata)),\n batchDeleteVersions: new this._gaxModule.LongrunningDescriptor(this.operationsClient, batchDeleteVersionsResponse.decode.bind(batchDeleteVersionsResponse), batchDeleteVersionsMetadata.decode.bind(batchDeleteVersionsMetadata)),\n deleteFile: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteFileResponse.decode.bind(deleteFileResponse), deleteFileMetadata.decode.bind(deleteFileMetadata)),\n createAttachment: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createAttachmentResponse.decode.bind(createAttachmentResponse), createAttachmentMetadata.decode.bind(createAttachmentMetadata)),\n deleteAttachment: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteAttachmentResponse.decode.bind(deleteAttachmentResponse), deleteAttachmentMetadata.decode.bind(deleteAttachmentMetadata)),\n };\n // Put together the default options sent with requests.\n this._defaults = this._gaxGrpc.constructSettings('google.devtools.artifactregistry.v1.ArtifactRegistry', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });\n // Set up a dictionary of \"inner API calls\"; the core implementation\n // of calling the API is handled in `google-gax`, with this code\n // merely providing the destination and request information.\n this.innerApiCalls = {};\n // Add a warn function to the client constructor so it can be easily tested.\n this.warn = this._gaxModule.warn;\n }\n /**\n * Initialize the client.\n * Performs asynchronous operations (such as authentication) and prepares the client.\n * This function will be called automatically when any class method is called for the\n * first time, but if you need to initialize it before calling an actual method,\n * feel free to call initialize() directly.\n *\n * You can await on this method if you want to make sure the client is initialized.\n *\n * @returns {Promise} A promise that resolves to an authenticated service stub.\n */\n initialize() {\n // If the client stub promise is already initialized, return immediately.\n if (this.artifactRegistryStub) {\n return this.artifactRegistryStub;\n }\n // Put together the \"service stub\" for\n // google.devtools.artifactregistry.v1.ArtifactRegistry.\n this.artifactRegistryStub = this._gaxGrpc.createStub(this._opts.fallback\n ? this._protos.lookupService('google.devtools.artifactregistry.v1.ArtifactRegistry')\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._protos.google.devtools.artifactregistry.v1\n .ArtifactRegistry, this._opts, this._providedCustomServicePath);\n // Iterate over each of the methods that the service provides\n // and create an API call method for each.\n const artifactRegistryStubMethods = [\n 'listDockerImages',\n 'getDockerImage',\n 'listMavenArtifacts',\n 'getMavenArtifact',\n 'listNpmPackages',\n 'getNpmPackage',\n 'listPythonPackages',\n 'getPythonPackage',\n 'importAptArtifacts',\n 'importYumArtifacts',\n 'listRepositories',\n 'getRepository',\n 'createRepository',\n 'updateRepository',\n 'deleteRepository',\n 'listPackages',\n 'getPackage',\n 'deletePackage',\n 'listVersions',\n 'getVersion',\n 'deleteVersion',\n 'batchDeleteVersions',\n 'updateVersion',\n 'listFiles',\n 'getFile',\n 'deleteFile',\n 'updateFile',\n 'listTags',\n 'getTag',\n 'createTag',\n 'updateTag',\n 'deleteTag',\n 'createRule',\n 'listRules',\n 'getRule',\n 'updateRule',\n 'deleteRule',\n 'setIamPolicy',\n 'getIamPolicy',\n 'testIamPermissions',\n 'getProjectSettings',\n 'updateProjectSettings',\n 'getVpcscConfig',\n 'updateVpcscConfig',\n 'updatePackage',\n 'listAttachments',\n 'getAttachment',\n 'createAttachment',\n 'deleteAttachment',\n ];\n for (const methodName of artifactRegistryStubMethods) {\n const callPromise = this.artifactRegistryStub.then(stub => (...args) => {\n if (this._terminated) {\n return Promise.reject('The client has already been closed.');\n }\n const func = stub[methodName];\n return func.apply(stub, args);\n }, (err) => () => {\n throw err;\n });\n const descriptor = this.descriptors.page[methodName] ||\n this.descriptors.longrunning[methodName] ||\n undefined;\n const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);\n this.innerApiCalls[methodName] = apiCall;\n }\n return this.artifactRegistryStub;\n }\n /**\n * The DNS address for this API service.\n * @deprecated Use the apiEndpoint method of the client instance.\n * @returns {string} The DNS address for this service.\n */\n static get servicePath() {\n if (typeof process === 'object' &&\n typeof process.emitWarning === 'function') {\n process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');\n }\n return 'artifactregistry.googleapis.com';\n }\n /**\n * The DNS address for this API service - same as servicePath.\n * @deprecated Use the apiEndpoint method of the client instance.\n * @returns {string} The DNS address for this service.\n */\n static get apiEndpoint() {\n if (typeof process === 'object' &&\n typeof process.emitWarning === 'function') {\n process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');\n }\n return 'artifactregistry.googleapis.com';\n }\n /**\n * The DNS address for this API service.\n * @returns {string} The DNS address for this service.\n */\n get apiEndpoint() {\n return this._servicePath;\n }\n get universeDomain() {\n return this._universeDomain;\n }\n /**\n * The port for this API service.\n * @returns {number} The default port for this service.\n */\n static get port() {\n return 443;\n }\n /**\n * The scopes needed to make gRPC calls for every method defined\n * in this service.\n * @returns {string[]} List of default scopes.\n */\n static get scopes() {\n return [\n 'https://www.googleapis.com/auth/cloud-platform',\n 'https://www.googleapis.com/auth/cloud-platform.read-only',\n ];\n }\n /**\n * Return the project ID used by this class.\n * @returns {Promise} A promise that resolves to string containing the project ID.\n */\n getProjectId(callback) {\n if (callback) {\n this.auth.getProjectId(callback);\n return;\n }\n return this.auth.getProjectId();\n }\n getDockerImage(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getDockerImage request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getDockerImage response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getDockerImage(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getDockerImage response %j', response);\n return [response, options, rawResponse];\n });\n }\n getMavenArtifact(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getMavenArtifact request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getMavenArtifact response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getMavenArtifact(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getMavenArtifact response %j', response);\n return [response, options, rawResponse];\n });\n }\n getNpmPackage(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getNpmPackage request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getNpmPackage response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getNpmPackage(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getNpmPackage response %j', response);\n return [response, options, rawResponse];\n });\n }\n getPythonPackage(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getPythonPackage request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getPythonPackage response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getPythonPackage(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getPythonPackage response %j', response);\n return [response, options, rawResponse];\n });\n }\n getRepository(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getRepository request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getRepository response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getRepository(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getRepository response %j', response);\n return [response, options, rawResponse];\n });\n }\n updateRepository(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n 'repository.name': request.repository.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('updateRepository request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('updateRepository response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .updateRepository(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('updateRepository response %j', response);\n return [response, options, rawResponse];\n });\n }\n getPackage(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getPackage request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getPackage response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getPackage(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getPackage response %j', response);\n return [response, options, rawResponse];\n });\n }\n getVersion(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getVersion request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getVersion response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getVersion(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getVersion response %j', response);\n return [response, options, rawResponse];\n });\n }\n updateVersion(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n 'version.name': request.version.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('updateVersion request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('updateVersion response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .updateVersion(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('updateVersion response %j', response);\n return [response, options, rawResponse];\n });\n }\n getFile(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getFile request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getFile response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getFile(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getFile response %j', response);\n return [response, options, rawResponse];\n });\n }\n updateFile(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n 'file.name': request.file.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('updateFile request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('updateFile response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .updateFile(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('updateFile response %j', response);\n return [response, options, rawResponse];\n });\n }\n getTag(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getTag request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getTag response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getTag(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getTag response %j', response);\n return [response, options, rawResponse];\n });\n }\n createTag(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('createTag request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('createTag response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .createTag(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('createTag response %j', response);\n return [response, options, rawResponse];\n });\n }\n updateTag(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n 'tag.name': request.tag.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('updateTag request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('updateTag response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .updateTag(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('updateTag response %j', response);\n return [response, options, rawResponse];\n });\n }\n deleteTag(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('deleteTag request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('deleteTag response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .deleteTag(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('deleteTag response %j', response);\n return [response, options, rawResponse];\n });\n }\n createRule(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('createRule request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('createRule response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .createRule(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('createRule response %j', response);\n return [response, options, rawResponse];\n });\n }\n getRule(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getRule request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getRule response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getRule(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getRule response %j', response);\n return [response, options, rawResponse];\n });\n }\n updateRule(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n 'rule.name': request.rule.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('updateRule request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('updateRule response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .updateRule(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('updateRule response %j', response);\n return [response, options, rawResponse];\n });\n }\n deleteRule(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('deleteRule request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('deleteRule response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .deleteRule(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('deleteRule response %j', response);\n return [response, options, rawResponse];\n });\n }\n setIamPolicy(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n resource: request.resource ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('setIamPolicy request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('setIamPolicy response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .setIamPolicy(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('setIamPolicy response %j', response);\n return [response, options, rawResponse];\n });\n }\n getIamPolicy(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n resource: request.resource ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getIamPolicy request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getIamPolicy response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getIamPolicy(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getIamPolicy response %j', response);\n return [response, options, rawResponse];\n });\n }\n testIamPermissions(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n resource: request.resource ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('testIamPermissions request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('testIamPermissions response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .testIamPermissions(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('testIamPermissions response %j', response);\n return [response, options, rawResponse];\n });\n }\n getProjectSettings(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getProjectSettings request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getProjectSettings response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getProjectSettings(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getProjectSettings response %j', response);\n return [response, options, rawResponse];\n });\n }\n updateProjectSettings(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n 'project_settings.name': request.projectSettings.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('updateProjectSettings request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('updateProjectSettings response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .updateProjectSettings(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('updateProjectSettings response %j', response);\n return [response, options, rawResponse];\n });\n }\n getVPCSCConfig(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getVPCSCConfig request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getVPCSCConfig response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getVpcscConfig(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getVPCSCConfig response %j', response);\n return [response, options, rawResponse];\n });\n }\n updateVPCSCConfig(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n 'vpcsc_config.name': request.vpcscConfig.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('updateVPCSCConfig request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('updateVPCSCConfig response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .updateVpcscConfig(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('updateVPCSCConfig response %j', response);\n return [response, options, rawResponse];\n });\n }\n updatePackage(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n 'package.name': request.package.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('updatePackage request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('updatePackage response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .updatePackage(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('updatePackage response %j', response);\n return [response, options, rawResponse];\n });\n }\n getAttachment(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getAttachment request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getAttachment response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getAttachment(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getAttachment response %j', response);\n return [response, options, rawResponse];\n });\n }\n importAptArtifacts(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('importAptArtifacts response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('importAptArtifacts request %j', request);\n return this.innerApiCalls\n .importAptArtifacts(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('importAptArtifacts response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `importAptArtifacts()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.import_apt_artifacts.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_ImportAptArtifacts_async\n */\n async checkImportAptArtifactsProgress(name) {\n this._log.info('importAptArtifacts long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importAptArtifacts, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n importYumArtifacts(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('importYumArtifacts response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('importYumArtifacts request %j', request);\n return this.innerApiCalls\n .importYumArtifacts(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('importYumArtifacts response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `importYumArtifacts()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.import_yum_artifacts.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_ImportYumArtifacts_async\n */\n async checkImportYumArtifactsProgress(name) {\n this._log.info('importYumArtifacts long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importYumArtifacts, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n createRepository(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('createRepository response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('createRepository request %j', request);\n return this.innerApiCalls\n .createRepository(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('createRepository response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `createRepository()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.create_repository.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_CreateRepository_async\n */\n async checkCreateRepositoryProgress(name) {\n this._log.info('createRepository long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createRepository, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n deleteRepository(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('deleteRepository response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('deleteRepository request %j', request);\n return this.innerApiCalls\n .deleteRepository(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('deleteRepository response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `deleteRepository()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.delete_repository.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_DeleteRepository_async\n */\n async checkDeleteRepositoryProgress(name) {\n this._log.info('deleteRepository long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteRepository, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n deletePackage(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('deletePackage response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('deletePackage request %j', request);\n return this.innerApiCalls\n .deletePackage(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('deletePackage response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `deletePackage()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.delete_package.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_DeletePackage_async\n */\n async checkDeletePackageProgress(name) {\n this._log.info('deletePackage long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deletePackage, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n deleteVersion(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('deleteVersion response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('deleteVersion request %j', request);\n return this.innerApiCalls\n .deleteVersion(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('deleteVersion response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `deleteVersion()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.delete_version.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_DeleteVersion_async\n */\n async checkDeleteVersionProgress(name) {\n this._log.info('deleteVersion long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteVersion, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n batchDeleteVersions(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('batchDeleteVersions response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('batchDeleteVersions request %j', request);\n return this.innerApiCalls\n .batchDeleteVersions(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('batchDeleteVersions response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `batchDeleteVersions()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.batch_delete_versions.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_BatchDeleteVersions_async\n */\n async checkBatchDeleteVersionsProgress(name) {\n this._log.info('batchDeleteVersions long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchDeleteVersions, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n deleteFile(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('deleteFile response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('deleteFile request %j', request);\n return this.innerApiCalls\n .deleteFile(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('deleteFile response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `deleteFile()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.delete_file.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_DeleteFile_async\n */\n async checkDeleteFileProgress(name) {\n this._log.info('deleteFile long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteFile, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n createAttachment(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('createAttachment response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('createAttachment request %j', request);\n return this.innerApiCalls\n .createAttachment(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('createAttachment response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `createAttachment()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.create_attachment.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_CreateAttachment_async\n */\n async checkCreateAttachmentProgress(name) {\n this._log.info('createAttachment long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createAttachment, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n deleteAttachment(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('deleteAttachment response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('deleteAttachment request %j', request);\n return this.innerApiCalls\n .deleteAttachment(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('deleteAttachment response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `deleteAttachment()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.delete_attachment.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_DeleteAttachment_async\n */\n async checkDeleteAttachmentProgress(name) {\n this._log.info('deleteAttachment long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteAttachment, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n listDockerImages(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listDockerImages values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listDockerImages request %j', request);\n return this.innerApiCalls\n .listDockerImages(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listDockerImages values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listDockerImages`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose docker images will be\n * listed.\n * @param {number} request.pageSize\n * The maximum number of artifacts to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {string} request.orderBy\n * The field to order the results by.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1.DockerImage|DockerImage} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listDockerImagesAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listDockerImagesStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listDockerImages'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listDockerImages stream %j', request);\n return this.descriptors.page.listDockerImages.createStream(this.innerApiCalls.listDockerImages, request, callSettings);\n }\n /**\n * Equivalent to `listDockerImages`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose docker images will be\n * listed.\n * @param {number} request.pageSize\n * The maximum number of artifacts to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {string} request.orderBy\n * The field to order the results by.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1.DockerImage|DockerImage}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.list_docker_images.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_ListDockerImages_async\n */\n listDockerImagesAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listDockerImages'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listDockerImages iterate %j', request);\n return this.descriptors.page.listDockerImages.asyncIterate(this.innerApiCalls['listDockerImages'], request, callSettings);\n }\n listMavenArtifacts(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listMavenArtifacts values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listMavenArtifacts request %j', request);\n return this.innerApiCalls\n .listMavenArtifacts(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listMavenArtifacts values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listMavenArtifacts`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose maven artifacts will be\n * listed.\n * @param {number} request.pageSize\n * The maximum number of artifacts to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1.MavenArtifact|MavenArtifact} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listMavenArtifactsAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listMavenArtifactsStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listMavenArtifacts'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listMavenArtifacts stream %j', request);\n return this.descriptors.page.listMavenArtifacts.createStream(this.innerApiCalls.listMavenArtifacts, request, callSettings);\n }\n /**\n * Equivalent to `listMavenArtifacts`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose maven artifacts will be\n * listed.\n * @param {number} request.pageSize\n * The maximum number of artifacts to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1.MavenArtifact|MavenArtifact}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.list_maven_artifacts.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_ListMavenArtifacts_async\n */\n listMavenArtifactsAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listMavenArtifacts'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listMavenArtifacts iterate %j', request);\n return this.descriptors.page.listMavenArtifacts.asyncIterate(this.innerApiCalls['listMavenArtifacts'], request, callSettings);\n }\n listNpmPackages(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listNpmPackages values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listNpmPackages request %j', request);\n return this.innerApiCalls\n .listNpmPackages(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listNpmPackages values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listNpmPackages`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose npm packages will be\n * listed.\n * @param {number} request.pageSize\n * The maximum number of artifacts to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1.NpmPackage|NpmPackage} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listNpmPackagesAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listNpmPackagesStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listNpmPackages'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listNpmPackages stream %j', request);\n return this.descriptors.page.listNpmPackages.createStream(this.innerApiCalls.listNpmPackages, request, callSettings);\n }\n /**\n * Equivalent to `listNpmPackages`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose npm packages will be\n * listed.\n * @param {number} request.pageSize\n * The maximum number of artifacts to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1.NpmPackage|NpmPackage}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.list_npm_packages.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_ListNpmPackages_async\n */\n listNpmPackagesAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listNpmPackages'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listNpmPackages iterate %j', request);\n return this.descriptors.page.listNpmPackages.asyncIterate(this.innerApiCalls['listNpmPackages'], request, callSettings);\n }\n listPythonPackages(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listPythonPackages values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listPythonPackages request %j', request);\n return this.innerApiCalls\n .listPythonPackages(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listPythonPackages values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listPythonPackages`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose python packages will be\n * listed.\n * @param {number} request.pageSize\n * The maximum number of artifacts to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1.PythonPackage|PythonPackage} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listPythonPackagesAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listPythonPackagesStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listPythonPackages'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listPythonPackages stream %j', request);\n return this.descriptors.page.listPythonPackages.createStream(this.innerApiCalls.listPythonPackages, request, callSettings);\n }\n /**\n * Equivalent to `listPythonPackages`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose python packages will be\n * listed.\n * @param {number} request.pageSize\n * The maximum number of artifacts to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1.PythonPackage|PythonPackage}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.list_python_packages.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_ListPythonPackages_async\n */\n listPythonPackagesAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listPythonPackages'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listPythonPackages iterate %j', request);\n return this.descriptors.page.listPythonPackages.asyncIterate(this.innerApiCalls['listPythonPackages'], request, callSettings);\n }\n listRepositories(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listRepositories values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listRepositories request %j', request);\n return this.innerApiCalls\n .listRepositories(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listRepositories values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listRepositories`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose repositories will be\n * listed.\n * @param {number} request.pageSize\n * The maximum number of repositories to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {string} [request.filter]\n * Optional. An expression for filtering the results of the request. Filter\n * rules are case insensitive. The fields eligible for filtering are:\n *\n * * `name`\n *\n * Examples of using a filter:\n *\n * To filter the results of your request to repositories with the name\n * `my-repo` in project `my-project` in the `us-central` region, append the\n * following filter expression to your request:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo\"`\n *\n * You can also use wildcards to match any number of characters before or\n * after the value:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-*\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/*repo\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/*repo*\"`\n * @param {string} [request.orderBy]\n * Optional. The field to order the results by.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1.Repository|Repository} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listRepositoriesAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listRepositoriesStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listRepositories'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listRepositories stream %j', request);\n return this.descriptors.page.listRepositories.createStream(this.innerApiCalls.listRepositories, request, callSettings);\n }\n /**\n * Equivalent to `listRepositories`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose repositories will be\n * listed.\n * @param {number} request.pageSize\n * The maximum number of repositories to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {string} [request.filter]\n * Optional. An expression for filtering the results of the request. Filter\n * rules are case insensitive. The fields eligible for filtering are:\n *\n * * `name`\n *\n * Examples of using a filter:\n *\n * To filter the results of your request to repositories with the name\n * `my-repo` in project `my-project` in the `us-central` region, append the\n * following filter expression to your request:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo\"`\n *\n * You can also use wildcards to match any number of characters before or\n * after the value:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-*\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/*repo\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/*repo*\"`\n * @param {string} [request.orderBy]\n * Optional. The field to order the results by.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1.Repository|Repository}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.list_repositories.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_ListRepositories_async\n */\n listRepositoriesAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listRepositories'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listRepositories iterate %j', request);\n return this.descriptors.page.listRepositories.asyncIterate(this.innerApiCalls['listRepositories'], request, callSettings);\n }\n listPackages(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listPackages values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listPackages request %j', request);\n return this.innerApiCalls\n .listPackages(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listPackages values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listPackages`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose packages will be listed.\n * @param {number} request.pageSize\n * The maximum number of packages to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {string} [request.filter]\n * Optional. An expression for filtering the results of the request. Filter\n * rules are case insensitive. The fields eligible for filtering are:\n *\n * * `name`\n * * `annotations`\n *\n * Examples of using a filter:\n *\n * To filter the results of your request to packages with the name\n * `my-package` in project `my-project` in the `us-central` region, in\n * repository `my-repo`, append the following filter expression to your\n * request:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package\"`\n *\n * You can also use wildcards to match any number of characters before or\n * after the value:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-*\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/*package\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/*pack*\"`\n *\n * To filter the results of your request to packages with the annotation\n * key-value pair [`external_link`: `external_link_value`], append the\n * following filter expression to your request\":\n *\n * * `\"annotations.external_link:external_link_value\"`\n *\n * To filter the results just for a specific annotation key `external_link`,\n * append the following filter expression to your request:\n *\n * * `\"annotations.external_link\"`\n *\n * If the annotation key or value contains special characters, you can escape\n * them by surrounding the value with backticks. For example, to filter the\n * results of your request to packages with the annotation key-value pair\n * [`external.link`:`https://example.com/my-package`], append the following\n * filter expression to your request:\n *\n * * `` \"annotations.`external.link`:`https://example.com/my-package`\" ``\n *\n * You can also filter with annotations with a wildcard to\n * match any number of characters before or after the value:\n *\n * * `` \"annotations.*_link:`*example.com*`\" ``\n * @param {string} [request.orderBy]\n * Optional. The field to order the results by.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1.Package|Package} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listPackagesAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listPackagesStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listPackages'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listPackages stream %j', request);\n return this.descriptors.page.listPackages.createStream(this.innerApiCalls.listPackages, request, callSettings);\n }\n /**\n * Equivalent to `listPackages`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose packages will be listed.\n * @param {number} request.pageSize\n * The maximum number of packages to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {string} [request.filter]\n * Optional. An expression for filtering the results of the request. Filter\n * rules are case insensitive. The fields eligible for filtering are:\n *\n * * `name`\n * * `annotations`\n *\n * Examples of using a filter:\n *\n * To filter the results of your request to packages with the name\n * `my-package` in project `my-project` in the `us-central` region, in\n * repository `my-repo`, append the following filter expression to your\n * request:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package\"`\n *\n * You can also use wildcards to match any number of characters before or\n * after the value:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-*\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/*package\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/*pack*\"`\n *\n * To filter the results of your request to packages with the annotation\n * key-value pair [`external_link`: `external_link_value`], append the\n * following filter expression to your request\":\n *\n * * `\"annotations.external_link:external_link_value\"`\n *\n * To filter the results just for a specific annotation key `external_link`,\n * append the following filter expression to your request:\n *\n * * `\"annotations.external_link\"`\n *\n * If the annotation key or value contains special characters, you can escape\n * them by surrounding the value with backticks. For example, to filter the\n * results of your request to packages with the annotation key-value pair\n * [`external.link`:`https://example.com/my-package`], append the following\n * filter expression to your request:\n *\n * * `` \"annotations.`external.link`:`https://example.com/my-package`\" ``\n *\n * You can also filter with annotations with a wildcard to\n * match any number of characters before or after the value:\n *\n * * `` \"annotations.*_link:`*example.com*`\" ``\n * @param {string} [request.orderBy]\n * Optional. The field to order the results by.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1.Package|Package}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.list_packages.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_ListPackages_async\n */\n listPackagesAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listPackages'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listPackages iterate %j', request);\n return this.descriptors.page.listPackages.asyncIterate(this.innerApiCalls['listPackages'], request, callSettings);\n }\n listVersions(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listVersions values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listVersions request %j', request);\n return this.innerApiCalls\n .listVersions(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listVersions values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listVersions`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * The name of the parent resource whose versions will be listed.\n * @param {number} request.pageSize\n * The maximum number of versions to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {google.devtools.artifactregistry.v1.VersionView} request.view\n * The view that should be returned in the response.\n * @param {string} [request.orderBy]\n * Optional. The field to order the results by.\n * @param {string} [request.filter]\n * Optional. An expression for filtering the results of the request. Filter\n * rules are case insensitive. The fields eligible for filtering are:\n *\n * * `name`\n * * `annotations`\n *\n * Examples of using a filter:\n *\n * To filter the results of your request to versions with the name\n * `my-version` in project `my-project` in the `us-central` region, in\n * repository `my-repo`, append the following filter expression to your\n * request:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my-version\"`\n *\n * You can also use wildcards to match any number of characters before or\n * after the value:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my*\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version*\"`\n *\n * To filter the results of your request to versions with the annotation\n * key-value pair [`external_link`: `external_link_value`], append the\n * following filter expression to your request:\n *\n * * `\"annotations.external_link:external_link_value\"`\n *\n * To filter just for a specific annotation key `external_link`, append the\n * following filter expression to your request:\n *\n * * `\"annotations.external_link\"`\n *\n * If the annotation key or value contains special characters, you can escape\n * them by surrounding the value with backticks. For example, to filter the\n * results of your request to versions with the annotation key-value pair\n * [`external.link`:`https://example.com/my-version`], append the following\n * filter expression to your request:\n *\n * * `` \"annotations.`external.link`:`https://example.com/my-version`\" ``\n *\n * You can also filter with annotations with a wildcard to\n * match any number of characters before or after the value:\n *\n * * `` \"annotations.*_link:`*example.com*`\" ``\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1.Version|Version} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listVersionsAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listVersionsStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listVersions'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listVersions stream %j', request);\n return this.descriptors.page.listVersions.createStream(this.innerApiCalls.listVersions, request, callSettings);\n }\n /**\n * Equivalent to `listVersions`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * The name of the parent resource whose versions will be listed.\n * @param {number} request.pageSize\n * The maximum number of versions to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {google.devtools.artifactregistry.v1.VersionView} request.view\n * The view that should be returned in the response.\n * @param {string} [request.orderBy]\n * Optional. The field to order the results by.\n * @param {string} [request.filter]\n * Optional. An expression for filtering the results of the request. Filter\n * rules are case insensitive. The fields eligible for filtering are:\n *\n * * `name`\n * * `annotations`\n *\n * Examples of using a filter:\n *\n * To filter the results of your request to versions with the name\n * `my-version` in project `my-project` in the `us-central` region, in\n * repository `my-repo`, append the following filter expression to your\n * request:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my-version\"`\n *\n * You can also use wildcards to match any number of characters before or\n * after the value:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my*\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version*\"`\n *\n * To filter the results of your request to versions with the annotation\n * key-value pair [`external_link`: `external_link_value`], append the\n * following filter expression to your request:\n *\n * * `\"annotations.external_link:external_link_value\"`\n *\n * To filter just for a specific annotation key `external_link`, append the\n * following filter expression to your request:\n *\n * * `\"annotations.external_link\"`\n *\n * If the annotation key or value contains special characters, you can escape\n * them by surrounding the value with backticks. For example, to filter the\n * results of your request to versions with the annotation key-value pair\n * [`external.link`:`https://example.com/my-version`], append the following\n * filter expression to your request:\n *\n * * `` \"annotations.`external.link`:`https://example.com/my-version`\" ``\n *\n * You can also filter with annotations with a wildcard to\n * match any number of characters before or after the value:\n *\n * * `` \"annotations.*_link:`*example.com*`\" ``\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1.Version|Version}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.list_versions.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_ListVersions_async\n */\n listVersionsAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listVersions'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listVersions iterate %j', request);\n return this.descriptors.page.listVersions.asyncIterate(this.innerApiCalls['listVersions'], request, callSettings);\n }\n listFiles(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listFiles values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listFiles request %j', request);\n return this.innerApiCalls\n .listFiles(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listFiles values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listFiles`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the repository whose files will be listed. For\n * example: \"projects/p1/locations/us-central1/repositories/repo1\n * @param {string} request.filter\n * An expression for filtering the results of the request. Filter rules are\n * case insensitive. The fields eligible for filtering are:\n *\n * * `name`\n * * `owner`\n * * `annotations`\n *\n * Examples of using a filter:\n *\n * To filter the results of your request to files with the name `my_file.txt`\n * in project `my-project` in the `us-central` region, in repository\n * `my-repo`, append the following filter expression to your request:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/files/my-file.txt\"`\n *\n * You can also use wildcards to match any number of characters before or\n * after the value:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/files/my-*\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/files/*file.txt\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/files/*file*\"`\n *\n * To filter the results of your request to files owned by the version `1.0`\n * in package `pkg1`, append the following filter expression to your request:\n *\n * * `owner=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0\"`\n *\n * To filter the results of your request to files with the annotation\n * key-value pair [`external_link`: `external_link_value`], append the\n * following filter expression to your request:\n *\n * * `\"annotations.external_link:external_link_value\"`\n *\n * To filter just for a specific annotation key `external_link`, append the\n * following filter expression to your request:\n *\n * * `\"annotations.external_link\"`\n *\n * If the annotation key or value contains special characters, you can escape\n * them by surrounding the value with backticks. For example, to filter the\n * results of your request to files with the annotation key-value pair\n * [`external.link`:`https://example.com/my-file`], append the following\n * filter expression to your request:\n *\n * * `` \"annotations.`external.link`:`https://example.com/my-file`\" ``\n *\n * You can also filter with annotations with a wildcard to\n * match any number of characters before or after the value:\n *\n * * `` \"annotations.*_link:`*example.com*`\" ``\n * @param {number} request.pageSize\n * The maximum number of files to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {string} request.orderBy\n * The field to order the results by.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1.File|File} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listFilesAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listFilesStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listFiles'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listFiles stream %j', request);\n return this.descriptors.page.listFiles.createStream(this.innerApiCalls.listFiles, request, callSettings);\n }\n /**\n * Equivalent to `listFiles`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the repository whose files will be listed. For\n * example: \"projects/p1/locations/us-central1/repositories/repo1\n * @param {string} request.filter\n * An expression for filtering the results of the request. Filter rules are\n * case insensitive. The fields eligible for filtering are:\n *\n * * `name`\n * * `owner`\n * * `annotations`\n *\n * Examples of using a filter:\n *\n * To filter the results of your request to files with the name `my_file.txt`\n * in project `my-project` in the `us-central` region, in repository\n * `my-repo`, append the following filter expression to your request:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/files/my-file.txt\"`\n *\n * You can also use wildcards to match any number of characters before or\n * after the value:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/files/my-*\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/files/*file.txt\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/files/*file*\"`\n *\n * To filter the results of your request to files owned by the version `1.0`\n * in package `pkg1`, append the following filter expression to your request:\n *\n * * `owner=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0\"`\n *\n * To filter the results of your request to files with the annotation\n * key-value pair [`external_link`: `external_link_value`], append the\n * following filter expression to your request:\n *\n * * `\"annotations.external_link:external_link_value\"`\n *\n * To filter just for a specific annotation key `external_link`, append the\n * following filter expression to your request:\n *\n * * `\"annotations.external_link\"`\n *\n * If the annotation key or value contains special characters, you can escape\n * them by surrounding the value with backticks. For example, to filter the\n * results of your request to files with the annotation key-value pair\n * [`external.link`:`https://example.com/my-file`], append the following\n * filter expression to your request:\n *\n * * `` \"annotations.`external.link`:`https://example.com/my-file`\" ``\n *\n * You can also filter with annotations with a wildcard to\n * match any number of characters before or after the value:\n *\n * * `` \"annotations.*_link:`*example.com*`\" ``\n * @param {number} request.pageSize\n * The maximum number of files to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {string} request.orderBy\n * The field to order the results by.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1.File|File}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.list_files.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_ListFiles_async\n */\n listFilesAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listFiles'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listFiles iterate %j', request);\n return this.descriptors.page.listFiles.asyncIterate(this.innerApiCalls['listFiles'], request, callSettings);\n }\n listTags(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listTags values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listTags request %j', request);\n return this.innerApiCalls\n .listTags(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listTags values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listTags`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * The name of the parent package whose tags will be listed.\n * For example:\n * `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1`.\n * @param {string} request.filter\n * An expression for filtering the results of the request. Filter rules are\n * case insensitive. The fields eligible for filtering are:\n *\n * * `name`\n * * `version`\n *\n * Examples of using a filter:\n *\n * To filter the results of your request to tags with the name `my-tag` in\n * package `my-package` in repository `my-repo` in project \"`y-project` in\n * the us-central region, append the following filter expression to your\n * request:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my-tag\"`\n *\n * You can also use wildcards to match any number of characters before or\n * after the value:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my*\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag*\"`\n *\n * To filter the results of your request to tags applied to the version\n * `1.0` in package `my-package`, append the following filter expression to\n * your request:\n *\n * * `version=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0\"`\n * @param {number} request.pageSize\n * The maximum number of tags to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1.Tag|Tag} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listTagsAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listTagsStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listTags'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listTags stream %j', request);\n return this.descriptors.page.listTags.createStream(this.innerApiCalls.listTags, request, callSettings);\n }\n /**\n * Equivalent to `listTags`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * The name of the parent package whose tags will be listed.\n * For example:\n * `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1`.\n * @param {string} request.filter\n * An expression for filtering the results of the request. Filter rules are\n * case insensitive. The fields eligible for filtering are:\n *\n * * `name`\n * * `version`\n *\n * Examples of using a filter:\n *\n * To filter the results of your request to tags with the name `my-tag` in\n * package `my-package` in repository `my-repo` in project \"`y-project` in\n * the us-central region, append the following filter expression to your\n * request:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my-tag\"`\n *\n * You can also use wildcards to match any number of characters before or\n * after the value:\n *\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my*\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag\"`\n * * `name=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag*\"`\n *\n * To filter the results of your request to tags applied to the version\n * `1.0` in package `my-package`, append the following filter expression to\n * your request:\n *\n * * `version=\"projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0\"`\n * @param {number} request.pageSize\n * The maximum number of tags to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1.Tag|Tag}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.list_tags.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_ListTags_async\n */\n listTagsAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listTags'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listTags iterate %j', request);\n return this.descriptors.page.listTags.asyncIterate(this.innerApiCalls['listTags'], request, callSettings);\n }\n listRules(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listRules values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listRules request %j', request);\n return this.innerApiCalls\n .listRules(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listRules values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listRules`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent repository whose rules will be listed.\n * For example:\n * `projects/p1/locations/us-central1/repositories/repo1`.\n * @param {number} request.pageSize\n * The maximum number of rules to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1.Rule|Rule} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listRulesAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listRulesStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listRules'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listRules stream %j', request);\n return this.descriptors.page.listRules.createStream(this.innerApiCalls.listRules, request, callSettings);\n }\n /**\n * Equivalent to `listRules`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent repository whose rules will be listed.\n * For example:\n * `projects/p1/locations/us-central1/repositories/repo1`.\n * @param {number} request.pageSize\n * The maximum number of rules to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1.Rule|Rule}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.list_rules.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_ListRules_async\n */\n listRulesAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listRules'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listRules iterate %j', request);\n return this.descriptors.page.listRules.asyncIterate(this.innerApiCalls['listRules'], request, callSettings);\n }\n listAttachments(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listAttachments values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listAttachments request %j', request);\n return this.innerApiCalls\n .listAttachments(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listAttachments values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listAttachments`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose attachments will be listed.\n * @param {string} [request.filter]\n * Optional. An expression for filtering the results of the request. Filter\n * rules are case insensitive. The fields eligible for filtering are:\n *\n * * `target`\n * * `type`\n * * `attachment_namespace`\n * @param {number} request.pageSize\n * The maximum number of attachments to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1.Attachment|Attachment} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listAttachmentsAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listAttachmentsStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listAttachments'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listAttachments stream %j', request);\n return this.descriptors.page.listAttachments.createStream(this.innerApiCalls.listAttachments, request, callSettings);\n }\n /**\n * Equivalent to `listAttachments`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose attachments will be listed.\n * @param {string} [request.filter]\n * Optional. An expression for filtering the results of the request. Filter\n * rules are case insensitive. The fields eligible for filtering are:\n *\n * * `target`\n * * `type`\n * * `attachment_namespace`\n * @param {number} request.pageSize\n * The maximum number of attachments to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1.Attachment|Attachment}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1/artifact_registry.list_attachments.js\n * region_tag:artifactregistry_v1_generated_ArtifactRegistry_ListAttachments_async\n */\n listAttachmentsAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listAttachments'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listAttachments iterate %j', request);\n return this.descriptors.page.listAttachments.asyncIterate(this.innerApiCalls['listAttachments'], request, callSettings);\n }\n /**\n * Gets information about a location.\n *\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.name\n * Resource name for the location.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.\n * @returns {Promise} - The promise which resolves to an array.\n * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }\n * for more details and examples.\n * @example\n * ```\n * const [response] = await client.getLocation(request);\n * ```\n */\n getLocation(request, options, callback) {\n return this.locationsClient.getLocation(request, options, callback);\n }\n /**\n * Lists information about the supported locations for this service. Returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.name\n * The resource that owns the locations collection, if applicable.\n * @param {string} request.filter\n * The standard list filter.\n * @param {number} request.pageSize\n * The standard list page size.\n * @param {string} request.pageToken\n * The standard list page token.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example\n * ```\n * const iterable = client.listLocationsAsync(request);\n * for await (const response of iterable) {\n * // process response\n * }\n * ```\n */\n listLocationsAsync(request, options) {\n return this.locationsClient.listLocationsAsync(request, options);\n }\n /**\n * Gets the latest state of a long-running operation. Clients can use this\n * method to poll the operation result at intervals as recommended by the API\n * service.\n *\n * @param {Object} request - The request object that will be sent.\n * @param {string} request.name - The name of the operation resource.\n * @param {Object=} options\n * Optional parameters. You can override the default settings for this call,\n * e.g, timeout, retries, paginations, etc. See {@link\n * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}\n * for the details.\n * @param {function(?Error, ?Object)=} callback\n * The function which will be called with the result of the API call.\n *\n * The second parameter to the callback is an object representing\n * {@link google.longrunning.Operation | google.longrunning.Operation}.\n * @return {Promise} - The promise which resolves to an array.\n * The first element of the array is an object representing\n * {@link google.longrunning.Operation | google.longrunning.Operation}.\n * The promise has a method named \"cancel\" which cancels the ongoing API call.\n *\n * @example\n * ```\n * const client = longrunning.operationsClient();\n * const name = '';\n * const [response] = await client.getOperation({name});\n * // doThingsWith(response)\n * ```\n */\n getOperation(request, optionsOrCallback, callback) {\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n return this.operationsClient.getOperation(request, options, callback);\n }\n /**\n * Lists operations that match the specified filter in the request. If the\n * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.\n *\n * For-await-of syntax is used with the iterable to recursively get response element on-demand.\n *\n * @param {Object} request - The request object that will be sent.\n * @param {string} request.name - The name of the operation collection.\n * @param {string} request.filter - The standard list filter.\n * @param {number=} request.pageSize -\n * The maximum number of resources contained in the underlying API\n * response. If page streaming is performed per-resource, this\n * parameter does not affect the return value. If page streaming is\n * performed per-page, this determines the maximum number of\n * resources in a page.\n * @param {Object=} options\n * Optional parameters. You can override the default settings for this call,\n * e.g, timeout, retries, paginations, etc. See {@link\n * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the\n * details.\n * @returns {Object}\n * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}.\n *\n * @example\n * ```\n * const client = longrunning.operationsClient();\n * for await (const response of client.listOperationsAsync(request));\n * // doThingsWith(response)\n * ```\n */\n listOperationsAsync(request, options) {\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n return this.operationsClient.listOperationsAsync(request, options);\n }\n /**\n * Starts asynchronous cancellation on a long-running operation. The server\n * makes a best effort to cancel the operation, but success is not\n * guaranteed. If the server doesn't support this method, it returns\n * `google.rpc.Code.UNIMPLEMENTED`. Clients can use\n * {@link Operations.GetOperation} or\n * other methods to check whether the cancellation succeeded or whether the\n * operation completed despite cancellation. On successful cancellation,\n * the operation is not deleted; instead, it becomes an operation with\n * an {@link Operation.error} value with a {@link google.rpc.Status.code} of\n * 1, corresponding to `Code.CANCELLED`.\n *\n * @param {Object} request - The request object that will be sent.\n * @param {string} request.name - The name of the operation resource to be cancelled.\n * @param {Object=} options\n * Optional parameters. You can override the default settings for this call,\n * e.g, timeout, retries, paginations, etc. See {@link\n * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the\n * details.\n * @param {function(?Error)=} callback\n * The function which will be called with the result of the API call.\n * @return {Promise} - The promise which resolves when API call finishes.\n * The promise has a method named \"cancel\" which cancels the ongoing API\n * call.\n *\n * @example\n * ```\n * const client = longrunning.operationsClient();\n * await client.cancelOperation({name: ''});\n * ```\n */\n cancelOperation(request, optionsOrCallback, callback) {\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n return this.operationsClient.cancelOperation(request, options, callback);\n }\n /**\n * Deletes a long-running operation. This method indicates that the client is\n * no longer interested in the operation result. It does not cancel the\n * operation. If the server doesn't support this method, it returns\n * `google.rpc.Code.UNIMPLEMENTED`.\n *\n * @param {Object} request - The request object that will be sent.\n * @param {string} request.name - The name of the operation resource to be deleted.\n * @param {Object=} options\n * Optional parameters. You can override the default settings for this call,\n * e.g, timeout, retries, paginations, etc. See {@link\n * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}\n * for the details.\n * @param {function(?Error)=} callback\n * The function which will be called with the result of the API call.\n * @return {Promise} - The promise which resolves when API call finishes.\n * The promise has a method named \"cancel\" which cancels the ongoing API\n * call.\n *\n * @example\n * ```\n * const client = longrunning.operationsClient();\n * await client.deleteOperation({name: ''});\n * ```\n */\n deleteOperation(request, optionsOrCallback, callback) {\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n return this.operationsClient.deleteOperation(request, options, callback);\n }\n // --------------------\n // -- Path templates --\n // --------------------\n /**\n * Return a fully-qualified aptArtifact resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} apt_artifact\n * @returns {string} Resource name string.\n */\n aptArtifactPath(project, location, repository, aptArtifact) {\n return this.pathTemplates.aptArtifactPathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n apt_artifact: aptArtifact,\n });\n }\n /**\n * Parse the project from AptArtifact resource.\n *\n * @param {string} aptArtifactName\n * A fully-qualified path representing AptArtifact resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromAptArtifactName(aptArtifactName) {\n return this.pathTemplates.aptArtifactPathTemplate.match(aptArtifactName)\n .project;\n }\n /**\n * Parse the location from AptArtifact resource.\n *\n * @param {string} aptArtifactName\n * A fully-qualified path representing AptArtifact resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromAptArtifactName(aptArtifactName) {\n return this.pathTemplates.aptArtifactPathTemplate.match(aptArtifactName)\n .location;\n }\n /**\n * Parse the repository from AptArtifact resource.\n *\n * @param {string} aptArtifactName\n * A fully-qualified path representing AptArtifact resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromAptArtifactName(aptArtifactName) {\n return this.pathTemplates.aptArtifactPathTemplate.match(aptArtifactName)\n .repository;\n }\n /**\n * Parse the apt_artifact from AptArtifact resource.\n *\n * @param {string} aptArtifactName\n * A fully-qualified path representing AptArtifact resource.\n * @returns {string} A string representing the apt_artifact.\n */\n matchAptArtifactFromAptArtifactName(aptArtifactName) {\n return this.pathTemplates.aptArtifactPathTemplate.match(aptArtifactName)\n .apt_artifact;\n }\n /**\n * Return a fully-qualified attachment resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} attachment\n * @returns {string} Resource name string.\n */\n attachmentPath(project, location, repository, attachment) {\n return this.pathTemplates.attachmentPathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n attachment: attachment,\n });\n }\n /**\n * Parse the project from Attachment resource.\n *\n * @param {string} attachmentName\n * A fully-qualified path representing Attachment resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromAttachmentName(attachmentName) {\n return this.pathTemplates.attachmentPathTemplate.match(attachmentName)\n .project;\n }\n /**\n * Parse the location from Attachment resource.\n *\n * @param {string} attachmentName\n * A fully-qualified path representing Attachment resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromAttachmentName(attachmentName) {\n return this.pathTemplates.attachmentPathTemplate.match(attachmentName)\n .location;\n }\n /**\n * Parse the repository from Attachment resource.\n *\n * @param {string} attachmentName\n * A fully-qualified path representing Attachment resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromAttachmentName(attachmentName) {\n return this.pathTemplates.attachmentPathTemplate.match(attachmentName)\n .repository;\n }\n /**\n * Parse the attachment from Attachment resource.\n *\n * @param {string} attachmentName\n * A fully-qualified path representing Attachment resource.\n * @returns {string} A string representing the attachment.\n */\n matchAttachmentFromAttachmentName(attachmentName) {\n return this.pathTemplates.attachmentPathTemplate.match(attachmentName)\n .attachment;\n }\n /**\n * Return a fully-qualified dockerImage resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} docker_image\n * @returns {string} Resource name string.\n */\n dockerImagePath(project, location, repository, dockerImage) {\n return this.pathTemplates.dockerImagePathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n docker_image: dockerImage,\n });\n }\n /**\n * Parse the project from DockerImage resource.\n *\n * @param {string} dockerImageName\n * A fully-qualified path representing DockerImage resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromDockerImageName(dockerImageName) {\n return this.pathTemplates.dockerImagePathTemplate.match(dockerImageName)\n .project;\n }\n /**\n * Parse the location from DockerImage resource.\n *\n * @param {string} dockerImageName\n * A fully-qualified path representing DockerImage resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromDockerImageName(dockerImageName) {\n return this.pathTemplates.dockerImagePathTemplate.match(dockerImageName)\n .location;\n }\n /**\n * Parse the repository from DockerImage resource.\n *\n * @param {string} dockerImageName\n * A fully-qualified path representing DockerImage resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromDockerImageName(dockerImageName) {\n return this.pathTemplates.dockerImagePathTemplate.match(dockerImageName)\n .repository;\n }\n /**\n * Parse the docker_image from DockerImage resource.\n *\n * @param {string} dockerImageName\n * A fully-qualified path representing DockerImage resource.\n * @returns {string} A string representing the docker_image.\n */\n matchDockerImageFromDockerImageName(dockerImageName) {\n return this.pathTemplates.dockerImagePathTemplate.match(dockerImageName)\n .docker_image;\n }\n /**\n * Return a fully-qualified file resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} file\n * @returns {string} Resource name string.\n */\n filePath(project, location, repository, file) {\n return this.pathTemplates.filePathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n file: file,\n });\n }\n /**\n * Parse the project from File resource.\n *\n * @param {string} fileName\n * A fully-qualified path representing File resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromFileName(fileName) {\n return this.pathTemplates.filePathTemplate.match(fileName).project;\n }\n /**\n * Parse the location from File resource.\n *\n * @param {string} fileName\n * A fully-qualified path representing File resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromFileName(fileName) {\n return this.pathTemplates.filePathTemplate.match(fileName).location;\n }\n /**\n * Parse the repository from File resource.\n *\n * @param {string} fileName\n * A fully-qualified path representing File resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromFileName(fileName) {\n return this.pathTemplates.filePathTemplate.match(fileName).repository;\n }\n /**\n * Parse the file from File resource.\n *\n * @param {string} fileName\n * A fully-qualified path representing File resource.\n * @returns {string} A string representing the file.\n */\n matchFileFromFileName(fileName) {\n return this.pathTemplates.filePathTemplate.match(fileName).file;\n }\n /**\n * Return a fully-qualified genericArtifact resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} generic_artifact\n * @returns {string} Resource name string.\n */\n genericArtifactPath(project, location, repository, genericArtifact) {\n return this.pathTemplates.genericArtifactPathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n generic_artifact: genericArtifact,\n });\n }\n /**\n * Parse the project from GenericArtifact resource.\n *\n * @param {string} genericArtifactName\n * A fully-qualified path representing GenericArtifact resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromGenericArtifactName(genericArtifactName) {\n return this.pathTemplates.genericArtifactPathTemplate.match(genericArtifactName).project;\n }\n /**\n * Parse the location from GenericArtifact resource.\n *\n * @param {string} genericArtifactName\n * A fully-qualified path representing GenericArtifact resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromGenericArtifactName(genericArtifactName) {\n return this.pathTemplates.genericArtifactPathTemplate.match(genericArtifactName).location;\n }\n /**\n * Parse the repository from GenericArtifact resource.\n *\n * @param {string} genericArtifactName\n * A fully-qualified path representing GenericArtifact resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromGenericArtifactName(genericArtifactName) {\n return this.pathTemplates.genericArtifactPathTemplate.match(genericArtifactName).repository;\n }\n /**\n * Parse the generic_artifact from GenericArtifact resource.\n *\n * @param {string} genericArtifactName\n * A fully-qualified path representing GenericArtifact resource.\n * @returns {string} A string representing the generic_artifact.\n */\n matchGenericArtifactFromGenericArtifactName(genericArtifactName) {\n return this.pathTemplates.genericArtifactPathTemplate.match(genericArtifactName).generic_artifact;\n }\n /**\n * Return a fully-qualified mavenArtifact resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} maven_artifact\n * @returns {string} Resource name string.\n */\n mavenArtifactPath(project, location, repository, mavenArtifact) {\n return this.pathTemplates.mavenArtifactPathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n maven_artifact: mavenArtifact,\n });\n }\n /**\n * Parse the project from MavenArtifact resource.\n *\n * @param {string} mavenArtifactName\n * A fully-qualified path representing MavenArtifact resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromMavenArtifactName(mavenArtifactName) {\n return this.pathTemplates.mavenArtifactPathTemplate.match(mavenArtifactName)\n .project;\n }\n /**\n * Parse the location from MavenArtifact resource.\n *\n * @param {string} mavenArtifactName\n * A fully-qualified path representing MavenArtifact resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromMavenArtifactName(mavenArtifactName) {\n return this.pathTemplates.mavenArtifactPathTemplate.match(mavenArtifactName)\n .location;\n }\n /**\n * Parse the repository from MavenArtifact resource.\n *\n * @param {string} mavenArtifactName\n * A fully-qualified path representing MavenArtifact resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromMavenArtifactName(mavenArtifactName) {\n return this.pathTemplates.mavenArtifactPathTemplate.match(mavenArtifactName)\n .repository;\n }\n /**\n * Parse the maven_artifact from MavenArtifact resource.\n *\n * @param {string} mavenArtifactName\n * A fully-qualified path representing MavenArtifact resource.\n * @returns {string} A string representing the maven_artifact.\n */\n matchMavenArtifactFromMavenArtifactName(mavenArtifactName) {\n return this.pathTemplates.mavenArtifactPathTemplate.match(mavenArtifactName)\n .maven_artifact;\n }\n /**\n * Return a fully-qualified npmPackage resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} npm_package\n * @returns {string} Resource name string.\n */\n npmPackagePath(project, location, repository, npmPackage) {\n return this.pathTemplates.npmPackagePathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n npm_package: npmPackage,\n });\n }\n /**\n * Parse the project from NpmPackage resource.\n *\n * @param {string} npmPackageName\n * A fully-qualified path representing NpmPackage resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromNpmPackageName(npmPackageName) {\n return this.pathTemplates.npmPackagePathTemplate.match(npmPackageName)\n .project;\n }\n /**\n * Parse the location from NpmPackage resource.\n *\n * @param {string} npmPackageName\n * A fully-qualified path representing NpmPackage resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromNpmPackageName(npmPackageName) {\n return this.pathTemplates.npmPackagePathTemplate.match(npmPackageName)\n .location;\n }\n /**\n * Parse the repository from NpmPackage resource.\n *\n * @param {string} npmPackageName\n * A fully-qualified path representing NpmPackage resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromNpmPackageName(npmPackageName) {\n return this.pathTemplates.npmPackagePathTemplate.match(npmPackageName)\n .repository;\n }\n /**\n * Parse the npm_package from NpmPackage resource.\n *\n * @param {string} npmPackageName\n * A fully-qualified path representing NpmPackage resource.\n * @returns {string} A string representing the npm_package.\n */\n matchNpmPackageFromNpmPackageName(npmPackageName) {\n return this.pathTemplates.npmPackagePathTemplate.match(npmPackageName)\n .npm_package;\n }\n /**\n * Return a fully-qualified package resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} packageParam\n * @returns {string} Resource name string.\n */\n packagePath(project, location, repository, packageParam) {\n return this.pathTemplates.packagePathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n package: packageParam,\n });\n }\n /**\n * Parse the project from Package resource.\n *\n * @param {string} packageName\n * A fully-qualified path representing Package resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromPackageName(packageName) {\n return this.pathTemplates.packagePathTemplate.match(packageName).project;\n }\n /**\n * Parse the location from Package resource.\n *\n * @param {string} packageName\n * A fully-qualified path representing Package resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromPackageName(packageName) {\n return this.pathTemplates.packagePathTemplate.match(packageName).location;\n }\n /**\n * Parse the repository from Package resource.\n *\n * @param {string} packageName\n * A fully-qualified path representing Package resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromPackageName(packageName) {\n return this.pathTemplates.packagePathTemplate.match(packageName).repository;\n }\n /**\n * Parse the package from Package resource.\n *\n * @param {string} packageName\n * A fully-qualified path representing Package resource.\n * @returns {string} A string representing the package.\n */\n matchPackageFromPackageName(packageName) {\n return this.pathTemplates.packagePathTemplate.match(packageName).package;\n }\n /**\n * Return a fully-qualified projectSettings resource name string.\n *\n * @param {string} project\n * @returns {string} Resource name string.\n */\n projectSettingsPath(project) {\n return this.pathTemplates.projectSettingsPathTemplate.render({\n project: project,\n });\n }\n /**\n * Parse the project from ProjectSettings resource.\n *\n * @param {string} projectSettingsName\n * A fully-qualified path representing ProjectSettings resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromProjectSettingsName(projectSettingsName) {\n return this.pathTemplates.projectSettingsPathTemplate.match(projectSettingsName).project;\n }\n /**\n * Return a fully-qualified pythonPackage resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} python_package\n * @returns {string} Resource name string.\n */\n pythonPackagePath(project, location, repository, pythonPackage) {\n return this.pathTemplates.pythonPackagePathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n python_package: pythonPackage,\n });\n }\n /**\n * Parse the project from PythonPackage resource.\n *\n * @param {string} pythonPackageName\n * A fully-qualified path representing PythonPackage resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromPythonPackageName(pythonPackageName) {\n return this.pathTemplates.pythonPackagePathTemplate.match(pythonPackageName)\n .project;\n }\n /**\n * Parse the location from PythonPackage resource.\n *\n * @param {string} pythonPackageName\n * A fully-qualified path representing PythonPackage resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromPythonPackageName(pythonPackageName) {\n return this.pathTemplates.pythonPackagePathTemplate.match(pythonPackageName)\n .location;\n }\n /**\n * Parse the repository from PythonPackage resource.\n *\n * @param {string} pythonPackageName\n * A fully-qualified path representing PythonPackage resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromPythonPackageName(pythonPackageName) {\n return this.pathTemplates.pythonPackagePathTemplate.match(pythonPackageName)\n .repository;\n }\n /**\n * Parse the python_package from PythonPackage resource.\n *\n * @param {string} pythonPackageName\n * A fully-qualified path representing PythonPackage resource.\n * @returns {string} A string representing the python_package.\n */\n matchPythonPackageFromPythonPackageName(pythonPackageName) {\n return this.pathTemplates.pythonPackagePathTemplate.match(pythonPackageName)\n .python_package;\n }\n /**\n * Return a fully-qualified repository resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @returns {string} Resource name string.\n */\n repositoryPath(project, location, repository) {\n return this.pathTemplates.repositoryPathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n });\n }\n /**\n * Parse the project from Repository resource.\n *\n * @param {string} repositoryName\n * A fully-qualified path representing Repository resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromRepositoryName(repositoryName) {\n return this.pathTemplates.repositoryPathTemplate.match(repositoryName)\n .project;\n }\n /**\n * Parse the location from Repository resource.\n *\n * @param {string} repositoryName\n * A fully-qualified path representing Repository resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromRepositoryName(repositoryName) {\n return this.pathTemplates.repositoryPathTemplate.match(repositoryName)\n .location;\n }\n /**\n * Parse the repository from Repository resource.\n *\n * @param {string} repositoryName\n * A fully-qualified path representing Repository resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromRepositoryName(repositoryName) {\n return this.pathTemplates.repositoryPathTemplate.match(repositoryName)\n .repository;\n }\n /**\n * Return a fully-qualified rule resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} rule\n * @returns {string} Resource name string.\n */\n rulePath(project, location, repository, rule) {\n return this.pathTemplates.rulePathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n rule: rule,\n });\n }\n /**\n * Parse the project from Rule resource.\n *\n * @param {string} ruleName\n * A fully-qualified path representing Rule resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromRuleName(ruleName) {\n return this.pathTemplates.rulePathTemplate.match(ruleName).project;\n }\n /**\n * Parse the location from Rule resource.\n *\n * @param {string} ruleName\n * A fully-qualified path representing Rule resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromRuleName(ruleName) {\n return this.pathTemplates.rulePathTemplate.match(ruleName).location;\n }\n /**\n * Parse the repository from Rule resource.\n *\n * @param {string} ruleName\n * A fully-qualified path representing Rule resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromRuleName(ruleName) {\n return this.pathTemplates.rulePathTemplate.match(ruleName).repository;\n }\n /**\n * Parse the rule from Rule resource.\n *\n * @param {string} ruleName\n * A fully-qualified path representing Rule resource.\n * @returns {string} A string representing the rule.\n */\n matchRuleFromRuleName(ruleName) {\n return this.pathTemplates.rulePathTemplate.match(ruleName).rule;\n }\n /**\n * Return a fully-qualified tag resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} packageParam\n * @param {string} tag\n * @returns {string} Resource name string.\n */\n tagPath(project, location, repository, packageParam, tag) {\n return this.pathTemplates.tagPathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n package: packageParam,\n tag: tag,\n });\n }\n /**\n * Parse the project from Tag resource.\n *\n * @param {string} tagName\n * A fully-qualified path representing Tag resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromTagName(tagName) {\n return this.pathTemplates.tagPathTemplate.match(tagName).project;\n }\n /**\n * Parse the location from Tag resource.\n *\n * @param {string} tagName\n * A fully-qualified path representing Tag resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromTagName(tagName) {\n return this.pathTemplates.tagPathTemplate.match(tagName).location;\n }\n /**\n * Parse the repository from Tag resource.\n *\n * @param {string} tagName\n * A fully-qualified path representing Tag resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromTagName(tagName) {\n return this.pathTemplates.tagPathTemplate.match(tagName).repository;\n }\n /**\n * Parse the package from Tag resource.\n *\n * @param {string} tagName\n * A fully-qualified path representing Tag resource.\n * @returns {string} A string representing the package.\n */\n matchPackageFromTagName(tagName) {\n return this.pathTemplates.tagPathTemplate.match(tagName).package;\n }\n /**\n * Parse the tag from Tag resource.\n *\n * @param {string} tagName\n * A fully-qualified path representing Tag resource.\n * @returns {string} A string representing the tag.\n */\n matchTagFromTagName(tagName) {\n return this.pathTemplates.tagPathTemplate.match(tagName).tag;\n }\n /**\n * Return a fully-qualified version resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} packageParam\n * @param {string} version\n * @returns {string} Resource name string.\n */\n versionPath(project, location, repository, packageParam, version) {\n return this.pathTemplates.versionPathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n package: packageParam,\n version: version,\n });\n }\n /**\n * Parse the project from Version resource.\n *\n * @param {string} versionName\n * A fully-qualified path representing Version resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromVersionName(versionName) {\n return this.pathTemplates.versionPathTemplate.match(versionName).project;\n }\n /**\n * Parse the location from Version resource.\n *\n * @param {string} versionName\n * A fully-qualified path representing Version resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromVersionName(versionName) {\n return this.pathTemplates.versionPathTemplate.match(versionName).location;\n }\n /**\n * Parse the repository from Version resource.\n *\n * @param {string} versionName\n * A fully-qualified path representing Version resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromVersionName(versionName) {\n return this.pathTemplates.versionPathTemplate.match(versionName).repository;\n }\n /**\n * Parse the package from Version resource.\n *\n * @param {string} versionName\n * A fully-qualified path representing Version resource.\n * @returns {string} A string representing the package.\n */\n matchPackageFromVersionName(versionName) {\n return this.pathTemplates.versionPathTemplate.match(versionName).package;\n }\n /**\n * Parse the version from Version resource.\n *\n * @param {string} versionName\n * A fully-qualified path representing Version resource.\n * @returns {string} A string representing the version.\n */\n matchVersionFromVersionName(versionName) {\n return this.pathTemplates.versionPathTemplate.match(versionName).version;\n }\n /**\n * Return a fully-qualified vpcscConfig resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @returns {string} Resource name string.\n */\n vpcscConfigPath(project, location) {\n return this.pathTemplates.vpcscConfigPathTemplate.render({\n project: project,\n location: location,\n });\n }\n /**\n * Parse the project from VpcscConfig resource.\n *\n * @param {string} vpcscConfigName\n * A fully-qualified path representing VpcscConfig resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromVpcscConfigName(vpcscConfigName) {\n return this.pathTemplates.vpcscConfigPathTemplate.match(vpcscConfigName)\n .project;\n }\n /**\n * Parse the location from VpcscConfig resource.\n *\n * @param {string} vpcscConfigName\n * A fully-qualified path representing VpcscConfig resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromVpcscConfigName(vpcscConfigName) {\n return this.pathTemplates.vpcscConfigPathTemplate.match(vpcscConfigName)\n .location;\n }\n /**\n * Return a fully-qualified yumArtifact resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} yum_artifact\n * @returns {string} Resource name string.\n */\n yumArtifactPath(project, location, repository, yumArtifact) {\n return this.pathTemplates.yumArtifactPathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n yum_artifact: yumArtifact,\n });\n }\n /**\n * Parse the project from YumArtifact resource.\n *\n * @param {string} yumArtifactName\n * A fully-qualified path representing YumArtifact resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromYumArtifactName(yumArtifactName) {\n return this.pathTemplates.yumArtifactPathTemplate.match(yumArtifactName)\n .project;\n }\n /**\n * Parse the location from YumArtifact resource.\n *\n * @param {string} yumArtifactName\n * A fully-qualified path representing YumArtifact resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromYumArtifactName(yumArtifactName) {\n return this.pathTemplates.yumArtifactPathTemplate.match(yumArtifactName)\n .location;\n }\n /**\n * Parse the repository from YumArtifact resource.\n *\n * @param {string} yumArtifactName\n * A fully-qualified path representing YumArtifact resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromYumArtifactName(yumArtifactName) {\n return this.pathTemplates.yumArtifactPathTemplate.match(yumArtifactName)\n .repository;\n }\n /**\n * Parse the yum_artifact from YumArtifact resource.\n *\n * @param {string} yumArtifactName\n * A fully-qualified path representing YumArtifact resource.\n * @returns {string} A string representing the yum_artifact.\n */\n matchYumArtifactFromYumArtifactName(yumArtifactName) {\n return this.pathTemplates.yumArtifactPathTemplate.match(yumArtifactName)\n .yum_artifact;\n }\n /**\n * Terminate the gRPC channel and close the client.\n *\n * The client will no longer be usable and all future behavior is undefined.\n * @returns {Promise} A promise that resolves when the client is closed.\n */\n close() {\n if (this.artifactRegistryStub && !this._terminated) {\n return this.artifactRegistryStub.then(stub => {\n this._log.info('ending gRPC channel');\n this._terminated = true;\n stub.close();\n this.locationsClient.close();\n this.operationsClient.close();\n });\n }\n return Promise.resolve();\n }\n}\nexports.ArtifactRegistryClient = ArtifactRegistryClient;\n//# sourceMappingURL=artifact_registry_client.js.map","\"use strict\";\n// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// ** This file is automatically generated by gapic-generator-typescript. **\n// ** https://github.com/googleapis/gapic-generator-typescript **\n// ** All changes to this file may be overwritten. **\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ArtifactRegistryClient = void 0;\nvar artifact_registry_client_1 = require(\"./artifact_registry_client\");\nObject.defineProperty(exports, \"ArtifactRegistryClient\", { enumerable: true, get: function () { return artifact_registry_client_1.ArtifactRegistryClient; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// ** This file is automatically generated by gapic-generator-typescript. **\n// ** https://github.com/googleapis/gapic-generator-typescript **\n// ** All changes to this file may be overwritten. **\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ArtifactRegistryClient = void 0;\nconst jsonProtos = require(\"../../protos/protos.json\");\nconst google_gax_1 = require(\"google-gax\");\n/**\n * Client JSON configuration object, loaded from\n * `src/v1beta2/artifact_registry_client_config.json`.\n * This file defines retry strategy and timeouts for all API methods in this library.\n */\nconst gapicConfig = require(\"./artifact_registry_client_config.json\");\nconst version = require('../../../package.json').version;\n/**\n * The Artifact Registry API service.\n *\n * Artifact Registry is an artifact management system for storing artifacts\n * from different package management systems.\n *\n * The resources managed by this API are:\n *\n * * Repositories, which group packages and their data.\n * * Packages, which group versions and their tags.\n * * Versions, which are specific forms of a package.\n * * Tags, which represent alternative names for versions.\n * * Files, which contain content and are optionally associated with a Package\n * or Version.\n * @class\n * @memberof v1beta2\n */\nclass ArtifactRegistryClient {\n _terminated = false;\n _opts;\n _providedCustomServicePath;\n _gaxModule;\n _gaxGrpc;\n _protos;\n _defaults;\n _universeDomain;\n _servicePath;\n _log = google_gax_1.loggingUtils.log('artifact-registry');\n auth;\n descriptors = {\n page: {},\n stream: {},\n longrunning: {},\n batching: {},\n };\n warn;\n innerApiCalls;\n locationsClient;\n pathTemplates;\n operationsClient;\n artifactRegistryStub;\n /**\n * Construct an instance of ArtifactRegistryClient.\n *\n * @param {object} [options] - The configuration object.\n * The options accepted by the constructor are described in detail\n * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).\n * The common options are:\n * @param {object} [options.credentials] - Credentials object.\n * @param {string} [options.credentials.client_email]\n * @param {string} [options.credentials.private_key]\n * @param {string} [options.email] - Account email address. Required when\n * using a .pem or .p12 keyFilename.\n * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or\n * .p12 key downloaded from the Google Developers Console. If you provide\n * a path to a JSON file, the projectId option below is not necessary.\n * NOTE: .pem and .p12 require you to specify options.email as well.\n * @param {number} [options.port] - The port on which to connect to\n * the remote host.\n * @param {string} [options.projectId] - The project ID from the Google\n * Developer's Console, e.g. 'grape-spaceship-123'. We will also check\n * the environment variable GCLOUD_PROJECT for your project ID. If your\n * app is running in an environment which supports\n * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},\n * your project ID will be detected automatically.\n * @param {string} [options.apiEndpoint] - The domain name of the\n * API remote host.\n * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.\n * Follows the structure of {@link gapicConfig}.\n * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.\n * For more information, please check the\n * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.\n * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you\n * need to avoid loading the default gRPC version and want to use the fallback\n * HTTP implementation. Load only fallback version and pass it to the constructor:\n * ```\n * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC\n * const client = new ArtifactRegistryClient({fallback: true}, gax);\n * ```\n */\n constructor(opts, gaxInstance) {\n // Ensure that options include all the required fields.\n const staticMembers = this.constructor;\n if (opts?.universe_domain &&\n opts?.universeDomain &&\n opts?.universe_domain !== opts?.universeDomain) {\n throw new Error('Please set either universe_domain or universeDomain, but not both.');\n }\n const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'\n ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']\n : undefined;\n this._universeDomain =\n opts?.universeDomain ??\n opts?.universe_domain ??\n universeDomainEnvVar ??\n 'googleapis.com';\n this._servicePath = 'artifactregistry.' + this._universeDomain;\n const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;\n this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);\n const port = opts?.port || staticMembers.port;\n const clientConfig = opts?.clientConfig ?? {};\n const fallback = opts?.fallback ??\n (typeof window !== 'undefined' && typeof window?.fetch === 'function');\n opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);\n // Request numeric enum values if REST transport is used.\n opts.numericEnums = true;\n // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.\n if (servicePath !== this._servicePath && !('scopes' in opts)) {\n opts['scopes'] = staticMembers.scopes;\n }\n // Load google-gax module synchronously if needed\n if (!gaxInstance) {\n gaxInstance = require('google-gax');\n }\n // Choose either gRPC or proto-over-HTTP implementation of google-gax.\n this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;\n // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.\n this._gaxGrpc = new this._gaxModule.GrpcClient(opts);\n // Save options to use in initialize() method.\n this._opts = opts;\n // Save the auth object to the client, for use by other methods.\n this.auth = this._gaxGrpc.auth;\n // Set useJWTAccessWithScope on the auth object.\n this.auth.useJWTAccessWithScope = true;\n // Set defaultServicePath on the auth object.\n this.auth.defaultServicePath = this._servicePath;\n // Set the default scopes in auth client if needed.\n if (servicePath === this._servicePath) {\n this.auth.defaultScopes = staticMembers.scopes;\n }\n this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);\n // Determine the client header string.\n const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];\n if (typeof process === 'object' && 'versions' in process) {\n clientHeader.push(`gl-node/${process.versions.node}`);\n }\n else {\n clientHeader.push(`gl-web/${this._gaxModule.version}`);\n }\n if (!opts.fallback) {\n clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);\n }\n else {\n clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);\n }\n if (opts.libName && opts.libVersion) {\n clientHeader.push(`${opts.libName}/${opts.libVersion}`);\n }\n // Load the applicable protos.\n this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);\n // This API contains \"path templates\"; forward-slash-separated\n // identifiers to uniquely identify resources within the API.\n // Create useful helper objects for these.\n this.pathTemplates = {\n aptArtifactPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/aptArtifacts/{apt_artifact}'),\n filePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/files/{file}'),\n projectSettingsPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/projectSettings'),\n repositoryPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}'),\n tagPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag}'),\n versionPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/versions/{version}'),\n yumArtifactPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/yumArtifacts/{yum_artifact}'),\n };\n // Some of the methods on this service return \"paged\" results,\n // (e.g. 50 results at a time, with tokens to get subsequent\n // pages). Denote the keys used for pagination and results.\n this.descriptors.page = {\n listRepositories: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'repositories'),\n listPackages: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'packages'),\n listVersions: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'versions'),\n listFiles: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'files'),\n listTags: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tags'),\n };\n const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);\n // This API contains \"long-running operations\", which return a\n // an Operation object that allows for tracking of the operation,\n // rather than holding a request open.\n const lroOptions = {\n auth: this.auth,\n grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,\n };\n if (opts.fallback) {\n lroOptions.protoJson = protoFilesRoot;\n lroOptions.httpRules = [\n {\n selector: 'google.cloud.location.Locations.GetLocation',\n get: '/v1beta2/{name=projects/*/locations/*}',\n },\n {\n selector: 'google.cloud.location.Locations.ListLocations',\n get: '/v1beta2/{name=projects/*}/locations',\n },\n {\n selector: 'google.longrunning.Operations.GetOperation',\n get: '/v1beta2/{name=projects/*/locations/*/operations/*}',\n },\n ];\n }\n this.operationsClient = this._gaxModule\n .lro(lroOptions)\n .operationsClient(opts);\n const importAptArtifactsResponse = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse');\n const importAptArtifactsMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata');\n const importYumArtifactsResponse = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse');\n const importYumArtifactsMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata');\n const createRepositoryResponse = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1beta2.Repository');\n const createRepositoryMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1beta2.OperationMetadata');\n const deleteRepositoryResponse = protoFilesRoot.lookup('.google.protobuf.Empty');\n const deleteRepositoryMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1beta2.OperationMetadata');\n const deletePackageResponse = protoFilesRoot.lookup('.google.protobuf.Empty');\n const deletePackageMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1beta2.OperationMetadata');\n const deleteVersionResponse = protoFilesRoot.lookup('.google.protobuf.Empty');\n const deleteVersionMetadata = protoFilesRoot.lookup('.google.devtools.artifactregistry.v1beta2.OperationMetadata');\n this.descriptors.longrunning = {\n importAptArtifacts: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importAptArtifactsResponse.decode.bind(importAptArtifactsResponse), importAptArtifactsMetadata.decode.bind(importAptArtifactsMetadata)),\n importYumArtifacts: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importYumArtifactsResponse.decode.bind(importYumArtifactsResponse), importYumArtifactsMetadata.decode.bind(importYumArtifactsMetadata)),\n createRepository: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createRepositoryResponse.decode.bind(createRepositoryResponse), createRepositoryMetadata.decode.bind(createRepositoryMetadata)),\n deleteRepository: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteRepositoryResponse.decode.bind(deleteRepositoryResponse), deleteRepositoryMetadata.decode.bind(deleteRepositoryMetadata)),\n deletePackage: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deletePackageResponse.decode.bind(deletePackageResponse), deletePackageMetadata.decode.bind(deletePackageMetadata)),\n deleteVersion: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteVersionResponse.decode.bind(deleteVersionResponse), deleteVersionMetadata.decode.bind(deleteVersionMetadata)),\n };\n // Put together the default options sent with requests.\n this._defaults = this._gaxGrpc.constructSettings('google.devtools.artifactregistry.v1beta2.ArtifactRegistry', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });\n // Set up a dictionary of \"inner API calls\"; the core implementation\n // of calling the API is handled in `google-gax`, with this code\n // merely providing the destination and request information.\n this.innerApiCalls = {};\n // Add a warn function to the client constructor so it can be easily tested.\n this.warn = this._gaxModule.warn;\n }\n /**\n * Initialize the client.\n * Performs asynchronous operations (such as authentication) and prepares the client.\n * This function will be called automatically when any class method is called for the\n * first time, but if you need to initialize it before calling an actual method,\n * feel free to call initialize() directly.\n *\n * You can await on this method if you want to make sure the client is initialized.\n *\n * @returns {Promise} A promise that resolves to an authenticated service stub.\n */\n initialize() {\n // If the client stub promise is already initialized, return immediately.\n if (this.artifactRegistryStub) {\n return this.artifactRegistryStub;\n }\n // Put together the \"service stub\" for\n // google.devtools.artifactregistry.v1beta2.ArtifactRegistry.\n this.artifactRegistryStub = this._gaxGrpc.createStub(this._opts.fallback\n ? this._protos.lookupService('google.devtools.artifactregistry.v1beta2.ArtifactRegistry')\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._protos.google.devtools.artifactregistry.v1beta2\n .ArtifactRegistry, this._opts, this._providedCustomServicePath);\n // Iterate over each of the methods that the service provides\n // and create an API call method for each.\n const artifactRegistryStubMethods = [\n 'importAptArtifacts',\n 'importYumArtifacts',\n 'listRepositories',\n 'getRepository',\n 'createRepository',\n 'updateRepository',\n 'deleteRepository',\n 'listPackages',\n 'getPackage',\n 'deletePackage',\n 'listVersions',\n 'getVersion',\n 'deleteVersion',\n 'listFiles',\n 'getFile',\n 'listTags',\n 'getTag',\n 'createTag',\n 'updateTag',\n 'deleteTag',\n 'setIamPolicy',\n 'getIamPolicy',\n 'testIamPermissions',\n 'getProjectSettings',\n 'updateProjectSettings',\n ];\n for (const methodName of artifactRegistryStubMethods) {\n const callPromise = this.artifactRegistryStub.then(stub => (...args) => {\n if (this._terminated) {\n return Promise.reject('The client has already been closed.');\n }\n const func = stub[methodName];\n return func.apply(stub, args);\n }, (err) => () => {\n throw err;\n });\n const descriptor = this.descriptors.page[methodName] ||\n this.descriptors.longrunning[methodName] ||\n undefined;\n const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);\n this.innerApiCalls[methodName] = apiCall;\n }\n return this.artifactRegistryStub;\n }\n /**\n * The DNS address for this API service.\n * @deprecated Use the apiEndpoint method of the client instance.\n * @returns {string} The DNS address for this service.\n */\n static get servicePath() {\n if (typeof process === 'object' &&\n typeof process.emitWarning === 'function') {\n process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');\n }\n return 'artifactregistry.googleapis.com';\n }\n /**\n * The DNS address for this API service - same as servicePath.\n * @deprecated Use the apiEndpoint method of the client instance.\n * @returns {string} The DNS address for this service.\n */\n static get apiEndpoint() {\n if (typeof process === 'object' &&\n typeof process.emitWarning === 'function') {\n process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');\n }\n return 'artifactregistry.googleapis.com';\n }\n /**\n * The DNS address for this API service.\n * @returns {string} The DNS address for this service.\n */\n get apiEndpoint() {\n return this._servicePath;\n }\n get universeDomain() {\n return this._universeDomain;\n }\n /**\n * The port for this API service.\n * @returns {number} The default port for this service.\n */\n static get port() {\n return 443;\n }\n /**\n * The scopes needed to make gRPC calls for every method defined\n * in this service.\n * @returns {string[]} List of default scopes.\n */\n static get scopes() {\n return [\n 'https://www.googleapis.com/auth/cloud-platform',\n 'https://www.googleapis.com/auth/cloud-platform.read-only',\n ];\n }\n /**\n * Return the project ID used by this class.\n * @returns {Promise} A promise that resolves to string containing the project ID.\n */\n getProjectId(callback) {\n if (callback) {\n this.auth.getProjectId(callback);\n return;\n }\n return this.auth.getProjectId();\n }\n getRepository(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getRepository request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getRepository response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getRepository(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getRepository response %j', response);\n return [response, options, rawResponse];\n });\n }\n updateRepository(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n 'repository.name': request.repository.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('updateRepository request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('updateRepository response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .updateRepository(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('updateRepository response %j', response);\n return [response, options, rawResponse];\n });\n }\n getPackage(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getPackage request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getPackage response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getPackage(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getPackage response %j', response);\n return [response, options, rawResponse];\n });\n }\n getVersion(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getVersion request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getVersion response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getVersion(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getVersion response %j', response);\n return [response, options, rawResponse];\n });\n }\n getFile(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getFile request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getFile response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getFile(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getFile response %j', response);\n return [response, options, rawResponse];\n });\n }\n getTag(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getTag request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getTag response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getTag(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getTag response %j', response);\n return [response, options, rawResponse];\n });\n }\n createTag(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('createTag request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('createTag response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .createTag(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('createTag response %j', response);\n return [response, options, rawResponse];\n });\n }\n updateTag(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n 'tag.name': request.tag.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('updateTag request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('updateTag response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .updateTag(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('updateTag response %j', response);\n return [response, options, rawResponse];\n });\n }\n deleteTag(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('deleteTag request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('deleteTag response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .deleteTag(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('deleteTag response %j', response);\n return [response, options, rawResponse];\n });\n }\n setIamPolicy(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n resource: request.resource ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('setIamPolicy request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('setIamPolicy response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .setIamPolicy(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('setIamPolicy response %j', response);\n return [response, options, rawResponse];\n });\n }\n getIamPolicy(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n resource: request.resource ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getIamPolicy request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getIamPolicy response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getIamPolicy(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getIamPolicy response %j', response);\n return [response, options, rawResponse];\n });\n }\n testIamPermissions(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n resource: request.resource ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('testIamPermissions request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('testIamPermissions response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .testIamPermissions(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('testIamPermissions response %j', response);\n return [response, options, rawResponse];\n });\n }\n getProjectSettings(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('getProjectSettings request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('getProjectSettings response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .getProjectSettings(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('getProjectSettings response %j', response);\n return [response, options, rawResponse];\n });\n }\n updateProjectSettings(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n 'project_settings.name': request.projectSettings.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('updateProjectSettings request %j', request);\n const wrappedCallback = callback\n ? (error, response, options, rawResponse) => {\n this._log.info('updateProjectSettings response %j', response);\n callback(error, response, options, rawResponse); // We verified callback above.\n }\n : undefined;\n return this.innerApiCalls\n .updateProjectSettings(request, options, wrappedCallback)\n ?.then(([response, options, rawResponse]) => {\n this._log.info('updateProjectSettings response %j', response);\n return [response, options, rawResponse];\n });\n }\n importAptArtifacts(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('importAptArtifacts response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('importAptArtifacts request %j', request);\n return this.innerApiCalls\n .importAptArtifacts(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('importAptArtifacts response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `importAptArtifacts()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1beta2/artifact_registry.import_apt_artifacts.js\n * region_tag:artifactregistry_v1beta2_generated_ArtifactRegistry_ImportAptArtifacts_async\n */\n async checkImportAptArtifactsProgress(name) {\n this._log.info('importAptArtifacts long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importAptArtifacts, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n importYumArtifacts(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('importYumArtifacts response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('importYumArtifacts request %j', request);\n return this.innerApiCalls\n .importYumArtifacts(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('importYumArtifacts response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `importYumArtifacts()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1beta2/artifact_registry.import_yum_artifacts.js\n * region_tag:artifactregistry_v1beta2_generated_ArtifactRegistry_ImportYumArtifacts_async\n */\n async checkImportYumArtifactsProgress(name) {\n this._log.info('importYumArtifacts long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importYumArtifacts, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n createRepository(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('createRepository response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('createRepository request %j', request);\n return this.innerApiCalls\n .createRepository(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('createRepository response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `createRepository()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1beta2/artifact_registry.create_repository.js\n * region_tag:artifactregistry_v1beta2_generated_ArtifactRegistry_CreateRepository_async\n */\n async checkCreateRepositoryProgress(name) {\n this._log.info('createRepository long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createRepository, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n deleteRepository(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('deleteRepository response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('deleteRepository request %j', request);\n return this.innerApiCalls\n .deleteRepository(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('deleteRepository response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `deleteRepository()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1beta2/artifact_registry.delete_repository.js\n * region_tag:artifactregistry_v1beta2_generated_ArtifactRegistry_DeleteRepository_async\n */\n async checkDeleteRepositoryProgress(name) {\n this._log.info('deleteRepository long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteRepository, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n deletePackage(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('deletePackage response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('deletePackage request %j', request);\n return this.innerApiCalls\n .deletePackage(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('deletePackage response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `deletePackage()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1beta2/artifact_registry.delete_package.js\n * region_tag:artifactregistry_v1beta2_generated_ArtifactRegistry_DeletePackage_async\n */\n async checkDeletePackageProgress(name) {\n this._log.info('deletePackage long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deletePackage, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n deleteVersion(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n name: request.name ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, response, rawResponse, _) => {\n this._log.info('deleteVersion response %j', rawResponse);\n callback(error, response, rawResponse, _); // We verified callback above.\n }\n : undefined;\n this._log.info('deleteVersion request %j', request);\n return this.innerApiCalls\n .deleteVersion(request, options, wrappedCallback)\n ?.then(([response, rawResponse, _]) => {\n this._log.info('deleteVersion response %j', rawResponse);\n return [response, rawResponse, _];\n });\n }\n /**\n * Check the status of the long running operation returned by `deleteVersion()`.\n * @param {String} name\n * The operation name that will be passed.\n * @returns {Promise} - The promise which resolves to an object.\n * The decoded operation object has result and metadata field to get information from.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1beta2/artifact_registry.delete_version.js\n * region_tag:artifactregistry_v1beta2_generated_ArtifactRegistry_DeleteVersion_async\n */\n async checkDeleteVersionProgress(name) {\n this._log.info('deleteVersion long-running');\n const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });\n const [operation] = await this.operationsClient.getOperation(request);\n const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteVersion, this._gaxModule.createDefaultBackoffSettings());\n return decodeOperation;\n }\n listRepositories(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listRepositories values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listRepositories request %j', request);\n return this.innerApiCalls\n .listRepositories(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listRepositories values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listRepositories`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose repositories will be listed.\n * @param {number} request.pageSize\n * The maximum number of repositories to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1beta2.Repository|Repository} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listRepositoriesAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listRepositoriesStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listRepositories'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listRepositories stream %j', request);\n return this.descriptors.page.listRepositories.createStream(this.innerApiCalls.listRepositories, request, callSettings);\n }\n /**\n * Equivalent to `listRepositories`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * Required. The name of the parent resource whose repositories will be listed.\n * @param {number} request.pageSize\n * The maximum number of repositories to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1beta2.Repository|Repository}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1beta2/artifact_registry.list_repositories.js\n * region_tag:artifactregistry_v1beta2_generated_ArtifactRegistry_ListRepositories_async\n */\n listRepositoriesAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listRepositories'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listRepositories iterate %j', request);\n return this.descriptors.page.listRepositories.asyncIterate(this.innerApiCalls['listRepositories'], request, callSettings);\n }\n listPackages(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listPackages values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listPackages request %j', request);\n return this.innerApiCalls\n .listPackages(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listPackages values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listPackages`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * The name of the parent resource whose packages will be listed.\n * @param {number} request.pageSize\n * The maximum number of packages to return.\n * Maximum page size is 10,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1beta2.Package|Package} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listPackagesAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listPackagesStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listPackages'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listPackages stream %j', request);\n return this.descriptors.page.listPackages.createStream(this.innerApiCalls.listPackages, request, callSettings);\n }\n /**\n * Equivalent to `listPackages`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * The name of the parent resource whose packages will be listed.\n * @param {number} request.pageSize\n * The maximum number of packages to return.\n * Maximum page size is 10,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1beta2.Package|Package}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1beta2/artifact_registry.list_packages.js\n * region_tag:artifactregistry_v1beta2_generated_ArtifactRegistry_ListPackages_async\n */\n listPackagesAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listPackages'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listPackages iterate %j', request);\n return this.descriptors.page.listPackages.asyncIterate(this.innerApiCalls['listPackages'], request, callSettings);\n }\n listVersions(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listVersions values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listVersions request %j', request);\n return this.innerApiCalls\n .listVersions(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listVersions values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listVersions`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * The name of the parent resource whose versions will be listed.\n * @param {number} request.pageSize\n * The maximum number of versions to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {google.devtools.artifactregistry.v1beta2.VersionView} request.view\n * The view that should be returned in the response.\n * @param {string} [request.orderBy]\n * Optional. The field to order the results by.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1beta2.Version|Version} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listVersionsAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listVersionsStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listVersions'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listVersions stream %j', request);\n return this.descriptors.page.listVersions.createStream(this.innerApiCalls.listVersions, request, callSettings);\n }\n /**\n * Equivalent to `listVersions`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * The name of the parent resource whose versions will be listed.\n * @param {number} request.pageSize\n * The maximum number of versions to return. Maximum page size is 1,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {google.devtools.artifactregistry.v1beta2.VersionView} request.view\n * The view that should be returned in the response.\n * @param {string} [request.orderBy]\n * Optional. The field to order the results by.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1beta2.Version|Version}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1beta2/artifact_registry.list_versions.js\n * region_tag:artifactregistry_v1beta2_generated_ArtifactRegistry_ListVersions_async\n */\n listVersionsAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listVersions'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listVersions iterate %j', request);\n return this.descriptors.page.listVersions.asyncIterate(this.innerApiCalls['listVersions'], request, callSettings);\n }\n listFiles(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listFiles values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listFiles request %j', request);\n return this.innerApiCalls\n .listFiles(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listFiles values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listFiles`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * The name of the repository whose files will be listed. For example:\n * \"projects/p1/locations/us-central1/repositories/repo1\n * @param {string} request.filter\n * An expression for filtering the results of the request. Filter rules are\n * case insensitive. The fields eligible for filtering are:\n *\n * * `name`\n * * `owner`\n *\n * An example of using a filter:\n *\n * * `name=\"projects/p1/locations/us-central1/repositories/repo1/files/a/b/*\"` --> Files with an\n * ID starting with \"a/b/\".\n * * `owner=\"projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0\"` -->\n * Files owned by the version `1.0` in package `pkg1`.\n * @param {number} request.pageSize\n * The maximum number of files to return.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1beta2.File|File} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listFilesAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listFilesStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listFiles'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listFiles stream %j', request);\n return this.descriptors.page.listFiles.createStream(this.innerApiCalls.listFiles, request, callSettings);\n }\n /**\n * Equivalent to `listFiles`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * The name of the repository whose files will be listed. For example:\n * \"projects/p1/locations/us-central1/repositories/repo1\n * @param {string} request.filter\n * An expression for filtering the results of the request. Filter rules are\n * case insensitive. The fields eligible for filtering are:\n *\n * * `name`\n * * `owner`\n *\n * An example of using a filter:\n *\n * * `name=\"projects/p1/locations/us-central1/repositories/repo1/files/a/b/*\"` --> Files with an\n * ID starting with \"a/b/\".\n * * `owner=\"projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0\"` -->\n * Files owned by the version `1.0` in package `pkg1`.\n * @param {number} request.pageSize\n * The maximum number of files to return.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1beta2.File|File}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1beta2/artifact_registry.list_files.js\n * region_tag:artifactregistry_v1beta2_generated_ArtifactRegistry_ListFiles_async\n */\n listFilesAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listFiles'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listFiles iterate %j', request);\n return this.descriptors.page.listFiles.asyncIterate(this.innerApiCalls['listFiles'], request, callSettings);\n }\n listTags(request, optionsOrCallback, callback) {\n request = request || {};\n let options;\n if (typeof optionsOrCallback === 'function' && callback === undefined) {\n callback = optionsOrCallback;\n options = {};\n }\n else {\n options = optionsOrCallback;\n }\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n this.initialize().catch(err => {\n throw err;\n });\n const wrappedCallback = callback\n ? (error, values, nextPageRequest, rawResponse) => {\n this._log.info('listTags values %j', values);\n callback(error, values, nextPageRequest, rawResponse); // We verified callback above.\n }\n : undefined;\n this._log.info('listTags request %j', request);\n return this.innerApiCalls\n .listTags(request, options, wrappedCallback)\n ?.then(([response, input, output]) => {\n this._log.info('listTags values %j', response);\n return [response, input, output];\n });\n }\n /**\n * Equivalent to `listTags`, but returns a NodeJS Stream object.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * The name of the parent resource whose tags will be listed.\n * @param {string} request.filter\n * An expression for filtering the results of the request. Filter rules are\n * case insensitive. The fields eligible for filtering are:\n *\n * * `version`\n *\n * An example of using a filter:\n *\n * * `version=\"projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0\"`\n * --> Tags that are applied to the version `1.0` in package `pkg1`.\n * @param {number} request.pageSize\n * The maximum number of tags to return. Maximum page size is 10,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Stream}\n * An object stream which emits an object representing {@link protos.google.devtools.artifactregistry.v1beta2.Tag|Tag} on 'data' event.\n * The client library will perform auto-pagination by default: it will call the API as many\n * times as needed. Note that it can affect your quota.\n * We recommend using `listTagsAsync()`\n * method described below for async iteration which you can stop as needed.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n */\n listTagsStream(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listTags'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listTags stream %j', request);\n return this.descriptors.page.listTags.createStream(this.innerApiCalls.listTags, request, callSettings);\n }\n /**\n * Equivalent to `listTags`, but returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.parent\n * The name of the parent resource whose tags will be listed.\n * @param {string} request.filter\n * An expression for filtering the results of the request. Filter rules are\n * case insensitive. The fields eligible for filtering are:\n *\n * * `version`\n *\n * An example of using a filter:\n *\n * * `version=\"projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0\"`\n * --> Tags that are applied to the version `1.0` in package `pkg1`.\n * @param {number} request.pageSize\n * The maximum number of tags to return. Maximum page size is 10,000.\n * @param {string} request.pageToken\n * The next_page_token value returned from a previous list request, if any.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link protos.google.devtools.artifactregistry.v1beta2.Tag|Tag}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example include:samples/generated/v1beta2/artifact_registry.list_tags.js\n * region_tag:artifactregistry_v1beta2_generated_ArtifactRegistry_ListTags_async\n */\n listTagsAsync(request, options) {\n request = request || {};\n options = options || {};\n options.otherArgs = options.otherArgs || {};\n options.otherArgs.headers = options.otherArgs.headers || {};\n options.otherArgs.headers['x-goog-request-params'] =\n this._gaxModule.routingHeader.fromParams({\n parent: request.parent ?? '',\n });\n const defaultCallSettings = this._defaults['listTags'];\n const callSettings = defaultCallSettings.merge(options);\n this.initialize().catch(err => {\n throw err;\n });\n this._log.info('listTags iterate %j', request);\n return this.descriptors.page.listTags.asyncIterate(this.innerApiCalls['listTags'], request, callSettings);\n }\n /**\n * Gets information about a location.\n *\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.name\n * Resource name for the location.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.\n * @returns {Promise} - The promise which resolves to an array.\n * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }\n * for more details and examples.\n * @example\n * ```\n * const [response] = await client.getLocation(request);\n * ```\n */\n getLocation(request, options, callback) {\n return this.locationsClient.getLocation(request, options, callback);\n }\n /**\n * Lists information about the supported locations for this service. Returns an iterable object.\n *\n * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.\n * @param {Object} request\n * The request object that will be sent.\n * @param {string} request.name\n * The resource that owns the locations collection, if applicable.\n * @param {string} request.filter\n * The standard list filter.\n * @param {number} request.pageSize\n * The standard list page size.\n * @param {string} request.pageToken\n * The standard list page token.\n * @param {object} [options]\n * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.\n * @returns {Object}\n * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.\n * When you iterate the returned iterable, each element will be an object representing\n * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,\n * so you can stop the iteration when you don't need more results.\n * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }\n * for more details and examples.\n * @example\n * ```\n * const iterable = client.listLocationsAsync(request);\n * for await (const response of iterable) {\n * // process response\n * }\n * ```\n */\n listLocationsAsync(request, options) {\n return this.locationsClient.listLocationsAsync(request, options);\n }\n // --------------------\n // -- Path templates --\n // --------------------\n /**\n * Return a fully-qualified aptArtifact resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} apt_artifact\n * @returns {string} Resource name string.\n */\n aptArtifactPath(project, location, repository, aptArtifact) {\n return this.pathTemplates.aptArtifactPathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n apt_artifact: aptArtifact,\n });\n }\n /**\n * Parse the project from AptArtifact resource.\n *\n * @param {string} aptArtifactName\n * A fully-qualified path representing AptArtifact resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromAptArtifactName(aptArtifactName) {\n return this.pathTemplates.aptArtifactPathTemplate.match(aptArtifactName)\n .project;\n }\n /**\n * Parse the location from AptArtifact resource.\n *\n * @param {string} aptArtifactName\n * A fully-qualified path representing AptArtifact resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromAptArtifactName(aptArtifactName) {\n return this.pathTemplates.aptArtifactPathTemplate.match(aptArtifactName)\n .location;\n }\n /**\n * Parse the repository from AptArtifact resource.\n *\n * @param {string} aptArtifactName\n * A fully-qualified path representing AptArtifact resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromAptArtifactName(aptArtifactName) {\n return this.pathTemplates.aptArtifactPathTemplate.match(aptArtifactName)\n .repository;\n }\n /**\n * Parse the apt_artifact from AptArtifact resource.\n *\n * @param {string} aptArtifactName\n * A fully-qualified path representing AptArtifact resource.\n * @returns {string} A string representing the apt_artifact.\n */\n matchAptArtifactFromAptArtifactName(aptArtifactName) {\n return this.pathTemplates.aptArtifactPathTemplate.match(aptArtifactName)\n .apt_artifact;\n }\n /**\n * Return a fully-qualified file resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} file\n * @returns {string} Resource name string.\n */\n filePath(project, location, repository, file) {\n return this.pathTemplates.filePathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n file: file,\n });\n }\n /**\n * Parse the project from File resource.\n *\n * @param {string} fileName\n * A fully-qualified path representing File resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromFileName(fileName) {\n return this.pathTemplates.filePathTemplate.match(fileName).project;\n }\n /**\n * Parse the location from File resource.\n *\n * @param {string} fileName\n * A fully-qualified path representing File resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromFileName(fileName) {\n return this.pathTemplates.filePathTemplate.match(fileName).location;\n }\n /**\n * Parse the repository from File resource.\n *\n * @param {string} fileName\n * A fully-qualified path representing File resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromFileName(fileName) {\n return this.pathTemplates.filePathTemplate.match(fileName).repository;\n }\n /**\n * Parse the file from File resource.\n *\n * @param {string} fileName\n * A fully-qualified path representing File resource.\n * @returns {string} A string representing the file.\n */\n matchFileFromFileName(fileName) {\n return this.pathTemplates.filePathTemplate.match(fileName).file;\n }\n /**\n * Return a fully-qualified projectSettings resource name string.\n *\n * @param {string} project\n * @returns {string} Resource name string.\n */\n projectSettingsPath(project) {\n return this.pathTemplates.projectSettingsPathTemplate.render({\n project: project,\n });\n }\n /**\n * Parse the project from ProjectSettings resource.\n *\n * @param {string} projectSettingsName\n * A fully-qualified path representing ProjectSettings resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromProjectSettingsName(projectSettingsName) {\n return this.pathTemplates.projectSettingsPathTemplate.match(projectSettingsName).project;\n }\n /**\n * Return a fully-qualified repository resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @returns {string} Resource name string.\n */\n repositoryPath(project, location, repository) {\n return this.pathTemplates.repositoryPathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n });\n }\n /**\n * Parse the project from Repository resource.\n *\n * @param {string} repositoryName\n * A fully-qualified path representing Repository resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromRepositoryName(repositoryName) {\n return this.pathTemplates.repositoryPathTemplate.match(repositoryName)\n .project;\n }\n /**\n * Parse the location from Repository resource.\n *\n * @param {string} repositoryName\n * A fully-qualified path representing Repository resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromRepositoryName(repositoryName) {\n return this.pathTemplates.repositoryPathTemplate.match(repositoryName)\n .location;\n }\n /**\n * Parse the repository from Repository resource.\n *\n * @param {string} repositoryName\n * A fully-qualified path representing Repository resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromRepositoryName(repositoryName) {\n return this.pathTemplates.repositoryPathTemplate.match(repositoryName)\n .repository;\n }\n /**\n * Return a fully-qualified tag resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} packageParam\n * @param {string} tag\n * @returns {string} Resource name string.\n */\n tagPath(project, location, repository, packageParam, tag) {\n return this.pathTemplates.tagPathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n package: packageParam,\n tag: tag,\n });\n }\n /**\n * Parse the project from Tag resource.\n *\n * @param {string} tagName\n * A fully-qualified path representing Tag resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromTagName(tagName) {\n return this.pathTemplates.tagPathTemplate.match(tagName).project;\n }\n /**\n * Parse the location from Tag resource.\n *\n * @param {string} tagName\n * A fully-qualified path representing Tag resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromTagName(tagName) {\n return this.pathTemplates.tagPathTemplate.match(tagName).location;\n }\n /**\n * Parse the repository from Tag resource.\n *\n * @param {string} tagName\n * A fully-qualified path representing Tag resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromTagName(tagName) {\n return this.pathTemplates.tagPathTemplate.match(tagName).repository;\n }\n /**\n * Parse the package from Tag resource.\n *\n * @param {string} tagName\n * A fully-qualified path representing Tag resource.\n * @returns {string} A string representing the package.\n */\n matchPackageFromTagName(tagName) {\n return this.pathTemplates.tagPathTemplate.match(tagName).package;\n }\n /**\n * Parse the tag from Tag resource.\n *\n * @param {string} tagName\n * A fully-qualified path representing Tag resource.\n * @returns {string} A string representing the tag.\n */\n matchTagFromTagName(tagName) {\n return this.pathTemplates.tagPathTemplate.match(tagName).tag;\n }\n /**\n * Return a fully-qualified version resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} packageParam\n * @param {string} version\n * @returns {string} Resource name string.\n */\n versionPath(project, location, repository, packageParam, version) {\n return this.pathTemplates.versionPathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n package: packageParam,\n version: version,\n });\n }\n /**\n * Parse the project from Version resource.\n *\n * @param {string} versionName\n * A fully-qualified path representing Version resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromVersionName(versionName) {\n return this.pathTemplates.versionPathTemplate.match(versionName).project;\n }\n /**\n * Parse the location from Version resource.\n *\n * @param {string} versionName\n * A fully-qualified path representing Version resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromVersionName(versionName) {\n return this.pathTemplates.versionPathTemplate.match(versionName).location;\n }\n /**\n * Parse the repository from Version resource.\n *\n * @param {string} versionName\n * A fully-qualified path representing Version resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromVersionName(versionName) {\n return this.pathTemplates.versionPathTemplate.match(versionName).repository;\n }\n /**\n * Parse the package from Version resource.\n *\n * @param {string} versionName\n * A fully-qualified path representing Version resource.\n * @returns {string} A string representing the package.\n */\n matchPackageFromVersionName(versionName) {\n return this.pathTemplates.versionPathTemplate.match(versionName).package;\n }\n /**\n * Parse the version from Version resource.\n *\n * @param {string} versionName\n * A fully-qualified path representing Version resource.\n * @returns {string} A string representing the version.\n */\n matchVersionFromVersionName(versionName) {\n return this.pathTemplates.versionPathTemplate.match(versionName).version;\n }\n /**\n * Return a fully-qualified yumArtifact resource name string.\n *\n * @param {string} project\n * @param {string} location\n * @param {string} repository\n * @param {string} yum_artifact\n * @returns {string} Resource name string.\n */\n yumArtifactPath(project, location, repository, yumArtifact) {\n return this.pathTemplates.yumArtifactPathTemplate.render({\n project: project,\n location: location,\n repository: repository,\n yum_artifact: yumArtifact,\n });\n }\n /**\n * Parse the project from YumArtifact resource.\n *\n * @param {string} yumArtifactName\n * A fully-qualified path representing YumArtifact resource.\n * @returns {string} A string representing the project.\n */\n matchProjectFromYumArtifactName(yumArtifactName) {\n return this.pathTemplates.yumArtifactPathTemplate.match(yumArtifactName)\n .project;\n }\n /**\n * Parse the location from YumArtifact resource.\n *\n * @param {string} yumArtifactName\n * A fully-qualified path representing YumArtifact resource.\n * @returns {string} A string representing the location.\n */\n matchLocationFromYumArtifactName(yumArtifactName) {\n return this.pathTemplates.yumArtifactPathTemplate.match(yumArtifactName)\n .location;\n }\n /**\n * Parse the repository from YumArtifact resource.\n *\n * @param {string} yumArtifactName\n * A fully-qualified path representing YumArtifact resource.\n * @returns {string} A string representing the repository.\n */\n matchRepositoryFromYumArtifactName(yumArtifactName) {\n return this.pathTemplates.yumArtifactPathTemplate.match(yumArtifactName)\n .repository;\n }\n /**\n * Parse the yum_artifact from YumArtifact resource.\n *\n * @param {string} yumArtifactName\n * A fully-qualified path representing YumArtifact resource.\n * @returns {string} A string representing the yum_artifact.\n */\n matchYumArtifactFromYumArtifactName(yumArtifactName) {\n return this.pathTemplates.yumArtifactPathTemplate.match(yumArtifactName)\n .yum_artifact;\n }\n /**\n * Terminate the gRPC channel and close the client.\n *\n * The client will no longer be usable and all future behavior is undefined.\n * @returns {Promise} A promise that resolves when the client is closed.\n */\n close() {\n if (this.artifactRegistryStub && !this._terminated) {\n return this.artifactRegistryStub.then(stub => {\n this._log.info('ending gRPC channel');\n this._terminated = true;\n stub.close();\n this.locationsClient.close();\n this.operationsClient.close();\n });\n }\n return Promise.resolve();\n }\n}\nexports.ArtifactRegistryClient = ArtifactRegistryClient;\n//# sourceMappingURL=artifact_registry_client.js.map","\"use strict\";\n// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// ** This file is automatically generated by gapic-generator-typescript. **\n// ** https://github.com/googleapis/gapic-generator-typescript **\n// ** All changes to this file may be overwritten. **\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ArtifactRegistryClient = void 0;\nvar artifact_registry_client_1 = require(\"./artifact_registry_client\");\nObject.defineProperty(exports, \"ArtifactRegistryClient\", { enumerable: true, get: function () { return artifact_registry_client_1.ArtifactRegistryClient; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\n/**\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.protobufMinimal = void 0;\n// This file is here to re-export protobuf.js so that the proto.js files\n// produced by tools/compileProtos.ts did not depend on protobuf.js\n// directly.\n// Usage:\n// const {protobufMinimal} = require('google-gax/build/src/protobuf');\nexports.protobufMinimal = __importStar(require(\"protobufjs/minimal\"));\n//# sourceMappingURL=protobuf.js.map","// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n(function(global, factory) { /* global define, require, module */\n\n /* AMD */ if (typeof define === 'function' && define.amd)\n define([\"protobufjs/minimal\"], factory);\n\n /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)\n module.exports = factory(require(\"google-gax/build/src/protobuf\").protobufMinimal);\n\n})(this, function($protobuf) {\n \"use strict\";\n\n // Common aliases\n var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n \n // Exported root namespace\n var $root = $protobuf.roots._google_cloud_artifact_registry_protos || ($protobuf.roots._google_cloud_artifact_registry_protos = {});\n \n $root.google = (function() {\n \n /**\n * Namespace google.\n * @exports google\n * @namespace\n */\n var google = {};\n \n google.devtools = (function() {\n \n /**\n * Namespace devtools.\n * @memberof google\n * @namespace\n */\n var devtools = {};\n \n devtools.artifactregistry = (function() {\n \n /**\n * Namespace artifactregistry.\n * @memberof google.devtools\n * @namespace\n */\n var artifactregistry = {};\n \n artifactregistry.v1 = (function() {\n \n /**\n * Namespace v1.\n * @memberof google.devtools.artifactregistry\n * @namespace\n */\n var v1 = {};\n \n v1.AptArtifact = (function() {\n \n /**\n * Properties of an AptArtifact.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IAptArtifact\n * @property {string|null} [name] AptArtifact name\n * @property {string|null} [packageName] AptArtifact packageName\n * @property {google.devtools.artifactregistry.v1.AptArtifact.PackageType|null} [packageType] AptArtifact packageType\n * @property {string|null} [architecture] AptArtifact architecture\n * @property {string|null} [component] AptArtifact component\n * @property {Uint8Array|null} [controlFile] AptArtifact controlFile\n */\n \n /**\n * Constructs a new AptArtifact.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an AptArtifact.\n * @implements IAptArtifact\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IAptArtifact=} [properties] Properties to set\n */\n function AptArtifact(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * AptArtifact name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @instance\n */\n AptArtifact.prototype.name = \"\";\n \n /**\n * AptArtifact packageName.\n * @member {string} packageName\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @instance\n */\n AptArtifact.prototype.packageName = \"\";\n \n /**\n * AptArtifact packageType.\n * @member {google.devtools.artifactregistry.v1.AptArtifact.PackageType} packageType\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @instance\n */\n AptArtifact.prototype.packageType = 0;\n \n /**\n * AptArtifact architecture.\n * @member {string} architecture\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @instance\n */\n AptArtifact.prototype.architecture = \"\";\n \n /**\n * AptArtifact component.\n * @member {string} component\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @instance\n */\n AptArtifact.prototype.component = \"\";\n \n /**\n * AptArtifact controlFile.\n * @member {Uint8Array} controlFile\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @instance\n */\n AptArtifact.prototype.controlFile = $util.newBuffer([]);\n \n /**\n * Creates a new AptArtifact instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.IAptArtifact=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.AptArtifact} AptArtifact instance\n */\n AptArtifact.create = function create(properties) {\n return new AptArtifact(properties);\n };\n \n /**\n * Encodes the specified AptArtifact message. Does not implicitly {@link google.devtools.artifactregistry.v1.AptArtifact.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.IAptArtifact} message AptArtifact message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n AptArtifact.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.packageName != null && Object.hasOwnProperty.call(message, \"packageName\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.packageName);\n if (message.packageType != null && Object.hasOwnProperty.call(message, \"packageType\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.packageType);\n if (message.architecture != null && Object.hasOwnProperty.call(message, \"architecture\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.architecture);\n if (message.component != null && Object.hasOwnProperty.call(message, \"component\"))\n writer.uint32(/* id 5, wireType 2 =*/42).string(message.component);\n if (message.controlFile != null && Object.hasOwnProperty.call(message, \"controlFile\"))\n writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.controlFile);\n return writer;\n };\n \n /**\n * Encodes the specified AptArtifact message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.AptArtifact.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.IAptArtifact} message AptArtifact message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n AptArtifact.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an AptArtifact message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.AptArtifact} AptArtifact\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n AptArtifact.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.AptArtifact();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.packageName = reader.string();\n break;\n }\n case 3: {\n message.packageType = reader.int32();\n break;\n }\n case 4: {\n message.architecture = reader.string();\n break;\n }\n case 5: {\n message.component = reader.string();\n break;\n }\n case 6: {\n message.controlFile = reader.bytes();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an AptArtifact message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.AptArtifact} AptArtifact\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n AptArtifact.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an AptArtifact message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n AptArtifact.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.packageName != null && message.hasOwnProperty(\"packageName\"))\n if (!$util.isString(message.packageName))\n return \"packageName: string expected\";\n if (message.packageType != null && message.hasOwnProperty(\"packageType\"))\n switch (message.packageType) {\n default:\n return \"packageType: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.architecture != null && message.hasOwnProperty(\"architecture\"))\n if (!$util.isString(message.architecture))\n return \"architecture: string expected\";\n if (message.component != null && message.hasOwnProperty(\"component\"))\n if (!$util.isString(message.component))\n return \"component: string expected\";\n if (message.controlFile != null && message.hasOwnProperty(\"controlFile\"))\n if (!(message.controlFile && typeof message.controlFile.length === \"number\" || $util.isString(message.controlFile)))\n return \"controlFile: buffer expected\";\n return null;\n };\n \n /**\n * Creates an AptArtifact message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.AptArtifact} AptArtifact\n */\n AptArtifact.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.AptArtifact)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.AptArtifact();\n if (object.name != null)\n message.name = String(object.name);\n if (object.packageName != null)\n message.packageName = String(object.packageName);\n switch (object.packageType) {\n default:\n if (typeof object.packageType === \"number\") {\n message.packageType = object.packageType;\n break;\n }\n break;\n case \"PACKAGE_TYPE_UNSPECIFIED\":\n case 0:\n message.packageType = 0;\n break;\n case \"BINARY\":\n case 1:\n message.packageType = 1;\n break;\n case \"SOURCE\":\n case 2:\n message.packageType = 2;\n break;\n }\n if (object.architecture != null)\n message.architecture = String(object.architecture);\n if (object.component != null)\n message.component = String(object.component);\n if (object.controlFile != null)\n if (typeof object.controlFile === \"string\")\n $util.base64.decode(object.controlFile, message.controlFile = $util.newBuffer($util.base64.length(object.controlFile)), 0);\n else if (object.controlFile.length >= 0)\n message.controlFile = object.controlFile;\n return message;\n };\n \n /**\n * Creates a plain object from an AptArtifact message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.AptArtifact} message AptArtifact\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n AptArtifact.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.packageName = \"\";\n object.packageType = options.enums === String ? \"PACKAGE_TYPE_UNSPECIFIED\" : 0;\n object.architecture = \"\";\n object.component = \"\";\n if (options.bytes === String)\n object.controlFile = \"\";\n else {\n object.controlFile = [];\n if (options.bytes !== Array)\n object.controlFile = $util.newBuffer(object.controlFile);\n }\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.packageName != null && message.hasOwnProperty(\"packageName\"))\n object.packageName = message.packageName;\n if (message.packageType != null && message.hasOwnProperty(\"packageType\"))\n object.packageType = options.enums === String ? $root.google.devtools.artifactregistry.v1.AptArtifact.PackageType[message.packageType] === undefined ? message.packageType : $root.google.devtools.artifactregistry.v1.AptArtifact.PackageType[message.packageType] : message.packageType;\n if (message.architecture != null && message.hasOwnProperty(\"architecture\"))\n object.architecture = message.architecture;\n if (message.component != null && message.hasOwnProperty(\"component\"))\n object.component = message.component;\n if (message.controlFile != null && message.hasOwnProperty(\"controlFile\"))\n object.controlFile = options.bytes === String ? $util.base64.encode(message.controlFile, 0, message.controlFile.length) : options.bytes === Array ? Array.prototype.slice.call(message.controlFile) : message.controlFile;\n return object;\n };\n \n /**\n * Converts this AptArtifact to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @instance\n * @returns {Object.} JSON object\n */\n AptArtifact.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for AptArtifact\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.AptArtifact\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n AptArtifact.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.AptArtifact\";\n };\n \n /**\n * PackageType enum.\n * @name google.devtools.artifactregistry.v1.AptArtifact.PackageType\n * @enum {number}\n * @property {number} PACKAGE_TYPE_UNSPECIFIED=0 PACKAGE_TYPE_UNSPECIFIED value\n * @property {number} BINARY=1 BINARY value\n * @property {number} SOURCE=2 SOURCE value\n */\n AptArtifact.PackageType = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"PACKAGE_TYPE_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"BINARY\"] = 1;\n values[valuesById[2] = \"SOURCE\"] = 2;\n return values;\n })();\n \n return AptArtifact;\n })();\n \n v1.ImportAptArtifactsGcsSource = (function() {\n \n /**\n * Properties of an ImportAptArtifactsGcsSource.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IImportAptArtifactsGcsSource\n * @property {Array.|null} [uris] ImportAptArtifactsGcsSource uris\n * @property {boolean|null} [useWildcards] ImportAptArtifactsGcsSource useWildcards\n */\n \n /**\n * Constructs a new ImportAptArtifactsGcsSource.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an ImportAptArtifactsGcsSource.\n * @implements IImportAptArtifactsGcsSource\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsGcsSource=} [properties] Properties to set\n */\n function ImportAptArtifactsGcsSource(properties) {\n this.uris = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportAptArtifactsGcsSource uris.\n * @member {Array.} uris\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource\n * @instance\n */\n ImportAptArtifactsGcsSource.prototype.uris = $util.emptyArray;\n \n /**\n * ImportAptArtifactsGcsSource useWildcards.\n * @member {boolean} useWildcards\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource\n * @instance\n */\n ImportAptArtifactsGcsSource.prototype.useWildcards = false;\n \n /**\n * Creates a new ImportAptArtifactsGcsSource instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsGcsSource=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource} ImportAptArtifactsGcsSource instance\n */\n ImportAptArtifactsGcsSource.create = function create(properties) {\n return new ImportAptArtifactsGcsSource(properties);\n };\n \n /**\n * Encodes the specified ImportAptArtifactsGcsSource message. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsGcsSource} message ImportAptArtifactsGcsSource message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsGcsSource.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.uris != null && message.uris.length)\n for (var i = 0; i < message.uris.length; ++i)\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.uris[i]);\n if (message.useWildcards != null && Object.hasOwnProperty.call(message, \"useWildcards\"))\n writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useWildcards);\n return writer;\n };\n \n /**\n * Encodes the specified ImportAptArtifactsGcsSource message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsGcsSource} message ImportAptArtifactsGcsSource message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsGcsSource.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportAptArtifactsGcsSource message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource} ImportAptArtifactsGcsSource\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsGcsSource.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.uris && message.uris.length))\n message.uris = [];\n message.uris.push(reader.string());\n break;\n }\n case 2: {\n message.useWildcards = reader.bool();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportAptArtifactsGcsSource message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource} ImportAptArtifactsGcsSource\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsGcsSource.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportAptArtifactsGcsSource message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportAptArtifactsGcsSource.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.uris != null && message.hasOwnProperty(\"uris\")) {\n if (!Array.isArray(message.uris))\n return \"uris: array expected\";\n for (var i = 0; i < message.uris.length; ++i)\n if (!$util.isString(message.uris[i]))\n return \"uris: string[] expected\";\n }\n if (message.useWildcards != null && message.hasOwnProperty(\"useWildcards\"))\n if (typeof message.useWildcards !== \"boolean\")\n return \"useWildcards: boolean expected\";\n return null;\n };\n \n /**\n * Creates an ImportAptArtifactsGcsSource message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource} ImportAptArtifactsGcsSource\n */\n ImportAptArtifactsGcsSource.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource();\n if (object.uris) {\n if (!Array.isArray(object.uris))\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource.uris: array expected\");\n message.uris = [];\n for (var i = 0; i < object.uris.length; ++i)\n message.uris[i] = String(object.uris[i]);\n }\n if (object.useWildcards != null)\n message.useWildcards = Boolean(object.useWildcards);\n return message;\n };\n \n /**\n * Creates a plain object from an ImportAptArtifactsGcsSource message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource} message ImportAptArtifactsGcsSource\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportAptArtifactsGcsSource.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.uris = [];\n if (options.defaults)\n object.useWildcards = false;\n if (message.uris && message.uris.length) {\n object.uris = [];\n for (var j = 0; j < message.uris.length; ++j)\n object.uris[j] = message.uris[j];\n }\n if (message.useWildcards != null && message.hasOwnProperty(\"useWildcards\"))\n object.useWildcards = message.useWildcards;\n return object;\n };\n \n /**\n * Converts this ImportAptArtifactsGcsSource to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource\n * @instance\n * @returns {Object.} JSON object\n */\n ImportAptArtifactsGcsSource.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportAptArtifactsGcsSource\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportAptArtifactsGcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource\";\n };\n \n return ImportAptArtifactsGcsSource;\n })();\n \n v1.ImportAptArtifactsRequest = (function() {\n \n /**\n * Properties of an ImportAptArtifactsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IImportAptArtifactsRequest\n * @property {google.devtools.artifactregistry.v1.IImportAptArtifactsGcsSource|null} [gcsSource] ImportAptArtifactsRequest gcsSource\n * @property {string|null} [parent] ImportAptArtifactsRequest parent\n */\n \n /**\n * Constructs a new ImportAptArtifactsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an ImportAptArtifactsRequest.\n * @implements IImportAptArtifactsRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsRequest=} [properties] Properties to set\n */\n function ImportAptArtifactsRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportAptArtifactsRequest gcsSource.\n * @member {google.devtools.artifactregistry.v1.IImportAptArtifactsGcsSource|null|undefined} gcsSource\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsRequest\n * @instance\n */\n ImportAptArtifactsRequest.prototype.gcsSource = null;\n \n /**\n * ImportAptArtifactsRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsRequest\n * @instance\n */\n ImportAptArtifactsRequest.prototype.parent = \"\";\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * ImportAptArtifactsRequest source.\n * @member {\"gcsSource\"|undefined} source\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsRequest\n * @instance\n */\n Object.defineProperty(ImportAptArtifactsRequest.prototype, \"source\", {\n get: $util.oneOfGetter($oneOfFields = [\"gcsSource\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new ImportAptArtifactsRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsRequest} ImportAptArtifactsRequest instance\n */\n ImportAptArtifactsRequest.create = function create(properties) {\n return new ImportAptArtifactsRequest(properties);\n };\n \n /**\n * Encodes the specified ImportAptArtifactsRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportAptArtifactsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsRequest} message ImportAptArtifactsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.gcsSource != null && Object.hasOwnProperty.call(message, \"gcsSource\"))\n $root.google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ImportAptArtifactsRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportAptArtifactsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsRequest} message ImportAptArtifactsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportAptArtifactsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsRequest} ImportAptArtifactsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ImportAptArtifactsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n message.gcsSource = $root.google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource.decode(reader, reader.uint32());\n break;\n }\n case 1: {\n message.parent = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportAptArtifactsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsRequest} ImportAptArtifactsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportAptArtifactsRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportAptArtifactsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n properties.source = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource.verify(message.gcsSource);\n if (error)\n return \"gcsSource.\" + error;\n }\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n return null;\n };\n \n /**\n * Creates an ImportAptArtifactsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsRequest} ImportAptArtifactsRequest\n */\n ImportAptArtifactsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ImportAptArtifactsRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ImportAptArtifactsRequest();\n if (object.gcsSource != null) {\n if (typeof object.gcsSource !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportAptArtifactsRequest.gcsSource: object expected\");\n message.gcsSource = $root.google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource.fromObject(object.gcsSource);\n }\n if (object.parent != null)\n message.parent = String(object.parent);\n return message;\n };\n \n /**\n * Creates a plain object from an ImportAptArtifactsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ImportAptArtifactsRequest} message ImportAptArtifactsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportAptArtifactsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.parent = \"\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n object.gcsSource = $root.google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource.toObject(message.gcsSource, options);\n if (options.oneofs)\n object.source = \"gcsSource\";\n }\n return object;\n };\n \n /**\n * Converts this ImportAptArtifactsRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ImportAptArtifactsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportAptArtifactsRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportAptArtifactsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ImportAptArtifactsRequest\";\n };\n \n return ImportAptArtifactsRequest;\n })();\n \n v1.ImportAptArtifactsErrorInfo = (function() {\n \n /**\n * Properties of an ImportAptArtifactsErrorInfo.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IImportAptArtifactsErrorInfo\n * @property {google.devtools.artifactregistry.v1.IImportAptArtifactsGcsSource|null} [gcsSource] ImportAptArtifactsErrorInfo gcsSource\n * @property {google.rpc.IStatus|null} [error] ImportAptArtifactsErrorInfo error\n */\n \n /**\n * Constructs a new ImportAptArtifactsErrorInfo.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an ImportAptArtifactsErrorInfo.\n * @implements IImportAptArtifactsErrorInfo\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsErrorInfo=} [properties] Properties to set\n */\n function ImportAptArtifactsErrorInfo(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportAptArtifactsErrorInfo gcsSource.\n * @member {google.devtools.artifactregistry.v1.IImportAptArtifactsGcsSource|null|undefined} gcsSource\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo\n * @instance\n */\n ImportAptArtifactsErrorInfo.prototype.gcsSource = null;\n \n /**\n * ImportAptArtifactsErrorInfo error.\n * @member {google.rpc.IStatus|null|undefined} error\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo\n * @instance\n */\n ImportAptArtifactsErrorInfo.prototype.error = null;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * ImportAptArtifactsErrorInfo source.\n * @member {\"gcsSource\"|undefined} source\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo\n * @instance\n */\n Object.defineProperty(ImportAptArtifactsErrorInfo.prototype, \"source\", {\n get: $util.oneOfGetter($oneOfFields = [\"gcsSource\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new ImportAptArtifactsErrorInfo instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsErrorInfo=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo} ImportAptArtifactsErrorInfo instance\n */\n ImportAptArtifactsErrorInfo.create = function create(properties) {\n return new ImportAptArtifactsErrorInfo(properties);\n };\n \n /**\n * Encodes the specified ImportAptArtifactsErrorInfo message. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsErrorInfo} message ImportAptArtifactsErrorInfo message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsErrorInfo.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.gcsSource != null && Object.hasOwnProperty.call(message, \"gcsSource\"))\n $root.google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.error != null && Object.hasOwnProperty.call(message, \"error\"))\n $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ImportAptArtifactsErrorInfo message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsErrorInfo} message ImportAptArtifactsErrorInfo message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsErrorInfo.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportAptArtifactsErrorInfo message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo} ImportAptArtifactsErrorInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsErrorInfo.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.gcsSource = $root.google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.error = $root.google.rpc.Status.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportAptArtifactsErrorInfo message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo} ImportAptArtifactsErrorInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsErrorInfo.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportAptArtifactsErrorInfo message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportAptArtifactsErrorInfo.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n properties.source = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource.verify(message.gcsSource);\n if (error)\n return \"gcsSource.\" + error;\n }\n }\n if (message.error != null && message.hasOwnProperty(\"error\")) {\n var error = $root.google.rpc.Status.verify(message.error);\n if (error)\n return \"error.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an ImportAptArtifactsErrorInfo message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo} ImportAptArtifactsErrorInfo\n */\n ImportAptArtifactsErrorInfo.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo();\n if (object.gcsSource != null) {\n if (typeof object.gcsSource !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo.gcsSource: object expected\");\n message.gcsSource = $root.google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource.fromObject(object.gcsSource);\n }\n if (object.error != null) {\n if (typeof object.error !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo.error: object expected\");\n message.error = $root.google.rpc.Status.fromObject(object.error);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an ImportAptArtifactsErrorInfo message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo} message ImportAptArtifactsErrorInfo\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportAptArtifactsErrorInfo.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.error = null;\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n object.gcsSource = $root.google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource.toObject(message.gcsSource, options);\n if (options.oneofs)\n object.source = \"gcsSource\";\n }\n if (message.error != null && message.hasOwnProperty(\"error\"))\n object.error = $root.google.rpc.Status.toObject(message.error, options);\n return object;\n };\n \n /**\n * Converts this ImportAptArtifactsErrorInfo to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo\n * @instance\n * @returns {Object.} JSON object\n */\n ImportAptArtifactsErrorInfo.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportAptArtifactsErrorInfo\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportAptArtifactsErrorInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo\";\n };\n \n return ImportAptArtifactsErrorInfo;\n })();\n \n v1.ImportAptArtifactsResponse = (function() {\n \n /**\n * Properties of an ImportAptArtifactsResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IImportAptArtifactsResponse\n * @property {Array.|null} [aptArtifacts] ImportAptArtifactsResponse aptArtifacts\n * @property {Array.|null} [errors] ImportAptArtifactsResponse errors\n */\n \n /**\n * Constructs a new ImportAptArtifactsResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an ImportAptArtifactsResponse.\n * @implements IImportAptArtifactsResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsResponse=} [properties] Properties to set\n */\n function ImportAptArtifactsResponse(properties) {\n this.aptArtifacts = [];\n this.errors = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportAptArtifactsResponse aptArtifacts.\n * @member {Array.} aptArtifacts\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsResponse\n * @instance\n */\n ImportAptArtifactsResponse.prototype.aptArtifacts = $util.emptyArray;\n \n /**\n * ImportAptArtifactsResponse errors.\n * @member {Array.} errors\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsResponse\n * @instance\n */\n ImportAptArtifactsResponse.prototype.errors = $util.emptyArray;\n \n /**\n * Creates a new ImportAptArtifactsResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsResponse} ImportAptArtifactsResponse instance\n */\n ImportAptArtifactsResponse.create = function create(properties) {\n return new ImportAptArtifactsResponse(properties);\n };\n \n /**\n * Encodes the specified ImportAptArtifactsResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportAptArtifactsResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsResponse} message ImportAptArtifactsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.aptArtifacts != null && message.aptArtifacts.length)\n for (var i = 0; i < message.aptArtifacts.length; ++i)\n $root.google.devtools.artifactregistry.v1.AptArtifact.encode(message.aptArtifacts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.errors != null && message.errors.length)\n for (var i = 0; i < message.errors.length; ++i)\n $root.google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo.encode(message.errors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ImportAptArtifactsResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportAptArtifactsResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsResponse} message ImportAptArtifactsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportAptArtifactsResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsResponse} ImportAptArtifactsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ImportAptArtifactsResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.aptArtifacts && message.aptArtifacts.length))\n message.aptArtifacts = [];\n message.aptArtifacts.push($root.google.devtools.artifactregistry.v1.AptArtifact.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n if (!(message.errors && message.errors.length))\n message.errors = [];\n message.errors.push($root.google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportAptArtifactsResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsResponse} ImportAptArtifactsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportAptArtifactsResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportAptArtifactsResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.aptArtifacts != null && message.hasOwnProperty(\"aptArtifacts\")) {\n if (!Array.isArray(message.aptArtifacts))\n return \"aptArtifacts: array expected\";\n for (var i = 0; i < message.aptArtifacts.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.AptArtifact.verify(message.aptArtifacts[i]);\n if (error)\n return \"aptArtifacts.\" + error;\n }\n }\n if (message.errors != null && message.hasOwnProperty(\"errors\")) {\n if (!Array.isArray(message.errors))\n return \"errors: array expected\";\n for (var i = 0; i < message.errors.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo.verify(message.errors[i]);\n if (error)\n return \"errors.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates an ImportAptArtifactsResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsResponse} ImportAptArtifactsResponse\n */\n ImportAptArtifactsResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ImportAptArtifactsResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ImportAptArtifactsResponse();\n if (object.aptArtifacts) {\n if (!Array.isArray(object.aptArtifacts))\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportAptArtifactsResponse.aptArtifacts: array expected\");\n message.aptArtifacts = [];\n for (var i = 0; i < object.aptArtifacts.length; ++i) {\n if (typeof object.aptArtifacts[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportAptArtifactsResponse.aptArtifacts: object expected\");\n message.aptArtifacts[i] = $root.google.devtools.artifactregistry.v1.AptArtifact.fromObject(object.aptArtifacts[i]);\n }\n }\n if (object.errors) {\n if (!Array.isArray(object.errors))\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportAptArtifactsResponse.errors: array expected\");\n message.errors = [];\n for (var i = 0; i < object.errors.length; ++i) {\n if (typeof object.errors[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportAptArtifactsResponse.errors: object expected\");\n message.errors[i] = $root.google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo.fromObject(object.errors[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from an ImportAptArtifactsResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.ImportAptArtifactsResponse} message ImportAptArtifactsResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportAptArtifactsResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.aptArtifacts = [];\n object.errors = [];\n }\n if (message.aptArtifacts && message.aptArtifacts.length) {\n object.aptArtifacts = [];\n for (var j = 0; j < message.aptArtifacts.length; ++j)\n object.aptArtifacts[j] = $root.google.devtools.artifactregistry.v1.AptArtifact.toObject(message.aptArtifacts[j], options);\n }\n if (message.errors && message.errors.length) {\n object.errors = [];\n for (var j = 0; j < message.errors.length; ++j)\n object.errors[j] = $root.google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo.toObject(message.errors[j], options);\n }\n return object;\n };\n \n /**\n * Converts this ImportAptArtifactsResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ImportAptArtifactsResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportAptArtifactsResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportAptArtifactsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ImportAptArtifactsResponse\";\n };\n \n return ImportAptArtifactsResponse;\n })();\n \n v1.ImportAptArtifactsMetadata = (function() {\n \n /**\n * Properties of an ImportAptArtifactsMetadata.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IImportAptArtifactsMetadata\n */\n \n /**\n * Constructs a new ImportAptArtifactsMetadata.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an ImportAptArtifactsMetadata.\n * @implements IImportAptArtifactsMetadata\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsMetadata=} [properties] Properties to set\n */\n function ImportAptArtifactsMetadata(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Creates a new ImportAptArtifactsMetadata instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsMetadata=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata} ImportAptArtifactsMetadata instance\n */\n ImportAptArtifactsMetadata.create = function create(properties) {\n return new ImportAptArtifactsMetadata(properties);\n };\n \n /**\n * Encodes the specified ImportAptArtifactsMetadata message. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsMetadata} message ImportAptArtifactsMetadata message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsMetadata.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n return writer;\n };\n \n /**\n * Encodes the specified ImportAptArtifactsMetadata message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsMetadata} message ImportAptArtifactsMetadata message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsMetadata.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportAptArtifactsMetadata message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata} ImportAptArtifactsMetadata\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsMetadata.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportAptArtifactsMetadata message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata} ImportAptArtifactsMetadata\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsMetadata.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportAptArtifactsMetadata message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportAptArtifactsMetadata.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n return null;\n };\n \n /**\n * Creates an ImportAptArtifactsMetadata message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata} ImportAptArtifactsMetadata\n */\n ImportAptArtifactsMetadata.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata)\n return object;\n return new $root.google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata();\n };\n \n /**\n * Creates a plain object from an ImportAptArtifactsMetadata message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata} message ImportAptArtifactsMetadata\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportAptArtifactsMetadata.toObject = function toObject() {\n return {};\n };\n \n /**\n * Converts this ImportAptArtifactsMetadata to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata\n * @instance\n * @returns {Object.} JSON object\n */\n ImportAptArtifactsMetadata.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportAptArtifactsMetadata\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportAptArtifactsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata\";\n };\n \n return ImportAptArtifactsMetadata;\n })();\n \n v1.DockerImage = (function() {\n \n /**\n * Properties of a DockerImage.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IDockerImage\n * @property {string|null} [name] DockerImage name\n * @property {string|null} [uri] DockerImage uri\n * @property {Array.|null} [tags] DockerImage tags\n * @property {number|Long|null} [imageSizeBytes] DockerImage imageSizeBytes\n * @property {google.protobuf.ITimestamp|null} [uploadTime] DockerImage uploadTime\n * @property {string|null} [mediaType] DockerImage mediaType\n * @property {google.protobuf.ITimestamp|null} [buildTime] DockerImage buildTime\n * @property {google.protobuf.ITimestamp|null} [updateTime] DockerImage updateTime\n */\n \n /**\n * Constructs a new DockerImage.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a DockerImage.\n * @implements IDockerImage\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IDockerImage=} [properties] Properties to set\n */\n function DockerImage(properties) {\n this.tags = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DockerImage name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @instance\n */\n DockerImage.prototype.name = \"\";\n \n /**\n * DockerImage uri.\n * @member {string} uri\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @instance\n */\n DockerImage.prototype.uri = \"\";\n \n /**\n * DockerImage tags.\n * @member {Array.} tags\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @instance\n */\n DockerImage.prototype.tags = $util.emptyArray;\n \n /**\n * DockerImage imageSizeBytes.\n * @member {number|Long} imageSizeBytes\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @instance\n */\n DockerImage.prototype.imageSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n \n /**\n * DockerImage uploadTime.\n * @member {google.protobuf.ITimestamp|null|undefined} uploadTime\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @instance\n */\n DockerImage.prototype.uploadTime = null;\n \n /**\n * DockerImage mediaType.\n * @member {string} mediaType\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @instance\n */\n DockerImage.prototype.mediaType = \"\";\n \n /**\n * DockerImage buildTime.\n * @member {google.protobuf.ITimestamp|null|undefined} buildTime\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @instance\n */\n DockerImage.prototype.buildTime = null;\n \n /**\n * DockerImage updateTime.\n * @member {google.protobuf.ITimestamp|null|undefined} updateTime\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @instance\n */\n DockerImage.prototype.updateTime = null;\n \n /**\n * Creates a new DockerImage instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @static\n * @param {google.devtools.artifactregistry.v1.IDockerImage=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.DockerImage} DockerImage instance\n */\n DockerImage.create = function create(properties) {\n return new DockerImage(properties);\n };\n \n /**\n * Encodes the specified DockerImage message. Does not implicitly {@link google.devtools.artifactregistry.v1.DockerImage.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @static\n * @param {google.devtools.artifactregistry.v1.IDockerImage} message DockerImage message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DockerImage.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.uri != null && Object.hasOwnProperty.call(message, \"uri\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri);\n if (message.tags != null && message.tags.length)\n for (var i = 0; i < message.tags.length; ++i)\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.tags[i]);\n if (message.imageSizeBytes != null && Object.hasOwnProperty.call(message, \"imageSizeBytes\"))\n writer.uint32(/* id 4, wireType 0 =*/32).int64(message.imageSizeBytes);\n if (message.uploadTime != null && Object.hasOwnProperty.call(message, \"uploadTime\"))\n $root.google.protobuf.Timestamp.encode(message.uploadTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.mediaType != null && Object.hasOwnProperty.call(message, \"mediaType\"))\n writer.uint32(/* id 6, wireType 2 =*/50).string(message.mediaType);\n if (message.buildTime != null && Object.hasOwnProperty.call(message, \"buildTime\"))\n $root.google.protobuf.Timestamp.encode(message.buildTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n if (message.updateTime != null && Object.hasOwnProperty.call(message, \"updateTime\"))\n $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified DockerImage message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.DockerImage.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @static\n * @param {google.devtools.artifactregistry.v1.IDockerImage} message DockerImage message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DockerImage.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DockerImage message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.DockerImage} DockerImage\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DockerImage.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.DockerImage();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.uri = reader.string();\n break;\n }\n case 3: {\n if (!(message.tags && message.tags.length))\n message.tags = [];\n message.tags.push(reader.string());\n break;\n }\n case 4: {\n message.imageSizeBytes = reader.int64();\n break;\n }\n case 5: {\n message.uploadTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 6: {\n message.mediaType = reader.string();\n break;\n }\n case 7: {\n message.buildTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 8: {\n message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DockerImage message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.DockerImage} DockerImage\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DockerImage.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DockerImage message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DockerImage.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n if (!$util.isString(message.uri))\n return \"uri: string expected\";\n if (message.tags != null && message.hasOwnProperty(\"tags\")) {\n if (!Array.isArray(message.tags))\n return \"tags: array expected\";\n for (var i = 0; i < message.tags.length; ++i)\n if (!$util.isString(message.tags[i]))\n return \"tags: string[] expected\";\n }\n if (message.imageSizeBytes != null && message.hasOwnProperty(\"imageSizeBytes\"))\n if (!$util.isInteger(message.imageSizeBytes) && !(message.imageSizeBytes && $util.isInteger(message.imageSizeBytes.low) && $util.isInteger(message.imageSizeBytes.high)))\n return \"imageSizeBytes: integer|Long expected\";\n if (message.uploadTime != null && message.hasOwnProperty(\"uploadTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.uploadTime);\n if (error)\n return \"uploadTime.\" + error;\n }\n if (message.mediaType != null && message.hasOwnProperty(\"mediaType\"))\n if (!$util.isString(message.mediaType))\n return \"mediaType: string expected\";\n if (message.buildTime != null && message.hasOwnProperty(\"buildTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.buildTime);\n if (error)\n return \"buildTime.\" + error;\n }\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.updateTime);\n if (error)\n return \"updateTime.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a DockerImage message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.DockerImage} DockerImage\n */\n DockerImage.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.DockerImage)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.DockerImage();\n if (object.name != null)\n message.name = String(object.name);\n if (object.uri != null)\n message.uri = String(object.uri);\n if (object.tags) {\n if (!Array.isArray(object.tags))\n throw TypeError(\".google.devtools.artifactregistry.v1.DockerImage.tags: array expected\");\n message.tags = [];\n for (var i = 0; i < object.tags.length; ++i)\n message.tags[i] = String(object.tags[i]);\n }\n if (object.imageSizeBytes != null)\n if ($util.Long)\n (message.imageSizeBytes = $util.Long.fromValue(object.imageSizeBytes)).unsigned = false;\n else if (typeof object.imageSizeBytes === \"string\")\n message.imageSizeBytes = parseInt(object.imageSizeBytes, 10);\n else if (typeof object.imageSizeBytes === \"number\")\n message.imageSizeBytes = object.imageSizeBytes;\n else if (typeof object.imageSizeBytes === \"object\")\n message.imageSizeBytes = new $util.LongBits(object.imageSizeBytes.low >>> 0, object.imageSizeBytes.high >>> 0).toNumber();\n if (object.uploadTime != null) {\n if (typeof object.uploadTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.DockerImage.uploadTime: object expected\");\n message.uploadTime = $root.google.protobuf.Timestamp.fromObject(object.uploadTime);\n }\n if (object.mediaType != null)\n message.mediaType = String(object.mediaType);\n if (object.buildTime != null) {\n if (typeof object.buildTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.DockerImage.buildTime: object expected\");\n message.buildTime = $root.google.protobuf.Timestamp.fromObject(object.buildTime);\n }\n if (object.updateTime != null) {\n if (typeof object.updateTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.DockerImage.updateTime: object expected\");\n message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a DockerImage message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @static\n * @param {google.devtools.artifactregistry.v1.DockerImage} message DockerImage\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DockerImage.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.tags = [];\n if (options.defaults) {\n object.name = \"\";\n object.uri = \"\";\n if ($util.Long) {\n var long = new $util.Long(0, 0, false);\n object.imageSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.imageSizeBytes = options.longs === String ? \"0\" : 0;\n object.uploadTime = null;\n object.mediaType = \"\";\n object.buildTime = null;\n object.updateTime = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n object.uri = message.uri;\n if (message.tags && message.tags.length) {\n object.tags = [];\n for (var j = 0; j < message.tags.length; ++j)\n object.tags[j] = message.tags[j];\n }\n if (message.imageSizeBytes != null && message.hasOwnProperty(\"imageSizeBytes\"))\n if (typeof message.imageSizeBytes === \"number\")\n object.imageSizeBytes = options.longs === String ? String(message.imageSizeBytes) : message.imageSizeBytes;\n else\n object.imageSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.imageSizeBytes) : options.longs === Number ? new $util.LongBits(message.imageSizeBytes.low >>> 0, message.imageSizeBytes.high >>> 0).toNumber() : message.imageSizeBytes;\n if (message.uploadTime != null && message.hasOwnProperty(\"uploadTime\"))\n object.uploadTime = $root.google.protobuf.Timestamp.toObject(message.uploadTime, options);\n if (message.mediaType != null && message.hasOwnProperty(\"mediaType\"))\n object.mediaType = message.mediaType;\n if (message.buildTime != null && message.hasOwnProperty(\"buildTime\"))\n object.buildTime = $root.google.protobuf.Timestamp.toObject(message.buildTime, options);\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\"))\n object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);\n return object;\n };\n \n /**\n * Converts this DockerImage to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @instance\n * @returns {Object.} JSON object\n */\n DockerImage.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DockerImage\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.DockerImage\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DockerImage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.DockerImage\";\n };\n \n return DockerImage;\n })();\n \n v1.ListDockerImagesRequest = (function() {\n \n /**\n * Properties of a ListDockerImagesRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListDockerImagesRequest\n * @property {string|null} [parent] ListDockerImagesRequest parent\n * @property {number|null} [pageSize] ListDockerImagesRequest pageSize\n * @property {string|null} [pageToken] ListDockerImagesRequest pageToken\n * @property {string|null} [orderBy] ListDockerImagesRequest orderBy\n */\n \n /**\n * Constructs a new ListDockerImagesRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListDockerImagesRequest.\n * @implements IListDockerImagesRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListDockerImagesRequest=} [properties] Properties to set\n */\n function ListDockerImagesRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListDockerImagesRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesRequest\n * @instance\n */\n ListDockerImagesRequest.prototype.parent = \"\";\n \n /**\n * ListDockerImagesRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesRequest\n * @instance\n */\n ListDockerImagesRequest.prototype.pageSize = 0;\n \n /**\n * ListDockerImagesRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesRequest\n * @instance\n */\n ListDockerImagesRequest.prototype.pageToken = \"\";\n \n /**\n * ListDockerImagesRequest orderBy.\n * @member {string} orderBy\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesRequest\n * @instance\n */\n ListDockerImagesRequest.prototype.orderBy = \"\";\n \n /**\n * Creates a new ListDockerImagesRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListDockerImagesRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListDockerImagesRequest} ListDockerImagesRequest instance\n */\n ListDockerImagesRequest.create = function create(properties) {\n return new ListDockerImagesRequest(properties);\n };\n \n /**\n * Encodes the specified ListDockerImagesRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListDockerImagesRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListDockerImagesRequest} message ListDockerImagesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListDockerImagesRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n if (message.orderBy != null && Object.hasOwnProperty.call(message, \"orderBy\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy);\n return writer;\n };\n \n /**\n * Encodes the specified ListDockerImagesRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListDockerImagesRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListDockerImagesRequest} message ListDockerImagesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListDockerImagesRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListDockerImagesRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListDockerImagesRequest} ListDockerImagesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListDockerImagesRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListDockerImagesRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n case 4: {\n message.orderBy = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListDockerImagesRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListDockerImagesRequest} ListDockerImagesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListDockerImagesRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListDockerImagesRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListDockerImagesRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n if (message.orderBy != null && message.hasOwnProperty(\"orderBy\"))\n if (!$util.isString(message.orderBy))\n return \"orderBy: string expected\";\n return null;\n };\n \n /**\n * Creates a ListDockerImagesRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListDockerImagesRequest} ListDockerImagesRequest\n */\n ListDockerImagesRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListDockerImagesRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListDockerImagesRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n if (object.orderBy != null)\n message.orderBy = String(object.orderBy);\n return message;\n };\n \n /**\n * Creates a plain object from a ListDockerImagesRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ListDockerImagesRequest} message ListDockerImagesRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListDockerImagesRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n object.orderBy = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n if (message.orderBy != null && message.hasOwnProperty(\"orderBy\"))\n object.orderBy = message.orderBy;\n return object;\n };\n \n /**\n * Converts this ListDockerImagesRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListDockerImagesRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListDockerImagesRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListDockerImagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListDockerImagesRequest\";\n };\n \n return ListDockerImagesRequest;\n })();\n \n v1.ListDockerImagesResponse = (function() {\n \n /**\n * Properties of a ListDockerImagesResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListDockerImagesResponse\n * @property {Array.|null} [dockerImages] ListDockerImagesResponse dockerImages\n * @property {string|null} [nextPageToken] ListDockerImagesResponse nextPageToken\n */\n \n /**\n * Constructs a new ListDockerImagesResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListDockerImagesResponse.\n * @implements IListDockerImagesResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListDockerImagesResponse=} [properties] Properties to set\n */\n function ListDockerImagesResponse(properties) {\n this.dockerImages = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListDockerImagesResponse dockerImages.\n * @member {Array.} dockerImages\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesResponse\n * @instance\n */\n ListDockerImagesResponse.prototype.dockerImages = $util.emptyArray;\n \n /**\n * ListDockerImagesResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesResponse\n * @instance\n */\n ListDockerImagesResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListDockerImagesResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListDockerImagesResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListDockerImagesResponse} ListDockerImagesResponse instance\n */\n ListDockerImagesResponse.create = function create(properties) {\n return new ListDockerImagesResponse(properties);\n };\n \n /**\n * Encodes the specified ListDockerImagesResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListDockerImagesResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListDockerImagesResponse} message ListDockerImagesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListDockerImagesResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.dockerImages != null && message.dockerImages.length)\n for (var i = 0; i < message.dockerImages.length; ++i)\n $root.google.devtools.artifactregistry.v1.DockerImage.encode(message.dockerImages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListDockerImagesResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListDockerImagesResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListDockerImagesResponse} message ListDockerImagesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListDockerImagesResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListDockerImagesResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListDockerImagesResponse} ListDockerImagesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListDockerImagesResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListDockerImagesResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.dockerImages && message.dockerImages.length))\n message.dockerImages = [];\n message.dockerImages.push($root.google.devtools.artifactregistry.v1.DockerImage.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListDockerImagesResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListDockerImagesResponse} ListDockerImagesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListDockerImagesResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListDockerImagesResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListDockerImagesResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.dockerImages != null && message.hasOwnProperty(\"dockerImages\")) {\n if (!Array.isArray(message.dockerImages))\n return \"dockerImages: array expected\";\n for (var i = 0; i < message.dockerImages.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.DockerImage.verify(message.dockerImages[i]);\n if (error)\n return \"dockerImages.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListDockerImagesResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListDockerImagesResponse} ListDockerImagesResponse\n */\n ListDockerImagesResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListDockerImagesResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListDockerImagesResponse();\n if (object.dockerImages) {\n if (!Array.isArray(object.dockerImages))\n throw TypeError(\".google.devtools.artifactregistry.v1.ListDockerImagesResponse.dockerImages: array expected\");\n message.dockerImages = [];\n for (var i = 0; i < object.dockerImages.length; ++i) {\n if (typeof object.dockerImages[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ListDockerImagesResponse.dockerImages: object expected\");\n message.dockerImages[i] = $root.google.devtools.artifactregistry.v1.DockerImage.fromObject(object.dockerImages[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListDockerImagesResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.ListDockerImagesResponse} message ListDockerImagesResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListDockerImagesResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.dockerImages = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.dockerImages && message.dockerImages.length) {\n object.dockerImages = [];\n for (var j = 0; j < message.dockerImages.length; ++j)\n object.dockerImages[j] = $root.google.devtools.artifactregistry.v1.DockerImage.toObject(message.dockerImages[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListDockerImagesResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListDockerImagesResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListDockerImagesResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListDockerImagesResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListDockerImagesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListDockerImagesResponse\";\n };\n \n return ListDockerImagesResponse;\n })();\n \n v1.GetDockerImageRequest = (function() {\n \n /**\n * Properties of a GetDockerImageRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IGetDockerImageRequest\n * @property {string|null} [name] GetDockerImageRequest name\n */\n \n /**\n * Constructs a new GetDockerImageRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a GetDockerImageRequest.\n * @implements IGetDockerImageRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IGetDockerImageRequest=} [properties] Properties to set\n */\n function GetDockerImageRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetDockerImageRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.GetDockerImageRequest\n * @instance\n */\n GetDockerImageRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetDockerImageRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.GetDockerImageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetDockerImageRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.GetDockerImageRequest} GetDockerImageRequest instance\n */\n GetDockerImageRequest.create = function create(properties) {\n return new GetDockerImageRequest(properties);\n };\n \n /**\n * Encodes the specified GetDockerImageRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.GetDockerImageRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.GetDockerImageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetDockerImageRequest} message GetDockerImageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetDockerImageRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetDockerImageRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.GetDockerImageRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetDockerImageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetDockerImageRequest} message GetDockerImageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetDockerImageRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetDockerImageRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.GetDockerImageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.GetDockerImageRequest} GetDockerImageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetDockerImageRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.GetDockerImageRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetDockerImageRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetDockerImageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.GetDockerImageRequest} GetDockerImageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetDockerImageRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetDockerImageRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.GetDockerImageRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetDockerImageRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetDockerImageRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.GetDockerImageRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.GetDockerImageRequest} GetDockerImageRequest\n */\n GetDockerImageRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.GetDockerImageRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.GetDockerImageRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetDockerImageRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.GetDockerImageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.GetDockerImageRequest} message GetDockerImageRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetDockerImageRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetDockerImageRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.GetDockerImageRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetDockerImageRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetDockerImageRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.GetDockerImageRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetDockerImageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.GetDockerImageRequest\";\n };\n \n return GetDockerImageRequest;\n })();\n \n v1.MavenArtifact = (function() {\n \n /**\n * Properties of a MavenArtifact.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IMavenArtifact\n * @property {string|null} [name] MavenArtifact name\n * @property {string|null} [pomUri] MavenArtifact pomUri\n * @property {string|null} [groupId] MavenArtifact groupId\n * @property {string|null} [artifactId] MavenArtifact artifactId\n * @property {string|null} [version] MavenArtifact version\n * @property {google.protobuf.ITimestamp|null} [createTime] MavenArtifact createTime\n * @property {google.protobuf.ITimestamp|null} [updateTime] MavenArtifact updateTime\n */\n \n /**\n * Constructs a new MavenArtifact.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a MavenArtifact.\n * @implements IMavenArtifact\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IMavenArtifact=} [properties] Properties to set\n */\n function MavenArtifact(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * MavenArtifact name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @instance\n */\n MavenArtifact.prototype.name = \"\";\n \n /**\n * MavenArtifact pomUri.\n * @member {string} pomUri\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @instance\n */\n MavenArtifact.prototype.pomUri = \"\";\n \n /**\n * MavenArtifact groupId.\n * @member {string} groupId\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @instance\n */\n MavenArtifact.prototype.groupId = \"\";\n \n /**\n * MavenArtifact artifactId.\n * @member {string} artifactId\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @instance\n */\n MavenArtifact.prototype.artifactId = \"\";\n \n /**\n * MavenArtifact version.\n * @member {string} version\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @instance\n */\n MavenArtifact.prototype.version = \"\";\n \n /**\n * MavenArtifact createTime.\n * @member {google.protobuf.ITimestamp|null|undefined} createTime\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @instance\n */\n MavenArtifact.prototype.createTime = null;\n \n /**\n * MavenArtifact updateTime.\n * @member {google.protobuf.ITimestamp|null|undefined} updateTime\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @instance\n */\n MavenArtifact.prototype.updateTime = null;\n \n /**\n * Creates a new MavenArtifact instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.IMavenArtifact=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.MavenArtifact} MavenArtifact instance\n */\n MavenArtifact.create = function create(properties) {\n return new MavenArtifact(properties);\n };\n \n /**\n * Encodes the specified MavenArtifact message. Does not implicitly {@link google.devtools.artifactregistry.v1.MavenArtifact.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.IMavenArtifact} message MavenArtifact message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MavenArtifact.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.pomUri != null && Object.hasOwnProperty.call(message, \"pomUri\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.pomUri);\n if (message.groupId != null && Object.hasOwnProperty.call(message, \"groupId\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupId);\n if (message.artifactId != null && Object.hasOwnProperty.call(message, \"artifactId\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.artifactId);\n if (message.version != null && Object.hasOwnProperty.call(message, \"version\"))\n writer.uint32(/* id 5, wireType 2 =*/42).string(message.version);\n if (message.createTime != null && Object.hasOwnProperty.call(message, \"createTime\"))\n $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.updateTime != null && Object.hasOwnProperty.call(message, \"updateTime\"))\n $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified MavenArtifact message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.MavenArtifact.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.IMavenArtifact} message MavenArtifact message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MavenArtifact.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a MavenArtifact message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.MavenArtifact} MavenArtifact\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MavenArtifact.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.MavenArtifact();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.pomUri = reader.string();\n break;\n }\n case 3: {\n message.groupId = reader.string();\n break;\n }\n case 4: {\n message.artifactId = reader.string();\n break;\n }\n case 5: {\n message.version = reader.string();\n break;\n }\n case 6: {\n message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 7: {\n message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a MavenArtifact message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.MavenArtifact} MavenArtifact\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MavenArtifact.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a MavenArtifact message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n MavenArtifact.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.pomUri != null && message.hasOwnProperty(\"pomUri\"))\n if (!$util.isString(message.pomUri))\n return \"pomUri: string expected\";\n if (message.groupId != null && message.hasOwnProperty(\"groupId\"))\n if (!$util.isString(message.groupId))\n return \"groupId: string expected\";\n if (message.artifactId != null && message.hasOwnProperty(\"artifactId\"))\n if (!$util.isString(message.artifactId))\n return \"artifactId: string expected\";\n if (message.version != null && message.hasOwnProperty(\"version\"))\n if (!$util.isString(message.version))\n return \"version: string expected\";\n if (message.createTime != null && message.hasOwnProperty(\"createTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.createTime);\n if (error)\n return \"createTime.\" + error;\n }\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.updateTime);\n if (error)\n return \"updateTime.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a MavenArtifact message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.MavenArtifact} MavenArtifact\n */\n MavenArtifact.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.MavenArtifact)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.MavenArtifact();\n if (object.name != null)\n message.name = String(object.name);\n if (object.pomUri != null)\n message.pomUri = String(object.pomUri);\n if (object.groupId != null)\n message.groupId = String(object.groupId);\n if (object.artifactId != null)\n message.artifactId = String(object.artifactId);\n if (object.version != null)\n message.version = String(object.version);\n if (object.createTime != null) {\n if (typeof object.createTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.MavenArtifact.createTime: object expected\");\n message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);\n }\n if (object.updateTime != null) {\n if (typeof object.updateTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.MavenArtifact.updateTime: object expected\");\n message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a MavenArtifact message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.MavenArtifact} message MavenArtifact\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n MavenArtifact.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.pomUri = \"\";\n object.groupId = \"\";\n object.artifactId = \"\";\n object.version = \"\";\n object.createTime = null;\n object.updateTime = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.pomUri != null && message.hasOwnProperty(\"pomUri\"))\n object.pomUri = message.pomUri;\n if (message.groupId != null && message.hasOwnProperty(\"groupId\"))\n object.groupId = message.groupId;\n if (message.artifactId != null && message.hasOwnProperty(\"artifactId\"))\n object.artifactId = message.artifactId;\n if (message.version != null && message.hasOwnProperty(\"version\"))\n object.version = message.version;\n if (message.createTime != null && message.hasOwnProperty(\"createTime\"))\n object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\"))\n object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);\n return object;\n };\n \n /**\n * Converts this MavenArtifact to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @instance\n * @returns {Object.} JSON object\n */\n MavenArtifact.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for MavenArtifact\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.MavenArtifact\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n MavenArtifact.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.MavenArtifact\";\n };\n \n return MavenArtifact;\n })();\n \n v1.ListMavenArtifactsRequest = (function() {\n \n /**\n * Properties of a ListMavenArtifactsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListMavenArtifactsRequest\n * @property {string|null} [parent] ListMavenArtifactsRequest parent\n * @property {number|null} [pageSize] ListMavenArtifactsRequest pageSize\n * @property {string|null} [pageToken] ListMavenArtifactsRequest pageToken\n */\n \n /**\n * Constructs a new ListMavenArtifactsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListMavenArtifactsRequest.\n * @implements IListMavenArtifactsRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListMavenArtifactsRequest=} [properties] Properties to set\n */\n function ListMavenArtifactsRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListMavenArtifactsRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsRequest\n * @instance\n */\n ListMavenArtifactsRequest.prototype.parent = \"\";\n \n /**\n * ListMavenArtifactsRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsRequest\n * @instance\n */\n ListMavenArtifactsRequest.prototype.pageSize = 0;\n \n /**\n * ListMavenArtifactsRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsRequest\n * @instance\n */\n ListMavenArtifactsRequest.prototype.pageToken = \"\";\n \n /**\n * Creates a new ListMavenArtifactsRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListMavenArtifactsRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListMavenArtifactsRequest} ListMavenArtifactsRequest instance\n */\n ListMavenArtifactsRequest.create = function create(properties) {\n return new ListMavenArtifactsRequest(properties);\n };\n \n /**\n * Encodes the specified ListMavenArtifactsRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListMavenArtifactsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListMavenArtifactsRequest} message ListMavenArtifactsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListMavenArtifactsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListMavenArtifactsRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListMavenArtifactsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListMavenArtifactsRequest} message ListMavenArtifactsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListMavenArtifactsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListMavenArtifactsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListMavenArtifactsRequest} ListMavenArtifactsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListMavenArtifactsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListMavenArtifactsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListMavenArtifactsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListMavenArtifactsRequest} ListMavenArtifactsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListMavenArtifactsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListMavenArtifactsRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListMavenArtifactsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListMavenArtifactsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListMavenArtifactsRequest} ListMavenArtifactsRequest\n */\n ListMavenArtifactsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListMavenArtifactsRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListMavenArtifactsRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListMavenArtifactsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ListMavenArtifactsRequest} message ListMavenArtifactsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListMavenArtifactsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n return object;\n };\n \n /**\n * Converts this ListMavenArtifactsRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListMavenArtifactsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListMavenArtifactsRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListMavenArtifactsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListMavenArtifactsRequest\";\n };\n \n return ListMavenArtifactsRequest;\n })();\n \n v1.ListMavenArtifactsResponse = (function() {\n \n /**\n * Properties of a ListMavenArtifactsResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListMavenArtifactsResponse\n * @property {Array.|null} [mavenArtifacts] ListMavenArtifactsResponse mavenArtifacts\n * @property {string|null} [nextPageToken] ListMavenArtifactsResponse nextPageToken\n */\n \n /**\n * Constructs a new ListMavenArtifactsResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListMavenArtifactsResponse.\n * @implements IListMavenArtifactsResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListMavenArtifactsResponse=} [properties] Properties to set\n */\n function ListMavenArtifactsResponse(properties) {\n this.mavenArtifacts = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListMavenArtifactsResponse mavenArtifacts.\n * @member {Array.} mavenArtifacts\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsResponse\n * @instance\n */\n ListMavenArtifactsResponse.prototype.mavenArtifacts = $util.emptyArray;\n \n /**\n * ListMavenArtifactsResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsResponse\n * @instance\n */\n ListMavenArtifactsResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListMavenArtifactsResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListMavenArtifactsResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListMavenArtifactsResponse} ListMavenArtifactsResponse instance\n */\n ListMavenArtifactsResponse.create = function create(properties) {\n return new ListMavenArtifactsResponse(properties);\n };\n \n /**\n * Encodes the specified ListMavenArtifactsResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListMavenArtifactsResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListMavenArtifactsResponse} message ListMavenArtifactsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListMavenArtifactsResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.mavenArtifacts != null && message.mavenArtifacts.length)\n for (var i = 0; i < message.mavenArtifacts.length; ++i)\n $root.google.devtools.artifactregistry.v1.MavenArtifact.encode(message.mavenArtifacts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListMavenArtifactsResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListMavenArtifactsResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListMavenArtifactsResponse} message ListMavenArtifactsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListMavenArtifactsResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListMavenArtifactsResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListMavenArtifactsResponse} ListMavenArtifactsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListMavenArtifactsResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListMavenArtifactsResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.mavenArtifacts && message.mavenArtifacts.length))\n message.mavenArtifacts = [];\n message.mavenArtifacts.push($root.google.devtools.artifactregistry.v1.MavenArtifact.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListMavenArtifactsResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListMavenArtifactsResponse} ListMavenArtifactsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListMavenArtifactsResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListMavenArtifactsResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListMavenArtifactsResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.mavenArtifacts != null && message.hasOwnProperty(\"mavenArtifacts\")) {\n if (!Array.isArray(message.mavenArtifacts))\n return \"mavenArtifacts: array expected\";\n for (var i = 0; i < message.mavenArtifacts.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.MavenArtifact.verify(message.mavenArtifacts[i]);\n if (error)\n return \"mavenArtifacts.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListMavenArtifactsResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListMavenArtifactsResponse} ListMavenArtifactsResponse\n */\n ListMavenArtifactsResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListMavenArtifactsResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListMavenArtifactsResponse();\n if (object.mavenArtifacts) {\n if (!Array.isArray(object.mavenArtifacts))\n throw TypeError(\".google.devtools.artifactregistry.v1.ListMavenArtifactsResponse.mavenArtifacts: array expected\");\n message.mavenArtifacts = [];\n for (var i = 0; i < object.mavenArtifacts.length; ++i) {\n if (typeof object.mavenArtifacts[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ListMavenArtifactsResponse.mavenArtifacts: object expected\");\n message.mavenArtifacts[i] = $root.google.devtools.artifactregistry.v1.MavenArtifact.fromObject(object.mavenArtifacts[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListMavenArtifactsResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.ListMavenArtifactsResponse} message ListMavenArtifactsResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListMavenArtifactsResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.mavenArtifacts = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.mavenArtifacts && message.mavenArtifacts.length) {\n object.mavenArtifacts = [];\n for (var j = 0; j < message.mavenArtifacts.length; ++j)\n object.mavenArtifacts[j] = $root.google.devtools.artifactregistry.v1.MavenArtifact.toObject(message.mavenArtifacts[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListMavenArtifactsResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListMavenArtifactsResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListMavenArtifactsResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListMavenArtifactsResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListMavenArtifactsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListMavenArtifactsResponse\";\n };\n \n return ListMavenArtifactsResponse;\n })();\n \n v1.GetMavenArtifactRequest = (function() {\n \n /**\n * Properties of a GetMavenArtifactRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IGetMavenArtifactRequest\n * @property {string|null} [name] GetMavenArtifactRequest name\n */\n \n /**\n * Constructs a new GetMavenArtifactRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a GetMavenArtifactRequest.\n * @implements IGetMavenArtifactRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IGetMavenArtifactRequest=} [properties] Properties to set\n */\n function GetMavenArtifactRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetMavenArtifactRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.GetMavenArtifactRequest\n * @instance\n */\n GetMavenArtifactRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetMavenArtifactRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.GetMavenArtifactRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetMavenArtifactRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.GetMavenArtifactRequest} GetMavenArtifactRequest instance\n */\n GetMavenArtifactRequest.create = function create(properties) {\n return new GetMavenArtifactRequest(properties);\n };\n \n /**\n * Encodes the specified GetMavenArtifactRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.GetMavenArtifactRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.GetMavenArtifactRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetMavenArtifactRequest} message GetMavenArtifactRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetMavenArtifactRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetMavenArtifactRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.GetMavenArtifactRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetMavenArtifactRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetMavenArtifactRequest} message GetMavenArtifactRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetMavenArtifactRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetMavenArtifactRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.GetMavenArtifactRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.GetMavenArtifactRequest} GetMavenArtifactRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetMavenArtifactRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.GetMavenArtifactRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetMavenArtifactRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetMavenArtifactRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.GetMavenArtifactRequest} GetMavenArtifactRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetMavenArtifactRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetMavenArtifactRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.GetMavenArtifactRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetMavenArtifactRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetMavenArtifactRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.GetMavenArtifactRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.GetMavenArtifactRequest} GetMavenArtifactRequest\n */\n GetMavenArtifactRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.GetMavenArtifactRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.GetMavenArtifactRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetMavenArtifactRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.GetMavenArtifactRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.GetMavenArtifactRequest} message GetMavenArtifactRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetMavenArtifactRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetMavenArtifactRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.GetMavenArtifactRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetMavenArtifactRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetMavenArtifactRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.GetMavenArtifactRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetMavenArtifactRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.GetMavenArtifactRequest\";\n };\n \n return GetMavenArtifactRequest;\n })();\n \n v1.NpmPackage = (function() {\n \n /**\n * Properties of a NpmPackage.\n * @memberof google.devtools.artifactregistry.v1\n * @interface INpmPackage\n * @property {string|null} [name] NpmPackage name\n * @property {string|null} [packageName] NpmPackage packageName\n * @property {string|null} [version] NpmPackage version\n * @property {Array.|null} [tags] NpmPackage tags\n * @property {google.protobuf.ITimestamp|null} [createTime] NpmPackage createTime\n * @property {google.protobuf.ITimestamp|null} [updateTime] NpmPackage updateTime\n */\n \n /**\n * Constructs a new NpmPackage.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a NpmPackage.\n * @implements INpmPackage\n * @constructor\n * @param {google.devtools.artifactregistry.v1.INpmPackage=} [properties] Properties to set\n */\n function NpmPackage(properties) {\n this.tags = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * NpmPackage name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @instance\n */\n NpmPackage.prototype.name = \"\";\n \n /**\n * NpmPackage packageName.\n * @member {string} packageName\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @instance\n */\n NpmPackage.prototype.packageName = \"\";\n \n /**\n * NpmPackage version.\n * @member {string} version\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @instance\n */\n NpmPackage.prototype.version = \"\";\n \n /**\n * NpmPackage tags.\n * @member {Array.} tags\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @instance\n */\n NpmPackage.prototype.tags = $util.emptyArray;\n \n /**\n * NpmPackage createTime.\n * @member {google.protobuf.ITimestamp|null|undefined} createTime\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @instance\n */\n NpmPackage.prototype.createTime = null;\n \n /**\n * NpmPackage updateTime.\n * @member {google.protobuf.ITimestamp|null|undefined} updateTime\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @instance\n */\n NpmPackage.prototype.updateTime = null;\n \n /**\n * Creates a new NpmPackage instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @static\n * @param {google.devtools.artifactregistry.v1.INpmPackage=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.NpmPackage} NpmPackage instance\n */\n NpmPackage.create = function create(properties) {\n return new NpmPackage(properties);\n };\n \n /**\n * Encodes the specified NpmPackage message. Does not implicitly {@link google.devtools.artifactregistry.v1.NpmPackage.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @static\n * @param {google.devtools.artifactregistry.v1.INpmPackage} message NpmPackage message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n NpmPackage.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.packageName != null && Object.hasOwnProperty.call(message, \"packageName\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.packageName);\n if (message.version != null && Object.hasOwnProperty.call(message, \"version\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.version);\n if (message.tags != null && message.tags.length)\n for (var i = 0; i < message.tags.length; ++i)\n writer.uint32(/* id 5, wireType 2 =*/42).string(message.tags[i]);\n if (message.createTime != null && Object.hasOwnProperty.call(message, \"createTime\"))\n $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.updateTime != null && Object.hasOwnProperty.call(message, \"updateTime\"))\n $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified NpmPackage message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.NpmPackage.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @static\n * @param {google.devtools.artifactregistry.v1.INpmPackage} message NpmPackage message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n NpmPackage.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a NpmPackage message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.NpmPackage} NpmPackage\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n NpmPackage.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.NpmPackage();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 3: {\n message.packageName = reader.string();\n break;\n }\n case 4: {\n message.version = reader.string();\n break;\n }\n case 5: {\n if (!(message.tags && message.tags.length))\n message.tags = [];\n message.tags.push(reader.string());\n break;\n }\n case 6: {\n message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 7: {\n message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a NpmPackage message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.NpmPackage} NpmPackage\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n NpmPackage.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a NpmPackage message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n NpmPackage.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.packageName != null && message.hasOwnProperty(\"packageName\"))\n if (!$util.isString(message.packageName))\n return \"packageName: string expected\";\n if (message.version != null && message.hasOwnProperty(\"version\"))\n if (!$util.isString(message.version))\n return \"version: string expected\";\n if (message.tags != null && message.hasOwnProperty(\"tags\")) {\n if (!Array.isArray(message.tags))\n return \"tags: array expected\";\n for (var i = 0; i < message.tags.length; ++i)\n if (!$util.isString(message.tags[i]))\n return \"tags: string[] expected\";\n }\n if (message.createTime != null && message.hasOwnProperty(\"createTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.createTime);\n if (error)\n return \"createTime.\" + error;\n }\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.updateTime);\n if (error)\n return \"updateTime.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a NpmPackage message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.NpmPackage} NpmPackage\n */\n NpmPackage.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.NpmPackage)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.NpmPackage();\n if (object.name != null)\n message.name = String(object.name);\n if (object.packageName != null)\n message.packageName = String(object.packageName);\n if (object.version != null)\n message.version = String(object.version);\n if (object.tags) {\n if (!Array.isArray(object.tags))\n throw TypeError(\".google.devtools.artifactregistry.v1.NpmPackage.tags: array expected\");\n message.tags = [];\n for (var i = 0; i < object.tags.length; ++i)\n message.tags[i] = String(object.tags[i]);\n }\n if (object.createTime != null) {\n if (typeof object.createTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.NpmPackage.createTime: object expected\");\n message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);\n }\n if (object.updateTime != null) {\n if (typeof object.updateTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.NpmPackage.updateTime: object expected\");\n message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a NpmPackage message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @static\n * @param {google.devtools.artifactregistry.v1.NpmPackage} message NpmPackage\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n NpmPackage.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.tags = [];\n if (options.defaults) {\n object.name = \"\";\n object.packageName = \"\";\n object.version = \"\";\n object.createTime = null;\n object.updateTime = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.packageName != null && message.hasOwnProperty(\"packageName\"))\n object.packageName = message.packageName;\n if (message.version != null && message.hasOwnProperty(\"version\"))\n object.version = message.version;\n if (message.tags && message.tags.length) {\n object.tags = [];\n for (var j = 0; j < message.tags.length; ++j)\n object.tags[j] = message.tags[j];\n }\n if (message.createTime != null && message.hasOwnProperty(\"createTime\"))\n object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\"))\n object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);\n return object;\n };\n \n /**\n * Converts this NpmPackage to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @instance\n * @returns {Object.} JSON object\n */\n NpmPackage.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for NpmPackage\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.NpmPackage\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n NpmPackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.NpmPackage\";\n };\n \n return NpmPackage;\n })();\n \n v1.ListNpmPackagesRequest = (function() {\n \n /**\n * Properties of a ListNpmPackagesRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListNpmPackagesRequest\n * @property {string|null} [parent] ListNpmPackagesRequest parent\n * @property {number|null} [pageSize] ListNpmPackagesRequest pageSize\n * @property {string|null} [pageToken] ListNpmPackagesRequest pageToken\n */\n \n /**\n * Constructs a new ListNpmPackagesRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListNpmPackagesRequest.\n * @implements IListNpmPackagesRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListNpmPackagesRequest=} [properties] Properties to set\n */\n function ListNpmPackagesRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListNpmPackagesRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesRequest\n * @instance\n */\n ListNpmPackagesRequest.prototype.parent = \"\";\n \n /**\n * ListNpmPackagesRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesRequest\n * @instance\n */\n ListNpmPackagesRequest.prototype.pageSize = 0;\n \n /**\n * ListNpmPackagesRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesRequest\n * @instance\n */\n ListNpmPackagesRequest.prototype.pageToken = \"\";\n \n /**\n * Creates a new ListNpmPackagesRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListNpmPackagesRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListNpmPackagesRequest} ListNpmPackagesRequest instance\n */\n ListNpmPackagesRequest.create = function create(properties) {\n return new ListNpmPackagesRequest(properties);\n };\n \n /**\n * Encodes the specified ListNpmPackagesRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListNpmPackagesRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListNpmPackagesRequest} message ListNpmPackagesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListNpmPackagesRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListNpmPackagesRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListNpmPackagesRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListNpmPackagesRequest} message ListNpmPackagesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListNpmPackagesRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListNpmPackagesRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListNpmPackagesRequest} ListNpmPackagesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListNpmPackagesRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListNpmPackagesRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListNpmPackagesRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListNpmPackagesRequest} ListNpmPackagesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListNpmPackagesRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListNpmPackagesRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListNpmPackagesRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListNpmPackagesRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListNpmPackagesRequest} ListNpmPackagesRequest\n */\n ListNpmPackagesRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListNpmPackagesRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListNpmPackagesRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListNpmPackagesRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ListNpmPackagesRequest} message ListNpmPackagesRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListNpmPackagesRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n return object;\n };\n \n /**\n * Converts this ListNpmPackagesRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListNpmPackagesRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListNpmPackagesRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListNpmPackagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListNpmPackagesRequest\";\n };\n \n return ListNpmPackagesRequest;\n })();\n \n v1.ListNpmPackagesResponse = (function() {\n \n /**\n * Properties of a ListNpmPackagesResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListNpmPackagesResponse\n * @property {Array.|null} [npmPackages] ListNpmPackagesResponse npmPackages\n * @property {string|null} [nextPageToken] ListNpmPackagesResponse nextPageToken\n */\n \n /**\n * Constructs a new ListNpmPackagesResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListNpmPackagesResponse.\n * @implements IListNpmPackagesResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListNpmPackagesResponse=} [properties] Properties to set\n */\n function ListNpmPackagesResponse(properties) {\n this.npmPackages = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListNpmPackagesResponse npmPackages.\n * @member {Array.} npmPackages\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesResponse\n * @instance\n */\n ListNpmPackagesResponse.prototype.npmPackages = $util.emptyArray;\n \n /**\n * ListNpmPackagesResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesResponse\n * @instance\n */\n ListNpmPackagesResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListNpmPackagesResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListNpmPackagesResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListNpmPackagesResponse} ListNpmPackagesResponse instance\n */\n ListNpmPackagesResponse.create = function create(properties) {\n return new ListNpmPackagesResponse(properties);\n };\n \n /**\n * Encodes the specified ListNpmPackagesResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListNpmPackagesResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListNpmPackagesResponse} message ListNpmPackagesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListNpmPackagesResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.npmPackages != null && message.npmPackages.length)\n for (var i = 0; i < message.npmPackages.length; ++i)\n $root.google.devtools.artifactregistry.v1.NpmPackage.encode(message.npmPackages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListNpmPackagesResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListNpmPackagesResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListNpmPackagesResponse} message ListNpmPackagesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListNpmPackagesResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListNpmPackagesResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListNpmPackagesResponse} ListNpmPackagesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListNpmPackagesResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListNpmPackagesResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.npmPackages && message.npmPackages.length))\n message.npmPackages = [];\n message.npmPackages.push($root.google.devtools.artifactregistry.v1.NpmPackage.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListNpmPackagesResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListNpmPackagesResponse} ListNpmPackagesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListNpmPackagesResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListNpmPackagesResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListNpmPackagesResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.npmPackages != null && message.hasOwnProperty(\"npmPackages\")) {\n if (!Array.isArray(message.npmPackages))\n return \"npmPackages: array expected\";\n for (var i = 0; i < message.npmPackages.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.NpmPackage.verify(message.npmPackages[i]);\n if (error)\n return \"npmPackages.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListNpmPackagesResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListNpmPackagesResponse} ListNpmPackagesResponse\n */\n ListNpmPackagesResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListNpmPackagesResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListNpmPackagesResponse();\n if (object.npmPackages) {\n if (!Array.isArray(object.npmPackages))\n throw TypeError(\".google.devtools.artifactregistry.v1.ListNpmPackagesResponse.npmPackages: array expected\");\n message.npmPackages = [];\n for (var i = 0; i < object.npmPackages.length; ++i) {\n if (typeof object.npmPackages[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ListNpmPackagesResponse.npmPackages: object expected\");\n message.npmPackages[i] = $root.google.devtools.artifactregistry.v1.NpmPackage.fromObject(object.npmPackages[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListNpmPackagesResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.ListNpmPackagesResponse} message ListNpmPackagesResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListNpmPackagesResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.npmPackages = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.npmPackages && message.npmPackages.length) {\n object.npmPackages = [];\n for (var j = 0; j < message.npmPackages.length; ++j)\n object.npmPackages[j] = $root.google.devtools.artifactregistry.v1.NpmPackage.toObject(message.npmPackages[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListNpmPackagesResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListNpmPackagesResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListNpmPackagesResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListNpmPackagesResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListNpmPackagesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListNpmPackagesResponse\";\n };\n \n return ListNpmPackagesResponse;\n })();\n \n v1.GetNpmPackageRequest = (function() {\n \n /**\n * Properties of a GetNpmPackageRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IGetNpmPackageRequest\n * @property {string|null} [name] GetNpmPackageRequest name\n */\n \n /**\n * Constructs a new GetNpmPackageRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a GetNpmPackageRequest.\n * @implements IGetNpmPackageRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IGetNpmPackageRequest=} [properties] Properties to set\n */\n function GetNpmPackageRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetNpmPackageRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.GetNpmPackageRequest\n * @instance\n */\n GetNpmPackageRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetNpmPackageRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.GetNpmPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetNpmPackageRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.GetNpmPackageRequest} GetNpmPackageRequest instance\n */\n GetNpmPackageRequest.create = function create(properties) {\n return new GetNpmPackageRequest(properties);\n };\n \n /**\n * Encodes the specified GetNpmPackageRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.GetNpmPackageRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.GetNpmPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetNpmPackageRequest} message GetNpmPackageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetNpmPackageRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetNpmPackageRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.GetNpmPackageRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetNpmPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetNpmPackageRequest} message GetNpmPackageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetNpmPackageRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetNpmPackageRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.GetNpmPackageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.GetNpmPackageRequest} GetNpmPackageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetNpmPackageRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.GetNpmPackageRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetNpmPackageRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetNpmPackageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.GetNpmPackageRequest} GetNpmPackageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetNpmPackageRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetNpmPackageRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.GetNpmPackageRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetNpmPackageRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetNpmPackageRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.GetNpmPackageRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.GetNpmPackageRequest} GetNpmPackageRequest\n */\n GetNpmPackageRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.GetNpmPackageRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.GetNpmPackageRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetNpmPackageRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.GetNpmPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.GetNpmPackageRequest} message GetNpmPackageRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetNpmPackageRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetNpmPackageRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.GetNpmPackageRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetNpmPackageRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetNpmPackageRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.GetNpmPackageRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetNpmPackageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.GetNpmPackageRequest\";\n };\n \n return GetNpmPackageRequest;\n })();\n \n v1.PythonPackage = (function() {\n \n /**\n * Properties of a PythonPackage.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IPythonPackage\n * @property {string|null} [name] PythonPackage name\n * @property {string|null} [uri] PythonPackage uri\n * @property {string|null} [packageName] PythonPackage packageName\n * @property {string|null} [version] PythonPackage version\n * @property {google.protobuf.ITimestamp|null} [createTime] PythonPackage createTime\n * @property {google.protobuf.ITimestamp|null} [updateTime] PythonPackage updateTime\n */\n \n /**\n * Constructs a new PythonPackage.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a PythonPackage.\n * @implements IPythonPackage\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IPythonPackage=} [properties] Properties to set\n */\n function PythonPackage(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * PythonPackage name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @instance\n */\n PythonPackage.prototype.name = \"\";\n \n /**\n * PythonPackage uri.\n * @member {string} uri\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @instance\n */\n PythonPackage.prototype.uri = \"\";\n \n /**\n * PythonPackage packageName.\n * @member {string} packageName\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @instance\n */\n PythonPackage.prototype.packageName = \"\";\n \n /**\n * PythonPackage version.\n * @member {string} version\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @instance\n */\n PythonPackage.prototype.version = \"\";\n \n /**\n * PythonPackage createTime.\n * @member {google.protobuf.ITimestamp|null|undefined} createTime\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @instance\n */\n PythonPackage.prototype.createTime = null;\n \n /**\n * PythonPackage updateTime.\n * @member {google.protobuf.ITimestamp|null|undefined} updateTime\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @instance\n */\n PythonPackage.prototype.updateTime = null;\n \n /**\n * Creates a new PythonPackage instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @static\n * @param {google.devtools.artifactregistry.v1.IPythonPackage=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.PythonPackage} PythonPackage instance\n */\n PythonPackage.create = function create(properties) {\n return new PythonPackage(properties);\n };\n \n /**\n * Encodes the specified PythonPackage message. Does not implicitly {@link google.devtools.artifactregistry.v1.PythonPackage.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @static\n * @param {google.devtools.artifactregistry.v1.IPythonPackage} message PythonPackage message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PythonPackage.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.uri != null && Object.hasOwnProperty.call(message, \"uri\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri);\n if (message.packageName != null && Object.hasOwnProperty.call(message, \"packageName\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.packageName);\n if (message.version != null && Object.hasOwnProperty.call(message, \"version\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.version);\n if (message.createTime != null && Object.hasOwnProperty.call(message, \"createTime\"))\n $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.updateTime != null && Object.hasOwnProperty.call(message, \"updateTime\"))\n $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified PythonPackage message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.PythonPackage.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @static\n * @param {google.devtools.artifactregistry.v1.IPythonPackage} message PythonPackage message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PythonPackage.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a PythonPackage message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.PythonPackage} PythonPackage\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PythonPackage.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.PythonPackage();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.uri = reader.string();\n break;\n }\n case 3: {\n message.packageName = reader.string();\n break;\n }\n case 4: {\n message.version = reader.string();\n break;\n }\n case 6: {\n message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 7: {\n message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a PythonPackage message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.PythonPackage} PythonPackage\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PythonPackage.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a PythonPackage message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n PythonPackage.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n if (!$util.isString(message.uri))\n return \"uri: string expected\";\n if (message.packageName != null && message.hasOwnProperty(\"packageName\"))\n if (!$util.isString(message.packageName))\n return \"packageName: string expected\";\n if (message.version != null && message.hasOwnProperty(\"version\"))\n if (!$util.isString(message.version))\n return \"version: string expected\";\n if (message.createTime != null && message.hasOwnProperty(\"createTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.createTime);\n if (error)\n return \"createTime.\" + error;\n }\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.updateTime);\n if (error)\n return \"updateTime.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a PythonPackage message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.PythonPackage} PythonPackage\n */\n PythonPackage.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.PythonPackage)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.PythonPackage();\n if (object.name != null)\n message.name = String(object.name);\n if (object.uri != null)\n message.uri = String(object.uri);\n if (object.packageName != null)\n message.packageName = String(object.packageName);\n if (object.version != null)\n message.version = String(object.version);\n if (object.createTime != null) {\n if (typeof object.createTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.PythonPackage.createTime: object expected\");\n message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);\n }\n if (object.updateTime != null) {\n if (typeof object.updateTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.PythonPackage.updateTime: object expected\");\n message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a PythonPackage message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @static\n * @param {google.devtools.artifactregistry.v1.PythonPackage} message PythonPackage\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n PythonPackage.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.uri = \"\";\n object.packageName = \"\";\n object.version = \"\";\n object.createTime = null;\n object.updateTime = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n object.uri = message.uri;\n if (message.packageName != null && message.hasOwnProperty(\"packageName\"))\n object.packageName = message.packageName;\n if (message.version != null && message.hasOwnProperty(\"version\"))\n object.version = message.version;\n if (message.createTime != null && message.hasOwnProperty(\"createTime\"))\n object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\"))\n object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);\n return object;\n };\n \n /**\n * Converts this PythonPackage to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @instance\n * @returns {Object.} JSON object\n */\n PythonPackage.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for PythonPackage\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.PythonPackage\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n PythonPackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.PythonPackage\";\n };\n \n return PythonPackage;\n })();\n \n v1.ListPythonPackagesRequest = (function() {\n \n /**\n * Properties of a ListPythonPackagesRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListPythonPackagesRequest\n * @property {string|null} [parent] ListPythonPackagesRequest parent\n * @property {number|null} [pageSize] ListPythonPackagesRequest pageSize\n * @property {string|null} [pageToken] ListPythonPackagesRequest pageToken\n */\n \n /**\n * Constructs a new ListPythonPackagesRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListPythonPackagesRequest.\n * @implements IListPythonPackagesRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListPythonPackagesRequest=} [properties] Properties to set\n */\n function ListPythonPackagesRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListPythonPackagesRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesRequest\n * @instance\n */\n ListPythonPackagesRequest.prototype.parent = \"\";\n \n /**\n * ListPythonPackagesRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesRequest\n * @instance\n */\n ListPythonPackagesRequest.prototype.pageSize = 0;\n \n /**\n * ListPythonPackagesRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesRequest\n * @instance\n */\n ListPythonPackagesRequest.prototype.pageToken = \"\";\n \n /**\n * Creates a new ListPythonPackagesRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListPythonPackagesRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListPythonPackagesRequest} ListPythonPackagesRequest instance\n */\n ListPythonPackagesRequest.create = function create(properties) {\n return new ListPythonPackagesRequest(properties);\n };\n \n /**\n * Encodes the specified ListPythonPackagesRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListPythonPackagesRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListPythonPackagesRequest} message ListPythonPackagesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListPythonPackagesRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListPythonPackagesRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListPythonPackagesRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListPythonPackagesRequest} message ListPythonPackagesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListPythonPackagesRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListPythonPackagesRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListPythonPackagesRequest} ListPythonPackagesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListPythonPackagesRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListPythonPackagesRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListPythonPackagesRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListPythonPackagesRequest} ListPythonPackagesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListPythonPackagesRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListPythonPackagesRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListPythonPackagesRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListPythonPackagesRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListPythonPackagesRequest} ListPythonPackagesRequest\n */\n ListPythonPackagesRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListPythonPackagesRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListPythonPackagesRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListPythonPackagesRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ListPythonPackagesRequest} message ListPythonPackagesRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListPythonPackagesRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n return object;\n };\n \n /**\n * Converts this ListPythonPackagesRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListPythonPackagesRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListPythonPackagesRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListPythonPackagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListPythonPackagesRequest\";\n };\n \n return ListPythonPackagesRequest;\n })();\n \n v1.ListPythonPackagesResponse = (function() {\n \n /**\n * Properties of a ListPythonPackagesResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListPythonPackagesResponse\n * @property {Array.|null} [pythonPackages] ListPythonPackagesResponse pythonPackages\n * @property {string|null} [nextPageToken] ListPythonPackagesResponse nextPageToken\n */\n \n /**\n * Constructs a new ListPythonPackagesResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListPythonPackagesResponse.\n * @implements IListPythonPackagesResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListPythonPackagesResponse=} [properties] Properties to set\n */\n function ListPythonPackagesResponse(properties) {\n this.pythonPackages = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListPythonPackagesResponse pythonPackages.\n * @member {Array.} pythonPackages\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesResponse\n * @instance\n */\n ListPythonPackagesResponse.prototype.pythonPackages = $util.emptyArray;\n \n /**\n * ListPythonPackagesResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesResponse\n * @instance\n */\n ListPythonPackagesResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListPythonPackagesResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListPythonPackagesResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListPythonPackagesResponse} ListPythonPackagesResponse instance\n */\n ListPythonPackagesResponse.create = function create(properties) {\n return new ListPythonPackagesResponse(properties);\n };\n \n /**\n * Encodes the specified ListPythonPackagesResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListPythonPackagesResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListPythonPackagesResponse} message ListPythonPackagesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListPythonPackagesResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.pythonPackages != null && message.pythonPackages.length)\n for (var i = 0; i < message.pythonPackages.length; ++i)\n $root.google.devtools.artifactregistry.v1.PythonPackage.encode(message.pythonPackages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListPythonPackagesResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListPythonPackagesResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListPythonPackagesResponse} message ListPythonPackagesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListPythonPackagesResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListPythonPackagesResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListPythonPackagesResponse} ListPythonPackagesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListPythonPackagesResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListPythonPackagesResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.pythonPackages && message.pythonPackages.length))\n message.pythonPackages = [];\n message.pythonPackages.push($root.google.devtools.artifactregistry.v1.PythonPackage.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListPythonPackagesResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListPythonPackagesResponse} ListPythonPackagesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListPythonPackagesResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListPythonPackagesResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListPythonPackagesResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.pythonPackages != null && message.hasOwnProperty(\"pythonPackages\")) {\n if (!Array.isArray(message.pythonPackages))\n return \"pythonPackages: array expected\";\n for (var i = 0; i < message.pythonPackages.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.PythonPackage.verify(message.pythonPackages[i]);\n if (error)\n return \"pythonPackages.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListPythonPackagesResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListPythonPackagesResponse} ListPythonPackagesResponse\n */\n ListPythonPackagesResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListPythonPackagesResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListPythonPackagesResponse();\n if (object.pythonPackages) {\n if (!Array.isArray(object.pythonPackages))\n throw TypeError(\".google.devtools.artifactregistry.v1.ListPythonPackagesResponse.pythonPackages: array expected\");\n message.pythonPackages = [];\n for (var i = 0; i < object.pythonPackages.length; ++i) {\n if (typeof object.pythonPackages[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ListPythonPackagesResponse.pythonPackages: object expected\");\n message.pythonPackages[i] = $root.google.devtools.artifactregistry.v1.PythonPackage.fromObject(object.pythonPackages[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListPythonPackagesResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.ListPythonPackagesResponse} message ListPythonPackagesResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListPythonPackagesResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.pythonPackages = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.pythonPackages && message.pythonPackages.length) {\n object.pythonPackages = [];\n for (var j = 0; j < message.pythonPackages.length; ++j)\n object.pythonPackages[j] = $root.google.devtools.artifactregistry.v1.PythonPackage.toObject(message.pythonPackages[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListPythonPackagesResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListPythonPackagesResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListPythonPackagesResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListPythonPackagesResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListPythonPackagesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListPythonPackagesResponse\";\n };\n \n return ListPythonPackagesResponse;\n })();\n \n v1.GetPythonPackageRequest = (function() {\n \n /**\n * Properties of a GetPythonPackageRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IGetPythonPackageRequest\n * @property {string|null} [name] GetPythonPackageRequest name\n */\n \n /**\n * Constructs a new GetPythonPackageRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a GetPythonPackageRequest.\n * @implements IGetPythonPackageRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IGetPythonPackageRequest=} [properties] Properties to set\n */\n function GetPythonPackageRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetPythonPackageRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.GetPythonPackageRequest\n * @instance\n */\n GetPythonPackageRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetPythonPackageRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.GetPythonPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetPythonPackageRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.GetPythonPackageRequest} GetPythonPackageRequest instance\n */\n GetPythonPackageRequest.create = function create(properties) {\n return new GetPythonPackageRequest(properties);\n };\n \n /**\n * Encodes the specified GetPythonPackageRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.GetPythonPackageRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.GetPythonPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetPythonPackageRequest} message GetPythonPackageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetPythonPackageRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetPythonPackageRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.GetPythonPackageRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetPythonPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetPythonPackageRequest} message GetPythonPackageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetPythonPackageRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetPythonPackageRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.GetPythonPackageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.GetPythonPackageRequest} GetPythonPackageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetPythonPackageRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.GetPythonPackageRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetPythonPackageRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetPythonPackageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.GetPythonPackageRequest} GetPythonPackageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetPythonPackageRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetPythonPackageRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.GetPythonPackageRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetPythonPackageRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetPythonPackageRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.GetPythonPackageRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.GetPythonPackageRequest} GetPythonPackageRequest\n */\n GetPythonPackageRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.GetPythonPackageRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.GetPythonPackageRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetPythonPackageRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.GetPythonPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.GetPythonPackageRequest} message GetPythonPackageRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetPythonPackageRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetPythonPackageRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.GetPythonPackageRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetPythonPackageRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetPythonPackageRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.GetPythonPackageRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetPythonPackageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.GetPythonPackageRequest\";\n };\n \n return GetPythonPackageRequest;\n })();\n \n v1.Attachment = (function() {\n \n /**\n * Properties of an Attachment.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IAttachment\n * @property {string|null} [name] Attachment name\n * @property {string|null} [target] Attachment target\n * @property {string|null} [type] Attachment type\n * @property {string|null} [attachmentNamespace] Attachment attachmentNamespace\n * @property {Object.|null} [annotations] Attachment annotations\n * @property {google.protobuf.ITimestamp|null} [createTime] Attachment createTime\n * @property {google.protobuf.ITimestamp|null} [updateTime] Attachment updateTime\n * @property {Array.|null} [files] Attachment files\n * @property {string|null} [ociVersionName] Attachment ociVersionName\n */\n \n /**\n * Constructs a new Attachment.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an Attachment.\n * @implements IAttachment\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IAttachment=} [properties] Properties to set\n */\n function Attachment(properties) {\n this.annotations = {};\n this.files = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Attachment name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @instance\n */\n Attachment.prototype.name = \"\";\n \n /**\n * Attachment target.\n * @member {string} target\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @instance\n */\n Attachment.prototype.target = \"\";\n \n /**\n * Attachment type.\n * @member {string} type\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @instance\n */\n Attachment.prototype.type = \"\";\n \n /**\n * Attachment attachmentNamespace.\n * @member {string} attachmentNamespace\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @instance\n */\n Attachment.prototype.attachmentNamespace = \"\";\n \n /**\n * Attachment annotations.\n * @member {Object.} annotations\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @instance\n */\n Attachment.prototype.annotations = $util.emptyObject;\n \n /**\n * Attachment createTime.\n * @member {google.protobuf.ITimestamp|null|undefined} createTime\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @instance\n */\n Attachment.prototype.createTime = null;\n \n /**\n * Attachment updateTime.\n * @member {google.protobuf.ITimestamp|null|undefined} updateTime\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @instance\n */\n Attachment.prototype.updateTime = null;\n \n /**\n * Attachment files.\n * @member {Array.} files\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @instance\n */\n Attachment.prototype.files = $util.emptyArray;\n \n /**\n * Attachment ociVersionName.\n * @member {string} ociVersionName\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @instance\n */\n Attachment.prototype.ociVersionName = \"\";\n \n /**\n * Creates a new Attachment instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @static\n * @param {google.devtools.artifactregistry.v1.IAttachment=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.Attachment} Attachment instance\n */\n Attachment.create = function create(properties) {\n return new Attachment(properties);\n };\n \n /**\n * Encodes the specified Attachment message. Does not implicitly {@link google.devtools.artifactregistry.v1.Attachment.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @static\n * @param {google.devtools.artifactregistry.v1.IAttachment} message Attachment message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Attachment.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.target != null && Object.hasOwnProperty.call(message, \"target\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.target);\n if (message.type != null && Object.hasOwnProperty.call(message, \"type\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.type);\n if (message.attachmentNamespace != null && Object.hasOwnProperty.call(message, \"attachmentNamespace\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.attachmentNamespace);\n if (message.annotations != null && Object.hasOwnProperty.call(message, \"annotations\"))\n for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i)\n writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim();\n if (message.createTime != null && Object.hasOwnProperty.call(message, \"createTime\"))\n $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.updateTime != null && Object.hasOwnProperty.call(message, \"updateTime\"))\n $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n if (message.files != null && message.files.length)\n for (var i = 0; i < message.files.length; ++i)\n writer.uint32(/* id 8, wireType 2 =*/66).string(message.files[i]);\n if (message.ociVersionName != null && Object.hasOwnProperty.call(message, \"ociVersionName\"))\n writer.uint32(/* id 9, wireType 2 =*/74).string(message.ociVersionName);\n return writer;\n };\n \n /**\n * Encodes the specified Attachment message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.Attachment.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @static\n * @param {google.devtools.artifactregistry.v1.IAttachment} message Attachment message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Attachment.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an Attachment message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.Attachment} Attachment\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Attachment.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.Attachment(), key, value;\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.target = reader.string();\n break;\n }\n case 3: {\n message.type = reader.string();\n break;\n }\n case 4: {\n message.attachmentNamespace = reader.string();\n break;\n }\n case 5: {\n if (message.annotations === $util.emptyObject)\n message.annotations = {};\n var end2 = reader.uint32() + reader.pos;\n key = \"\";\n value = \"\";\n while (reader.pos < end2) {\n var tag2 = reader.uint32();\n switch (tag2 >>> 3) {\n case 1:\n key = reader.string();\n break;\n case 2:\n value = reader.string();\n break;\n default:\n reader.skipType(tag2 & 7);\n break;\n }\n }\n message.annotations[key] = value;\n break;\n }\n case 6: {\n message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 7: {\n message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 8: {\n if (!(message.files && message.files.length))\n message.files = [];\n message.files.push(reader.string());\n break;\n }\n case 9: {\n message.ociVersionName = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an Attachment message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.Attachment} Attachment\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Attachment.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an Attachment message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Attachment.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.target != null && message.hasOwnProperty(\"target\"))\n if (!$util.isString(message.target))\n return \"target: string expected\";\n if (message.type != null && message.hasOwnProperty(\"type\"))\n if (!$util.isString(message.type))\n return \"type: string expected\";\n if (message.attachmentNamespace != null && message.hasOwnProperty(\"attachmentNamespace\"))\n if (!$util.isString(message.attachmentNamespace))\n return \"attachmentNamespace: string expected\";\n if (message.annotations != null && message.hasOwnProperty(\"annotations\")) {\n if (!$util.isObject(message.annotations))\n return \"annotations: object expected\";\n var key = Object.keys(message.annotations);\n for (var i = 0; i < key.length; ++i)\n if (!$util.isString(message.annotations[key[i]]))\n return \"annotations: string{k:string} expected\";\n }\n if (message.createTime != null && message.hasOwnProperty(\"createTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.createTime);\n if (error)\n return \"createTime.\" + error;\n }\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.updateTime);\n if (error)\n return \"updateTime.\" + error;\n }\n if (message.files != null && message.hasOwnProperty(\"files\")) {\n if (!Array.isArray(message.files))\n return \"files: array expected\";\n for (var i = 0; i < message.files.length; ++i)\n if (!$util.isString(message.files[i]))\n return \"files: string[] expected\";\n }\n if (message.ociVersionName != null && message.hasOwnProperty(\"ociVersionName\"))\n if (!$util.isString(message.ociVersionName))\n return \"ociVersionName: string expected\";\n return null;\n };\n \n /**\n * Creates an Attachment message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.Attachment} Attachment\n */\n Attachment.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.Attachment)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.Attachment();\n if (object.name != null)\n message.name = String(object.name);\n if (object.target != null)\n message.target = String(object.target);\n if (object.type != null)\n message.type = String(object.type);\n if (object.attachmentNamespace != null)\n message.attachmentNamespace = String(object.attachmentNamespace);\n if (object.annotations) {\n if (typeof object.annotations !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Attachment.annotations: object expected\");\n message.annotations = {};\n for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i)\n message.annotations[keys[i]] = String(object.annotations[keys[i]]);\n }\n if (object.createTime != null) {\n if (typeof object.createTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Attachment.createTime: object expected\");\n message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);\n }\n if (object.updateTime != null) {\n if (typeof object.updateTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Attachment.updateTime: object expected\");\n message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);\n }\n if (object.files) {\n if (!Array.isArray(object.files))\n throw TypeError(\".google.devtools.artifactregistry.v1.Attachment.files: array expected\");\n message.files = [];\n for (var i = 0; i < object.files.length; ++i)\n message.files[i] = String(object.files[i]);\n }\n if (object.ociVersionName != null)\n message.ociVersionName = String(object.ociVersionName);\n return message;\n };\n \n /**\n * Creates a plain object from an Attachment message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @static\n * @param {google.devtools.artifactregistry.v1.Attachment} message Attachment\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Attachment.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.files = [];\n if (options.objects || options.defaults)\n object.annotations = {};\n if (options.defaults) {\n object.name = \"\";\n object.target = \"\";\n object.type = \"\";\n object.attachmentNamespace = \"\";\n object.createTime = null;\n object.updateTime = null;\n object.ociVersionName = \"\";\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.target != null && message.hasOwnProperty(\"target\"))\n object.target = message.target;\n if (message.type != null && message.hasOwnProperty(\"type\"))\n object.type = message.type;\n if (message.attachmentNamespace != null && message.hasOwnProperty(\"attachmentNamespace\"))\n object.attachmentNamespace = message.attachmentNamespace;\n var keys2;\n if (message.annotations && (keys2 = Object.keys(message.annotations)).length) {\n object.annotations = {};\n for (var j = 0; j < keys2.length; ++j)\n object.annotations[keys2[j]] = message.annotations[keys2[j]];\n }\n if (message.createTime != null && message.hasOwnProperty(\"createTime\"))\n object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\"))\n object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);\n if (message.files && message.files.length) {\n object.files = [];\n for (var j = 0; j < message.files.length; ++j)\n object.files[j] = message.files[j];\n }\n if (message.ociVersionName != null && message.hasOwnProperty(\"ociVersionName\"))\n object.ociVersionName = message.ociVersionName;\n return object;\n };\n \n /**\n * Converts this Attachment to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @instance\n * @returns {Object.} JSON object\n */\n Attachment.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Attachment\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.Attachment\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Attachment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.Attachment\";\n };\n \n return Attachment;\n })();\n \n v1.ListAttachmentsRequest = (function() {\n \n /**\n * Properties of a ListAttachmentsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListAttachmentsRequest\n * @property {string|null} [parent] ListAttachmentsRequest parent\n * @property {string|null} [filter] ListAttachmentsRequest filter\n * @property {number|null} [pageSize] ListAttachmentsRequest pageSize\n * @property {string|null} [pageToken] ListAttachmentsRequest pageToken\n */\n \n /**\n * Constructs a new ListAttachmentsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListAttachmentsRequest.\n * @implements IListAttachmentsRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListAttachmentsRequest=} [properties] Properties to set\n */\n function ListAttachmentsRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListAttachmentsRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsRequest\n * @instance\n */\n ListAttachmentsRequest.prototype.parent = \"\";\n \n /**\n * ListAttachmentsRequest filter.\n * @member {string} filter\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsRequest\n * @instance\n */\n ListAttachmentsRequest.prototype.filter = \"\";\n \n /**\n * ListAttachmentsRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsRequest\n * @instance\n */\n ListAttachmentsRequest.prototype.pageSize = 0;\n \n /**\n * ListAttachmentsRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsRequest\n * @instance\n */\n ListAttachmentsRequest.prototype.pageToken = \"\";\n \n /**\n * Creates a new ListAttachmentsRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListAttachmentsRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListAttachmentsRequest} ListAttachmentsRequest instance\n */\n ListAttachmentsRequest.create = function create(properties) {\n return new ListAttachmentsRequest(properties);\n };\n \n /**\n * Encodes the specified ListAttachmentsRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListAttachmentsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListAttachmentsRequest} message ListAttachmentsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListAttachmentsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.filter != null && Object.hasOwnProperty.call(message, \"filter\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListAttachmentsRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListAttachmentsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListAttachmentsRequest} message ListAttachmentsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListAttachmentsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListAttachmentsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListAttachmentsRequest} ListAttachmentsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListAttachmentsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListAttachmentsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.filter = reader.string();\n break;\n }\n case 3: {\n message.pageSize = reader.int32();\n break;\n }\n case 4: {\n message.pageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListAttachmentsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListAttachmentsRequest} ListAttachmentsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListAttachmentsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListAttachmentsRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListAttachmentsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n if (!$util.isString(message.filter))\n return \"filter: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListAttachmentsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListAttachmentsRequest} ListAttachmentsRequest\n */\n ListAttachmentsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListAttachmentsRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListAttachmentsRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.filter != null)\n message.filter = String(object.filter);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListAttachmentsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ListAttachmentsRequest} message ListAttachmentsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListAttachmentsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.filter = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n object.filter = message.filter;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n return object;\n };\n \n /**\n * Converts this ListAttachmentsRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListAttachmentsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListAttachmentsRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListAttachmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListAttachmentsRequest\";\n };\n \n return ListAttachmentsRequest;\n })();\n \n v1.ListAttachmentsResponse = (function() {\n \n /**\n * Properties of a ListAttachmentsResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListAttachmentsResponse\n * @property {Array.|null} [attachments] ListAttachmentsResponse attachments\n * @property {string|null} [nextPageToken] ListAttachmentsResponse nextPageToken\n */\n \n /**\n * Constructs a new ListAttachmentsResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListAttachmentsResponse.\n * @implements IListAttachmentsResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListAttachmentsResponse=} [properties] Properties to set\n */\n function ListAttachmentsResponse(properties) {\n this.attachments = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListAttachmentsResponse attachments.\n * @member {Array.} attachments\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsResponse\n * @instance\n */\n ListAttachmentsResponse.prototype.attachments = $util.emptyArray;\n \n /**\n * ListAttachmentsResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsResponse\n * @instance\n */\n ListAttachmentsResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListAttachmentsResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListAttachmentsResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListAttachmentsResponse} ListAttachmentsResponse instance\n */\n ListAttachmentsResponse.create = function create(properties) {\n return new ListAttachmentsResponse(properties);\n };\n \n /**\n * Encodes the specified ListAttachmentsResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListAttachmentsResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListAttachmentsResponse} message ListAttachmentsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListAttachmentsResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.attachments != null && message.attachments.length)\n for (var i = 0; i < message.attachments.length; ++i)\n $root.google.devtools.artifactregistry.v1.Attachment.encode(message.attachments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListAttachmentsResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListAttachmentsResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListAttachmentsResponse} message ListAttachmentsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListAttachmentsResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListAttachmentsResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListAttachmentsResponse} ListAttachmentsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListAttachmentsResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListAttachmentsResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.attachments && message.attachments.length))\n message.attachments = [];\n message.attachments.push($root.google.devtools.artifactregistry.v1.Attachment.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListAttachmentsResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListAttachmentsResponse} ListAttachmentsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListAttachmentsResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListAttachmentsResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListAttachmentsResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.attachments != null && message.hasOwnProperty(\"attachments\")) {\n if (!Array.isArray(message.attachments))\n return \"attachments: array expected\";\n for (var i = 0; i < message.attachments.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.Attachment.verify(message.attachments[i]);\n if (error)\n return \"attachments.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListAttachmentsResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListAttachmentsResponse} ListAttachmentsResponse\n */\n ListAttachmentsResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListAttachmentsResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListAttachmentsResponse();\n if (object.attachments) {\n if (!Array.isArray(object.attachments))\n throw TypeError(\".google.devtools.artifactregistry.v1.ListAttachmentsResponse.attachments: array expected\");\n message.attachments = [];\n for (var i = 0; i < object.attachments.length; ++i) {\n if (typeof object.attachments[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ListAttachmentsResponse.attachments: object expected\");\n message.attachments[i] = $root.google.devtools.artifactregistry.v1.Attachment.fromObject(object.attachments[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListAttachmentsResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.ListAttachmentsResponse} message ListAttachmentsResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListAttachmentsResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.attachments = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.attachments && message.attachments.length) {\n object.attachments = [];\n for (var j = 0; j < message.attachments.length; ++j)\n object.attachments[j] = $root.google.devtools.artifactregistry.v1.Attachment.toObject(message.attachments[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListAttachmentsResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListAttachmentsResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListAttachmentsResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListAttachmentsResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListAttachmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListAttachmentsResponse\";\n };\n \n return ListAttachmentsResponse;\n })();\n \n v1.GetAttachmentRequest = (function() {\n \n /**\n * Properties of a GetAttachmentRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IGetAttachmentRequest\n * @property {string|null} [name] GetAttachmentRequest name\n */\n \n /**\n * Constructs a new GetAttachmentRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a GetAttachmentRequest.\n * @implements IGetAttachmentRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IGetAttachmentRequest=} [properties] Properties to set\n */\n function GetAttachmentRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetAttachmentRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.GetAttachmentRequest\n * @instance\n */\n GetAttachmentRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetAttachmentRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.GetAttachmentRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetAttachmentRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.GetAttachmentRequest} GetAttachmentRequest instance\n */\n GetAttachmentRequest.create = function create(properties) {\n return new GetAttachmentRequest(properties);\n };\n \n /**\n * Encodes the specified GetAttachmentRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.GetAttachmentRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.GetAttachmentRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetAttachmentRequest} message GetAttachmentRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetAttachmentRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetAttachmentRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.GetAttachmentRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetAttachmentRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetAttachmentRequest} message GetAttachmentRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetAttachmentRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.GetAttachmentRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.GetAttachmentRequest} GetAttachmentRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetAttachmentRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.GetAttachmentRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetAttachmentRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetAttachmentRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.GetAttachmentRequest} GetAttachmentRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetAttachmentRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetAttachmentRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.GetAttachmentRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetAttachmentRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetAttachmentRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.GetAttachmentRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.GetAttachmentRequest} GetAttachmentRequest\n */\n GetAttachmentRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.GetAttachmentRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.GetAttachmentRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetAttachmentRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.GetAttachmentRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.GetAttachmentRequest} message GetAttachmentRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetAttachmentRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetAttachmentRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.GetAttachmentRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetAttachmentRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetAttachmentRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.GetAttachmentRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.GetAttachmentRequest\";\n };\n \n return GetAttachmentRequest;\n })();\n \n v1.CreateAttachmentRequest = (function() {\n \n /**\n * Properties of a CreateAttachmentRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface ICreateAttachmentRequest\n * @property {string|null} [parent] CreateAttachmentRequest parent\n * @property {string|null} [attachmentId] CreateAttachmentRequest attachmentId\n * @property {google.devtools.artifactregistry.v1.IAttachment|null} [attachment] CreateAttachmentRequest attachment\n */\n \n /**\n * Constructs a new CreateAttachmentRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a CreateAttachmentRequest.\n * @implements ICreateAttachmentRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.ICreateAttachmentRequest=} [properties] Properties to set\n */\n function CreateAttachmentRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CreateAttachmentRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.CreateAttachmentRequest\n * @instance\n */\n CreateAttachmentRequest.prototype.parent = \"\";\n \n /**\n * CreateAttachmentRequest attachmentId.\n * @member {string} attachmentId\n * @memberof google.devtools.artifactregistry.v1.CreateAttachmentRequest\n * @instance\n */\n CreateAttachmentRequest.prototype.attachmentId = \"\";\n \n /**\n * CreateAttachmentRequest attachment.\n * @member {google.devtools.artifactregistry.v1.IAttachment|null|undefined} attachment\n * @memberof google.devtools.artifactregistry.v1.CreateAttachmentRequest\n * @instance\n */\n CreateAttachmentRequest.prototype.attachment = null;\n \n /**\n * Creates a new CreateAttachmentRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.CreateAttachmentRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ICreateAttachmentRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.CreateAttachmentRequest} CreateAttachmentRequest instance\n */\n CreateAttachmentRequest.create = function create(properties) {\n return new CreateAttachmentRequest(properties);\n };\n \n /**\n * Encodes the specified CreateAttachmentRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.CreateAttachmentRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.CreateAttachmentRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ICreateAttachmentRequest} message CreateAttachmentRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CreateAttachmentRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.attachmentId != null && Object.hasOwnProperty.call(message, \"attachmentId\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.attachmentId);\n if (message.attachment != null && Object.hasOwnProperty.call(message, \"attachment\"))\n $root.google.devtools.artifactregistry.v1.Attachment.encode(message.attachment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified CreateAttachmentRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.CreateAttachmentRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.CreateAttachmentRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ICreateAttachmentRequest} message CreateAttachmentRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CreateAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CreateAttachmentRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.CreateAttachmentRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.CreateAttachmentRequest} CreateAttachmentRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CreateAttachmentRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.CreateAttachmentRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.attachmentId = reader.string();\n break;\n }\n case 3: {\n message.attachment = $root.google.devtools.artifactregistry.v1.Attachment.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CreateAttachmentRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.CreateAttachmentRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.CreateAttachmentRequest} CreateAttachmentRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CreateAttachmentRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CreateAttachmentRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.CreateAttachmentRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CreateAttachmentRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.attachmentId != null && message.hasOwnProperty(\"attachmentId\"))\n if (!$util.isString(message.attachmentId))\n return \"attachmentId: string expected\";\n if (message.attachment != null && message.hasOwnProperty(\"attachment\")) {\n var error = $root.google.devtools.artifactregistry.v1.Attachment.verify(message.attachment);\n if (error)\n return \"attachment.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a CreateAttachmentRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.CreateAttachmentRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.CreateAttachmentRequest} CreateAttachmentRequest\n */\n CreateAttachmentRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.CreateAttachmentRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.CreateAttachmentRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.attachmentId != null)\n message.attachmentId = String(object.attachmentId);\n if (object.attachment != null) {\n if (typeof object.attachment !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.CreateAttachmentRequest.attachment: object expected\");\n message.attachment = $root.google.devtools.artifactregistry.v1.Attachment.fromObject(object.attachment);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a CreateAttachmentRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.CreateAttachmentRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.CreateAttachmentRequest} message CreateAttachmentRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CreateAttachmentRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.attachmentId = \"\";\n object.attachment = null;\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.attachmentId != null && message.hasOwnProperty(\"attachmentId\"))\n object.attachmentId = message.attachmentId;\n if (message.attachment != null && message.hasOwnProperty(\"attachment\"))\n object.attachment = $root.google.devtools.artifactregistry.v1.Attachment.toObject(message.attachment, options);\n return object;\n };\n \n /**\n * Converts this CreateAttachmentRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.CreateAttachmentRequest\n * @instance\n * @returns {Object.} JSON object\n */\n CreateAttachmentRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CreateAttachmentRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.CreateAttachmentRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CreateAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.CreateAttachmentRequest\";\n };\n \n return CreateAttachmentRequest;\n })();\n \n v1.DeleteAttachmentRequest = (function() {\n \n /**\n * Properties of a DeleteAttachmentRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IDeleteAttachmentRequest\n * @property {string|null} [name] DeleteAttachmentRequest name\n */\n \n /**\n * Constructs a new DeleteAttachmentRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a DeleteAttachmentRequest.\n * @implements IDeleteAttachmentRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IDeleteAttachmentRequest=} [properties] Properties to set\n */\n function DeleteAttachmentRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DeleteAttachmentRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.DeleteAttachmentRequest\n * @instance\n */\n DeleteAttachmentRequest.prototype.name = \"\";\n \n /**\n * Creates a new DeleteAttachmentRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.DeleteAttachmentRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteAttachmentRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.DeleteAttachmentRequest} DeleteAttachmentRequest instance\n */\n DeleteAttachmentRequest.create = function create(properties) {\n return new DeleteAttachmentRequest(properties);\n };\n \n /**\n * Encodes the specified DeleteAttachmentRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.DeleteAttachmentRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.DeleteAttachmentRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteAttachmentRequest} message DeleteAttachmentRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteAttachmentRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified DeleteAttachmentRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.DeleteAttachmentRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DeleteAttachmentRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteAttachmentRequest} message DeleteAttachmentRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DeleteAttachmentRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.DeleteAttachmentRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.DeleteAttachmentRequest} DeleteAttachmentRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteAttachmentRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.DeleteAttachmentRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DeleteAttachmentRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DeleteAttachmentRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.DeleteAttachmentRequest} DeleteAttachmentRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteAttachmentRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DeleteAttachmentRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.DeleteAttachmentRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DeleteAttachmentRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a DeleteAttachmentRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.DeleteAttachmentRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.DeleteAttachmentRequest} DeleteAttachmentRequest\n */\n DeleteAttachmentRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.DeleteAttachmentRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.DeleteAttachmentRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a DeleteAttachmentRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.DeleteAttachmentRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.DeleteAttachmentRequest} message DeleteAttachmentRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DeleteAttachmentRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this DeleteAttachmentRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.DeleteAttachmentRequest\n * @instance\n * @returns {Object.} JSON object\n */\n DeleteAttachmentRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DeleteAttachmentRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.DeleteAttachmentRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DeleteAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.DeleteAttachmentRequest\";\n };\n \n return DeleteAttachmentRequest;\n })();\n \n v1.Hash = (function() {\n \n /**\n * Properties of a Hash.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IHash\n * @property {google.devtools.artifactregistry.v1.Hash.HashType|null} [type] Hash type\n * @property {Uint8Array|null} [value] Hash value\n */\n \n /**\n * Constructs a new Hash.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a Hash.\n * @implements IHash\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IHash=} [properties] Properties to set\n */\n function Hash(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Hash type.\n * @member {google.devtools.artifactregistry.v1.Hash.HashType} type\n * @memberof google.devtools.artifactregistry.v1.Hash\n * @instance\n */\n Hash.prototype.type = 0;\n \n /**\n * Hash value.\n * @member {Uint8Array} value\n * @memberof google.devtools.artifactregistry.v1.Hash\n * @instance\n */\n Hash.prototype.value = $util.newBuffer([]);\n \n /**\n * Creates a new Hash instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.Hash\n * @static\n * @param {google.devtools.artifactregistry.v1.IHash=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.Hash} Hash instance\n */\n Hash.create = function create(properties) {\n return new Hash(properties);\n };\n \n /**\n * Encodes the specified Hash message. Does not implicitly {@link google.devtools.artifactregistry.v1.Hash.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.Hash\n * @static\n * @param {google.devtools.artifactregistry.v1.IHash} message Hash message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Hash.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.type != null && Object.hasOwnProperty.call(message, \"type\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type);\n if (message.value != null && Object.hasOwnProperty.call(message, \"value\"))\n writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value);\n return writer;\n };\n \n /**\n * Encodes the specified Hash message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.Hash.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Hash\n * @static\n * @param {google.devtools.artifactregistry.v1.IHash} message Hash message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Hash.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Hash message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.Hash\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.Hash} Hash\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Hash.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.Hash();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.type = reader.int32();\n break;\n }\n case 2: {\n message.value = reader.bytes();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Hash message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Hash\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.Hash} Hash\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Hash.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Hash message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.Hash\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Hash.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.type != null && message.hasOwnProperty(\"type\"))\n switch (message.type) {\n default:\n return \"type: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.value != null && message.hasOwnProperty(\"value\"))\n if (!(message.value && typeof message.value.length === \"number\" || $util.isString(message.value)))\n return \"value: buffer expected\";\n return null;\n };\n \n /**\n * Creates a Hash message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.Hash\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.Hash} Hash\n */\n Hash.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.Hash)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.Hash();\n switch (object.type) {\n default:\n if (typeof object.type === \"number\") {\n message.type = object.type;\n break;\n }\n break;\n case \"HASH_TYPE_UNSPECIFIED\":\n case 0:\n message.type = 0;\n break;\n case \"SHA256\":\n case 1:\n message.type = 1;\n break;\n case \"MD5\":\n case 2:\n message.type = 2;\n break;\n }\n if (object.value != null)\n if (typeof object.value === \"string\")\n $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0);\n else if (object.value.length >= 0)\n message.value = object.value;\n return message;\n };\n \n /**\n * Creates a plain object from a Hash message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.Hash\n * @static\n * @param {google.devtools.artifactregistry.v1.Hash} message Hash\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Hash.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.type = options.enums === String ? \"HASH_TYPE_UNSPECIFIED\" : 0;\n if (options.bytes === String)\n object.value = \"\";\n else {\n object.value = [];\n if (options.bytes !== Array)\n object.value = $util.newBuffer(object.value);\n }\n }\n if (message.type != null && message.hasOwnProperty(\"type\"))\n object.type = options.enums === String ? $root.google.devtools.artifactregistry.v1.Hash.HashType[message.type] === undefined ? message.type : $root.google.devtools.artifactregistry.v1.Hash.HashType[message.type] : message.type;\n if (message.value != null && message.hasOwnProperty(\"value\"))\n object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value;\n return object;\n };\n \n /**\n * Converts this Hash to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.Hash\n * @instance\n * @returns {Object.} JSON object\n */\n Hash.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Hash\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.Hash\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Hash.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.Hash\";\n };\n \n /**\n * HashType enum.\n * @name google.devtools.artifactregistry.v1.Hash.HashType\n * @enum {number}\n * @property {number} HASH_TYPE_UNSPECIFIED=0 HASH_TYPE_UNSPECIFIED value\n * @property {number} SHA256=1 SHA256 value\n * @property {number} MD5=2 MD5 value\n */\n Hash.HashType = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"HASH_TYPE_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"SHA256\"] = 1;\n values[valuesById[2] = \"MD5\"] = 2;\n return values;\n })();\n \n return Hash;\n })();\n \n v1.File = (function() {\n \n /**\n * Properties of a File.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IFile\n * @property {string|null} [name] File name\n * @property {number|Long|null} [sizeBytes] File sizeBytes\n * @property {Array.|null} [hashes] File hashes\n * @property {google.protobuf.ITimestamp|null} [createTime] File createTime\n * @property {google.protobuf.ITimestamp|null} [updateTime] File updateTime\n * @property {string|null} [owner] File owner\n * @property {google.protobuf.ITimestamp|null} [fetchTime] File fetchTime\n * @property {Object.|null} [annotations] File annotations\n */\n \n /**\n * Constructs a new File.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a File.\n * @implements IFile\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IFile=} [properties] Properties to set\n */\n function File(properties) {\n this.hashes = [];\n this.annotations = {};\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * File name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.File\n * @instance\n */\n File.prototype.name = \"\";\n \n /**\n * File sizeBytes.\n * @member {number|Long} sizeBytes\n * @memberof google.devtools.artifactregistry.v1.File\n * @instance\n */\n File.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n \n /**\n * File hashes.\n * @member {Array.} hashes\n * @memberof google.devtools.artifactregistry.v1.File\n * @instance\n */\n File.prototype.hashes = $util.emptyArray;\n \n /**\n * File createTime.\n * @member {google.protobuf.ITimestamp|null|undefined} createTime\n * @memberof google.devtools.artifactregistry.v1.File\n * @instance\n */\n File.prototype.createTime = null;\n \n /**\n * File updateTime.\n * @member {google.protobuf.ITimestamp|null|undefined} updateTime\n * @memberof google.devtools.artifactregistry.v1.File\n * @instance\n */\n File.prototype.updateTime = null;\n \n /**\n * File owner.\n * @member {string} owner\n * @memberof google.devtools.artifactregistry.v1.File\n * @instance\n */\n File.prototype.owner = \"\";\n \n /**\n * File fetchTime.\n * @member {google.protobuf.ITimestamp|null|undefined} fetchTime\n * @memberof google.devtools.artifactregistry.v1.File\n * @instance\n */\n File.prototype.fetchTime = null;\n \n /**\n * File annotations.\n * @member {Object.} annotations\n * @memberof google.devtools.artifactregistry.v1.File\n * @instance\n */\n File.prototype.annotations = $util.emptyObject;\n \n /**\n * Creates a new File instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.File\n * @static\n * @param {google.devtools.artifactregistry.v1.IFile=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.File} File instance\n */\n File.create = function create(properties) {\n return new File(properties);\n };\n \n /**\n * Encodes the specified File message. Does not implicitly {@link google.devtools.artifactregistry.v1.File.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.File\n * @static\n * @param {google.devtools.artifactregistry.v1.IFile} message File message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n File.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.sizeBytes != null && Object.hasOwnProperty.call(message, \"sizeBytes\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int64(message.sizeBytes);\n if (message.hashes != null && message.hashes.length)\n for (var i = 0; i < message.hashes.length; ++i)\n $root.google.devtools.artifactregistry.v1.Hash.encode(message.hashes[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n if (message.createTime != null && Object.hasOwnProperty.call(message, \"createTime\"))\n $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.updateTime != null && Object.hasOwnProperty.call(message, \"updateTime\"))\n $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.owner != null && Object.hasOwnProperty.call(message, \"owner\"))\n writer.uint32(/* id 7, wireType 2 =*/58).string(message.owner);\n if (message.fetchTime != null && Object.hasOwnProperty.call(message, \"fetchTime\"))\n $root.google.protobuf.Timestamp.encode(message.fetchTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n if (message.annotations != null && Object.hasOwnProperty.call(message, \"annotations\"))\n for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i)\n writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified File message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.File.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.File\n * @static\n * @param {google.devtools.artifactregistry.v1.IFile} message File message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n File.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a File message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.File\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.File} File\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n File.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.File(), key, value;\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 3: {\n message.sizeBytes = reader.int64();\n break;\n }\n case 4: {\n if (!(message.hashes && message.hashes.length))\n message.hashes = [];\n message.hashes.push($root.google.devtools.artifactregistry.v1.Hash.decode(reader, reader.uint32()));\n break;\n }\n case 5: {\n message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 6: {\n message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 7: {\n message.owner = reader.string();\n break;\n }\n case 8: {\n message.fetchTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 9: {\n if (message.annotations === $util.emptyObject)\n message.annotations = {};\n var end2 = reader.uint32() + reader.pos;\n key = \"\";\n value = \"\";\n while (reader.pos < end2) {\n var tag2 = reader.uint32();\n switch (tag2 >>> 3) {\n case 1:\n key = reader.string();\n break;\n case 2:\n value = reader.string();\n break;\n default:\n reader.skipType(tag2 & 7);\n break;\n }\n }\n message.annotations[key] = value;\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a File message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.File\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.File} File\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n File.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a File message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.File\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n File.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.sizeBytes != null && message.hasOwnProperty(\"sizeBytes\"))\n if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high)))\n return \"sizeBytes: integer|Long expected\";\n if (message.hashes != null && message.hasOwnProperty(\"hashes\")) {\n if (!Array.isArray(message.hashes))\n return \"hashes: array expected\";\n for (var i = 0; i < message.hashes.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.Hash.verify(message.hashes[i]);\n if (error)\n return \"hashes.\" + error;\n }\n }\n if (message.createTime != null && message.hasOwnProperty(\"createTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.createTime);\n if (error)\n return \"createTime.\" + error;\n }\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.updateTime);\n if (error)\n return \"updateTime.\" + error;\n }\n if (message.owner != null && message.hasOwnProperty(\"owner\"))\n if (!$util.isString(message.owner))\n return \"owner: string expected\";\n if (message.fetchTime != null && message.hasOwnProperty(\"fetchTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.fetchTime);\n if (error)\n return \"fetchTime.\" + error;\n }\n if (message.annotations != null && message.hasOwnProperty(\"annotations\")) {\n if (!$util.isObject(message.annotations))\n return \"annotations: object expected\";\n var key = Object.keys(message.annotations);\n for (var i = 0; i < key.length; ++i)\n if (!$util.isString(message.annotations[key[i]]))\n return \"annotations: string{k:string} expected\";\n }\n return null;\n };\n \n /**\n * Creates a File message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.File\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.File} File\n */\n File.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.File)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.File();\n if (object.name != null)\n message.name = String(object.name);\n if (object.sizeBytes != null)\n if ($util.Long)\n (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false;\n else if (typeof object.sizeBytes === \"string\")\n message.sizeBytes = parseInt(object.sizeBytes, 10);\n else if (typeof object.sizeBytes === \"number\")\n message.sizeBytes = object.sizeBytes;\n else if (typeof object.sizeBytes === \"object\")\n message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber();\n if (object.hashes) {\n if (!Array.isArray(object.hashes))\n throw TypeError(\".google.devtools.artifactregistry.v1.File.hashes: array expected\");\n message.hashes = [];\n for (var i = 0; i < object.hashes.length; ++i) {\n if (typeof object.hashes[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.File.hashes: object expected\");\n message.hashes[i] = $root.google.devtools.artifactregistry.v1.Hash.fromObject(object.hashes[i]);\n }\n }\n if (object.createTime != null) {\n if (typeof object.createTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.File.createTime: object expected\");\n message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);\n }\n if (object.updateTime != null) {\n if (typeof object.updateTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.File.updateTime: object expected\");\n message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);\n }\n if (object.owner != null)\n message.owner = String(object.owner);\n if (object.fetchTime != null) {\n if (typeof object.fetchTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.File.fetchTime: object expected\");\n message.fetchTime = $root.google.protobuf.Timestamp.fromObject(object.fetchTime);\n }\n if (object.annotations) {\n if (typeof object.annotations !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.File.annotations: object expected\");\n message.annotations = {};\n for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i)\n message.annotations[keys[i]] = String(object.annotations[keys[i]]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a File message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.File\n * @static\n * @param {google.devtools.artifactregistry.v1.File} message File\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n File.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.hashes = [];\n if (options.objects || options.defaults)\n object.annotations = {};\n if (options.defaults) {\n object.name = \"\";\n if ($util.Long) {\n var long = new $util.Long(0, 0, false);\n object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.sizeBytes = options.longs === String ? \"0\" : 0;\n object.createTime = null;\n object.updateTime = null;\n object.owner = \"\";\n object.fetchTime = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.sizeBytes != null && message.hasOwnProperty(\"sizeBytes\"))\n if (typeof message.sizeBytes === \"number\")\n object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes;\n else\n object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes;\n if (message.hashes && message.hashes.length) {\n object.hashes = [];\n for (var j = 0; j < message.hashes.length; ++j)\n object.hashes[j] = $root.google.devtools.artifactregistry.v1.Hash.toObject(message.hashes[j], options);\n }\n if (message.createTime != null && message.hasOwnProperty(\"createTime\"))\n object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\"))\n object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);\n if (message.owner != null && message.hasOwnProperty(\"owner\"))\n object.owner = message.owner;\n if (message.fetchTime != null && message.hasOwnProperty(\"fetchTime\"))\n object.fetchTime = $root.google.protobuf.Timestamp.toObject(message.fetchTime, options);\n var keys2;\n if (message.annotations && (keys2 = Object.keys(message.annotations)).length) {\n object.annotations = {};\n for (var j = 0; j < keys2.length; ++j)\n object.annotations[keys2[j]] = message.annotations[keys2[j]];\n }\n return object;\n };\n \n /**\n * Converts this File to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.File\n * @instance\n * @returns {Object.} JSON object\n */\n File.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for File\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.File\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n File.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.File\";\n };\n \n return File;\n })();\n \n v1.ListFilesRequest = (function() {\n \n /**\n * Properties of a ListFilesRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListFilesRequest\n * @property {string|null} [parent] ListFilesRequest parent\n * @property {string|null} [filter] ListFilesRequest filter\n * @property {number|null} [pageSize] ListFilesRequest pageSize\n * @property {string|null} [pageToken] ListFilesRequest pageToken\n * @property {string|null} [orderBy] ListFilesRequest orderBy\n */\n \n /**\n * Constructs a new ListFilesRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListFilesRequest.\n * @implements IListFilesRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListFilesRequest=} [properties] Properties to set\n */\n function ListFilesRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListFilesRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.ListFilesRequest\n * @instance\n */\n ListFilesRequest.prototype.parent = \"\";\n \n /**\n * ListFilesRequest filter.\n * @member {string} filter\n * @memberof google.devtools.artifactregistry.v1.ListFilesRequest\n * @instance\n */\n ListFilesRequest.prototype.filter = \"\";\n \n /**\n * ListFilesRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1.ListFilesRequest\n * @instance\n */\n ListFilesRequest.prototype.pageSize = 0;\n \n /**\n * ListFilesRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1.ListFilesRequest\n * @instance\n */\n ListFilesRequest.prototype.pageToken = \"\";\n \n /**\n * ListFilesRequest orderBy.\n * @member {string} orderBy\n * @memberof google.devtools.artifactregistry.v1.ListFilesRequest\n * @instance\n */\n ListFilesRequest.prototype.orderBy = \"\";\n \n /**\n * Creates a new ListFilesRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListFilesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListFilesRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListFilesRequest} ListFilesRequest instance\n */\n ListFilesRequest.create = function create(properties) {\n return new ListFilesRequest(properties);\n };\n \n /**\n * Encodes the specified ListFilesRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListFilesRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListFilesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListFilesRequest} message ListFilesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListFilesRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n if (message.filter != null && Object.hasOwnProperty.call(message, \"filter\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter);\n if (message.orderBy != null && Object.hasOwnProperty.call(message, \"orderBy\"))\n writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy);\n return writer;\n };\n \n /**\n * Encodes the specified ListFilesRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListFilesRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListFilesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListFilesRequest} message ListFilesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListFilesRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListFilesRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListFilesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListFilesRequest} ListFilesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListFilesRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListFilesRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 4: {\n message.filter = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n case 5: {\n message.orderBy = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListFilesRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListFilesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListFilesRequest} ListFilesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListFilesRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListFilesRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListFilesRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListFilesRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n if (!$util.isString(message.filter))\n return \"filter: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n if (message.orderBy != null && message.hasOwnProperty(\"orderBy\"))\n if (!$util.isString(message.orderBy))\n return \"orderBy: string expected\";\n return null;\n };\n \n /**\n * Creates a ListFilesRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListFilesRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListFilesRequest} ListFilesRequest\n */\n ListFilesRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListFilesRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListFilesRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.filter != null)\n message.filter = String(object.filter);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n if (object.orderBy != null)\n message.orderBy = String(object.orderBy);\n return message;\n };\n \n /**\n * Creates a plain object from a ListFilesRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListFilesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ListFilesRequest} message ListFilesRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListFilesRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n object.filter = \"\";\n object.orderBy = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n object.filter = message.filter;\n if (message.orderBy != null && message.hasOwnProperty(\"orderBy\"))\n object.orderBy = message.orderBy;\n return object;\n };\n \n /**\n * Converts this ListFilesRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListFilesRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListFilesRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListFilesRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListFilesRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListFilesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListFilesRequest\";\n };\n \n return ListFilesRequest;\n })();\n \n v1.ListFilesResponse = (function() {\n \n /**\n * Properties of a ListFilesResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListFilesResponse\n * @property {Array.|null} [files] ListFilesResponse files\n * @property {string|null} [nextPageToken] ListFilesResponse nextPageToken\n */\n \n /**\n * Constructs a new ListFilesResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListFilesResponse.\n * @implements IListFilesResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListFilesResponse=} [properties] Properties to set\n */\n function ListFilesResponse(properties) {\n this.files = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListFilesResponse files.\n * @member {Array.} files\n * @memberof google.devtools.artifactregistry.v1.ListFilesResponse\n * @instance\n */\n ListFilesResponse.prototype.files = $util.emptyArray;\n \n /**\n * ListFilesResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1.ListFilesResponse\n * @instance\n */\n ListFilesResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListFilesResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListFilesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListFilesResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListFilesResponse} ListFilesResponse instance\n */\n ListFilesResponse.create = function create(properties) {\n return new ListFilesResponse(properties);\n };\n \n /**\n * Encodes the specified ListFilesResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListFilesResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListFilesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListFilesResponse} message ListFilesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListFilesResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.files != null && message.files.length)\n for (var i = 0; i < message.files.length; ++i)\n $root.google.devtools.artifactregistry.v1.File.encode(message.files[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListFilesResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListFilesResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListFilesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListFilesResponse} message ListFilesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListFilesResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListFilesResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListFilesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListFilesResponse} ListFilesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListFilesResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListFilesResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.files && message.files.length))\n message.files = [];\n message.files.push($root.google.devtools.artifactregistry.v1.File.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListFilesResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListFilesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListFilesResponse} ListFilesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListFilesResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListFilesResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListFilesResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListFilesResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.files != null && message.hasOwnProperty(\"files\")) {\n if (!Array.isArray(message.files))\n return \"files: array expected\";\n for (var i = 0; i < message.files.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.File.verify(message.files[i]);\n if (error)\n return \"files.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListFilesResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListFilesResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListFilesResponse} ListFilesResponse\n */\n ListFilesResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListFilesResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListFilesResponse();\n if (object.files) {\n if (!Array.isArray(object.files))\n throw TypeError(\".google.devtools.artifactregistry.v1.ListFilesResponse.files: array expected\");\n message.files = [];\n for (var i = 0; i < object.files.length; ++i) {\n if (typeof object.files[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ListFilesResponse.files: object expected\");\n message.files[i] = $root.google.devtools.artifactregistry.v1.File.fromObject(object.files[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListFilesResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListFilesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.ListFilesResponse} message ListFilesResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListFilesResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.files = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.files && message.files.length) {\n object.files = [];\n for (var j = 0; j < message.files.length; ++j)\n object.files[j] = $root.google.devtools.artifactregistry.v1.File.toObject(message.files[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListFilesResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListFilesResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListFilesResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListFilesResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListFilesResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListFilesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListFilesResponse\";\n };\n \n return ListFilesResponse;\n })();\n \n v1.GetFileRequest = (function() {\n \n /**\n * Properties of a GetFileRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IGetFileRequest\n * @property {string|null} [name] GetFileRequest name\n */\n \n /**\n * Constructs a new GetFileRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a GetFileRequest.\n * @implements IGetFileRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IGetFileRequest=} [properties] Properties to set\n */\n function GetFileRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetFileRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.GetFileRequest\n * @instance\n */\n GetFileRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetFileRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.GetFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetFileRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.GetFileRequest} GetFileRequest instance\n */\n GetFileRequest.create = function create(properties) {\n return new GetFileRequest(properties);\n };\n \n /**\n * Encodes the specified GetFileRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.GetFileRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.GetFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetFileRequest} message GetFileRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetFileRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetFileRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.GetFileRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetFileRequest} message GetFileRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetFileRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetFileRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.GetFileRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.GetFileRequest} GetFileRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetFileRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.GetFileRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetFileRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetFileRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.GetFileRequest} GetFileRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetFileRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetFileRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.GetFileRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetFileRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetFileRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.GetFileRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.GetFileRequest} GetFileRequest\n */\n GetFileRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.GetFileRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.GetFileRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetFileRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.GetFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.GetFileRequest} message GetFileRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetFileRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetFileRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.GetFileRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetFileRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetFileRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.GetFileRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.GetFileRequest\";\n };\n \n return GetFileRequest;\n })();\n \n v1.DeleteFileRequest = (function() {\n \n /**\n * Properties of a DeleteFileRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IDeleteFileRequest\n * @property {string|null} [name] DeleteFileRequest name\n */\n \n /**\n * Constructs a new DeleteFileRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a DeleteFileRequest.\n * @implements IDeleteFileRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IDeleteFileRequest=} [properties] Properties to set\n */\n function DeleteFileRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DeleteFileRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.DeleteFileRequest\n * @instance\n */\n DeleteFileRequest.prototype.name = \"\";\n \n /**\n * Creates a new DeleteFileRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.DeleteFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteFileRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.DeleteFileRequest} DeleteFileRequest instance\n */\n DeleteFileRequest.create = function create(properties) {\n return new DeleteFileRequest(properties);\n };\n \n /**\n * Encodes the specified DeleteFileRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.DeleteFileRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.DeleteFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteFileRequest} message DeleteFileRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteFileRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified DeleteFileRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.DeleteFileRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DeleteFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteFileRequest} message DeleteFileRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteFileRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DeleteFileRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.DeleteFileRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.DeleteFileRequest} DeleteFileRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteFileRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.DeleteFileRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DeleteFileRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DeleteFileRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.DeleteFileRequest} DeleteFileRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteFileRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DeleteFileRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.DeleteFileRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DeleteFileRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a DeleteFileRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.DeleteFileRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.DeleteFileRequest} DeleteFileRequest\n */\n DeleteFileRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.DeleteFileRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.DeleteFileRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a DeleteFileRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.DeleteFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.DeleteFileRequest} message DeleteFileRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DeleteFileRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this DeleteFileRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.DeleteFileRequest\n * @instance\n * @returns {Object.} JSON object\n */\n DeleteFileRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DeleteFileRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.DeleteFileRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DeleteFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.DeleteFileRequest\";\n };\n \n return DeleteFileRequest;\n })();\n \n v1.UpdateFileRequest = (function() {\n \n /**\n * Properties of an UpdateFileRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IUpdateFileRequest\n * @property {google.devtools.artifactregistry.v1.IFile|null} [file] UpdateFileRequest file\n * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFileRequest updateMask\n */\n \n /**\n * Constructs a new UpdateFileRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an UpdateFileRequest.\n * @implements IUpdateFileRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IUpdateFileRequest=} [properties] Properties to set\n */\n function UpdateFileRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * UpdateFileRequest file.\n * @member {google.devtools.artifactregistry.v1.IFile|null|undefined} file\n * @memberof google.devtools.artifactregistry.v1.UpdateFileRequest\n * @instance\n */\n UpdateFileRequest.prototype.file = null;\n \n /**\n * UpdateFileRequest updateMask.\n * @member {google.protobuf.IFieldMask|null|undefined} updateMask\n * @memberof google.devtools.artifactregistry.v1.UpdateFileRequest\n * @instance\n */\n UpdateFileRequest.prototype.updateMask = null;\n \n /**\n * Creates a new UpdateFileRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.UpdateFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateFileRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.UpdateFileRequest} UpdateFileRequest instance\n */\n UpdateFileRequest.create = function create(properties) {\n return new UpdateFileRequest(properties);\n };\n \n /**\n * Encodes the specified UpdateFileRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdateFileRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.UpdateFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateFileRequest} message UpdateFileRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateFileRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.file != null && Object.hasOwnProperty.call(message, \"file\"))\n $root.google.devtools.artifactregistry.v1.File.encode(message.file, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.updateMask != null && Object.hasOwnProperty.call(message, \"updateMask\"))\n $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified UpdateFileRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdateFileRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdateFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateFileRequest} message UpdateFileRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateFileRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an UpdateFileRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.UpdateFileRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.UpdateFileRequest} UpdateFileRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateFileRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.UpdateFileRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.file = $root.google.devtools.artifactregistry.v1.File.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an UpdateFileRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdateFileRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.UpdateFileRequest} UpdateFileRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateFileRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an UpdateFileRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.UpdateFileRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n UpdateFileRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.file != null && message.hasOwnProperty(\"file\")) {\n var error = $root.google.devtools.artifactregistry.v1.File.verify(message.file);\n if (error)\n return \"file.\" + error;\n }\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\")) {\n var error = $root.google.protobuf.FieldMask.verify(message.updateMask);\n if (error)\n return \"updateMask.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an UpdateFileRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.UpdateFileRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.UpdateFileRequest} UpdateFileRequest\n */\n UpdateFileRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.UpdateFileRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.UpdateFileRequest();\n if (object.file != null) {\n if (typeof object.file !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdateFileRequest.file: object expected\");\n message.file = $root.google.devtools.artifactregistry.v1.File.fromObject(object.file);\n }\n if (object.updateMask != null) {\n if (typeof object.updateMask !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdateFileRequest.updateMask: object expected\");\n message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an UpdateFileRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.UpdateFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.UpdateFileRequest} message UpdateFileRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n UpdateFileRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.file = null;\n object.updateMask = null;\n }\n if (message.file != null && message.hasOwnProperty(\"file\"))\n object.file = $root.google.devtools.artifactregistry.v1.File.toObject(message.file, options);\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\"))\n object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);\n return object;\n };\n \n /**\n * Converts this UpdateFileRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.UpdateFileRequest\n * @instance\n * @returns {Object.} JSON object\n */\n UpdateFileRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for UpdateFileRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.UpdateFileRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n UpdateFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.UpdateFileRequest\";\n };\n \n return UpdateFileRequest;\n })();\n \n v1.GenericArtifact = (function() {\n \n /**\n * Properties of a GenericArtifact.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IGenericArtifact\n * @property {string|null} [name] GenericArtifact name\n * @property {string|null} [version] GenericArtifact version\n * @property {google.protobuf.ITimestamp|null} [createTime] GenericArtifact createTime\n * @property {google.protobuf.ITimestamp|null} [updateTime] GenericArtifact updateTime\n */\n \n /**\n * Constructs a new GenericArtifact.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a GenericArtifact.\n * @implements IGenericArtifact\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IGenericArtifact=} [properties] Properties to set\n */\n function GenericArtifact(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GenericArtifact name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.GenericArtifact\n * @instance\n */\n GenericArtifact.prototype.name = \"\";\n \n /**\n * GenericArtifact version.\n * @member {string} version\n * @memberof google.devtools.artifactregistry.v1.GenericArtifact\n * @instance\n */\n GenericArtifact.prototype.version = \"\";\n \n /**\n * GenericArtifact createTime.\n * @member {google.protobuf.ITimestamp|null|undefined} createTime\n * @memberof google.devtools.artifactregistry.v1.GenericArtifact\n * @instance\n */\n GenericArtifact.prototype.createTime = null;\n \n /**\n * GenericArtifact updateTime.\n * @member {google.protobuf.ITimestamp|null|undefined} updateTime\n * @memberof google.devtools.artifactregistry.v1.GenericArtifact\n * @instance\n */\n GenericArtifact.prototype.updateTime = null;\n \n /**\n * Creates a new GenericArtifact instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.GenericArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.IGenericArtifact=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.GenericArtifact} GenericArtifact instance\n */\n GenericArtifact.create = function create(properties) {\n return new GenericArtifact(properties);\n };\n \n /**\n * Encodes the specified GenericArtifact message. Does not implicitly {@link google.devtools.artifactregistry.v1.GenericArtifact.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.GenericArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.IGenericArtifact} message GenericArtifact message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GenericArtifact.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.version != null && Object.hasOwnProperty.call(message, \"version\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.version);\n if (message.createTime != null && Object.hasOwnProperty.call(message, \"createTime\"))\n $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n if (message.updateTime != null && Object.hasOwnProperty.call(message, \"updateTime\"))\n $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified GenericArtifact message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.GenericArtifact.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GenericArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.IGenericArtifact} message GenericArtifact message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GenericArtifact.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GenericArtifact message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.GenericArtifact\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.GenericArtifact} GenericArtifact\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GenericArtifact.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.GenericArtifact();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.version = reader.string();\n break;\n }\n case 3: {\n message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 4: {\n message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GenericArtifact message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GenericArtifact\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.GenericArtifact} GenericArtifact\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GenericArtifact.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GenericArtifact message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.GenericArtifact\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GenericArtifact.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.version != null && message.hasOwnProperty(\"version\"))\n if (!$util.isString(message.version))\n return \"version: string expected\";\n if (message.createTime != null && message.hasOwnProperty(\"createTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.createTime);\n if (error)\n return \"createTime.\" + error;\n }\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.updateTime);\n if (error)\n return \"updateTime.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a GenericArtifact message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.GenericArtifact\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.GenericArtifact} GenericArtifact\n */\n GenericArtifact.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.GenericArtifact)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.GenericArtifact();\n if (object.name != null)\n message.name = String(object.name);\n if (object.version != null)\n message.version = String(object.version);\n if (object.createTime != null) {\n if (typeof object.createTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.GenericArtifact.createTime: object expected\");\n message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);\n }\n if (object.updateTime != null) {\n if (typeof object.updateTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.GenericArtifact.updateTime: object expected\");\n message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a GenericArtifact message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.GenericArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.GenericArtifact} message GenericArtifact\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GenericArtifact.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.version = \"\";\n object.createTime = null;\n object.updateTime = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.version != null && message.hasOwnProperty(\"version\"))\n object.version = message.version;\n if (message.createTime != null && message.hasOwnProperty(\"createTime\"))\n object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\"))\n object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);\n return object;\n };\n \n /**\n * Converts this GenericArtifact to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.GenericArtifact\n * @instance\n * @returns {Object.} JSON object\n */\n GenericArtifact.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GenericArtifact\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.GenericArtifact\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GenericArtifact.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.GenericArtifact\";\n };\n \n return GenericArtifact;\n })();\n \n v1.Package = (function() {\n \n /**\n * Properties of a Package.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IPackage\n * @property {string|null} [name] Package name\n * @property {string|null} [displayName] Package displayName\n * @property {google.protobuf.ITimestamp|null} [createTime] Package createTime\n * @property {google.protobuf.ITimestamp|null} [updateTime] Package updateTime\n * @property {Object.|null} [annotations] Package annotations\n */\n \n /**\n * Constructs a new Package.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a Package.\n * @implements IPackage\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IPackage=} [properties] Properties to set\n */\n function Package(properties) {\n this.annotations = {};\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Package name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.Package\n * @instance\n */\n Package.prototype.name = \"\";\n \n /**\n * Package displayName.\n * @member {string} displayName\n * @memberof google.devtools.artifactregistry.v1.Package\n * @instance\n */\n Package.prototype.displayName = \"\";\n \n /**\n * Package createTime.\n * @member {google.protobuf.ITimestamp|null|undefined} createTime\n * @memberof google.devtools.artifactregistry.v1.Package\n * @instance\n */\n Package.prototype.createTime = null;\n \n /**\n * Package updateTime.\n * @member {google.protobuf.ITimestamp|null|undefined} updateTime\n * @memberof google.devtools.artifactregistry.v1.Package\n * @instance\n */\n Package.prototype.updateTime = null;\n \n /**\n * Package annotations.\n * @member {Object.} annotations\n * @memberof google.devtools.artifactregistry.v1.Package\n * @instance\n */\n Package.prototype.annotations = $util.emptyObject;\n \n /**\n * Creates a new Package instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.Package\n * @static\n * @param {google.devtools.artifactregistry.v1.IPackage=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.Package} Package instance\n */\n Package.create = function create(properties) {\n return new Package(properties);\n };\n \n /**\n * Encodes the specified Package message. Does not implicitly {@link google.devtools.artifactregistry.v1.Package.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.Package\n * @static\n * @param {google.devtools.artifactregistry.v1.IPackage} message Package message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Package.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.displayName != null && Object.hasOwnProperty.call(message, \"displayName\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName);\n if (message.createTime != null && Object.hasOwnProperty.call(message, \"createTime\"))\n $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.updateTime != null && Object.hasOwnProperty.call(message, \"updateTime\"))\n $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.annotations != null && Object.hasOwnProperty.call(message, \"annotations\"))\n for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i)\n writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified Package message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.Package.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Package\n * @static\n * @param {google.devtools.artifactregistry.v1.IPackage} message Package message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Package.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Package message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.Package\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.Package} Package\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Package.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.Package(), key, value;\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.displayName = reader.string();\n break;\n }\n case 5: {\n message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 6: {\n message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 7: {\n if (message.annotations === $util.emptyObject)\n message.annotations = {};\n var end2 = reader.uint32() + reader.pos;\n key = \"\";\n value = \"\";\n while (reader.pos < end2) {\n var tag2 = reader.uint32();\n switch (tag2 >>> 3) {\n case 1:\n key = reader.string();\n break;\n case 2:\n value = reader.string();\n break;\n default:\n reader.skipType(tag2 & 7);\n break;\n }\n }\n message.annotations[key] = value;\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Package message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Package\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.Package} Package\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Package.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Package message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.Package\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Package.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.displayName != null && message.hasOwnProperty(\"displayName\"))\n if (!$util.isString(message.displayName))\n return \"displayName: string expected\";\n if (message.createTime != null && message.hasOwnProperty(\"createTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.createTime);\n if (error)\n return \"createTime.\" + error;\n }\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.updateTime);\n if (error)\n return \"updateTime.\" + error;\n }\n if (message.annotations != null && message.hasOwnProperty(\"annotations\")) {\n if (!$util.isObject(message.annotations))\n return \"annotations: object expected\";\n var key = Object.keys(message.annotations);\n for (var i = 0; i < key.length; ++i)\n if (!$util.isString(message.annotations[key[i]]))\n return \"annotations: string{k:string} expected\";\n }\n return null;\n };\n \n /**\n * Creates a Package message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.Package\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.Package} Package\n */\n Package.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.Package)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.Package();\n if (object.name != null)\n message.name = String(object.name);\n if (object.displayName != null)\n message.displayName = String(object.displayName);\n if (object.createTime != null) {\n if (typeof object.createTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Package.createTime: object expected\");\n message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);\n }\n if (object.updateTime != null) {\n if (typeof object.updateTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Package.updateTime: object expected\");\n message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);\n }\n if (object.annotations) {\n if (typeof object.annotations !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Package.annotations: object expected\");\n message.annotations = {};\n for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i)\n message.annotations[keys[i]] = String(object.annotations[keys[i]]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a Package message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.Package\n * @static\n * @param {google.devtools.artifactregistry.v1.Package} message Package\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Package.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.objects || options.defaults)\n object.annotations = {};\n if (options.defaults) {\n object.name = \"\";\n object.displayName = \"\";\n object.createTime = null;\n object.updateTime = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.displayName != null && message.hasOwnProperty(\"displayName\"))\n object.displayName = message.displayName;\n if (message.createTime != null && message.hasOwnProperty(\"createTime\"))\n object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\"))\n object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);\n var keys2;\n if (message.annotations && (keys2 = Object.keys(message.annotations)).length) {\n object.annotations = {};\n for (var j = 0; j < keys2.length; ++j)\n object.annotations[keys2[j]] = message.annotations[keys2[j]];\n }\n return object;\n };\n \n /**\n * Converts this Package to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.Package\n * @instance\n * @returns {Object.} JSON object\n */\n Package.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Package\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.Package\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Package.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.Package\";\n };\n \n return Package;\n })();\n \n v1.ListPackagesRequest = (function() {\n \n /**\n * Properties of a ListPackagesRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListPackagesRequest\n * @property {string|null} [parent] ListPackagesRequest parent\n * @property {number|null} [pageSize] ListPackagesRequest pageSize\n * @property {string|null} [pageToken] ListPackagesRequest pageToken\n * @property {string|null} [filter] ListPackagesRequest filter\n * @property {string|null} [orderBy] ListPackagesRequest orderBy\n */\n \n /**\n * Constructs a new ListPackagesRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListPackagesRequest.\n * @implements IListPackagesRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListPackagesRequest=} [properties] Properties to set\n */\n function ListPackagesRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListPackagesRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.ListPackagesRequest\n * @instance\n */\n ListPackagesRequest.prototype.parent = \"\";\n \n /**\n * ListPackagesRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1.ListPackagesRequest\n * @instance\n */\n ListPackagesRequest.prototype.pageSize = 0;\n \n /**\n * ListPackagesRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1.ListPackagesRequest\n * @instance\n */\n ListPackagesRequest.prototype.pageToken = \"\";\n \n /**\n * ListPackagesRequest filter.\n * @member {string} filter\n * @memberof google.devtools.artifactregistry.v1.ListPackagesRequest\n * @instance\n */\n ListPackagesRequest.prototype.filter = \"\";\n \n /**\n * ListPackagesRequest orderBy.\n * @member {string} orderBy\n * @memberof google.devtools.artifactregistry.v1.ListPackagesRequest\n * @instance\n */\n ListPackagesRequest.prototype.orderBy = \"\";\n \n /**\n * Creates a new ListPackagesRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListPackagesRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListPackagesRequest} ListPackagesRequest instance\n */\n ListPackagesRequest.create = function create(properties) {\n return new ListPackagesRequest(properties);\n };\n \n /**\n * Encodes the specified ListPackagesRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListPackagesRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListPackagesRequest} message ListPackagesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListPackagesRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n if (message.filter != null && Object.hasOwnProperty.call(message, \"filter\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter);\n if (message.orderBy != null && Object.hasOwnProperty.call(message, \"orderBy\"))\n writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy);\n return writer;\n };\n \n /**\n * Encodes the specified ListPackagesRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListPackagesRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListPackagesRequest} message ListPackagesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListPackagesRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListPackagesRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListPackagesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListPackagesRequest} ListPackagesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListPackagesRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListPackagesRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n case 4: {\n message.filter = reader.string();\n break;\n }\n case 5: {\n message.orderBy = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListPackagesRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListPackagesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListPackagesRequest} ListPackagesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListPackagesRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListPackagesRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListPackagesRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListPackagesRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n if (!$util.isString(message.filter))\n return \"filter: string expected\";\n if (message.orderBy != null && message.hasOwnProperty(\"orderBy\"))\n if (!$util.isString(message.orderBy))\n return \"orderBy: string expected\";\n return null;\n };\n \n /**\n * Creates a ListPackagesRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListPackagesRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListPackagesRequest} ListPackagesRequest\n */\n ListPackagesRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListPackagesRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListPackagesRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n if (object.filter != null)\n message.filter = String(object.filter);\n if (object.orderBy != null)\n message.orderBy = String(object.orderBy);\n return message;\n };\n \n /**\n * Creates a plain object from a ListPackagesRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ListPackagesRequest} message ListPackagesRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListPackagesRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n object.filter = \"\";\n object.orderBy = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n object.filter = message.filter;\n if (message.orderBy != null && message.hasOwnProperty(\"orderBy\"))\n object.orderBy = message.orderBy;\n return object;\n };\n \n /**\n * Converts this ListPackagesRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListPackagesRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListPackagesRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListPackagesRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListPackagesRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListPackagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListPackagesRequest\";\n };\n \n return ListPackagesRequest;\n })();\n \n v1.ListPackagesResponse = (function() {\n \n /**\n * Properties of a ListPackagesResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListPackagesResponse\n * @property {Array.|null} [packages] ListPackagesResponse packages\n * @property {string|null} [nextPageToken] ListPackagesResponse nextPageToken\n */\n \n /**\n * Constructs a new ListPackagesResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListPackagesResponse.\n * @implements IListPackagesResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListPackagesResponse=} [properties] Properties to set\n */\n function ListPackagesResponse(properties) {\n this.packages = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListPackagesResponse packages.\n * @member {Array.} packages\n * @memberof google.devtools.artifactregistry.v1.ListPackagesResponse\n * @instance\n */\n ListPackagesResponse.prototype.packages = $util.emptyArray;\n \n /**\n * ListPackagesResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1.ListPackagesResponse\n * @instance\n */\n ListPackagesResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListPackagesResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListPackagesResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListPackagesResponse} ListPackagesResponse instance\n */\n ListPackagesResponse.create = function create(properties) {\n return new ListPackagesResponse(properties);\n };\n \n /**\n * Encodes the specified ListPackagesResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListPackagesResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListPackagesResponse} message ListPackagesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListPackagesResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.packages != null && message.packages.length)\n for (var i = 0; i < message.packages.length; ++i)\n $root.google.devtools.artifactregistry.v1.Package.encode(message.packages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListPackagesResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListPackagesResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListPackagesResponse} message ListPackagesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListPackagesResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListPackagesResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListPackagesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListPackagesResponse} ListPackagesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListPackagesResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListPackagesResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.packages && message.packages.length))\n message.packages = [];\n message.packages.push($root.google.devtools.artifactregistry.v1.Package.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListPackagesResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListPackagesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListPackagesResponse} ListPackagesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListPackagesResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListPackagesResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListPackagesResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListPackagesResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.packages != null && message.hasOwnProperty(\"packages\")) {\n if (!Array.isArray(message.packages))\n return \"packages: array expected\";\n for (var i = 0; i < message.packages.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.Package.verify(message.packages[i]);\n if (error)\n return \"packages.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListPackagesResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListPackagesResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListPackagesResponse} ListPackagesResponse\n */\n ListPackagesResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListPackagesResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListPackagesResponse();\n if (object.packages) {\n if (!Array.isArray(object.packages))\n throw TypeError(\".google.devtools.artifactregistry.v1.ListPackagesResponse.packages: array expected\");\n message.packages = [];\n for (var i = 0; i < object.packages.length; ++i) {\n if (typeof object.packages[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ListPackagesResponse.packages: object expected\");\n message.packages[i] = $root.google.devtools.artifactregistry.v1.Package.fromObject(object.packages[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListPackagesResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.ListPackagesResponse} message ListPackagesResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListPackagesResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.packages = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.packages && message.packages.length) {\n object.packages = [];\n for (var j = 0; j < message.packages.length; ++j)\n object.packages[j] = $root.google.devtools.artifactregistry.v1.Package.toObject(message.packages[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListPackagesResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListPackagesResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListPackagesResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListPackagesResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListPackagesResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListPackagesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListPackagesResponse\";\n };\n \n return ListPackagesResponse;\n })();\n \n v1.GetPackageRequest = (function() {\n \n /**\n * Properties of a GetPackageRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IGetPackageRequest\n * @property {string|null} [name] GetPackageRequest name\n */\n \n /**\n * Constructs a new GetPackageRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a GetPackageRequest.\n * @implements IGetPackageRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IGetPackageRequest=} [properties] Properties to set\n */\n function GetPackageRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetPackageRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.GetPackageRequest\n * @instance\n */\n GetPackageRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetPackageRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.GetPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetPackageRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.GetPackageRequest} GetPackageRequest instance\n */\n GetPackageRequest.create = function create(properties) {\n return new GetPackageRequest(properties);\n };\n \n /**\n * Encodes the specified GetPackageRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.GetPackageRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.GetPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetPackageRequest} message GetPackageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetPackageRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetPackageRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.GetPackageRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetPackageRequest} message GetPackageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetPackageRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetPackageRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.GetPackageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.GetPackageRequest} GetPackageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetPackageRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.GetPackageRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetPackageRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetPackageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.GetPackageRequest} GetPackageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetPackageRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetPackageRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.GetPackageRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetPackageRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetPackageRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.GetPackageRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.GetPackageRequest} GetPackageRequest\n */\n GetPackageRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.GetPackageRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.GetPackageRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetPackageRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.GetPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.GetPackageRequest} message GetPackageRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetPackageRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetPackageRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.GetPackageRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetPackageRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetPackageRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.GetPackageRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetPackageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.GetPackageRequest\";\n };\n \n return GetPackageRequest;\n })();\n \n v1.DeletePackageRequest = (function() {\n \n /**\n * Properties of a DeletePackageRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IDeletePackageRequest\n * @property {string|null} [name] DeletePackageRequest name\n */\n \n /**\n * Constructs a new DeletePackageRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a DeletePackageRequest.\n * @implements IDeletePackageRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IDeletePackageRequest=} [properties] Properties to set\n */\n function DeletePackageRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DeletePackageRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.DeletePackageRequest\n * @instance\n */\n DeletePackageRequest.prototype.name = \"\";\n \n /**\n * Creates a new DeletePackageRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.DeletePackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeletePackageRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.DeletePackageRequest} DeletePackageRequest instance\n */\n DeletePackageRequest.create = function create(properties) {\n return new DeletePackageRequest(properties);\n };\n \n /**\n * Encodes the specified DeletePackageRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.DeletePackageRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.DeletePackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeletePackageRequest} message DeletePackageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeletePackageRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified DeletePackageRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.DeletePackageRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DeletePackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeletePackageRequest} message DeletePackageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeletePackageRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DeletePackageRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.DeletePackageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.DeletePackageRequest} DeletePackageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeletePackageRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.DeletePackageRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DeletePackageRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DeletePackageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.DeletePackageRequest} DeletePackageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeletePackageRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DeletePackageRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.DeletePackageRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DeletePackageRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a DeletePackageRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.DeletePackageRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.DeletePackageRequest} DeletePackageRequest\n */\n DeletePackageRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.DeletePackageRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.DeletePackageRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a DeletePackageRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.DeletePackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.DeletePackageRequest} message DeletePackageRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DeletePackageRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this DeletePackageRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.DeletePackageRequest\n * @instance\n * @returns {Object.} JSON object\n */\n DeletePackageRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DeletePackageRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.DeletePackageRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DeletePackageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.DeletePackageRequest\";\n };\n \n return DeletePackageRequest;\n })();\n \n v1.UpdatePackageRequest = (function() {\n \n /**\n * Properties of an UpdatePackageRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IUpdatePackageRequest\n * @property {google.devtools.artifactregistry.v1.IPackage|null} [\"package\"] UpdatePackageRequest package\n * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePackageRequest updateMask\n */\n \n /**\n * Constructs a new UpdatePackageRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an UpdatePackageRequest.\n * @implements IUpdatePackageRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IUpdatePackageRequest=} [properties] Properties to set\n */\n function UpdatePackageRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * UpdatePackageRequest package.\n * @member {google.devtools.artifactregistry.v1.IPackage|null|undefined} package\n * @memberof google.devtools.artifactregistry.v1.UpdatePackageRequest\n * @instance\n */\n UpdatePackageRequest.prototype[\"package\"] = null;\n \n /**\n * UpdatePackageRequest updateMask.\n * @member {google.protobuf.IFieldMask|null|undefined} updateMask\n * @memberof google.devtools.artifactregistry.v1.UpdatePackageRequest\n * @instance\n */\n UpdatePackageRequest.prototype.updateMask = null;\n \n /**\n * Creates a new UpdatePackageRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.UpdatePackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdatePackageRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.UpdatePackageRequest} UpdatePackageRequest instance\n */\n UpdatePackageRequest.create = function create(properties) {\n return new UpdatePackageRequest(properties);\n };\n \n /**\n * Encodes the specified UpdatePackageRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdatePackageRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.UpdatePackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdatePackageRequest} message UpdatePackageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdatePackageRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message[\"package\"] != null && Object.hasOwnProperty.call(message, \"package\"))\n $root.google.devtools.artifactregistry.v1.Package.encode(message[\"package\"], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.updateMask != null && Object.hasOwnProperty.call(message, \"updateMask\"))\n $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified UpdatePackageRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdatePackageRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdatePackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdatePackageRequest} message UpdatePackageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdatePackageRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an UpdatePackageRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.UpdatePackageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.UpdatePackageRequest} UpdatePackageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdatePackageRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.UpdatePackageRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message[\"package\"] = $root.google.devtools.artifactregistry.v1.Package.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an UpdatePackageRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdatePackageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.UpdatePackageRequest} UpdatePackageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdatePackageRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an UpdatePackageRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.UpdatePackageRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n UpdatePackageRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message[\"package\"] != null && message.hasOwnProperty(\"package\")) {\n var error = $root.google.devtools.artifactregistry.v1.Package.verify(message[\"package\"]);\n if (error)\n return \"package.\" + error;\n }\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\")) {\n var error = $root.google.protobuf.FieldMask.verify(message.updateMask);\n if (error)\n return \"updateMask.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an UpdatePackageRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.UpdatePackageRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.UpdatePackageRequest} UpdatePackageRequest\n */\n UpdatePackageRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.UpdatePackageRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.UpdatePackageRequest();\n if (object[\"package\"] != null) {\n if (typeof object[\"package\"] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdatePackageRequest.package: object expected\");\n message[\"package\"] = $root.google.devtools.artifactregistry.v1.Package.fromObject(object[\"package\"]);\n }\n if (object.updateMask != null) {\n if (typeof object.updateMask !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdatePackageRequest.updateMask: object expected\");\n message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an UpdatePackageRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.UpdatePackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.UpdatePackageRequest} message UpdatePackageRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n UpdatePackageRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object[\"package\"] = null;\n object.updateMask = null;\n }\n if (message[\"package\"] != null && message.hasOwnProperty(\"package\"))\n object[\"package\"] = $root.google.devtools.artifactregistry.v1.Package.toObject(message[\"package\"], options);\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\"))\n object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);\n return object;\n };\n \n /**\n * Converts this UpdatePackageRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.UpdatePackageRequest\n * @instance\n * @returns {Object.} JSON object\n */\n UpdatePackageRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for UpdatePackageRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.UpdatePackageRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n UpdatePackageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.UpdatePackageRequest\";\n };\n \n return UpdatePackageRequest;\n })();\n \n v1.UpstreamPolicy = (function() {\n \n /**\n * Properties of an UpstreamPolicy.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IUpstreamPolicy\n * @property {string|null} [id] UpstreamPolicy id\n * @property {string|null} [repository] UpstreamPolicy repository\n * @property {number|null} [priority] UpstreamPolicy priority\n */\n \n /**\n * Constructs a new UpstreamPolicy.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an UpstreamPolicy.\n * @implements IUpstreamPolicy\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IUpstreamPolicy=} [properties] Properties to set\n */\n function UpstreamPolicy(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * UpstreamPolicy id.\n * @member {string} id\n * @memberof google.devtools.artifactregistry.v1.UpstreamPolicy\n * @instance\n */\n UpstreamPolicy.prototype.id = \"\";\n \n /**\n * UpstreamPolicy repository.\n * @member {string} repository\n * @memberof google.devtools.artifactregistry.v1.UpstreamPolicy\n * @instance\n */\n UpstreamPolicy.prototype.repository = \"\";\n \n /**\n * UpstreamPolicy priority.\n * @member {number} priority\n * @memberof google.devtools.artifactregistry.v1.UpstreamPolicy\n * @instance\n */\n UpstreamPolicy.prototype.priority = 0;\n \n /**\n * Creates a new UpstreamPolicy instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.UpstreamPolicy\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpstreamPolicy=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.UpstreamPolicy} UpstreamPolicy instance\n */\n UpstreamPolicy.create = function create(properties) {\n return new UpstreamPolicy(properties);\n };\n \n /**\n * Encodes the specified UpstreamPolicy message. Does not implicitly {@link google.devtools.artifactregistry.v1.UpstreamPolicy.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.UpstreamPolicy\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpstreamPolicy} message UpstreamPolicy message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpstreamPolicy.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.id != null && Object.hasOwnProperty.call(message, \"id\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);\n if (message.repository != null && Object.hasOwnProperty.call(message, \"repository\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.repository);\n if (message.priority != null && Object.hasOwnProperty.call(message, \"priority\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.priority);\n return writer;\n };\n \n /**\n * Encodes the specified UpstreamPolicy message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.UpstreamPolicy.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpstreamPolicy\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpstreamPolicy} message UpstreamPolicy message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpstreamPolicy.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an UpstreamPolicy message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.UpstreamPolicy\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.UpstreamPolicy} UpstreamPolicy\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpstreamPolicy.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.UpstreamPolicy();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.id = reader.string();\n break;\n }\n case 2: {\n message.repository = reader.string();\n break;\n }\n case 3: {\n message.priority = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an UpstreamPolicy message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpstreamPolicy\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.UpstreamPolicy} UpstreamPolicy\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpstreamPolicy.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an UpstreamPolicy message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.UpstreamPolicy\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n UpstreamPolicy.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.id != null && message.hasOwnProperty(\"id\"))\n if (!$util.isString(message.id))\n return \"id: string expected\";\n if (message.repository != null && message.hasOwnProperty(\"repository\"))\n if (!$util.isString(message.repository))\n return \"repository: string expected\";\n if (message.priority != null && message.hasOwnProperty(\"priority\"))\n if (!$util.isInteger(message.priority))\n return \"priority: integer expected\";\n return null;\n };\n \n /**\n * Creates an UpstreamPolicy message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.UpstreamPolicy\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.UpstreamPolicy} UpstreamPolicy\n */\n UpstreamPolicy.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.UpstreamPolicy)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.UpstreamPolicy();\n if (object.id != null)\n message.id = String(object.id);\n if (object.repository != null)\n message.repository = String(object.repository);\n if (object.priority != null)\n message.priority = object.priority | 0;\n return message;\n };\n \n /**\n * Creates a plain object from an UpstreamPolicy message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.UpstreamPolicy\n * @static\n * @param {google.devtools.artifactregistry.v1.UpstreamPolicy} message UpstreamPolicy\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n UpstreamPolicy.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.id = \"\";\n object.repository = \"\";\n object.priority = 0;\n }\n if (message.id != null && message.hasOwnProperty(\"id\"))\n object.id = message.id;\n if (message.repository != null && message.hasOwnProperty(\"repository\"))\n object.repository = message.repository;\n if (message.priority != null && message.hasOwnProperty(\"priority\"))\n object.priority = message.priority;\n return object;\n };\n \n /**\n * Converts this UpstreamPolicy to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.UpstreamPolicy\n * @instance\n * @returns {Object.} JSON object\n */\n UpstreamPolicy.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for UpstreamPolicy\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.UpstreamPolicy\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n UpstreamPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.UpstreamPolicy\";\n };\n \n return UpstreamPolicy;\n })();\n \n v1.CleanupPolicyCondition = (function() {\n \n /**\n * Properties of a CleanupPolicyCondition.\n * @memberof google.devtools.artifactregistry.v1\n * @interface ICleanupPolicyCondition\n * @property {google.devtools.artifactregistry.v1.CleanupPolicyCondition.TagState|null} [tagState] CleanupPolicyCondition tagState\n * @property {Array.|null} [tagPrefixes] CleanupPolicyCondition tagPrefixes\n * @property {Array.|null} [versionNamePrefixes] CleanupPolicyCondition versionNamePrefixes\n * @property {Array.|null} [packageNamePrefixes] CleanupPolicyCondition packageNamePrefixes\n * @property {google.protobuf.IDuration|null} [olderThan] CleanupPolicyCondition olderThan\n * @property {google.protobuf.IDuration|null} [newerThan] CleanupPolicyCondition newerThan\n */\n \n /**\n * Constructs a new CleanupPolicyCondition.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a CleanupPolicyCondition.\n * @implements ICleanupPolicyCondition\n * @constructor\n * @param {google.devtools.artifactregistry.v1.ICleanupPolicyCondition=} [properties] Properties to set\n */\n function CleanupPolicyCondition(properties) {\n this.tagPrefixes = [];\n this.versionNamePrefixes = [];\n this.packageNamePrefixes = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CleanupPolicyCondition tagState.\n * @member {google.devtools.artifactregistry.v1.CleanupPolicyCondition.TagState|null|undefined} tagState\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @instance\n */\n CleanupPolicyCondition.prototype.tagState = null;\n \n /**\n * CleanupPolicyCondition tagPrefixes.\n * @member {Array.} tagPrefixes\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @instance\n */\n CleanupPolicyCondition.prototype.tagPrefixes = $util.emptyArray;\n \n /**\n * CleanupPolicyCondition versionNamePrefixes.\n * @member {Array.} versionNamePrefixes\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @instance\n */\n CleanupPolicyCondition.prototype.versionNamePrefixes = $util.emptyArray;\n \n /**\n * CleanupPolicyCondition packageNamePrefixes.\n * @member {Array.} packageNamePrefixes\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @instance\n */\n CleanupPolicyCondition.prototype.packageNamePrefixes = $util.emptyArray;\n \n /**\n * CleanupPolicyCondition olderThan.\n * @member {google.protobuf.IDuration|null|undefined} olderThan\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @instance\n */\n CleanupPolicyCondition.prototype.olderThan = null;\n \n /**\n * CleanupPolicyCondition newerThan.\n * @member {google.protobuf.IDuration|null|undefined} newerThan\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @instance\n */\n CleanupPolicyCondition.prototype.newerThan = null;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * CleanupPolicyCondition _tagState.\n * @member {\"tagState\"|undefined} _tagState\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @instance\n */\n Object.defineProperty(CleanupPolicyCondition.prototype, \"_tagState\", {\n get: $util.oneOfGetter($oneOfFields = [\"tagState\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * CleanupPolicyCondition _olderThan.\n * @member {\"olderThan\"|undefined} _olderThan\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @instance\n */\n Object.defineProperty(CleanupPolicyCondition.prototype, \"_olderThan\", {\n get: $util.oneOfGetter($oneOfFields = [\"olderThan\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * CleanupPolicyCondition _newerThan.\n * @member {\"newerThan\"|undefined} _newerThan\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @instance\n */\n Object.defineProperty(CleanupPolicyCondition.prototype, \"_newerThan\", {\n get: $util.oneOfGetter($oneOfFields = [\"newerThan\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new CleanupPolicyCondition instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @static\n * @param {google.devtools.artifactregistry.v1.ICleanupPolicyCondition=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.CleanupPolicyCondition} CleanupPolicyCondition instance\n */\n CleanupPolicyCondition.create = function create(properties) {\n return new CleanupPolicyCondition(properties);\n };\n \n /**\n * Encodes the specified CleanupPolicyCondition message. Does not implicitly {@link google.devtools.artifactregistry.v1.CleanupPolicyCondition.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @static\n * @param {google.devtools.artifactregistry.v1.ICleanupPolicyCondition} message CleanupPolicyCondition message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CleanupPolicyCondition.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.tagState != null && Object.hasOwnProperty.call(message, \"tagState\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.tagState);\n if (message.tagPrefixes != null && message.tagPrefixes.length)\n for (var i = 0; i < message.tagPrefixes.length; ++i)\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.tagPrefixes[i]);\n if (message.versionNamePrefixes != null && message.versionNamePrefixes.length)\n for (var i = 0; i < message.versionNamePrefixes.length; ++i)\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.versionNamePrefixes[i]);\n if (message.packageNamePrefixes != null && message.packageNamePrefixes.length)\n for (var i = 0; i < message.packageNamePrefixes.length; ++i)\n writer.uint32(/* id 5, wireType 2 =*/42).string(message.packageNamePrefixes[i]);\n if (message.olderThan != null && Object.hasOwnProperty.call(message, \"olderThan\"))\n $root.google.protobuf.Duration.encode(message.olderThan, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.newerThan != null && Object.hasOwnProperty.call(message, \"newerThan\"))\n $root.google.protobuf.Duration.encode(message.newerThan, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified CleanupPolicyCondition message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.CleanupPolicyCondition.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @static\n * @param {google.devtools.artifactregistry.v1.ICleanupPolicyCondition} message CleanupPolicyCondition message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CleanupPolicyCondition.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CleanupPolicyCondition message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.CleanupPolicyCondition} CleanupPolicyCondition\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CleanupPolicyCondition.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.CleanupPolicyCondition();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n message.tagState = reader.int32();\n break;\n }\n case 3: {\n if (!(message.tagPrefixes && message.tagPrefixes.length))\n message.tagPrefixes = [];\n message.tagPrefixes.push(reader.string());\n break;\n }\n case 4: {\n if (!(message.versionNamePrefixes && message.versionNamePrefixes.length))\n message.versionNamePrefixes = [];\n message.versionNamePrefixes.push(reader.string());\n break;\n }\n case 5: {\n if (!(message.packageNamePrefixes && message.packageNamePrefixes.length))\n message.packageNamePrefixes = [];\n message.packageNamePrefixes.push(reader.string());\n break;\n }\n case 6: {\n message.olderThan = $root.google.protobuf.Duration.decode(reader, reader.uint32());\n break;\n }\n case 7: {\n message.newerThan = $root.google.protobuf.Duration.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CleanupPolicyCondition message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.CleanupPolicyCondition} CleanupPolicyCondition\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CleanupPolicyCondition.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CleanupPolicyCondition message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CleanupPolicyCondition.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.tagState != null && message.hasOwnProperty(\"tagState\")) {\n properties._tagState = 1;\n switch (message.tagState) {\n default:\n return \"tagState: enum value expected\";\n case 0:\n case 1:\n case 2:\n case 3:\n break;\n }\n }\n if (message.tagPrefixes != null && message.hasOwnProperty(\"tagPrefixes\")) {\n if (!Array.isArray(message.tagPrefixes))\n return \"tagPrefixes: array expected\";\n for (var i = 0; i < message.tagPrefixes.length; ++i)\n if (!$util.isString(message.tagPrefixes[i]))\n return \"tagPrefixes: string[] expected\";\n }\n if (message.versionNamePrefixes != null && message.hasOwnProperty(\"versionNamePrefixes\")) {\n if (!Array.isArray(message.versionNamePrefixes))\n return \"versionNamePrefixes: array expected\";\n for (var i = 0; i < message.versionNamePrefixes.length; ++i)\n if (!$util.isString(message.versionNamePrefixes[i]))\n return \"versionNamePrefixes: string[] expected\";\n }\n if (message.packageNamePrefixes != null && message.hasOwnProperty(\"packageNamePrefixes\")) {\n if (!Array.isArray(message.packageNamePrefixes))\n return \"packageNamePrefixes: array expected\";\n for (var i = 0; i < message.packageNamePrefixes.length; ++i)\n if (!$util.isString(message.packageNamePrefixes[i]))\n return \"packageNamePrefixes: string[] expected\";\n }\n if (message.olderThan != null && message.hasOwnProperty(\"olderThan\")) {\n properties._olderThan = 1;\n {\n var error = $root.google.protobuf.Duration.verify(message.olderThan);\n if (error)\n return \"olderThan.\" + error;\n }\n }\n if (message.newerThan != null && message.hasOwnProperty(\"newerThan\")) {\n properties._newerThan = 1;\n {\n var error = $root.google.protobuf.Duration.verify(message.newerThan);\n if (error)\n return \"newerThan.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a CleanupPolicyCondition message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.CleanupPolicyCondition} CleanupPolicyCondition\n */\n CleanupPolicyCondition.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.CleanupPolicyCondition)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.CleanupPolicyCondition();\n switch (object.tagState) {\n default:\n if (typeof object.tagState === \"number\") {\n message.tagState = object.tagState;\n break;\n }\n break;\n case \"TAG_STATE_UNSPECIFIED\":\n case 0:\n message.tagState = 0;\n break;\n case \"TAGGED\":\n case 1:\n message.tagState = 1;\n break;\n case \"UNTAGGED\":\n case 2:\n message.tagState = 2;\n break;\n case \"ANY\":\n case 3:\n message.tagState = 3;\n break;\n }\n if (object.tagPrefixes) {\n if (!Array.isArray(object.tagPrefixes))\n throw TypeError(\".google.devtools.artifactregistry.v1.CleanupPolicyCondition.tagPrefixes: array expected\");\n message.tagPrefixes = [];\n for (var i = 0; i < object.tagPrefixes.length; ++i)\n message.tagPrefixes[i] = String(object.tagPrefixes[i]);\n }\n if (object.versionNamePrefixes) {\n if (!Array.isArray(object.versionNamePrefixes))\n throw TypeError(\".google.devtools.artifactregistry.v1.CleanupPolicyCondition.versionNamePrefixes: array expected\");\n message.versionNamePrefixes = [];\n for (var i = 0; i < object.versionNamePrefixes.length; ++i)\n message.versionNamePrefixes[i] = String(object.versionNamePrefixes[i]);\n }\n if (object.packageNamePrefixes) {\n if (!Array.isArray(object.packageNamePrefixes))\n throw TypeError(\".google.devtools.artifactregistry.v1.CleanupPolicyCondition.packageNamePrefixes: array expected\");\n message.packageNamePrefixes = [];\n for (var i = 0; i < object.packageNamePrefixes.length; ++i)\n message.packageNamePrefixes[i] = String(object.packageNamePrefixes[i]);\n }\n if (object.olderThan != null) {\n if (typeof object.olderThan !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.CleanupPolicyCondition.olderThan: object expected\");\n message.olderThan = $root.google.protobuf.Duration.fromObject(object.olderThan);\n }\n if (object.newerThan != null) {\n if (typeof object.newerThan !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.CleanupPolicyCondition.newerThan: object expected\");\n message.newerThan = $root.google.protobuf.Duration.fromObject(object.newerThan);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a CleanupPolicyCondition message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @static\n * @param {google.devtools.artifactregistry.v1.CleanupPolicyCondition} message CleanupPolicyCondition\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CleanupPolicyCondition.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.tagPrefixes = [];\n object.versionNamePrefixes = [];\n object.packageNamePrefixes = [];\n }\n if (message.tagState != null && message.hasOwnProperty(\"tagState\")) {\n object.tagState = options.enums === String ? $root.google.devtools.artifactregistry.v1.CleanupPolicyCondition.TagState[message.tagState] === undefined ? message.tagState : $root.google.devtools.artifactregistry.v1.CleanupPolicyCondition.TagState[message.tagState] : message.tagState;\n if (options.oneofs)\n object._tagState = \"tagState\";\n }\n if (message.tagPrefixes && message.tagPrefixes.length) {\n object.tagPrefixes = [];\n for (var j = 0; j < message.tagPrefixes.length; ++j)\n object.tagPrefixes[j] = message.tagPrefixes[j];\n }\n if (message.versionNamePrefixes && message.versionNamePrefixes.length) {\n object.versionNamePrefixes = [];\n for (var j = 0; j < message.versionNamePrefixes.length; ++j)\n object.versionNamePrefixes[j] = message.versionNamePrefixes[j];\n }\n if (message.packageNamePrefixes && message.packageNamePrefixes.length) {\n object.packageNamePrefixes = [];\n for (var j = 0; j < message.packageNamePrefixes.length; ++j)\n object.packageNamePrefixes[j] = message.packageNamePrefixes[j];\n }\n if (message.olderThan != null && message.hasOwnProperty(\"olderThan\")) {\n object.olderThan = $root.google.protobuf.Duration.toObject(message.olderThan, options);\n if (options.oneofs)\n object._olderThan = \"olderThan\";\n }\n if (message.newerThan != null && message.hasOwnProperty(\"newerThan\")) {\n object.newerThan = $root.google.protobuf.Duration.toObject(message.newerThan, options);\n if (options.oneofs)\n object._newerThan = \"newerThan\";\n }\n return object;\n };\n \n /**\n * Converts this CleanupPolicyCondition to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @instance\n * @returns {Object.} JSON object\n */\n CleanupPolicyCondition.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CleanupPolicyCondition\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyCondition\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CleanupPolicyCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.CleanupPolicyCondition\";\n };\n \n /**\n * TagState enum.\n * @name google.devtools.artifactregistry.v1.CleanupPolicyCondition.TagState\n * @enum {number}\n * @property {number} TAG_STATE_UNSPECIFIED=0 TAG_STATE_UNSPECIFIED value\n * @property {number} TAGGED=1 TAGGED value\n * @property {number} UNTAGGED=2 UNTAGGED value\n * @property {number} ANY=3 ANY value\n */\n CleanupPolicyCondition.TagState = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"TAG_STATE_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"TAGGED\"] = 1;\n values[valuesById[2] = \"UNTAGGED\"] = 2;\n values[valuesById[3] = \"ANY\"] = 3;\n return values;\n })();\n \n return CleanupPolicyCondition;\n })();\n \n v1.CleanupPolicyMostRecentVersions = (function() {\n \n /**\n * Properties of a CleanupPolicyMostRecentVersions.\n * @memberof google.devtools.artifactregistry.v1\n * @interface ICleanupPolicyMostRecentVersions\n * @property {Array.|null} [packageNamePrefixes] CleanupPolicyMostRecentVersions packageNamePrefixes\n * @property {number|null} [keepCount] CleanupPolicyMostRecentVersions keepCount\n */\n \n /**\n * Constructs a new CleanupPolicyMostRecentVersions.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a CleanupPolicyMostRecentVersions.\n * @implements ICleanupPolicyMostRecentVersions\n * @constructor\n * @param {google.devtools.artifactregistry.v1.ICleanupPolicyMostRecentVersions=} [properties] Properties to set\n */\n function CleanupPolicyMostRecentVersions(properties) {\n this.packageNamePrefixes = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CleanupPolicyMostRecentVersions packageNamePrefixes.\n * @member {Array.} packageNamePrefixes\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions\n * @instance\n */\n CleanupPolicyMostRecentVersions.prototype.packageNamePrefixes = $util.emptyArray;\n \n /**\n * CleanupPolicyMostRecentVersions keepCount.\n * @member {number|null|undefined} keepCount\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions\n * @instance\n */\n CleanupPolicyMostRecentVersions.prototype.keepCount = null;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * CleanupPolicyMostRecentVersions _keepCount.\n * @member {\"keepCount\"|undefined} _keepCount\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions\n * @instance\n */\n Object.defineProperty(CleanupPolicyMostRecentVersions.prototype, \"_keepCount\", {\n get: $util.oneOfGetter($oneOfFields = [\"keepCount\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new CleanupPolicyMostRecentVersions instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions\n * @static\n * @param {google.devtools.artifactregistry.v1.ICleanupPolicyMostRecentVersions=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions} CleanupPolicyMostRecentVersions instance\n */\n CleanupPolicyMostRecentVersions.create = function create(properties) {\n return new CleanupPolicyMostRecentVersions(properties);\n };\n \n /**\n * Encodes the specified CleanupPolicyMostRecentVersions message. Does not implicitly {@link google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions\n * @static\n * @param {google.devtools.artifactregistry.v1.ICleanupPolicyMostRecentVersions} message CleanupPolicyMostRecentVersions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CleanupPolicyMostRecentVersions.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.packageNamePrefixes != null && message.packageNamePrefixes.length)\n for (var i = 0; i < message.packageNamePrefixes.length; ++i)\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.packageNamePrefixes[i]);\n if (message.keepCount != null && Object.hasOwnProperty.call(message, \"keepCount\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.keepCount);\n return writer;\n };\n \n /**\n * Encodes the specified CleanupPolicyMostRecentVersions message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions\n * @static\n * @param {google.devtools.artifactregistry.v1.ICleanupPolicyMostRecentVersions} message CleanupPolicyMostRecentVersions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CleanupPolicyMostRecentVersions.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CleanupPolicyMostRecentVersions message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions} CleanupPolicyMostRecentVersions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CleanupPolicyMostRecentVersions.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.packageNamePrefixes && message.packageNamePrefixes.length))\n message.packageNamePrefixes = [];\n message.packageNamePrefixes.push(reader.string());\n break;\n }\n case 2: {\n message.keepCount = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CleanupPolicyMostRecentVersions message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions} CleanupPolicyMostRecentVersions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CleanupPolicyMostRecentVersions.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CleanupPolicyMostRecentVersions message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CleanupPolicyMostRecentVersions.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.packageNamePrefixes != null && message.hasOwnProperty(\"packageNamePrefixes\")) {\n if (!Array.isArray(message.packageNamePrefixes))\n return \"packageNamePrefixes: array expected\";\n for (var i = 0; i < message.packageNamePrefixes.length; ++i)\n if (!$util.isString(message.packageNamePrefixes[i]))\n return \"packageNamePrefixes: string[] expected\";\n }\n if (message.keepCount != null && message.hasOwnProperty(\"keepCount\")) {\n properties._keepCount = 1;\n if (!$util.isInteger(message.keepCount))\n return \"keepCount: integer expected\";\n }\n return null;\n };\n \n /**\n * Creates a CleanupPolicyMostRecentVersions message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions} CleanupPolicyMostRecentVersions\n */\n CleanupPolicyMostRecentVersions.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions();\n if (object.packageNamePrefixes) {\n if (!Array.isArray(object.packageNamePrefixes))\n throw TypeError(\".google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions.packageNamePrefixes: array expected\");\n message.packageNamePrefixes = [];\n for (var i = 0; i < object.packageNamePrefixes.length; ++i)\n message.packageNamePrefixes[i] = String(object.packageNamePrefixes[i]);\n }\n if (object.keepCount != null)\n message.keepCount = object.keepCount | 0;\n return message;\n };\n \n /**\n * Creates a plain object from a CleanupPolicyMostRecentVersions message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions\n * @static\n * @param {google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions} message CleanupPolicyMostRecentVersions\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CleanupPolicyMostRecentVersions.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.packageNamePrefixes = [];\n if (message.packageNamePrefixes && message.packageNamePrefixes.length) {\n object.packageNamePrefixes = [];\n for (var j = 0; j < message.packageNamePrefixes.length; ++j)\n object.packageNamePrefixes[j] = message.packageNamePrefixes[j];\n }\n if (message.keepCount != null && message.hasOwnProperty(\"keepCount\")) {\n object.keepCount = message.keepCount;\n if (options.oneofs)\n object._keepCount = \"keepCount\";\n }\n return object;\n };\n \n /**\n * Converts this CleanupPolicyMostRecentVersions to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions\n * @instance\n * @returns {Object.} JSON object\n */\n CleanupPolicyMostRecentVersions.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CleanupPolicyMostRecentVersions\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CleanupPolicyMostRecentVersions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions\";\n };\n \n return CleanupPolicyMostRecentVersions;\n })();\n \n v1.CleanupPolicy = (function() {\n \n /**\n * Properties of a CleanupPolicy.\n * @memberof google.devtools.artifactregistry.v1\n * @interface ICleanupPolicy\n * @property {google.devtools.artifactregistry.v1.ICleanupPolicyCondition|null} [condition] CleanupPolicy condition\n * @property {google.devtools.artifactregistry.v1.ICleanupPolicyMostRecentVersions|null} [mostRecentVersions] CleanupPolicy mostRecentVersions\n * @property {string|null} [id] CleanupPolicy id\n * @property {google.devtools.artifactregistry.v1.CleanupPolicy.Action|null} [action] CleanupPolicy action\n */\n \n /**\n * Constructs a new CleanupPolicy.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a CleanupPolicy.\n * @implements ICleanupPolicy\n * @constructor\n * @param {google.devtools.artifactregistry.v1.ICleanupPolicy=} [properties] Properties to set\n */\n function CleanupPolicy(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CleanupPolicy condition.\n * @member {google.devtools.artifactregistry.v1.ICleanupPolicyCondition|null|undefined} condition\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicy\n * @instance\n */\n CleanupPolicy.prototype.condition = null;\n \n /**\n * CleanupPolicy mostRecentVersions.\n * @member {google.devtools.artifactregistry.v1.ICleanupPolicyMostRecentVersions|null|undefined} mostRecentVersions\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicy\n * @instance\n */\n CleanupPolicy.prototype.mostRecentVersions = null;\n \n /**\n * CleanupPolicy id.\n * @member {string} id\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicy\n * @instance\n */\n CleanupPolicy.prototype.id = \"\";\n \n /**\n * CleanupPolicy action.\n * @member {google.devtools.artifactregistry.v1.CleanupPolicy.Action} action\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicy\n * @instance\n */\n CleanupPolicy.prototype.action = 0;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * CleanupPolicy conditionType.\n * @member {\"condition\"|\"mostRecentVersions\"|undefined} conditionType\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicy\n * @instance\n */\n Object.defineProperty(CleanupPolicy.prototype, \"conditionType\", {\n get: $util.oneOfGetter($oneOfFields = [\"condition\", \"mostRecentVersions\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new CleanupPolicy instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicy\n * @static\n * @param {google.devtools.artifactregistry.v1.ICleanupPolicy=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.CleanupPolicy} CleanupPolicy instance\n */\n CleanupPolicy.create = function create(properties) {\n return new CleanupPolicy(properties);\n };\n \n /**\n * Encodes the specified CleanupPolicy message. Does not implicitly {@link google.devtools.artifactregistry.v1.CleanupPolicy.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicy\n * @static\n * @param {google.devtools.artifactregistry.v1.ICleanupPolicy} message CleanupPolicy message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CleanupPolicy.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.id != null && Object.hasOwnProperty.call(message, \"id\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);\n if (message.condition != null && Object.hasOwnProperty.call(message, \"condition\"))\n $root.google.devtools.artifactregistry.v1.CleanupPolicyCondition.encode(message.condition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.action != null && Object.hasOwnProperty.call(message, \"action\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.action);\n if (message.mostRecentVersions != null && Object.hasOwnProperty.call(message, \"mostRecentVersions\"))\n $root.google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions.encode(message.mostRecentVersions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified CleanupPolicy message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.CleanupPolicy.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicy\n * @static\n * @param {google.devtools.artifactregistry.v1.ICleanupPolicy} message CleanupPolicy message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CleanupPolicy.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CleanupPolicy message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicy\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.CleanupPolicy} CleanupPolicy\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CleanupPolicy.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.CleanupPolicy();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n message.condition = $root.google.devtools.artifactregistry.v1.CleanupPolicyCondition.decode(reader, reader.uint32());\n break;\n }\n case 4: {\n message.mostRecentVersions = $root.google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions.decode(reader, reader.uint32());\n break;\n }\n case 1: {\n message.id = reader.string();\n break;\n }\n case 3: {\n message.action = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CleanupPolicy message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicy\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.CleanupPolicy} CleanupPolicy\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CleanupPolicy.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CleanupPolicy message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicy\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CleanupPolicy.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.condition != null && message.hasOwnProperty(\"condition\")) {\n properties.conditionType = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.CleanupPolicyCondition.verify(message.condition);\n if (error)\n return \"condition.\" + error;\n }\n }\n if (message.mostRecentVersions != null && message.hasOwnProperty(\"mostRecentVersions\")) {\n if (properties.conditionType === 1)\n return \"conditionType: multiple values\";\n properties.conditionType = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions.verify(message.mostRecentVersions);\n if (error)\n return \"mostRecentVersions.\" + error;\n }\n }\n if (message.id != null && message.hasOwnProperty(\"id\"))\n if (!$util.isString(message.id))\n return \"id: string expected\";\n if (message.action != null && message.hasOwnProperty(\"action\"))\n switch (message.action) {\n default:\n return \"action: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n return null;\n };\n \n /**\n * Creates a CleanupPolicy message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicy\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.CleanupPolicy} CleanupPolicy\n */\n CleanupPolicy.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.CleanupPolicy)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.CleanupPolicy();\n if (object.condition != null) {\n if (typeof object.condition !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.CleanupPolicy.condition: object expected\");\n message.condition = $root.google.devtools.artifactregistry.v1.CleanupPolicyCondition.fromObject(object.condition);\n }\n if (object.mostRecentVersions != null) {\n if (typeof object.mostRecentVersions !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.CleanupPolicy.mostRecentVersions: object expected\");\n message.mostRecentVersions = $root.google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions.fromObject(object.mostRecentVersions);\n }\n if (object.id != null)\n message.id = String(object.id);\n switch (object.action) {\n default:\n if (typeof object.action === \"number\") {\n message.action = object.action;\n break;\n }\n break;\n case \"ACTION_UNSPECIFIED\":\n case 0:\n message.action = 0;\n break;\n case \"DELETE\":\n case 1:\n message.action = 1;\n break;\n case \"KEEP\":\n case 2:\n message.action = 2;\n break;\n }\n return message;\n };\n \n /**\n * Creates a plain object from a CleanupPolicy message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicy\n * @static\n * @param {google.devtools.artifactregistry.v1.CleanupPolicy} message CleanupPolicy\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CleanupPolicy.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.id = \"\";\n object.action = options.enums === String ? \"ACTION_UNSPECIFIED\" : 0;\n }\n if (message.id != null && message.hasOwnProperty(\"id\"))\n object.id = message.id;\n if (message.condition != null && message.hasOwnProperty(\"condition\")) {\n object.condition = $root.google.devtools.artifactregistry.v1.CleanupPolicyCondition.toObject(message.condition, options);\n if (options.oneofs)\n object.conditionType = \"condition\";\n }\n if (message.action != null && message.hasOwnProperty(\"action\"))\n object.action = options.enums === String ? $root.google.devtools.artifactregistry.v1.CleanupPolicy.Action[message.action] === undefined ? message.action : $root.google.devtools.artifactregistry.v1.CleanupPolicy.Action[message.action] : message.action;\n if (message.mostRecentVersions != null && message.hasOwnProperty(\"mostRecentVersions\")) {\n object.mostRecentVersions = $root.google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions.toObject(message.mostRecentVersions, options);\n if (options.oneofs)\n object.conditionType = \"mostRecentVersions\";\n }\n return object;\n };\n \n /**\n * Converts this CleanupPolicy to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicy\n * @instance\n * @returns {Object.} JSON object\n */\n CleanupPolicy.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CleanupPolicy\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.CleanupPolicy\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CleanupPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.CleanupPolicy\";\n };\n \n /**\n * Action enum.\n * @name google.devtools.artifactregistry.v1.CleanupPolicy.Action\n * @enum {number}\n * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value\n * @property {number} DELETE=1 DELETE value\n * @property {number} KEEP=2 KEEP value\n */\n CleanupPolicy.Action = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"ACTION_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"DELETE\"] = 1;\n values[valuesById[2] = \"KEEP\"] = 2;\n return values;\n })();\n \n return CleanupPolicy;\n })();\n \n v1.VirtualRepositoryConfig = (function() {\n \n /**\n * Properties of a VirtualRepositoryConfig.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IVirtualRepositoryConfig\n * @property {Array.|null} [upstreamPolicies] VirtualRepositoryConfig upstreamPolicies\n */\n \n /**\n * Constructs a new VirtualRepositoryConfig.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a VirtualRepositoryConfig.\n * @implements IVirtualRepositoryConfig\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IVirtualRepositoryConfig=} [properties] Properties to set\n */\n function VirtualRepositoryConfig(properties) {\n this.upstreamPolicies = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * VirtualRepositoryConfig upstreamPolicies.\n * @member {Array.} upstreamPolicies\n * @memberof google.devtools.artifactregistry.v1.VirtualRepositoryConfig\n * @instance\n */\n VirtualRepositoryConfig.prototype.upstreamPolicies = $util.emptyArray;\n \n /**\n * Creates a new VirtualRepositoryConfig instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.VirtualRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.IVirtualRepositoryConfig=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.VirtualRepositoryConfig} VirtualRepositoryConfig instance\n */\n VirtualRepositoryConfig.create = function create(properties) {\n return new VirtualRepositoryConfig(properties);\n };\n \n /**\n * Encodes the specified VirtualRepositoryConfig message. Does not implicitly {@link google.devtools.artifactregistry.v1.VirtualRepositoryConfig.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.VirtualRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.IVirtualRepositoryConfig} message VirtualRepositoryConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n VirtualRepositoryConfig.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.upstreamPolicies != null && message.upstreamPolicies.length)\n for (var i = 0; i < message.upstreamPolicies.length; ++i)\n $root.google.devtools.artifactregistry.v1.UpstreamPolicy.encode(message.upstreamPolicies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified VirtualRepositoryConfig message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.VirtualRepositoryConfig.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.VirtualRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.IVirtualRepositoryConfig} message VirtualRepositoryConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n VirtualRepositoryConfig.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a VirtualRepositoryConfig message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.VirtualRepositoryConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.VirtualRepositoryConfig} VirtualRepositoryConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n VirtualRepositoryConfig.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.VirtualRepositoryConfig();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.upstreamPolicies && message.upstreamPolicies.length))\n message.upstreamPolicies = [];\n message.upstreamPolicies.push($root.google.devtools.artifactregistry.v1.UpstreamPolicy.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a VirtualRepositoryConfig message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.VirtualRepositoryConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.VirtualRepositoryConfig} VirtualRepositoryConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n VirtualRepositoryConfig.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a VirtualRepositoryConfig message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.VirtualRepositoryConfig\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n VirtualRepositoryConfig.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.upstreamPolicies != null && message.hasOwnProperty(\"upstreamPolicies\")) {\n if (!Array.isArray(message.upstreamPolicies))\n return \"upstreamPolicies: array expected\";\n for (var i = 0; i < message.upstreamPolicies.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.UpstreamPolicy.verify(message.upstreamPolicies[i]);\n if (error)\n return \"upstreamPolicies.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a VirtualRepositoryConfig message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.VirtualRepositoryConfig\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.VirtualRepositoryConfig} VirtualRepositoryConfig\n */\n VirtualRepositoryConfig.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.VirtualRepositoryConfig)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.VirtualRepositoryConfig();\n if (object.upstreamPolicies) {\n if (!Array.isArray(object.upstreamPolicies))\n throw TypeError(\".google.devtools.artifactregistry.v1.VirtualRepositoryConfig.upstreamPolicies: array expected\");\n message.upstreamPolicies = [];\n for (var i = 0; i < object.upstreamPolicies.length; ++i) {\n if (typeof object.upstreamPolicies[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.VirtualRepositoryConfig.upstreamPolicies: object expected\");\n message.upstreamPolicies[i] = $root.google.devtools.artifactregistry.v1.UpstreamPolicy.fromObject(object.upstreamPolicies[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from a VirtualRepositoryConfig message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.VirtualRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.VirtualRepositoryConfig} message VirtualRepositoryConfig\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n VirtualRepositoryConfig.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.upstreamPolicies = [];\n if (message.upstreamPolicies && message.upstreamPolicies.length) {\n object.upstreamPolicies = [];\n for (var j = 0; j < message.upstreamPolicies.length; ++j)\n object.upstreamPolicies[j] = $root.google.devtools.artifactregistry.v1.UpstreamPolicy.toObject(message.upstreamPolicies[j], options);\n }\n return object;\n };\n \n /**\n * Converts this VirtualRepositoryConfig to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.VirtualRepositoryConfig\n * @instance\n * @returns {Object.} JSON object\n */\n VirtualRepositoryConfig.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for VirtualRepositoryConfig\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.VirtualRepositoryConfig\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n VirtualRepositoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.VirtualRepositoryConfig\";\n };\n \n return VirtualRepositoryConfig;\n })();\n \n v1.RemoteRepositoryConfig = (function() {\n \n /**\n * Properties of a RemoteRepositoryConfig.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IRemoteRepositoryConfig\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IDockerRepository|null} [dockerRepository] RemoteRepositoryConfig dockerRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IMavenRepository|null} [mavenRepository] RemoteRepositoryConfig mavenRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.INpmRepository|null} [npmRepository] RemoteRepositoryConfig npmRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IPythonRepository|null} [pythonRepository] RemoteRepositoryConfig pythonRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IAptRepository|null} [aptRepository] RemoteRepositoryConfig aptRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IYumRepository|null} [yumRepository] RemoteRepositoryConfig yumRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.ICommonRemoteRepository|null} [commonRepository] RemoteRepositoryConfig commonRepository\n * @property {string|null} [description] RemoteRepositoryConfig description\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IUpstreamCredentials|null} [upstreamCredentials] RemoteRepositoryConfig upstreamCredentials\n * @property {boolean|null} [disableUpstreamValidation] RemoteRepositoryConfig disableUpstreamValidation\n */\n \n /**\n * Constructs a new RemoteRepositoryConfig.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a RemoteRepositoryConfig.\n * @implements IRemoteRepositoryConfig\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IRemoteRepositoryConfig=} [properties] Properties to set\n */\n function RemoteRepositoryConfig(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * RemoteRepositoryConfig dockerRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IDockerRepository|null|undefined} dockerRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @instance\n */\n RemoteRepositoryConfig.prototype.dockerRepository = null;\n \n /**\n * RemoteRepositoryConfig mavenRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IMavenRepository|null|undefined} mavenRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @instance\n */\n RemoteRepositoryConfig.prototype.mavenRepository = null;\n \n /**\n * RemoteRepositoryConfig npmRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.INpmRepository|null|undefined} npmRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @instance\n */\n RemoteRepositoryConfig.prototype.npmRepository = null;\n \n /**\n * RemoteRepositoryConfig pythonRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IPythonRepository|null|undefined} pythonRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @instance\n */\n RemoteRepositoryConfig.prototype.pythonRepository = null;\n \n /**\n * RemoteRepositoryConfig aptRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IAptRepository|null|undefined} aptRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @instance\n */\n RemoteRepositoryConfig.prototype.aptRepository = null;\n \n /**\n * RemoteRepositoryConfig yumRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IYumRepository|null|undefined} yumRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @instance\n */\n RemoteRepositoryConfig.prototype.yumRepository = null;\n \n /**\n * RemoteRepositoryConfig commonRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.ICommonRemoteRepository|null|undefined} commonRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @instance\n */\n RemoteRepositoryConfig.prototype.commonRepository = null;\n \n /**\n * RemoteRepositoryConfig description.\n * @member {string} description\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @instance\n */\n RemoteRepositoryConfig.prototype.description = \"\";\n \n /**\n * RemoteRepositoryConfig upstreamCredentials.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IUpstreamCredentials|null|undefined} upstreamCredentials\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @instance\n */\n RemoteRepositoryConfig.prototype.upstreamCredentials = null;\n \n /**\n * RemoteRepositoryConfig disableUpstreamValidation.\n * @member {boolean} disableUpstreamValidation\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @instance\n */\n RemoteRepositoryConfig.prototype.disableUpstreamValidation = false;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * RemoteRepositoryConfig remoteSource.\n * @member {\"dockerRepository\"|\"mavenRepository\"|\"npmRepository\"|\"pythonRepository\"|\"aptRepository\"|\"yumRepository\"|\"commonRepository\"|undefined} remoteSource\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @instance\n */\n Object.defineProperty(RemoteRepositoryConfig.prototype, \"remoteSource\", {\n get: $util.oneOfGetter($oneOfFields = [\"dockerRepository\", \"mavenRepository\", \"npmRepository\", \"pythonRepository\", \"aptRepository\", \"yumRepository\", \"commonRepository\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new RemoteRepositoryConfig instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.IRemoteRepositoryConfig=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig} RemoteRepositoryConfig instance\n */\n RemoteRepositoryConfig.create = function create(properties) {\n return new RemoteRepositoryConfig(properties);\n };\n \n /**\n * Encodes the specified RemoteRepositoryConfig message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.IRemoteRepositoryConfig} message RemoteRepositoryConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n RemoteRepositoryConfig.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.description != null && Object.hasOwnProperty.call(message, \"description\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.description);\n if (message.dockerRepository != null && Object.hasOwnProperty.call(message, \"dockerRepository\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.encode(message.dockerRepository, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.mavenRepository != null && Object.hasOwnProperty.call(message, \"mavenRepository\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.encode(message.mavenRepository, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n if (message.npmRepository != null && Object.hasOwnProperty.call(message, \"npmRepository\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.encode(message.npmRepository, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n if (message.pythonRepository != null && Object.hasOwnProperty.call(message, \"pythonRepository\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.encode(message.pythonRepository, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.aptRepository != null && Object.hasOwnProperty.call(message, \"aptRepository\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.encode(message.aptRepository, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.yumRepository != null && Object.hasOwnProperty.call(message, \"yumRepository\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.encode(message.yumRepository, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n if (message.upstreamCredentials != null && Object.hasOwnProperty.call(message, \"upstreamCredentials\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.encode(message.upstreamCredentials, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();\n if (message.disableUpstreamValidation != null && Object.hasOwnProperty.call(message, \"disableUpstreamValidation\"))\n writer.uint32(/* id 12, wireType 0 =*/96).bool(message.disableUpstreamValidation);\n if (message.commonRepository != null && Object.hasOwnProperty.call(message, \"commonRepository\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository.encode(message.commonRepository, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified RemoteRepositoryConfig message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.IRemoteRepositoryConfig} message RemoteRepositoryConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n RemoteRepositoryConfig.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a RemoteRepositoryConfig message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig} RemoteRepositoryConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n RemoteRepositoryConfig.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n message.dockerRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.decode(reader, reader.uint32());\n break;\n }\n case 3: {\n message.mavenRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.decode(reader, reader.uint32());\n break;\n }\n case 4: {\n message.npmRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.decode(reader, reader.uint32());\n break;\n }\n case 5: {\n message.pythonRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.decode(reader, reader.uint32());\n break;\n }\n case 6: {\n message.aptRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.decode(reader, reader.uint32());\n break;\n }\n case 7: {\n message.yumRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.decode(reader, reader.uint32());\n break;\n }\n case 14: {\n message.commonRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository.decode(reader, reader.uint32());\n break;\n }\n case 1: {\n message.description = reader.string();\n break;\n }\n case 9: {\n message.upstreamCredentials = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.decode(reader, reader.uint32());\n break;\n }\n case 12: {\n message.disableUpstreamValidation = reader.bool();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a RemoteRepositoryConfig message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig} RemoteRepositoryConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n RemoteRepositoryConfig.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a RemoteRepositoryConfig message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n RemoteRepositoryConfig.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.dockerRepository != null && message.hasOwnProperty(\"dockerRepository\")) {\n properties.remoteSource = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.verify(message.dockerRepository);\n if (error)\n return \"dockerRepository.\" + error;\n }\n }\n if (message.mavenRepository != null && message.hasOwnProperty(\"mavenRepository\")) {\n if (properties.remoteSource === 1)\n return \"remoteSource: multiple values\";\n properties.remoteSource = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.verify(message.mavenRepository);\n if (error)\n return \"mavenRepository.\" + error;\n }\n }\n if (message.npmRepository != null && message.hasOwnProperty(\"npmRepository\")) {\n if (properties.remoteSource === 1)\n return \"remoteSource: multiple values\";\n properties.remoteSource = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.verify(message.npmRepository);\n if (error)\n return \"npmRepository.\" + error;\n }\n }\n if (message.pythonRepository != null && message.hasOwnProperty(\"pythonRepository\")) {\n if (properties.remoteSource === 1)\n return \"remoteSource: multiple values\";\n properties.remoteSource = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.verify(message.pythonRepository);\n if (error)\n return \"pythonRepository.\" + error;\n }\n }\n if (message.aptRepository != null && message.hasOwnProperty(\"aptRepository\")) {\n if (properties.remoteSource === 1)\n return \"remoteSource: multiple values\";\n properties.remoteSource = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.verify(message.aptRepository);\n if (error)\n return \"aptRepository.\" + error;\n }\n }\n if (message.yumRepository != null && message.hasOwnProperty(\"yumRepository\")) {\n if (properties.remoteSource === 1)\n return \"remoteSource: multiple values\";\n properties.remoteSource = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.verify(message.yumRepository);\n if (error)\n return \"yumRepository.\" + error;\n }\n }\n if (message.commonRepository != null && message.hasOwnProperty(\"commonRepository\")) {\n if (properties.remoteSource === 1)\n return \"remoteSource: multiple values\";\n properties.remoteSource = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository.verify(message.commonRepository);\n if (error)\n return \"commonRepository.\" + error;\n }\n }\n if (message.description != null && message.hasOwnProperty(\"description\"))\n if (!$util.isString(message.description))\n return \"description: string expected\";\n if (message.upstreamCredentials != null && message.hasOwnProperty(\"upstreamCredentials\")) {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.verify(message.upstreamCredentials);\n if (error)\n return \"upstreamCredentials.\" + error;\n }\n if (message.disableUpstreamValidation != null && message.hasOwnProperty(\"disableUpstreamValidation\"))\n if (typeof message.disableUpstreamValidation !== \"boolean\")\n return \"disableUpstreamValidation: boolean expected\";\n return null;\n };\n \n /**\n * Creates a RemoteRepositoryConfig message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig} RemoteRepositoryConfig\n */\n RemoteRepositoryConfig.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig();\n if (object.dockerRepository != null) {\n if (typeof object.dockerRepository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.dockerRepository: object expected\");\n message.dockerRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.fromObject(object.dockerRepository);\n }\n if (object.mavenRepository != null) {\n if (typeof object.mavenRepository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.mavenRepository: object expected\");\n message.mavenRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.fromObject(object.mavenRepository);\n }\n if (object.npmRepository != null) {\n if (typeof object.npmRepository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.npmRepository: object expected\");\n message.npmRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.fromObject(object.npmRepository);\n }\n if (object.pythonRepository != null) {\n if (typeof object.pythonRepository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.pythonRepository: object expected\");\n message.pythonRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.fromObject(object.pythonRepository);\n }\n if (object.aptRepository != null) {\n if (typeof object.aptRepository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.aptRepository: object expected\");\n message.aptRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.fromObject(object.aptRepository);\n }\n if (object.yumRepository != null) {\n if (typeof object.yumRepository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.yumRepository: object expected\");\n message.yumRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.fromObject(object.yumRepository);\n }\n if (object.commonRepository != null) {\n if (typeof object.commonRepository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.commonRepository: object expected\");\n message.commonRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository.fromObject(object.commonRepository);\n }\n if (object.description != null)\n message.description = String(object.description);\n if (object.upstreamCredentials != null) {\n if (typeof object.upstreamCredentials !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.upstreamCredentials: object expected\");\n message.upstreamCredentials = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.fromObject(object.upstreamCredentials);\n }\n if (object.disableUpstreamValidation != null)\n message.disableUpstreamValidation = Boolean(object.disableUpstreamValidation);\n return message;\n };\n \n /**\n * Creates a plain object from a RemoteRepositoryConfig message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig} message RemoteRepositoryConfig\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n RemoteRepositoryConfig.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.description = \"\";\n object.upstreamCredentials = null;\n object.disableUpstreamValidation = false;\n }\n if (message.description != null && message.hasOwnProperty(\"description\"))\n object.description = message.description;\n if (message.dockerRepository != null && message.hasOwnProperty(\"dockerRepository\")) {\n object.dockerRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.toObject(message.dockerRepository, options);\n if (options.oneofs)\n object.remoteSource = \"dockerRepository\";\n }\n if (message.mavenRepository != null && message.hasOwnProperty(\"mavenRepository\")) {\n object.mavenRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.toObject(message.mavenRepository, options);\n if (options.oneofs)\n object.remoteSource = \"mavenRepository\";\n }\n if (message.npmRepository != null && message.hasOwnProperty(\"npmRepository\")) {\n object.npmRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.toObject(message.npmRepository, options);\n if (options.oneofs)\n object.remoteSource = \"npmRepository\";\n }\n if (message.pythonRepository != null && message.hasOwnProperty(\"pythonRepository\")) {\n object.pythonRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.toObject(message.pythonRepository, options);\n if (options.oneofs)\n object.remoteSource = \"pythonRepository\";\n }\n if (message.aptRepository != null && message.hasOwnProperty(\"aptRepository\")) {\n object.aptRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.toObject(message.aptRepository, options);\n if (options.oneofs)\n object.remoteSource = \"aptRepository\";\n }\n if (message.yumRepository != null && message.hasOwnProperty(\"yumRepository\")) {\n object.yumRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.toObject(message.yumRepository, options);\n if (options.oneofs)\n object.remoteSource = \"yumRepository\";\n }\n if (message.upstreamCredentials != null && message.hasOwnProperty(\"upstreamCredentials\"))\n object.upstreamCredentials = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.toObject(message.upstreamCredentials, options);\n if (message.disableUpstreamValidation != null && message.hasOwnProperty(\"disableUpstreamValidation\"))\n object.disableUpstreamValidation = message.disableUpstreamValidation;\n if (message.commonRepository != null && message.hasOwnProperty(\"commonRepository\")) {\n object.commonRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository.toObject(message.commonRepository, options);\n if (options.oneofs)\n object.remoteSource = \"commonRepository\";\n }\n return object;\n };\n \n /**\n * Converts this RemoteRepositoryConfig to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @instance\n * @returns {Object.} JSON object\n */\n RemoteRepositoryConfig.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for RemoteRepositoryConfig\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n RemoteRepositoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig\";\n };\n \n RemoteRepositoryConfig.UpstreamCredentials = (function() {\n \n /**\n * Properties of an UpstreamCredentials.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @interface IUpstreamCredentials\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.IUsernamePasswordCredentials|null} [usernamePasswordCredentials] UpstreamCredentials usernamePasswordCredentials\n */\n \n /**\n * Constructs a new UpstreamCredentials.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @classdesc Represents an UpstreamCredentials.\n * @implements IUpstreamCredentials\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IUpstreamCredentials=} [properties] Properties to set\n */\n function UpstreamCredentials(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * UpstreamCredentials usernamePasswordCredentials.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.IUsernamePasswordCredentials|null|undefined} usernamePasswordCredentials\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials\n * @instance\n */\n UpstreamCredentials.prototype.usernamePasswordCredentials = null;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * UpstreamCredentials credentials.\n * @member {\"usernamePasswordCredentials\"|undefined} credentials\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials\n * @instance\n */\n Object.defineProperty(UpstreamCredentials.prototype, \"credentials\", {\n get: $util.oneOfGetter($oneOfFields = [\"usernamePasswordCredentials\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new UpstreamCredentials instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IUpstreamCredentials=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials} UpstreamCredentials instance\n */\n UpstreamCredentials.create = function create(properties) {\n return new UpstreamCredentials(properties);\n };\n \n /**\n * Encodes the specified UpstreamCredentials message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IUpstreamCredentials} message UpstreamCredentials message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpstreamCredentials.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.usernamePasswordCredentials != null && Object.hasOwnProperty.call(message, \"usernamePasswordCredentials\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials.encode(message.usernamePasswordCredentials, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified UpstreamCredentials message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IUpstreamCredentials} message UpstreamCredentials message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpstreamCredentials.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an UpstreamCredentials message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials} UpstreamCredentials\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpstreamCredentials.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.usernamePasswordCredentials = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an UpstreamCredentials message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials} UpstreamCredentials\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpstreamCredentials.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an UpstreamCredentials message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n UpstreamCredentials.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.usernamePasswordCredentials != null && message.hasOwnProperty(\"usernamePasswordCredentials\")) {\n properties.credentials = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials.verify(message.usernamePasswordCredentials);\n if (error)\n return \"usernamePasswordCredentials.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates an UpstreamCredentials message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials} UpstreamCredentials\n */\n UpstreamCredentials.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials();\n if (object.usernamePasswordCredentials != null) {\n if (typeof object.usernamePasswordCredentials !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.usernamePasswordCredentials: object expected\");\n message.usernamePasswordCredentials = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials.fromObject(object.usernamePasswordCredentials);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an UpstreamCredentials message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials} message UpstreamCredentials\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n UpstreamCredentials.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (message.usernamePasswordCredentials != null && message.hasOwnProperty(\"usernamePasswordCredentials\")) {\n object.usernamePasswordCredentials = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials.toObject(message.usernamePasswordCredentials, options);\n if (options.oneofs)\n object.credentials = \"usernamePasswordCredentials\";\n }\n return object;\n };\n \n /**\n * Converts this UpstreamCredentials to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials\n * @instance\n * @returns {Object.} JSON object\n */\n UpstreamCredentials.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for UpstreamCredentials\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n UpstreamCredentials.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials\";\n };\n \n UpstreamCredentials.UsernamePasswordCredentials = (function() {\n \n /**\n * Properties of a UsernamePasswordCredentials.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials\n * @interface IUsernamePasswordCredentials\n * @property {string|null} [username] UsernamePasswordCredentials username\n * @property {string|null} [passwordSecretVersion] UsernamePasswordCredentials passwordSecretVersion\n */\n \n /**\n * Constructs a new UsernamePasswordCredentials.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials\n * @classdesc Represents a UsernamePasswordCredentials.\n * @implements IUsernamePasswordCredentials\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.IUsernamePasswordCredentials=} [properties] Properties to set\n */\n function UsernamePasswordCredentials(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * UsernamePasswordCredentials username.\n * @member {string} username\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials\n * @instance\n */\n UsernamePasswordCredentials.prototype.username = \"\";\n \n /**\n * UsernamePasswordCredentials passwordSecretVersion.\n * @member {string} passwordSecretVersion\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials\n * @instance\n */\n UsernamePasswordCredentials.prototype.passwordSecretVersion = \"\";\n \n /**\n * Creates a new UsernamePasswordCredentials instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.IUsernamePasswordCredentials=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials} UsernamePasswordCredentials instance\n */\n UsernamePasswordCredentials.create = function create(properties) {\n return new UsernamePasswordCredentials(properties);\n };\n \n /**\n * Encodes the specified UsernamePasswordCredentials message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.IUsernamePasswordCredentials} message UsernamePasswordCredentials message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UsernamePasswordCredentials.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.username != null && Object.hasOwnProperty.call(message, \"username\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.username);\n if (message.passwordSecretVersion != null && Object.hasOwnProperty.call(message, \"passwordSecretVersion\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.passwordSecretVersion);\n return writer;\n };\n \n /**\n * Encodes the specified UsernamePasswordCredentials message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.IUsernamePasswordCredentials} message UsernamePasswordCredentials message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UsernamePasswordCredentials.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a UsernamePasswordCredentials message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials} UsernamePasswordCredentials\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UsernamePasswordCredentials.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.username = reader.string();\n break;\n }\n case 2: {\n message.passwordSecretVersion = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a UsernamePasswordCredentials message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials} UsernamePasswordCredentials\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UsernamePasswordCredentials.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a UsernamePasswordCredentials message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n UsernamePasswordCredentials.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.username != null && message.hasOwnProperty(\"username\"))\n if (!$util.isString(message.username))\n return \"username: string expected\";\n if (message.passwordSecretVersion != null && message.hasOwnProperty(\"passwordSecretVersion\"))\n if (!$util.isString(message.passwordSecretVersion))\n return \"passwordSecretVersion: string expected\";\n return null;\n };\n \n /**\n * Creates a UsernamePasswordCredentials message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials} UsernamePasswordCredentials\n */\n UsernamePasswordCredentials.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials();\n if (object.username != null)\n message.username = String(object.username);\n if (object.passwordSecretVersion != null)\n message.passwordSecretVersion = String(object.passwordSecretVersion);\n return message;\n };\n \n /**\n * Creates a plain object from a UsernamePasswordCredentials message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials} message UsernamePasswordCredentials\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n UsernamePasswordCredentials.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.username = \"\";\n object.passwordSecretVersion = \"\";\n }\n if (message.username != null && message.hasOwnProperty(\"username\"))\n object.username = message.username;\n if (message.passwordSecretVersion != null && message.hasOwnProperty(\"passwordSecretVersion\"))\n object.passwordSecretVersion = message.passwordSecretVersion;\n return object;\n };\n \n /**\n * Converts this UsernamePasswordCredentials to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials\n * @instance\n * @returns {Object.} JSON object\n */\n UsernamePasswordCredentials.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for UsernamePasswordCredentials\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n UsernamePasswordCredentials.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials\";\n };\n \n return UsernamePasswordCredentials;\n })();\n \n return UpstreamCredentials;\n })();\n \n RemoteRepositoryConfig.DockerRepository = (function() {\n \n /**\n * Properties of a DockerRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @interface IDockerRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.PublicRepository|null} [publicRepository] DockerRepository publicRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.ICustomRepository|null} [customRepository] DockerRepository customRepository\n */\n \n /**\n * Constructs a new DockerRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @classdesc Represents a DockerRepository.\n * @implements IDockerRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IDockerRepository=} [properties] Properties to set\n */\n function DockerRepository(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DockerRepository publicRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.PublicRepository|null|undefined} publicRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\n * @instance\n */\n DockerRepository.prototype.publicRepository = null;\n \n /**\n * DockerRepository customRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.ICustomRepository|null|undefined} customRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\n * @instance\n */\n DockerRepository.prototype.customRepository = null;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * DockerRepository upstream.\n * @member {\"publicRepository\"|\"customRepository\"|undefined} upstream\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\n * @instance\n */\n Object.defineProperty(DockerRepository.prototype, \"upstream\", {\n get: $util.oneOfGetter($oneOfFields = [\"publicRepository\", \"customRepository\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new DockerRepository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IDockerRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository} DockerRepository instance\n */\n DockerRepository.create = function create(properties) {\n return new DockerRepository(properties);\n };\n \n /**\n * Encodes the specified DockerRepository message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IDockerRepository} message DockerRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DockerRepository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.publicRepository != null && Object.hasOwnProperty.call(message, \"publicRepository\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.publicRepository);\n if (message.customRepository != null && Object.hasOwnProperty.call(message, \"customRepository\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository.encode(message.customRepository, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified DockerRepository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IDockerRepository} message DockerRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DockerRepository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DockerRepository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository} DockerRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DockerRepository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.publicRepository = reader.int32();\n break;\n }\n case 3: {\n message.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DockerRepository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository} DockerRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DockerRepository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DockerRepository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DockerRepository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.publicRepository != null && message.hasOwnProperty(\"publicRepository\")) {\n properties.upstream = 1;\n switch (message.publicRepository) {\n default:\n return \"publicRepository: enum value expected\";\n case 0:\n case 1:\n break;\n }\n }\n if (message.customRepository != null && message.hasOwnProperty(\"customRepository\")) {\n if (properties.upstream === 1)\n return \"upstream: multiple values\";\n properties.upstream = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository.verify(message.customRepository);\n if (error)\n return \"customRepository.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a DockerRepository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository} DockerRepository\n */\n DockerRepository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository();\n switch (object.publicRepository) {\n default:\n if (typeof object.publicRepository === \"number\") {\n message.publicRepository = object.publicRepository;\n break;\n }\n break;\n case \"PUBLIC_REPOSITORY_UNSPECIFIED\":\n case 0:\n message.publicRepository = 0;\n break;\n case \"DOCKER_HUB\":\n case 1:\n message.publicRepository = 1;\n break;\n }\n if (object.customRepository != null) {\n if (typeof object.customRepository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.customRepository: object expected\");\n message.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository.fromObject(object.customRepository);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a DockerRepository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository} message DockerRepository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DockerRepository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (message.publicRepository != null && message.hasOwnProperty(\"publicRepository\")) {\n object.publicRepository = options.enums === String ? $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.PublicRepository[message.publicRepository] === undefined ? message.publicRepository : $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.PublicRepository[message.publicRepository] : message.publicRepository;\n if (options.oneofs)\n object.upstream = \"publicRepository\";\n }\n if (message.customRepository != null && message.hasOwnProperty(\"customRepository\")) {\n object.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository.toObject(message.customRepository, options);\n if (options.oneofs)\n object.upstream = \"customRepository\";\n }\n return object;\n };\n \n /**\n * Converts this DockerRepository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\n * @instance\n * @returns {Object.} JSON object\n */\n DockerRepository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DockerRepository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DockerRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\";\n };\n \n DockerRepository.CustomRepository = (function() {\n \n /**\n * Properties of a CustomRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\n * @interface ICustomRepository\n * @property {string|null} [uri] CustomRepository uri\n */\n \n /**\n * Constructs a new CustomRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository\n * @classdesc Represents a CustomRepository.\n * @implements ICustomRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.ICustomRepository=} [properties] Properties to set\n */\n function CustomRepository(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CustomRepository uri.\n * @member {string} uri\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository\n * @instance\n */\n CustomRepository.prototype.uri = \"\";\n \n /**\n * Creates a new CustomRepository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.ICustomRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository} CustomRepository instance\n */\n CustomRepository.create = function create(properties) {\n return new CustomRepository(properties);\n };\n \n /**\n * Encodes the specified CustomRepository message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.ICustomRepository} message CustomRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CustomRepository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.uri != null && Object.hasOwnProperty.call(message, \"uri\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri);\n return writer;\n };\n \n /**\n * Encodes the specified CustomRepository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.ICustomRepository} message CustomRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CustomRepository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CustomRepository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository} CustomRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CustomRepository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.uri = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CustomRepository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository} CustomRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CustomRepository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CustomRepository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CustomRepository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n if (!$util.isString(message.uri))\n return \"uri: string expected\";\n return null;\n };\n \n /**\n * Creates a CustomRepository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository} CustomRepository\n */\n CustomRepository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository();\n if (object.uri != null)\n message.uri = String(object.uri);\n return message;\n };\n \n /**\n * Creates a plain object from a CustomRepository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository} message CustomRepository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CustomRepository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.uri = \"\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n object.uri = message.uri;\n return object;\n };\n \n /**\n * Converts this CustomRepository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository\n * @instance\n * @returns {Object.} JSON object\n */\n CustomRepository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CustomRepository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CustomRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository\";\n };\n \n return CustomRepository;\n })();\n \n /**\n * PublicRepository enum.\n * @name google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.PublicRepository\n * @enum {number}\n * @property {number} PUBLIC_REPOSITORY_UNSPECIFIED=0 PUBLIC_REPOSITORY_UNSPECIFIED value\n * @property {number} DOCKER_HUB=1 DOCKER_HUB value\n */\n DockerRepository.PublicRepository = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"PUBLIC_REPOSITORY_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"DOCKER_HUB\"] = 1;\n return values;\n })();\n \n return DockerRepository;\n })();\n \n RemoteRepositoryConfig.MavenRepository = (function() {\n \n /**\n * Properties of a MavenRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @interface IMavenRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.PublicRepository|null} [publicRepository] MavenRepository publicRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.ICustomRepository|null} [customRepository] MavenRepository customRepository\n */\n \n /**\n * Constructs a new MavenRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @classdesc Represents a MavenRepository.\n * @implements IMavenRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IMavenRepository=} [properties] Properties to set\n */\n function MavenRepository(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * MavenRepository publicRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.PublicRepository|null|undefined} publicRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\n * @instance\n */\n MavenRepository.prototype.publicRepository = null;\n \n /**\n * MavenRepository customRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.ICustomRepository|null|undefined} customRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\n * @instance\n */\n MavenRepository.prototype.customRepository = null;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * MavenRepository upstream.\n * @member {\"publicRepository\"|\"customRepository\"|undefined} upstream\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\n * @instance\n */\n Object.defineProperty(MavenRepository.prototype, \"upstream\", {\n get: $util.oneOfGetter($oneOfFields = [\"publicRepository\", \"customRepository\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new MavenRepository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IMavenRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository} MavenRepository instance\n */\n MavenRepository.create = function create(properties) {\n return new MavenRepository(properties);\n };\n \n /**\n * Encodes the specified MavenRepository message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IMavenRepository} message MavenRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MavenRepository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.publicRepository != null && Object.hasOwnProperty.call(message, \"publicRepository\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.publicRepository);\n if (message.customRepository != null && Object.hasOwnProperty.call(message, \"customRepository\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository.encode(message.customRepository, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified MavenRepository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IMavenRepository} message MavenRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MavenRepository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a MavenRepository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository} MavenRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MavenRepository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.publicRepository = reader.int32();\n break;\n }\n case 3: {\n message.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a MavenRepository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository} MavenRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MavenRepository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a MavenRepository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n MavenRepository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.publicRepository != null && message.hasOwnProperty(\"publicRepository\")) {\n properties.upstream = 1;\n switch (message.publicRepository) {\n default:\n return \"publicRepository: enum value expected\";\n case 0:\n case 1:\n break;\n }\n }\n if (message.customRepository != null && message.hasOwnProperty(\"customRepository\")) {\n if (properties.upstream === 1)\n return \"upstream: multiple values\";\n properties.upstream = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository.verify(message.customRepository);\n if (error)\n return \"customRepository.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a MavenRepository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository} MavenRepository\n */\n MavenRepository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository();\n switch (object.publicRepository) {\n default:\n if (typeof object.publicRepository === \"number\") {\n message.publicRepository = object.publicRepository;\n break;\n }\n break;\n case \"PUBLIC_REPOSITORY_UNSPECIFIED\":\n case 0:\n message.publicRepository = 0;\n break;\n case \"MAVEN_CENTRAL\":\n case 1:\n message.publicRepository = 1;\n break;\n }\n if (object.customRepository != null) {\n if (typeof object.customRepository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.customRepository: object expected\");\n message.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository.fromObject(object.customRepository);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a MavenRepository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository} message MavenRepository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n MavenRepository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (message.publicRepository != null && message.hasOwnProperty(\"publicRepository\")) {\n object.publicRepository = options.enums === String ? $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.PublicRepository[message.publicRepository] === undefined ? message.publicRepository : $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.PublicRepository[message.publicRepository] : message.publicRepository;\n if (options.oneofs)\n object.upstream = \"publicRepository\";\n }\n if (message.customRepository != null && message.hasOwnProperty(\"customRepository\")) {\n object.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository.toObject(message.customRepository, options);\n if (options.oneofs)\n object.upstream = \"customRepository\";\n }\n return object;\n };\n \n /**\n * Converts this MavenRepository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\n * @instance\n * @returns {Object.} JSON object\n */\n MavenRepository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for MavenRepository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n MavenRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\";\n };\n \n MavenRepository.CustomRepository = (function() {\n \n /**\n * Properties of a CustomRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\n * @interface ICustomRepository\n * @property {string|null} [uri] CustomRepository uri\n */\n \n /**\n * Constructs a new CustomRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository\n * @classdesc Represents a CustomRepository.\n * @implements ICustomRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.ICustomRepository=} [properties] Properties to set\n */\n function CustomRepository(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CustomRepository uri.\n * @member {string} uri\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository\n * @instance\n */\n CustomRepository.prototype.uri = \"\";\n \n /**\n * Creates a new CustomRepository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.ICustomRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository} CustomRepository instance\n */\n CustomRepository.create = function create(properties) {\n return new CustomRepository(properties);\n };\n \n /**\n * Encodes the specified CustomRepository message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.ICustomRepository} message CustomRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CustomRepository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.uri != null && Object.hasOwnProperty.call(message, \"uri\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri);\n return writer;\n };\n \n /**\n * Encodes the specified CustomRepository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.ICustomRepository} message CustomRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CustomRepository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CustomRepository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository} CustomRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CustomRepository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.uri = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CustomRepository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository} CustomRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CustomRepository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CustomRepository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CustomRepository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n if (!$util.isString(message.uri))\n return \"uri: string expected\";\n return null;\n };\n \n /**\n * Creates a CustomRepository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository} CustomRepository\n */\n CustomRepository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository();\n if (object.uri != null)\n message.uri = String(object.uri);\n return message;\n };\n \n /**\n * Creates a plain object from a CustomRepository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository} message CustomRepository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CustomRepository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.uri = \"\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n object.uri = message.uri;\n return object;\n };\n \n /**\n * Converts this CustomRepository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository\n * @instance\n * @returns {Object.} JSON object\n */\n CustomRepository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CustomRepository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CustomRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository\";\n };\n \n return CustomRepository;\n })();\n \n /**\n * PublicRepository enum.\n * @name google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.PublicRepository\n * @enum {number}\n * @property {number} PUBLIC_REPOSITORY_UNSPECIFIED=0 PUBLIC_REPOSITORY_UNSPECIFIED value\n * @property {number} MAVEN_CENTRAL=1 MAVEN_CENTRAL value\n */\n MavenRepository.PublicRepository = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"PUBLIC_REPOSITORY_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"MAVEN_CENTRAL\"] = 1;\n return values;\n })();\n \n return MavenRepository;\n })();\n \n RemoteRepositoryConfig.NpmRepository = (function() {\n \n /**\n * Properties of a NpmRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @interface INpmRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.PublicRepository|null} [publicRepository] NpmRepository publicRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.ICustomRepository|null} [customRepository] NpmRepository customRepository\n */\n \n /**\n * Constructs a new NpmRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @classdesc Represents a NpmRepository.\n * @implements INpmRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.INpmRepository=} [properties] Properties to set\n */\n function NpmRepository(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * NpmRepository publicRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.PublicRepository|null|undefined} publicRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\n * @instance\n */\n NpmRepository.prototype.publicRepository = null;\n \n /**\n * NpmRepository customRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.ICustomRepository|null|undefined} customRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\n * @instance\n */\n NpmRepository.prototype.customRepository = null;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * NpmRepository upstream.\n * @member {\"publicRepository\"|\"customRepository\"|undefined} upstream\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\n * @instance\n */\n Object.defineProperty(NpmRepository.prototype, \"upstream\", {\n get: $util.oneOfGetter($oneOfFields = [\"publicRepository\", \"customRepository\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new NpmRepository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.INpmRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository} NpmRepository instance\n */\n NpmRepository.create = function create(properties) {\n return new NpmRepository(properties);\n };\n \n /**\n * Encodes the specified NpmRepository message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.INpmRepository} message NpmRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n NpmRepository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.publicRepository != null && Object.hasOwnProperty.call(message, \"publicRepository\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.publicRepository);\n if (message.customRepository != null && Object.hasOwnProperty.call(message, \"customRepository\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository.encode(message.customRepository, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified NpmRepository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.INpmRepository} message NpmRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n NpmRepository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a NpmRepository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository} NpmRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n NpmRepository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.publicRepository = reader.int32();\n break;\n }\n case 3: {\n message.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a NpmRepository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository} NpmRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n NpmRepository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a NpmRepository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n NpmRepository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.publicRepository != null && message.hasOwnProperty(\"publicRepository\")) {\n properties.upstream = 1;\n switch (message.publicRepository) {\n default:\n return \"publicRepository: enum value expected\";\n case 0:\n case 1:\n break;\n }\n }\n if (message.customRepository != null && message.hasOwnProperty(\"customRepository\")) {\n if (properties.upstream === 1)\n return \"upstream: multiple values\";\n properties.upstream = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository.verify(message.customRepository);\n if (error)\n return \"customRepository.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a NpmRepository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository} NpmRepository\n */\n NpmRepository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository();\n switch (object.publicRepository) {\n default:\n if (typeof object.publicRepository === \"number\") {\n message.publicRepository = object.publicRepository;\n break;\n }\n break;\n case \"PUBLIC_REPOSITORY_UNSPECIFIED\":\n case 0:\n message.publicRepository = 0;\n break;\n case \"NPMJS\":\n case 1:\n message.publicRepository = 1;\n break;\n }\n if (object.customRepository != null) {\n if (typeof object.customRepository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.customRepository: object expected\");\n message.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository.fromObject(object.customRepository);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a NpmRepository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository} message NpmRepository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n NpmRepository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (message.publicRepository != null && message.hasOwnProperty(\"publicRepository\")) {\n object.publicRepository = options.enums === String ? $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.PublicRepository[message.publicRepository] === undefined ? message.publicRepository : $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.PublicRepository[message.publicRepository] : message.publicRepository;\n if (options.oneofs)\n object.upstream = \"publicRepository\";\n }\n if (message.customRepository != null && message.hasOwnProperty(\"customRepository\")) {\n object.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository.toObject(message.customRepository, options);\n if (options.oneofs)\n object.upstream = \"customRepository\";\n }\n return object;\n };\n \n /**\n * Converts this NpmRepository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\n * @instance\n * @returns {Object.} JSON object\n */\n NpmRepository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for NpmRepository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n NpmRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\";\n };\n \n NpmRepository.CustomRepository = (function() {\n \n /**\n * Properties of a CustomRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\n * @interface ICustomRepository\n * @property {string|null} [uri] CustomRepository uri\n */\n \n /**\n * Constructs a new CustomRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository\n * @classdesc Represents a CustomRepository.\n * @implements ICustomRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.ICustomRepository=} [properties] Properties to set\n */\n function CustomRepository(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CustomRepository uri.\n * @member {string} uri\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository\n * @instance\n */\n CustomRepository.prototype.uri = \"\";\n \n /**\n * Creates a new CustomRepository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.ICustomRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository} CustomRepository instance\n */\n CustomRepository.create = function create(properties) {\n return new CustomRepository(properties);\n };\n \n /**\n * Encodes the specified CustomRepository message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.ICustomRepository} message CustomRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CustomRepository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.uri != null && Object.hasOwnProperty.call(message, \"uri\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri);\n return writer;\n };\n \n /**\n * Encodes the specified CustomRepository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.ICustomRepository} message CustomRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CustomRepository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CustomRepository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository} CustomRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CustomRepository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.uri = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CustomRepository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository} CustomRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CustomRepository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CustomRepository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CustomRepository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n if (!$util.isString(message.uri))\n return \"uri: string expected\";\n return null;\n };\n \n /**\n * Creates a CustomRepository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository} CustomRepository\n */\n CustomRepository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository();\n if (object.uri != null)\n message.uri = String(object.uri);\n return message;\n };\n \n /**\n * Creates a plain object from a CustomRepository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository} message CustomRepository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CustomRepository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.uri = \"\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n object.uri = message.uri;\n return object;\n };\n \n /**\n * Converts this CustomRepository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository\n * @instance\n * @returns {Object.} JSON object\n */\n CustomRepository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CustomRepository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CustomRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository\";\n };\n \n return CustomRepository;\n })();\n \n /**\n * PublicRepository enum.\n * @name google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.PublicRepository\n * @enum {number}\n * @property {number} PUBLIC_REPOSITORY_UNSPECIFIED=0 PUBLIC_REPOSITORY_UNSPECIFIED value\n * @property {number} NPMJS=1 NPMJS value\n */\n NpmRepository.PublicRepository = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"PUBLIC_REPOSITORY_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"NPMJS\"] = 1;\n return values;\n })();\n \n return NpmRepository;\n })();\n \n RemoteRepositoryConfig.PythonRepository = (function() {\n \n /**\n * Properties of a PythonRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @interface IPythonRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.PublicRepository|null} [publicRepository] PythonRepository publicRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.ICustomRepository|null} [customRepository] PythonRepository customRepository\n */\n \n /**\n * Constructs a new PythonRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @classdesc Represents a PythonRepository.\n * @implements IPythonRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IPythonRepository=} [properties] Properties to set\n */\n function PythonRepository(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * PythonRepository publicRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.PublicRepository|null|undefined} publicRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\n * @instance\n */\n PythonRepository.prototype.publicRepository = null;\n \n /**\n * PythonRepository customRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.ICustomRepository|null|undefined} customRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\n * @instance\n */\n PythonRepository.prototype.customRepository = null;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * PythonRepository upstream.\n * @member {\"publicRepository\"|\"customRepository\"|undefined} upstream\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\n * @instance\n */\n Object.defineProperty(PythonRepository.prototype, \"upstream\", {\n get: $util.oneOfGetter($oneOfFields = [\"publicRepository\", \"customRepository\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new PythonRepository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IPythonRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository} PythonRepository instance\n */\n PythonRepository.create = function create(properties) {\n return new PythonRepository(properties);\n };\n \n /**\n * Encodes the specified PythonRepository message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IPythonRepository} message PythonRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PythonRepository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.publicRepository != null && Object.hasOwnProperty.call(message, \"publicRepository\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.publicRepository);\n if (message.customRepository != null && Object.hasOwnProperty.call(message, \"customRepository\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository.encode(message.customRepository, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified PythonRepository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IPythonRepository} message PythonRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PythonRepository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a PythonRepository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository} PythonRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PythonRepository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.publicRepository = reader.int32();\n break;\n }\n case 3: {\n message.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a PythonRepository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository} PythonRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PythonRepository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a PythonRepository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n PythonRepository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.publicRepository != null && message.hasOwnProperty(\"publicRepository\")) {\n properties.upstream = 1;\n switch (message.publicRepository) {\n default:\n return \"publicRepository: enum value expected\";\n case 0:\n case 1:\n break;\n }\n }\n if (message.customRepository != null && message.hasOwnProperty(\"customRepository\")) {\n if (properties.upstream === 1)\n return \"upstream: multiple values\";\n properties.upstream = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository.verify(message.customRepository);\n if (error)\n return \"customRepository.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a PythonRepository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository} PythonRepository\n */\n PythonRepository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository();\n switch (object.publicRepository) {\n default:\n if (typeof object.publicRepository === \"number\") {\n message.publicRepository = object.publicRepository;\n break;\n }\n break;\n case \"PUBLIC_REPOSITORY_UNSPECIFIED\":\n case 0:\n message.publicRepository = 0;\n break;\n case \"PYPI\":\n case 1:\n message.publicRepository = 1;\n break;\n }\n if (object.customRepository != null) {\n if (typeof object.customRepository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.customRepository: object expected\");\n message.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository.fromObject(object.customRepository);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a PythonRepository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository} message PythonRepository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n PythonRepository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (message.publicRepository != null && message.hasOwnProperty(\"publicRepository\")) {\n object.publicRepository = options.enums === String ? $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.PublicRepository[message.publicRepository] === undefined ? message.publicRepository : $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.PublicRepository[message.publicRepository] : message.publicRepository;\n if (options.oneofs)\n object.upstream = \"publicRepository\";\n }\n if (message.customRepository != null && message.hasOwnProperty(\"customRepository\")) {\n object.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository.toObject(message.customRepository, options);\n if (options.oneofs)\n object.upstream = \"customRepository\";\n }\n return object;\n };\n \n /**\n * Converts this PythonRepository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\n * @instance\n * @returns {Object.} JSON object\n */\n PythonRepository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for PythonRepository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n PythonRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\";\n };\n \n PythonRepository.CustomRepository = (function() {\n \n /**\n * Properties of a CustomRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\n * @interface ICustomRepository\n * @property {string|null} [uri] CustomRepository uri\n */\n \n /**\n * Constructs a new CustomRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository\n * @classdesc Represents a CustomRepository.\n * @implements ICustomRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.ICustomRepository=} [properties] Properties to set\n */\n function CustomRepository(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CustomRepository uri.\n * @member {string} uri\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository\n * @instance\n */\n CustomRepository.prototype.uri = \"\";\n \n /**\n * Creates a new CustomRepository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.ICustomRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository} CustomRepository instance\n */\n CustomRepository.create = function create(properties) {\n return new CustomRepository(properties);\n };\n \n /**\n * Encodes the specified CustomRepository message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.ICustomRepository} message CustomRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CustomRepository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.uri != null && Object.hasOwnProperty.call(message, \"uri\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri);\n return writer;\n };\n \n /**\n * Encodes the specified CustomRepository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.ICustomRepository} message CustomRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CustomRepository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CustomRepository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository} CustomRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CustomRepository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.uri = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CustomRepository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository} CustomRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CustomRepository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CustomRepository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CustomRepository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n if (!$util.isString(message.uri))\n return \"uri: string expected\";\n return null;\n };\n \n /**\n * Creates a CustomRepository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository} CustomRepository\n */\n CustomRepository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository();\n if (object.uri != null)\n message.uri = String(object.uri);\n return message;\n };\n \n /**\n * Creates a plain object from a CustomRepository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository} message CustomRepository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CustomRepository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.uri = \"\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n object.uri = message.uri;\n return object;\n };\n \n /**\n * Converts this CustomRepository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository\n * @instance\n * @returns {Object.} JSON object\n */\n CustomRepository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CustomRepository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CustomRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository\";\n };\n \n return CustomRepository;\n })();\n \n /**\n * PublicRepository enum.\n * @name google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.PublicRepository\n * @enum {number}\n * @property {number} PUBLIC_REPOSITORY_UNSPECIFIED=0 PUBLIC_REPOSITORY_UNSPECIFIED value\n * @property {number} PYPI=1 PYPI value\n */\n PythonRepository.PublicRepository = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"PUBLIC_REPOSITORY_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"PYPI\"] = 1;\n return values;\n })();\n \n return PythonRepository;\n })();\n \n RemoteRepositoryConfig.AptRepository = (function() {\n \n /**\n * Properties of an AptRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @interface IAptRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.IPublicRepository|null} [publicRepository] AptRepository publicRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.ICustomRepository|null} [customRepository] AptRepository customRepository\n */\n \n /**\n * Constructs a new AptRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @classdesc Represents an AptRepository.\n * @implements IAptRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IAptRepository=} [properties] Properties to set\n */\n function AptRepository(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * AptRepository publicRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.IPublicRepository|null|undefined} publicRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @instance\n */\n AptRepository.prototype.publicRepository = null;\n \n /**\n * AptRepository customRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.ICustomRepository|null|undefined} customRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @instance\n */\n AptRepository.prototype.customRepository = null;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * AptRepository upstream.\n * @member {\"publicRepository\"|\"customRepository\"|undefined} upstream\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @instance\n */\n Object.defineProperty(AptRepository.prototype, \"upstream\", {\n get: $util.oneOfGetter($oneOfFields = [\"publicRepository\", \"customRepository\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new AptRepository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IAptRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository} AptRepository instance\n */\n AptRepository.create = function create(properties) {\n return new AptRepository(properties);\n };\n \n /**\n * Encodes the specified AptRepository message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IAptRepository} message AptRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n AptRepository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.publicRepository != null && Object.hasOwnProperty.call(message, \"publicRepository\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository.encode(message.publicRepository, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.customRepository != null && Object.hasOwnProperty.call(message, \"customRepository\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository.encode(message.customRepository, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified AptRepository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IAptRepository} message AptRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n AptRepository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an AptRepository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository} AptRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n AptRepository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.publicRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository.decode(reader, reader.uint32());\n break;\n }\n case 3: {\n message.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an AptRepository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository} AptRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n AptRepository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an AptRepository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n AptRepository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.publicRepository != null && message.hasOwnProperty(\"publicRepository\")) {\n properties.upstream = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository.verify(message.publicRepository);\n if (error)\n return \"publicRepository.\" + error;\n }\n }\n if (message.customRepository != null && message.hasOwnProperty(\"customRepository\")) {\n if (properties.upstream === 1)\n return \"upstream: multiple values\";\n properties.upstream = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository.verify(message.customRepository);\n if (error)\n return \"customRepository.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates an AptRepository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository} AptRepository\n */\n AptRepository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository();\n if (object.publicRepository != null) {\n if (typeof object.publicRepository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.publicRepository: object expected\");\n message.publicRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository.fromObject(object.publicRepository);\n }\n if (object.customRepository != null) {\n if (typeof object.customRepository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.customRepository: object expected\");\n message.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository.fromObject(object.customRepository);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an AptRepository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository} message AptRepository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n AptRepository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (message.publicRepository != null && message.hasOwnProperty(\"publicRepository\")) {\n object.publicRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository.toObject(message.publicRepository, options);\n if (options.oneofs)\n object.upstream = \"publicRepository\";\n }\n if (message.customRepository != null && message.hasOwnProperty(\"customRepository\")) {\n object.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository.toObject(message.customRepository, options);\n if (options.oneofs)\n object.upstream = \"customRepository\";\n }\n return object;\n };\n \n /**\n * Converts this AptRepository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @instance\n * @returns {Object.} JSON object\n */\n AptRepository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for AptRepository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n AptRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\";\n };\n \n AptRepository.PublicRepository = (function() {\n \n /**\n * Properties of a PublicRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @interface IPublicRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository.RepositoryBase|null} [repositoryBase] PublicRepository repositoryBase\n * @property {string|null} [repositoryPath] PublicRepository repositoryPath\n */\n \n /**\n * Constructs a new PublicRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @classdesc Represents a PublicRepository.\n * @implements IPublicRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.IPublicRepository=} [properties] Properties to set\n */\n function PublicRepository(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * PublicRepository repositoryBase.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository.RepositoryBase} repositoryBase\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository\n * @instance\n */\n PublicRepository.prototype.repositoryBase = 0;\n \n /**\n * PublicRepository repositoryPath.\n * @member {string} repositoryPath\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository\n * @instance\n */\n PublicRepository.prototype.repositoryPath = \"\";\n \n /**\n * Creates a new PublicRepository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.IPublicRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository} PublicRepository instance\n */\n PublicRepository.create = function create(properties) {\n return new PublicRepository(properties);\n };\n \n /**\n * Encodes the specified PublicRepository message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.IPublicRepository} message PublicRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PublicRepository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.repositoryBase != null && Object.hasOwnProperty.call(message, \"repositoryBase\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.repositoryBase);\n if (message.repositoryPath != null && Object.hasOwnProperty.call(message, \"repositoryPath\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.repositoryPath);\n return writer;\n };\n \n /**\n * Encodes the specified PublicRepository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.IPublicRepository} message PublicRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PublicRepository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a PublicRepository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository} PublicRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PublicRepository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.repositoryBase = reader.int32();\n break;\n }\n case 2: {\n message.repositoryPath = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a PublicRepository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository} PublicRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PublicRepository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a PublicRepository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n PublicRepository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.repositoryBase != null && message.hasOwnProperty(\"repositoryBase\"))\n switch (message.repositoryBase) {\n default:\n return \"repositoryBase: enum value expected\";\n case 0:\n case 1:\n case 2:\n case 3:\n break;\n }\n if (message.repositoryPath != null && message.hasOwnProperty(\"repositoryPath\"))\n if (!$util.isString(message.repositoryPath))\n return \"repositoryPath: string expected\";\n return null;\n };\n \n /**\n * Creates a PublicRepository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository} PublicRepository\n */\n PublicRepository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository();\n switch (object.repositoryBase) {\n default:\n if (typeof object.repositoryBase === \"number\") {\n message.repositoryBase = object.repositoryBase;\n break;\n }\n break;\n case \"REPOSITORY_BASE_UNSPECIFIED\":\n case 0:\n message.repositoryBase = 0;\n break;\n case \"DEBIAN\":\n case 1:\n message.repositoryBase = 1;\n break;\n case \"UBUNTU\":\n case 2:\n message.repositoryBase = 2;\n break;\n case \"DEBIAN_SNAPSHOT\":\n case 3:\n message.repositoryBase = 3;\n break;\n }\n if (object.repositoryPath != null)\n message.repositoryPath = String(object.repositoryPath);\n return message;\n };\n \n /**\n * Creates a plain object from a PublicRepository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository} message PublicRepository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n PublicRepository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.repositoryBase = options.enums === String ? \"REPOSITORY_BASE_UNSPECIFIED\" : 0;\n object.repositoryPath = \"\";\n }\n if (message.repositoryBase != null && message.hasOwnProperty(\"repositoryBase\"))\n object.repositoryBase = options.enums === String ? $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository.RepositoryBase[message.repositoryBase] === undefined ? message.repositoryBase : $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository.RepositoryBase[message.repositoryBase] : message.repositoryBase;\n if (message.repositoryPath != null && message.hasOwnProperty(\"repositoryPath\"))\n object.repositoryPath = message.repositoryPath;\n return object;\n };\n \n /**\n * Converts this PublicRepository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository\n * @instance\n * @returns {Object.} JSON object\n */\n PublicRepository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for PublicRepository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n PublicRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository\";\n };\n \n /**\n * RepositoryBase enum.\n * @name google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository.RepositoryBase\n * @enum {number}\n * @property {number} REPOSITORY_BASE_UNSPECIFIED=0 REPOSITORY_BASE_UNSPECIFIED value\n * @property {number} DEBIAN=1 DEBIAN value\n * @property {number} UBUNTU=2 UBUNTU value\n * @property {number} DEBIAN_SNAPSHOT=3 DEBIAN_SNAPSHOT value\n */\n PublicRepository.RepositoryBase = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"REPOSITORY_BASE_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"DEBIAN\"] = 1;\n values[valuesById[2] = \"UBUNTU\"] = 2;\n values[valuesById[3] = \"DEBIAN_SNAPSHOT\"] = 3;\n return values;\n })();\n \n return PublicRepository;\n })();\n \n AptRepository.CustomRepository = (function() {\n \n /**\n * Properties of a CustomRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @interface ICustomRepository\n * @property {string|null} [uri] CustomRepository uri\n */\n \n /**\n * Constructs a new CustomRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository\n * @classdesc Represents a CustomRepository.\n * @implements ICustomRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.ICustomRepository=} [properties] Properties to set\n */\n function CustomRepository(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CustomRepository uri.\n * @member {string} uri\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository\n * @instance\n */\n CustomRepository.prototype.uri = \"\";\n \n /**\n * Creates a new CustomRepository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.ICustomRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository} CustomRepository instance\n */\n CustomRepository.create = function create(properties) {\n return new CustomRepository(properties);\n };\n \n /**\n * Encodes the specified CustomRepository message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.ICustomRepository} message CustomRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CustomRepository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.uri != null && Object.hasOwnProperty.call(message, \"uri\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri);\n return writer;\n };\n \n /**\n * Encodes the specified CustomRepository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.ICustomRepository} message CustomRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CustomRepository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CustomRepository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository} CustomRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CustomRepository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.uri = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CustomRepository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository} CustomRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CustomRepository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CustomRepository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CustomRepository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n if (!$util.isString(message.uri))\n return \"uri: string expected\";\n return null;\n };\n \n /**\n * Creates a CustomRepository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository} CustomRepository\n */\n CustomRepository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository();\n if (object.uri != null)\n message.uri = String(object.uri);\n return message;\n };\n \n /**\n * Creates a plain object from a CustomRepository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository} message CustomRepository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CustomRepository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.uri = \"\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n object.uri = message.uri;\n return object;\n };\n \n /**\n * Converts this CustomRepository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository\n * @instance\n * @returns {Object.} JSON object\n */\n CustomRepository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CustomRepository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CustomRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository\";\n };\n \n return CustomRepository;\n })();\n \n return AptRepository;\n })();\n \n RemoteRepositoryConfig.YumRepository = (function() {\n \n /**\n * Properties of a YumRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @interface IYumRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.IPublicRepository|null} [publicRepository] YumRepository publicRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.ICustomRepository|null} [customRepository] YumRepository customRepository\n */\n \n /**\n * Constructs a new YumRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @classdesc Represents a YumRepository.\n * @implements IYumRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IYumRepository=} [properties] Properties to set\n */\n function YumRepository(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * YumRepository publicRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.IPublicRepository|null|undefined} publicRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @instance\n */\n YumRepository.prototype.publicRepository = null;\n \n /**\n * YumRepository customRepository.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.ICustomRepository|null|undefined} customRepository\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @instance\n */\n YumRepository.prototype.customRepository = null;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * YumRepository upstream.\n * @member {\"publicRepository\"|\"customRepository\"|undefined} upstream\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @instance\n */\n Object.defineProperty(YumRepository.prototype, \"upstream\", {\n get: $util.oneOfGetter($oneOfFields = [\"publicRepository\", \"customRepository\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new YumRepository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IYumRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository} YumRepository instance\n */\n YumRepository.create = function create(properties) {\n return new YumRepository(properties);\n };\n \n /**\n * Encodes the specified YumRepository message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IYumRepository} message YumRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n YumRepository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.publicRepository != null && Object.hasOwnProperty.call(message, \"publicRepository\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository.encode(message.publicRepository, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.customRepository != null && Object.hasOwnProperty.call(message, \"customRepository\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository.encode(message.customRepository, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified YumRepository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.IYumRepository} message YumRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n YumRepository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a YumRepository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository} YumRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n YumRepository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.publicRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository.decode(reader, reader.uint32());\n break;\n }\n case 3: {\n message.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a YumRepository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository} YumRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n YumRepository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a YumRepository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n YumRepository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.publicRepository != null && message.hasOwnProperty(\"publicRepository\")) {\n properties.upstream = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository.verify(message.publicRepository);\n if (error)\n return \"publicRepository.\" + error;\n }\n }\n if (message.customRepository != null && message.hasOwnProperty(\"customRepository\")) {\n if (properties.upstream === 1)\n return \"upstream: multiple values\";\n properties.upstream = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository.verify(message.customRepository);\n if (error)\n return \"customRepository.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a YumRepository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository} YumRepository\n */\n YumRepository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository();\n if (object.publicRepository != null) {\n if (typeof object.publicRepository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.publicRepository: object expected\");\n message.publicRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository.fromObject(object.publicRepository);\n }\n if (object.customRepository != null) {\n if (typeof object.customRepository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.customRepository: object expected\");\n message.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository.fromObject(object.customRepository);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a YumRepository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository} message YumRepository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n YumRepository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (message.publicRepository != null && message.hasOwnProperty(\"publicRepository\")) {\n object.publicRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository.toObject(message.publicRepository, options);\n if (options.oneofs)\n object.upstream = \"publicRepository\";\n }\n if (message.customRepository != null && message.hasOwnProperty(\"customRepository\")) {\n object.customRepository = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository.toObject(message.customRepository, options);\n if (options.oneofs)\n object.upstream = \"customRepository\";\n }\n return object;\n };\n \n /**\n * Converts this YumRepository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @instance\n * @returns {Object.} JSON object\n */\n YumRepository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for YumRepository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n YumRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\";\n };\n \n YumRepository.PublicRepository = (function() {\n \n /**\n * Properties of a PublicRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @interface IPublicRepository\n * @property {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository.RepositoryBase|null} [repositoryBase] PublicRepository repositoryBase\n * @property {string|null} [repositoryPath] PublicRepository repositoryPath\n */\n \n /**\n * Constructs a new PublicRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @classdesc Represents a PublicRepository.\n * @implements IPublicRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.IPublicRepository=} [properties] Properties to set\n */\n function PublicRepository(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * PublicRepository repositoryBase.\n * @member {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository.RepositoryBase} repositoryBase\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository\n * @instance\n */\n PublicRepository.prototype.repositoryBase = 0;\n \n /**\n * PublicRepository repositoryPath.\n * @member {string} repositoryPath\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository\n * @instance\n */\n PublicRepository.prototype.repositoryPath = \"\";\n \n /**\n * Creates a new PublicRepository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.IPublicRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository} PublicRepository instance\n */\n PublicRepository.create = function create(properties) {\n return new PublicRepository(properties);\n };\n \n /**\n * Encodes the specified PublicRepository message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.IPublicRepository} message PublicRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PublicRepository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.repositoryBase != null && Object.hasOwnProperty.call(message, \"repositoryBase\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.repositoryBase);\n if (message.repositoryPath != null && Object.hasOwnProperty.call(message, \"repositoryPath\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.repositoryPath);\n return writer;\n };\n \n /**\n * Encodes the specified PublicRepository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.IPublicRepository} message PublicRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PublicRepository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a PublicRepository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository} PublicRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PublicRepository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.repositoryBase = reader.int32();\n break;\n }\n case 2: {\n message.repositoryPath = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a PublicRepository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository} PublicRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PublicRepository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a PublicRepository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n PublicRepository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.repositoryBase != null && message.hasOwnProperty(\"repositoryBase\"))\n switch (message.repositoryBase) {\n default:\n return \"repositoryBase: enum value expected\";\n case 0:\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n break;\n }\n if (message.repositoryPath != null && message.hasOwnProperty(\"repositoryPath\"))\n if (!$util.isString(message.repositoryPath))\n return \"repositoryPath: string expected\";\n return null;\n };\n \n /**\n * Creates a PublicRepository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository} PublicRepository\n */\n PublicRepository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository();\n switch (object.repositoryBase) {\n default:\n if (typeof object.repositoryBase === \"number\") {\n message.repositoryBase = object.repositoryBase;\n break;\n }\n break;\n case \"REPOSITORY_BASE_UNSPECIFIED\":\n case 0:\n message.repositoryBase = 0;\n break;\n case \"CENTOS\":\n case 1:\n message.repositoryBase = 1;\n break;\n case \"CENTOS_DEBUG\":\n case 2:\n message.repositoryBase = 2;\n break;\n case \"CENTOS_VAULT\":\n case 3:\n message.repositoryBase = 3;\n break;\n case \"CENTOS_STREAM\":\n case 4:\n message.repositoryBase = 4;\n break;\n case \"ROCKY\":\n case 5:\n message.repositoryBase = 5;\n break;\n case \"EPEL\":\n case 6:\n message.repositoryBase = 6;\n break;\n }\n if (object.repositoryPath != null)\n message.repositoryPath = String(object.repositoryPath);\n return message;\n };\n \n /**\n * Creates a plain object from a PublicRepository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository} message PublicRepository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n PublicRepository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.repositoryBase = options.enums === String ? \"REPOSITORY_BASE_UNSPECIFIED\" : 0;\n object.repositoryPath = \"\";\n }\n if (message.repositoryBase != null && message.hasOwnProperty(\"repositoryBase\"))\n object.repositoryBase = options.enums === String ? $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository.RepositoryBase[message.repositoryBase] === undefined ? message.repositoryBase : $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository.RepositoryBase[message.repositoryBase] : message.repositoryBase;\n if (message.repositoryPath != null && message.hasOwnProperty(\"repositoryPath\"))\n object.repositoryPath = message.repositoryPath;\n return object;\n };\n \n /**\n * Converts this PublicRepository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository\n * @instance\n * @returns {Object.} JSON object\n */\n PublicRepository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for PublicRepository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n PublicRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository\";\n };\n \n /**\n * RepositoryBase enum.\n * @name google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository.RepositoryBase\n * @enum {number}\n * @property {number} REPOSITORY_BASE_UNSPECIFIED=0 REPOSITORY_BASE_UNSPECIFIED value\n * @property {number} CENTOS=1 CENTOS value\n * @property {number} CENTOS_DEBUG=2 CENTOS_DEBUG value\n * @property {number} CENTOS_VAULT=3 CENTOS_VAULT value\n * @property {number} CENTOS_STREAM=4 CENTOS_STREAM value\n * @property {number} ROCKY=5 ROCKY value\n * @property {number} EPEL=6 EPEL value\n */\n PublicRepository.RepositoryBase = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"REPOSITORY_BASE_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"CENTOS\"] = 1;\n values[valuesById[2] = \"CENTOS_DEBUG\"] = 2;\n values[valuesById[3] = \"CENTOS_VAULT\"] = 3;\n values[valuesById[4] = \"CENTOS_STREAM\"] = 4;\n values[valuesById[5] = \"ROCKY\"] = 5;\n values[valuesById[6] = \"EPEL\"] = 6;\n return values;\n })();\n \n return PublicRepository;\n })();\n \n YumRepository.CustomRepository = (function() {\n \n /**\n * Properties of a CustomRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @interface ICustomRepository\n * @property {string|null} [uri] CustomRepository uri\n */\n \n /**\n * Constructs a new CustomRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository\n * @classdesc Represents a CustomRepository.\n * @implements ICustomRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.ICustomRepository=} [properties] Properties to set\n */\n function CustomRepository(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CustomRepository uri.\n * @member {string} uri\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository\n * @instance\n */\n CustomRepository.prototype.uri = \"\";\n \n /**\n * Creates a new CustomRepository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.ICustomRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository} CustomRepository instance\n */\n CustomRepository.create = function create(properties) {\n return new CustomRepository(properties);\n };\n \n /**\n * Encodes the specified CustomRepository message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.ICustomRepository} message CustomRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CustomRepository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.uri != null && Object.hasOwnProperty.call(message, \"uri\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri);\n return writer;\n };\n \n /**\n * Encodes the specified CustomRepository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.ICustomRepository} message CustomRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CustomRepository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CustomRepository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository} CustomRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CustomRepository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.uri = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CustomRepository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository} CustomRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CustomRepository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CustomRepository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CustomRepository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n if (!$util.isString(message.uri))\n return \"uri: string expected\";\n return null;\n };\n \n /**\n * Creates a CustomRepository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository} CustomRepository\n */\n CustomRepository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository();\n if (object.uri != null)\n message.uri = String(object.uri);\n return message;\n };\n \n /**\n * Creates a plain object from a CustomRepository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository} message CustomRepository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CustomRepository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.uri = \"\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n object.uri = message.uri;\n return object;\n };\n \n /**\n * Converts this CustomRepository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository\n * @instance\n * @returns {Object.} JSON object\n */\n CustomRepository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CustomRepository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CustomRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository\";\n };\n \n return CustomRepository;\n })();\n \n return YumRepository;\n })();\n \n RemoteRepositoryConfig.CommonRemoteRepository = (function() {\n \n /**\n * Properties of a CommonRemoteRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @interface ICommonRemoteRepository\n * @property {string|null} [uri] CommonRemoteRepository uri\n */\n \n /**\n * Constructs a new CommonRemoteRepository.\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig\n * @classdesc Represents a CommonRemoteRepository.\n * @implements ICommonRemoteRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.ICommonRemoteRepository=} [properties] Properties to set\n */\n function CommonRemoteRepository(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CommonRemoteRepository uri.\n * @member {string} uri\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository\n * @instance\n */\n CommonRemoteRepository.prototype.uri = \"\";\n \n /**\n * Creates a new CommonRemoteRepository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.ICommonRemoteRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository} CommonRemoteRepository instance\n */\n CommonRemoteRepository.create = function create(properties) {\n return new CommonRemoteRepository(properties);\n };\n \n /**\n * Encodes the specified CommonRemoteRepository message. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.ICommonRemoteRepository} message CommonRemoteRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CommonRemoteRepository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.uri != null && Object.hasOwnProperty.call(message, \"uri\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri);\n return writer;\n };\n \n /**\n * Encodes the specified CommonRemoteRepository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.ICommonRemoteRepository} message CommonRemoteRepository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CommonRemoteRepository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CommonRemoteRepository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository} CommonRemoteRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CommonRemoteRepository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.uri = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CommonRemoteRepository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository} CommonRemoteRepository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CommonRemoteRepository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CommonRemoteRepository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CommonRemoteRepository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n if (!$util.isString(message.uri))\n return \"uri: string expected\";\n return null;\n };\n \n /**\n * Creates a CommonRemoteRepository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository} CommonRemoteRepository\n */\n CommonRemoteRepository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository();\n if (object.uri != null)\n message.uri = String(object.uri);\n return message;\n };\n \n /**\n * Creates a plain object from a CommonRemoteRepository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository\n * @static\n * @param {google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository} message CommonRemoteRepository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CommonRemoteRepository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.uri = \"\";\n if (message.uri != null && message.hasOwnProperty(\"uri\"))\n object.uri = message.uri;\n return object;\n };\n \n /**\n * Converts this CommonRemoteRepository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository\n * @instance\n * @returns {Object.} JSON object\n */\n CommonRemoteRepository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CommonRemoteRepository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CommonRemoteRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository\";\n };\n \n return CommonRemoteRepository;\n })();\n \n return RemoteRepositoryConfig;\n })();\n \n v1.Repository = (function() {\n \n /**\n * Properties of a Repository.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IRepository\n * @property {google.devtools.artifactregistry.v1.Repository.IMavenRepositoryConfig|null} [mavenConfig] Repository mavenConfig\n * @property {google.devtools.artifactregistry.v1.Repository.IDockerRepositoryConfig|null} [dockerConfig] Repository dockerConfig\n * @property {google.devtools.artifactregistry.v1.IVirtualRepositoryConfig|null} [virtualRepositoryConfig] Repository virtualRepositoryConfig\n * @property {google.devtools.artifactregistry.v1.IRemoteRepositoryConfig|null} [remoteRepositoryConfig] Repository remoteRepositoryConfig\n * @property {string|null} [name] Repository name\n * @property {google.devtools.artifactregistry.v1.Repository.Format|null} [format] Repository format\n * @property {string|null} [description] Repository description\n * @property {Object.|null} [labels] Repository labels\n * @property {google.protobuf.ITimestamp|null} [createTime] Repository createTime\n * @property {google.protobuf.ITimestamp|null} [updateTime] Repository updateTime\n * @property {string|null} [kmsKeyName] Repository kmsKeyName\n * @property {google.devtools.artifactregistry.v1.Repository.Mode|null} [mode] Repository mode\n * @property {Object.|null} [cleanupPolicies] Repository cleanupPolicies\n * @property {number|Long|null} [sizeBytes] Repository sizeBytes\n * @property {boolean|null} [satisfiesPzs] Repository satisfiesPzs\n * @property {boolean|null} [cleanupPolicyDryRun] Repository cleanupPolicyDryRun\n * @property {google.devtools.artifactregistry.v1.Repository.IVulnerabilityScanningConfig|null} [vulnerabilityScanningConfig] Repository vulnerabilityScanningConfig\n * @property {boolean|null} [disallowUnspecifiedMode] Repository disallowUnspecifiedMode\n * @property {boolean|null} [satisfiesPzi] Repository satisfiesPzi\n */\n \n /**\n * Constructs a new Repository.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a Repository.\n * @implements IRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IRepository=} [properties] Properties to set\n */\n function Repository(properties) {\n this.labels = {};\n this.cleanupPolicies = {};\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Repository mavenConfig.\n * @member {google.devtools.artifactregistry.v1.Repository.IMavenRepositoryConfig|null|undefined} mavenConfig\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.mavenConfig = null;\n \n /**\n * Repository dockerConfig.\n * @member {google.devtools.artifactregistry.v1.Repository.IDockerRepositoryConfig|null|undefined} dockerConfig\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.dockerConfig = null;\n \n /**\n * Repository virtualRepositoryConfig.\n * @member {google.devtools.artifactregistry.v1.IVirtualRepositoryConfig|null|undefined} virtualRepositoryConfig\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.virtualRepositoryConfig = null;\n \n /**\n * Repository remoteRepositoryConfig.\n * @member {google.devtools.artifactregistry.v1.IRemoteRepositoryConfig|null|undefined} remoteRepositoryConfig\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.remoteRepositoryConfig = null;\n \n /**\n * Repository name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.name = \"\";\n \n /**\n * Repository format.\n * @member {google.devtools.artifactregistry.v1.Repository.Format} format\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.format = 0;\n \n /**\n * Repository description.\n * @member {string} description\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.description = \"\";\n \n /**\n * Repository labels.\n * @member {Object.} labels\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.labels = $util.emptyObject;\n \n /**\n * Repository createTime.\n * @member {google.protobuf.ITimestamp|null|undefined} createTime\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.createTime = null;\n \n /**\n * Repository updateTime.\n * @member {google.protobuf.ITimestamp|null|undefined} updateTime\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.updateTime = null;\n \n /**\n * Repository kmsKeyName.\n * @member {string} kmsKeyName\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.kmsKeyName = \"\";\n \n /**\n * Repository mode.\n * @member {google.devtools.artifactregistry.v1.Repository.Mode} mode\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.mode = 0;\n \n /**\n * Repository cleanupPolicies.\n * @member {Object.} cleanupPolicies\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.cleanupPolicies = $util.emptyObject;\n \n /**\n * Repository sizeBytes.\n * @member {number|Long} sizeBytes\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n \n /**\n * Repository satisfiesPzs.\n * @member {boolean} satisfiesPzs\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.satisfiesPzs = false;\n \n /**\n * Repository cleanupPolicyDryRun.\n * @member {boolean} cleanupPolicyDryRun\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.cleanupPolicyDryRun = false;\n \n /**\n * Repository vulnerabilityScanningConfig.\n * @member {google.devtools.artifactregistry.v1.Repository.IVulnerabilityScanningConfig|null|undefined} vulnerabilityScanningConfig\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.vulnerabilityScanningConfig = null;\n \n /**\n * Repository disallowUnspecifiedMode.\n * @member {boolean} disallowUnspecifiedMode\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.disallowUnspecifiedMode = false;\n \n /**\n * Repository satisfiesPzi.\n * @member {boolean} satisfiesPzi\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Repository.prototype.satisfiesPzi = false;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * Repository formatConfig.\n * @member {\"mavenConfig\"|\"dockerConfig\"|undefined} formatConfig\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Object.defineProperty(Repository.prototype, \"formatConfig\", {\n get: $util.oneOfGetter($oneOfFields = [\"mavenConfig\", \"dockerConfig\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Repository modeConfig.\n * @member {\"virtualRepositoryConfig\"|\"remoteRepositoryConfig\"|undefined} modeConfig\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n */\n Object.defineProperty(Repository.prototype, \"modeConfig\", {\n get: $util.oneOfGetter($oneOfFields = [\"virtualRepositoryConfig\", \"remoteRepositoryConfig\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new Repository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @static\n * @param {google.devtools.artifactregistry.v1.IRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.Repository} Repository instance\n */\n Repository.create = function create(properties) {\n return new Repository(properties);\n };\n \n /**\n * Encodes the specified Repository message. Does not implicitly {@link google.devtools.artifactregistry.v1.Repository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @static\n * @param {google.devtools.artifactregistry.v1.IRepository} message Repository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Repository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.format != null && Object.hasOwnProperty.call(message, \"format\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.format);\n if (message.description != null && Object.hasOwnProperty.call(message, \"description\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.description);\n if (message.labels != null && Object.hasOwnProperty.call(message, \"labels\"))\n for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i)\n writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim();\n if (message.createTime != null && Object.hasOwnProperty.call(message, \"createTime\"))\n $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.updateTime != null && Object.hasOwnProperty.call(message, \"updateTime\"))\n $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, \"kmsKeyName\"))\n writer.uint32(/* id 8, wireType 2 =*/66).string(message.kmsKeyName);\n if (message.mavenConfig != null && Object.hasOwnProperty.call(message, \"mavenConfig\"))\n $root.google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig.encode(message.mavenConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();\n if (message.mode != null && Object.hasOwnProperty.call(message, \"mode\"))\n writer.uint32(/* id 10, wireType 0 =*/80).int32(message.mode);\n if (message.cleanupPolicies != null && Object.hasOwnProperty.call(message, \"cleanupPolicies\"))\n for (var keys = Object.keys(message.cleanupPolicies), i = 0; i < keys.length; ++i) {\n writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);\n $root.google.devtools.artifactregistry.v1.CleanupPolicy.encode(message.cleanupPolicies[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();\n }\n if (message.sizeBytes != null && Object.hasOwnProperty.call(message, \"sizeBytes\"))\n writer.uint32(/* id 13, wireType 0 =*/104).int64(message.sizeBytes);\n if (message.virtualRepositoryConfig != null && Object.hasOwnProperty.call(message, \"virtualRepositoryConfig\"))\n $root.google.devtools.artifactregistry.v1.VirtualRepositoryConfig.encode(message.virtualRepositoryConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();\n if (message.remoteRepositoryConfig != null && Object.hasOwnProperty.call(message, \"remoteRepositoryConfig\"))\n $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.encode(message.remoteRepositoryConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim();\n if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, \"satisfiesPzs\"))\n writer.uint32(/* id 16, wireType 0 =*/128).bool(message.satisfiesPzs);\n if (message.dockerConfig != null && Object.hasOwnProperty.call(message, \"dockerConfig\"))\n $root.google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig.encode(message.dockerConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim();\n if (message.cleanupPolicyDryRun != null && Object.hasOwnProperty.call(message, \"cleanupPolicyDryRun\"))\n writer.uint32(/* id 18, wireType 0 =*/144).bool(message.cleanupPolicyDryRun);\n if (message.vulnerabilityScanningConfig != null && Object.hasOwnProperty.call(message, \"vulnerabilityScanningConfig\"))\n $root.google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.encode(message.vulnerabilityScanningConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim();\n if (message.disallowUnspecifiedMode != null && Object.hasOwnProperty.call(message, \"disallowUnspecifiedMode\"))\n writer.uint32(/* id 21, wireType 0 =*/168).bool(message.disallowUnspecifiedMode);\n if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, \"satisfiesPzi\"))\n writer.uint32(/* id 22, wireType 0 =*/176).bool(message.satisfiesPzi);\n return writer;\n };\n \n /**\n * Encodes the specified Repository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.Repository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @static\n * @param {google.devtools.artifactregistry.v1.IRepository} message Repository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Repository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Repository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.Repository} Repository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Repository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.Repository(), key, value;\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 9: {\n message.mavenConfig = $root.google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig.decode(reader, reader.uint32());\n break;\n }\n case 17: {\n message.dockerConfig = $root.google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig.decode(reader, reader.uint32());\n break;\n }\n case 14: {\n message.virtualRepositoryConfig = $root.google.devtools.artifactregistry.v1.VirtualRepositoryConfig.decode(reader, reader.uint32());\n break;\n }\n case 15: {\n message.remoteRepositoryConfig = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.decode(reader, reader.uint32());\n break;\n }\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.format = reader.int32();\n break;\n }\n case 3: {\n message.description = reader.string();\n break;\n }\n case 4: {\n if (message.labels === $util.emptyObject)\n message.labels = {};\n var end2 = reader.uint32() + reader.pos;\n key = \"\";\n value = \"\";\n while (reader.pos < end2) {\n var tag2 = reader.uint32();\n switch (tag2 >>> 3) {\n case 1:\n key = reader.string();\n break;\n case 2:\n value = reader.string();\n break;\n default:\n reader.skipType(tag2 & 7);\n break;\n }\n }\n message.labels[key] = value;\n break;\n }\n case 5: {\n message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 6: {\n message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 8: {\n message.kmsKeyName = reader.string();\n break;\n }\n case 10: {\n message.mode = reader.int32();\n break;\n }\n case 12: {\n if (message.cleanupPolicies === $util.emptyObject)\n message.cleanupPolicies = {};\n var end2 = reader.uint32() + reader.pos;\n key = \"\";\n value = null;\n while (reader.pos < end2) {\n var tag2 = reader.uint32();\n switch (tag2 >>> 3) {\n case 1:\n key = reader.string();\n break;\n case 2:\n value = $root.google.devtools.artifactregistry.v1.CleanupPolicy.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag2 & 7);\n break;\n }\n }\n message.cleanupPolicies[key] = value;\n break;\n }\n case 13: {\n message.sizeBytes = reader.int64();\n break;\n }\n case 16: {\n message.satisfiesPzs = reader.bool();\n break;\n }\n case 18: {\n message.cleanupPolicyDryRun = reader.bool();\n break;\n }\n case 19: {\n message.vulnerabilityScanningConfig = $root.google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.decode(reader, reader.uint32());\n break;\n }\n case 21: {\n message.disallowUnspecifiedMode = reader.bool();\n break;\n }\n case 22: {\n message.satisfiesPzi = reader.bool();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Repository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.Repository} Repository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Repository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Repository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Repository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.mavenConfig != null && message.hasOwnProperty(\"mavenConfig\")) {\n properties.formatConfig = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig.verify(message.mavenConfig);\n if (error)\n return \"mavenConfig.\" + error;\n }\n }\n if (message.dockerConfig != null && message.hasOwnProperty(\"dockerConfig\")) {\n if (properties.formatConfig === 1)\n return \"formatConfig: multiple values\";\n properties.formatConfig = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig.verify(message.dockerConfig);\n if (error)\n return \"dockerConfig.\" + error;\n }\n }\n if (message.virtualRepositoryConfig != null && message.hasOwnProperty(\"virtualRepositoryConfig\")) {\n properties.modeConfig = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.VirtualRepositoryConfig.verify(message.virtualRepositoryConfig);\n if (error)\n return \"virtualRepositoryConfig.\" + error;\n }\n }\n if (message.remoteRepositoryConfig != null && message.hasOwnProperty(\"remoteRepositoryConfig\")) {\n if (properties.modeConfig === 1)\n return \"modeConfig: multiple values\";\n properties.modeConfig = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.verify(message.remoteRepositoryConfig);\n if (error)\n return \"remoteRepositoryConfig.\" + error;\n }\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.format != null && message.hasOwnProperty(\"format\"))\n switch (message.format) {\n default:\n return \"format: enum value expected\";\n case 0:\n case 1:\n case 2:\n case 3:\n case 5:\n case 6:\n case 8:\n case 9:\n case 10:\n case 11:\n break;\n }\n if (message.description != null && message.hasOwnProperty(\"description\"))\n if (!$util.isString(message.description))\n return \"description: string expected\";\n if (message.labels != null && message.hasOwnProperty(\"labels\")) {\n if (!$util.isObject(message.labels))\n return \"labels: object expected\";\n var key = Object.keys(message.labels);\n for (var i = 0; i < key.length; ++i)\n if (!$util.isString(message.labels[key[i]]))\n return \"labels: string{k:string} expected\";\n }\n if (message.createTime != null && message.hasOwnProperty(\"createTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.createTime);\n if (error)\n return \"createTime.\" + error;\n }\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.updateTime);\n if (error)\n return \"updateTime.\" + error;\n }\n if (message.kmsKeyName != null && message.hasOwnProperty(\"kmsKeyName\"))\n if (!$util.isString(message.kmsKeyName))\n return \"kmsKeyName: string expected\";\n if (message.mode != null && message.hasOwnProperty(\"mode\"))\n switch (message.mode) {\n default:\n return \"mode: enum value expected\";\n case 0:\n case 1:\n case 2:\n case 3:\n break;\n }\n if (message.cleanupPolicies != null && message.hasOwnProperty(\"cleanupPolicies\")) {\n if (!$util.isObject(message.cleanupPolicies))\n return \"cleanupPolicies: object expected\";\n var key = Object.keys(message.cleanupPolicies);\n for (var i = 0; i < key.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.CleanupPolicy.verify(message.cleanupPolicies[key[i]]);\n if (error)\n return \"cleanupPolicies.\" + error;\n }\n }\n if (message.sizeBytes != null && message.hasOwnProperty(\"sizeBytes\"))\n if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high)))\n return \"sizeBytes: integer|Long expected\";\n if (message.satisfiesPzs != null && message.hasOwnProperty(\"satisfiesPzs\"))\n if (typeof message.satisfiesPzs !== \"boolean\")\n return \"satisfiesPzs: boolean expected\";\n if (message.cleanupPolicyDryRun != null && message.hasOwnProperty(\"cleanupPolicyDryRun\"))\n if (typeof message.cleanupPolicyDryRun !== \"boolean\")\n return \"cleanupPolicyDryRun: boolean expected\";\n if (message.vulnerabilityScanningConfig != null && message.hasOwnProperty(\"vulnerabilityScanningConfig\")) {\n var error = $root.google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.verify(message.vulnerabilityScanningConfig);\n if (error)\n return \"vulnerabilityScanningConfig.\" + error;\n }\n if (message.disallowUnspecifiedMode != null && message.hasOwnProperty(\"disallowUnspecifiedMode\"))\n if (typeof message.disallowUnspecifiedMode !== \"boolean\")\n return \"disallowUnspecifiedMode: boolean expected\";\n if (message.satisfiesPzi != null && message.hasOwnProperty(\"satisfiesPzi\"))\n if (typeof message.satisfiesPzi !== \"boolean\")\n return \"satisfiesPzi: boolean expected\";\n return null;\n };\n \n /**\n * Creates a Repository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.Repository} Repository\n */\n Repository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.Repository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.Repository();\n if (object.mavenConfig != null) {\n if (typeof object.mavenConfig !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Repository.mavenConfig: object expected\");\n message.mavenConfig = $root.google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig.fromObject(object.mavenConfig);\n }\n if (object.dockerConfig != null) {\n if (typeof object.dockerConfig !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Repository.dockerConfig: object expected\");\n message.dockerConfig = $root.google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig.fromObject(object.dockerConfig);\n }\n if (object.virtualRepositoryConfig != null) {\n if (typeof object.virtualRepositoryConfig !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Repository.virtualRepositoryConfig: object expected\");\n message.virtualRepositoryConfig = $root.google.devtools.artifactregistry.v1.VirtualRepositoryConfig.fromObject(object.virtualRepositoryConfig);\n }\n if (object.remoteRepositoryConfig != null) {\n if (typeof object.remoteRepositoryConfig !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Repository.remoteRepositoryConfig: object expected\");\n message.remoteRepositoryConfig = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.fromObject(object.remoteRepositoryConfig);\n }\n if (object.name != null)\n message.name = String(object.name);\n switch (object.format) {\n default:\n if (typeof object.format === \"number\") {\n message.format = object.format;\n break;\n }\n break;\n case \"FORMAT_UNSPECIFIED\":\n case 0:\n message.format = 0;\n break;\n case \"DOCKER\":\n case 1:\n message.format = 1;\n break;\n case \"MAVEN\":\n case 2:\n message.format = 2;\n break;\n case \"NPM\":\n case 3:\n message.format = 3;\n break;\n case \"APT\":\n case 5:\n message.format = 5;\n break;\n case \"YUM\":\n case 6:\n message.format = 6;\n break;\n case \"PYTHON\":\n case 8:\n message.format = 8;\n break;\n case \"KFP\":\n case 9:\n message.format = 9;\n break;\n case \"GO\":\n case 10:\n message.format = 10;\n break;\n case \"GENERIC\":\n case 11:\n message.format = 11;\n break;\n }\n if (object.description != null)\n message.description = String(object.description);\n if (object.labels) {\n if (typeof object.labels !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Repository.labels: object expected\");\n message.labels = {};\n for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i)\n message.labels[keys[i]] = String(object.labels[keys[i]]);\n }\n if (object.createTime != null) {\n if (typeof object.createTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Repository.createTime: object expected\");\n message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);\n }\n if (object.updateTime != null) {\n if (typeof object.updateTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Repository.updateTime: object expected\");\n message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);\n }\n if (object.kmsKeyName != null)\n message.kmsKeyName = String(object.kmsKeyName);\n switch (object.mode) {\n default:\n if (typeof object.mode === \"number\") {\n message.mode = object.mode;\n break;\n }\n break;\n case \"MODE_UNSPECIFIED\":\n case 0:\n message.mode = 0;\n break;\n case \"STANDARD_REPOSITORY\":\n case 1:\n message.mode = 1;\n break;\n case \"VIRTUAL_REPOSITORY\":\n case 2:\n message.mode = 2;\n break;\n case \"REMOTE_REPOSITORY\":\n case 3:\n message.mode = 3;\n break;\n }\n if (object.cleanupPolicies) {\n if (typeof object.cleanupPolicies !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Repository.cleanupPolicies: object expected\");\n message.cleanupPolicies = {};\n for (var keys = Object.keys(object.cleanupPolicies), i = 0; i < keys.length; ++i) {\n if (typeof object.cleanupPolicies[keys[i]] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Repository.cleanupPolicies: object expected\");\n message.cleanupPolicies[keys[i]] = $root.google.devtools.artifactregistry.v1.CleanupPolicy.fromObject(object.cleanupPolicies[keys[i]]);\n }\n }\n if (object.sizeBytes != null)\n if ($util.Long)\n (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false;\n else if (typeof object.sizeBytes === \"string\")\n message.sizeBytes = parseInt(object.sizeBytes, 10);\n else if (typeof object.sizeBytes === \"number\")\n message.sizeBytes = object.sizeBytes;\n else if (typeof object.sizeBytes === \"object\")\n message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber();\n if (object.satisfiesPzs != null)\n message.satisfiesPzs = Boolean(object.satisfiesPzs);\n if (object.cleanupPolicyDryRun != null)\n message.cleanupPolicyDryRun = Boolean(object.cleanupPolicyDryRun);\n if (object.vulnerabilityScanningConfig != null) {\n if (typeof object.vulnerabilityScanningConfig !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Repository.vulnerabilityScanningConfig: object expected\");\n message.vulnerabilityScanningConfig = $root.google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.fromObject(object.vulnerabilityScanningConfig);\n }\n if (object.disallowUnspecifiedMode != null)\n message.disallowUnspecifiedMode = Boolean(object.disallowUnspecifiedMode);\n if (object.satisfiesPzi != null)\n message.satisfiesPzi = Boolean(object.satisfiesPzi);\n return message;\n };\n \n /**\n * Creates a plain object from a Repository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @static\n * @param {google.devtools.artifactregistry.v1.Repository} message Repository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Repository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.objects || options.defaults) {\n object.labels = {};\n object.cleanupPolicies = {};\n }\n if (options.defaults) {\n object.name = \"\";\n object.format = options.enums === String ? \"FORMAT_UNSPECIFIED\" : 0;\n object.description = \"\";\n object.createTime = null;\n object.updateTime = null;\n object.kmsKeyName = \"\";\n object.mode = options.enums === String ? \"MODE_UNSPECIFIED\" : 0;\n if ($util.Long) {\n var long = new $util.Long(0, 0, false);\n object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.sizeBytes = options.longs === String ? \"0\" : 0;\n object.satisfiesPzs = false;\n object.cleanupPolicyDryRun = false;\n object.vulnerabilityScanningConfig = null;\n object.disallowUnspecifiedMode = false;\n object.satisfiesPzi = false;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.format != null && message.hasOwnProperty(\"format\"))\n object.format = options.enums === String ? $root.google.devtools.artifactregistry.v1.Repository.Format[message.format] === undefined ? message.format : $root.google.devtools.artifactregistry.v1.Repository.Format[message.format] : message.format;\n if (message.description != null && message.hasOwnProperty(\"description\"))\n object.description = message.description;\n var keys2;\n if (message.labels && (keys2 = Object.keys(message.labels)).length) {\n object.labels = {};\n for (var j = 0; j < keys2.length; ++j)\n object.labels[keys2[j]] = message.labels[keys2[j]];\n }\n if (message.createTime != null && message.hasOwnProperty(\"createTime\"))\n object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\"))\n object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);\n if (message.kmsKeyName != null && message.hasOwnProperty(\"kmsKeyName\"))\n object.kmsKeyName = message.kmsKeyName;\n if (message.mavenConfig != null && message.hasOwnProperty(\"mavenConfig\")) {\n object.mavenConfig = $root.google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig.toObject(message.mavenConfig, options);\n if (options.oneofs)\n object.formatConfig = \"mavenConfig\";\n }\n if (message.mode != null && message.hasOwnProperty(\"mode\"))\n object.mode = options.enums === String ? $root.google.devtools.artifactregistry.v1.Repository.Mode[message.mode] === undefined ? message.mode : $root.google.devtools.artifactregistry.v1.Repository.Mode[message.mode] : message.mode;\n if (message.cleanupPolicies && (keys2 = Object.keys(message.cleanupPolicies)).length) {\n object.cleanupPolicies = {};\n for (var j = 0; j < keys2.length; ++j)\n object.cleanupPolicies[keys2[j]] = $root.google.devtools.artifactregistry.v1.CleanupPolicy.toObject(message.cleanupPolicies[keys2[j]], options);\n }\n if (message.sizeBytes != null && message.hasOwnProperty(\"sizeBytes\"))\n if (typeof message.sizeBytes === \"number\")\n object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes;\n else\n object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes;\n if (message.virtualRepositoryConfig != null && message.hasOwnProperty(\"virtualRepositoryConfig\")) {\n object.virtualRepositoryConfig = $root.google.devtools.artifactregistry.v1.VirtualRepositoryConfig.toObject(message.virtualRepositoryConfig, options);\n if (options.oneofs)\n object.modeConfig = \"virtualRepositoryConfig\";\n }\n if (message.remoteRepositoryConfig != null && message.hasOwnProperty(\"remoteRepositoryConfig\")) {\n object.remoteRepositoryConfig = $root.google.devtools.artifactregistry.v1.RemoteRepositoryConfig.toObject(message.remoteRepositoryConfig, options);\n if (options.oneofs)\n object.modeConfig = \"remoteRepositoryConfig\";\n }\n if (message.satisfiesPzs != null && message.hasOwnProperty(\"satisfiesPzs\"))\n object.satisfiesPzs = message.satisfiesPzs;\n if (message.dockerConfig != null && message.hasOwnProperty(\"dockerConfig\")) {\n object.dockerConfig = $root.google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig.toObject(message.dockerConfig, options);\n if (options.oneofs)\n object.formatConfig = \"dockerConfig\";\n }\n if (message.cleanupPolicyDryRun != null && message.hasOwnProperty(\"cleanupPolicyDryRun\"))\n object.cleanupPolicyDryRun = message.cleanupPolicyDryRun;\n if (message.vulnerabilityScanningConfig != null && message.hasOwnProperty(\"vulnerabilityScanningConfig\"))\n object.vulnerabilityScanningConfig = $root.google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.toObject(message.vulnerabilityScanningConfig, options);\n if (message.disallowUnspecifiedMode != null && message.hasOwnProperty(\"disallowUnspecifiedMode\"))\n object.disallowUnspecifiedMode = message.disallowUnspecifiedMode;\n if (message.satisfiesPzi != null && message.hasOwnProperty(\"satisfiesPzi\"))\n object.satisfiesPzi = message.satisfiesPzi;\n return object;\n };\n \n /**\n * Converts this Repository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @instance\n * @returns {Object.} JSON object\n */\n Repository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Repository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Repository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.Repository\";\n };\n \n Repository.MavenRepositoryConfig = (function() {\n \n /**\n * Properties of a MavenRepositoryConfig.\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @interface IMavenRepositoryConfig\n * @property {boolean|null} [allowSnapshotOverwrites] MavenRepositoryConfig allowSnapshotOverwrites\n * @property {google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig.VersionPolicy|null} [versionPolicy] MavenRepositoryConfig versionPolicy\n */\n \n /**\n * Constructs a new MavenRepositoryConfig.\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @classdesc Represents a MavenRepositoryConfig.\n * @implements IMavenRepositoryConfig\n * @constructor\n * @param {google.devtools.artifactregistry.v1.Repository.IMavenRepositoryConfig=} [properties] Properties to set\n */\n function MavenRepositoryConfig(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * MavenRepositoryConfig allowSnapshotOverwrites.\n * @member {boolean} allowSnapshotOverwrites\n * @memberof google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig\n * @instance\n */\n MavenRepositoryConfig.prototype.allowSnapshotOverwrites = false;\n \n /**\n * MavenRepositoryConfig versionPolicy.\n * @member {google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig.VersionPolicy} versionPolicy\n * @memberof google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig\n * @instance\n */\n MavenRepositoryConfig.prototype.versionPolicy = 0;\n \n /**\n * Creates a new MavenRepositoryConfig instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.Repository.IMavenRepositoryConfig=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig} MavenRepositoryConfig instance\n */\n MavenRepositoryConfig.create = function create(properties) {\n return new MavenRepositoryConfig(properties);\n };\n \n /**\n * Encodes the specified MavenRepositoryConfig message. Does not implicitly {@link google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.Repository.IMavenRepositoryConfig} message MavenRepositoryConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MavenRepositoryConfig.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.allowSnapshotOverwrites != null && Object.hasOwnProperty.call(message, \"allowSnapshotOverwrites\"))\n writer.uint32(/* id 1, wireType 0 =*/8).bool(message.allowSnapshotOverwrites);\n if (message.versionPolicy != null && Object.hasOwnProperty.call(message, \"versionPolicy\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.versionPolicy);\n return writer;\n };\n \n /**\n * Encodes the specified MavenRepositoryConfig message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.Repository.IMavenRepositoryConfig} message MavenRepositoryConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MavenRepositoryConfig.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a MavenRepositoryConfig message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig} MavenRepositoryConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MavenRepositoryConfig.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.allowSnapshotOverwrites = reader.bool();\n break;\n }\n case 2: {\n message.versionPolicy = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a MavenRepositoryConfig message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig} MavenRepositoryConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MavenRepositoryConfig.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a MavenRepositoryConfig message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n MavenRepositoryConfig.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.allowSnapshotOverwrites != null && message.hasOwnProperty(\"allowSnapshotOverwrites\"))\n if (typeof message.allowSnapshotOverwrites !== \"boolean\")\n return \"allowSnapshotOverwrites: boolean expected\";\n if (message.versionPolicy != null && message.hasOwnProperty(\"versionPolicy\"))\n switch (message.versionPolicy) {\n default:\n return \"versionPolicy: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n return null;\n };\n \n /**\n * Creates a MavenRepositoryConfig message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig} MavenRepositoryConfig\n */\n MavenRepositoryConfig.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig();\n if (object.allowSnapshotOverwrites != null)\n message.allowSnapshotOverwrites = Boolean(object.allowSnapshotOverwrites);\n switch (object.versionPolicy) {\n default:\n if (typeof object.versionPolicy === \"number\") {\n message.versionPolicy = object.versionPolicy;\n break;\n }\n break;\n case \"VERSION_POLICY_UNSPECIFIED\":\n case 0:\n message.versionPolicy = 0;\n break;\n case \"RELEASE\":\n case 1:\n message.versionPolicy = 1;\n break;\n case \"SNAPSHOT\":\n case 2:\n message.versionPolicy = 2;\n break;\n }\n return message;\n };\n \n /**\n * Creates a plain object from a MavenRepositoryConfig message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig} message MavenRepositoryConfig\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n MavenRepositoryConfig.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.allowSnapshotOverwrites = false;\n object.versionPolicy = options.enums === String ? \"VERSION_POLICY_UNSPECIFIED\" : 0;\n }\n if (message.allowSnapshotOverwrites != null && message.hasOwnProperty(\"allowSnapshotOverwrites\"))\n object.allowSnapshotOverwrites = message.allowSnapshotOverwrites;\n if (message.versionPolicy != null && message.hasOwnProperty(\"versionPolicy\"))\n object.versionPolicy = options.enums === String ? $root.google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig.VersionPolicy[message.versionPolicy] === undefined ? message.versionPolicy : $root.google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig.VersionPolicy[message.versionPolicy] : message.versionPolicy;\n return object;\n };\n \n /**\n * Converts this MavenRepositoryConfig to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig\n * @instance\n * @returns {Object.} JSON object\n */\n MavenRepositoryConfig.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for MavenRepositoryConfig\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n MavenRepositoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig\";\n };\n \n /**\n * VersionPolicy enum.\n * @name google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig.VersionPolicy\n * @enum {number}\n * @property {number} VERSION_POLICY_UNSPECIFIED=0 VERSION_POLICY_UNSPECIFIED value\n * @property {number} RELEASE=1 RELEASE value\n * @property {number} SNAPSHOT=2 SNAPSHOT value\n */\n MavenRepositoryConfig.VersionPolicy = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"VERSION_POLICY_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"RELEASE\"] = 1;\n values[valuesById[2] = \"SNAPSHOT\"] = 2;\n return values;\n })();\n \n return MavenRepositoryConfig;\n })();\n \n Repository.DockerRepositoryConfig = (function() {\n \n /**\n * Properties of a DockerRepositoryConfig.\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @interface IDockerRepositoryConfig\n * @property {boolean|null} [immutableTags] DockerRepositoryConfig immutableTags\n */\n \n /**\n * Constructs a new DockerRepositoryConfig.\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @classdesc Represents a DockerRepositoryConfig.\n * @implements IDockerRepositoryConfig\n * @constructor\n * @param {google.devtools.artifactregistry.v1.Repository.IDockerRepositoryConfig=} [properties] Properties to set\n */\n function DockerRepositoryConfig(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DockerRepositoryConfig immutableTags.\n * @member {boolean} immutableTags\n * @memberof google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig\n * @instance\n */\n DockerRepositoryConfig.prototype.immutableTags = false;\n \n /**\n * Creates a new DockerRepositoryConfig instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.Repository.IDockerRepositoryConfig=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig} DockerRepositoryConfig instance\n */\n DockerRepositoryConfig.create = function create(properties) {\n return new DockerRepositoryConfig(properties);\n };\n \n /**\n * Encodes the specified DockerRepositoryConfig message. Does not implicitly {@link google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.Repository.IDockerRepositoryConfig} message DockerRepositoryConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DockerRepositoryConfig.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.immutableTags != null && Object.hasOwnProperty.call(message, \"immutableTags\"))\n writer.uint32(/* id 1, wireType 0 =*/8).bool(message.immutableTags);\n return writer;\n };\n \n /**\n * Encodes the specified DockerRepositoryConfig message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.Repository.IDockerRepositoryConfig} message DockerRepositoryConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DockerRepositoryConfig.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DockerRepositoryConfig message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig} DockerRepositoryConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DockerRepositoryConfig.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.immutableTags = reader.bool();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DockerRepositoryConfig message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig} DockerRepositoryConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DockerRepositoryConfig.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DockerRepositoryConfig message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DockerRepositoryConfig.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.immutableTags != null && message.hasOwnProperty(\"immutableTags\"))\n if (typeof message.immutableTags !== \"boolean\")\n return \"immutableTags: boolean expected\";\n return null;\n };\n \n /**\n * Creates a DockerRepositoryConfig message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig} DockerRepositoryConfig\n */\n DockerRepositoryConfig.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig();\n if (object.immutableTags != null)\n message.immutableTags = Boolean(object.immutableTags);\n return message;\n };\n \n /**\n * Creates a plain object from a DockerRepositoryConfig message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig} message DockerRepositoryConfig\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DockerRepositoryConfig.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.immutableTags = false;\n if (message.immutableTags != null && message.hasOwnProperty(\"immutableTags\"))\n object.immutableTags = message.immutableTags;\n return object;\n };\n \n /**\n * Converts this DockerRepositoryConfig to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig\n * @instance\n * @returns {Object.} JSON object\n */\n DockerRepositoryConfig.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DockerRepositoryConfig\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DockerRepositoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig\";\n };\n \n return DockerRepositoryConfig;\n })();\n \n Repository.VulnerabilityScanningConfig = (function() {\n \n /**\n * Properties of a VulnerabilityScanningConfig.\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @interface IVulnerabilityScanningConfig\n * @property {google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementConfig|null} [enablementConfig] VulnerabilityScanningConfig enablementConfig\n * @property {google.protobuf.ITimestamp|null} [lastEnableTime] VulnerabilityScanningConfig lastEnableTime\n * @property {google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementState|null} [enablementState] VulnerabilityScanningConfig enablementState\n * @property {string|null} [enablementStateReason] VulnerabilityScanningConfig enablementStateReason\n */\n \n /**\n * Constructs a new VulnerabilityScanningConfig.\n * @memberof google.devtools.artifactregistry.v1.Repository\n * @classdesc Represents a VulnerabilityScanningConfig.\n * @implements IVulnerabilityScanningConfig\n * @constructor\n * @param {google.devtools.artifactregistry.v1.Repository.IVulnerabilityScanningConfig=} [properties] Properties to set\n */\n function VulnerabilityScanningConfig(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * VulnerabilityScanningConfig enablementConfig.\n * @member {google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementConfig} enablementConfig\n * @memberof google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig\n * @instance\n */\n VulnerabilityScanningConfig.prototype.enablementConfig = 0;\n \n /**\n * VulnerabilityScanningConfig lastEnableTime.\n * @member {google.protobuf.ITimestamp|null|undefined} lastEnableTime\n * @memberof google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig\n * @instance\n */\n VulnerabilityScanningConfig.prototype.lastEnableTime = null;\n \n /**\n * VulnerabilityScanningConfig enablementState.\n * @member {google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementState} enablementState\n * @memberof google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig\n * @instance\n */\n VulnerabilityScanningConfig.prototype.enablementState = 0;\n \n /**\n * VulnerabilityScanningConfig enablementStateReason.\n * @member {string} enablementStateReason\n * @memberof google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig\n * @instance\n */\n VulnerabilityScanningConfig.prototype.enablementStateReason = \"\";\n \n /**\n * Creates a new VulnerabilityScanningConfig instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.Repository.IVulnerabilityScanningConfig=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig} VulnerabilityScanningConfig instance\n */\n VulnerabilityScanningConfig.create = function create(properties) {\n return new VulnerabilityScanningConfig(properties);\n };\n \n /**\n * Encodes the specified VulnerabilityScanningConfig message. Does not implicitly {@link google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.Repository.IVulnerabilityScanningConfig} message VulnerabilityScanningConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n VulnerabilityScanningConfig.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.enablementConfig != null && Object.hasOwnProperty.call(message, \"enablementConfig\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.enablementConfig);\n if (message.lastEnableTime != null && Object.hasOwnProperty.call(message, \"lastEnableTime\"))\n $root.google.protobuf.Timestamp.encode(message.lastEnableTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.enablementState != null && Object.hasOwnProperty.call(message, \"enablementState\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.enablementState);\n if (message.enablementStateReason != null && Object.hasOwnProperty.call(message, \"enablementStateReason\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.enablementStateReason);\n return writer;\n };\n \n /**\n * Encodes the specified VulnerabilityScanningConfig message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.Repository.IVulnerabilityScanningConfig} message VulnerabilityScanningConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n VulnerabilityScanningConfig.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a VulnerabilityScanningConfig message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig} VulnerabilityScanningConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n VulnerabilityScanningConfig.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.enablementConfig = reader.int32();\n break;\n }\n case 2: {\n message.lastEnableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 3: {\n message.enablementState = reader.int32();\n break;\n }\n case 4: {\n message.enablementStateReason = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a VulnerabilityScanningConfig message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig} VulnerabilityScanningConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n VulnerabilityScanningConfig.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a VulnerabilityScanningConfig message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n VulnerabilityScanningConfig.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.enablementConfig != null && message.hasOwnProperty(\"enablementConfig\"))\n switch (message.enablementConfig) {\n default:\n return \"enablementConfig: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.lastEnableTime != null && message.hasOwnProperty(\"lastEnableTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.lastEnableTime);\n if (error)\n return \"lastEnableTime.\" + error;\n }\n if (message.enablementState != null && message.hasOwnProperty(\"enablementState\"))\n switch (message.enablementState) {\n default:\n return \"enablementState: enum value expected\";\n case 0:\n case 1:\n case 2:\n case 3:\n break;\n }\n if (message.enablementStateReason != null && message.hasOwnProperty(\"enablementStateReason\"))\n if (!$util.isString(message.enablementStateReason))\n return \"enablementStateReason: string expected\";\n return null;\n };\n \n /**\n * Creates a VulnerabilityScanningConfig message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig} VulnerabilityScanningConfig\n */\n VulnerabilityScanningConfig.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig();\n switch (object.enablementConfig) {\n default:\n if (typeof object.enablementConfig === \"number\") {\n message.enablementConfig = object.enablementConfig;\n break;\n }\n break;\n case \"ENABLEMENT_CONFIG_UNSPECIFIED\":\n case 0:\n message.enablementConfig = 0;\n break;\n case \"INHERITED\":\n case 1:\n message.enablementConfig = 1;\n break;\n case \"DISABLED\":\n case 2:\n message.enablementConfig = 2;\n break;\n }\n if (object.lastEnableTime != null) {\n if (typeof object.lastEnableTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.lastEnableTime: object expected\");\n message.lastEnableTime = $root.google.protobuf.Timestamp.fromObject(object.lastEnableTime);\n }\n switch (object.enablementState) {\n default:\n if (typeof object.enablementState === \"number\") {\n message.enablementState = object.enablementState;\n break;\n }\n break;\n case \"ENABLEMENT_STATE_UNSPECIFIED\":\n case 0:\n message.enablementState = 0;\n break;\n case \"SCANNING_UNSUPPORTED\":\n case 1:\n message.enablementState = 1;\n break;\n case \"SCANNING_DISABLED\":\n case 2:\n message.enablementState = 2;\n break;\n case \"SCANNING_ACTIVE\":\n case 3:\n message.enablementState = 3;\n break;\n }\n if (object.enablementStateReason != null)\n message.enablementStateReason = String(object.enablementStateReason);\n return message;\n };\n \n /**\n * Creates a plain object from a VulnerabilityScanningConfig message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig} message VulnerabilityScanningConfig\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n VulnerabilityScanningConfig.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.enablementConfig = options.enums === String ? \"ENABLEMENT_CONFIG_UNSPECIFIED\" : 0;\n object.lastEnableTime = null;\n object.enablementState = options.enums === String ? \"ENABLEMENT_STATE_UNSPECIFIED\" : 0;\n object.enablementStateReason = \"\";\n }\n if (message.enablementConfig != null && message.hasOwnProperty(\"enablementConfig\"))\n object.enablementConfig = options.enums === String ? $root.google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementConfig[message.enablementConfig] === undefined ? message.enablementConfig : $root.google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementConfig[message.enablementConfig] : message.enablementConfig;\n if (message.lastEnableTime != null && message.hasOwnProperty(\"lastEnableTime\"))\n object.lastEnableTime = $root.google.protobuf.Timestamp.toObject(message.lastEnableTime, options);\n if (message.enablementState != null && message.hasOwnProperty(\"enablementState\"))\n object.enablementState = options.enums === String ? $root.google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementState[message.enablementState] === undefined ? message.enablementState : $root.google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementState[message.enablementState] : message.enablementState;\n if (message.enablementStateReason != null && message.hasOwnProperty(\"enablementStateReason\"))\n object.enablementStateReason = message.enablementStateReason;\n return object;\n };\n \n /**\n * Converts this VulnerabilityScanningConfig to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig\n * @instance\n * @returns {Object.} JSON object\n */\n VulnerabilityScanningConfig.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for VulnerabilityScanningConfig\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n VulnerabilityScanningConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig\";\n };\n \n /**\n * EnablementConfig enum.\n * @name google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementConfig\n * @enum {number}\n * @property {number} ENABLEMENT_CONFIG_UNSPECIFIED=0 ENABLEMENT_CONFIG_UNSPECIFIED value\n * @property {number} INHERITED=1 INHERITED value\n * @property {number} DISABLED=2 DISABLED value\n */\n VulnerabilityScanningConfig.EnablementConfig = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"ENABLEMENT_CONFIG_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"INHERITED\"] = 1;\n values[valuesById[2] = \"DISABLED\"] = 2;\n return values;\n })();\n \n /**\n * EnablementState enum.\n * @name google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementState\n * @enum {number}\n * @property {number} ENABLEMENT_STATE_UNSPECIFIED=0 ENABLEMENT_STATE_UNSPECIFIED value\n * @property {number} SCANNING_UNSUPPORTED=1 SCANNING_UNSUPPORTED value\n * @property {number} SCANNING_DISABLED=2 SCANNING_DISABLED value\n * @property {number} SCANNING_ACTIVE=3 SCANNING_ACTIVE value\n */\n VulnerabilityScanningConfig.EnablementState = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"ENABLEMENT_STATE_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"SCANNING_UNSUPPORTED\"] = 1;\n values[valuesById[2] = \"SCANNING_DISABLED\"] = 2;\n values[valuesById[3] = \"SCANNING_ACTIVE\"] = 3;\n return values;\n })();\n \n return VulnerabilityScanningConfig;\n })();\n \n /**\n * Format enum.\n * @name google.devtools.artifactregistry.v1.Repository.Format\n * @enum {number}\n * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value\n * @property {number} DOCKER=1 DOCKER value\n * @property {number} MAVEN=2 MAVEN value\n * @property {number} NPM=3 NPM value\n * @property {number} APT=5 APT value\n * @property {number} YUM=6 YUM value\n * @property {number} PYTHON=8 PYTHON value\n * @property {number} KFP=9 KFP value\n * @property {number} GO=10 GO value\n * @property {number} GENERIC=11 GENERIC value\n */\n Repository.Format = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"FORMAT_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"DOCKER\"] = 1;\n values[valuesById[2] = \"MAVEN\"] = 2;\n values[valuesById[3] = \"NPM\"] = 3;\n values[valuesById[5] = \"APT\"] = 5;\n values[valuesById[6] = \"YUM\"] = 6;\n values[valuesById[8] = \"PYTHON\"] = 8;\n values[valuesById[9] = \"KFP\"] = 9;\n values[valuesById[10] = \"GO\"] = 10;\n values[valuesById[11] = \"GENERIC\"] = 11;\n return values;\n })();\n \n /**\n * Mode enum.\n * @name google.devtools.artifactregistry.v1.Repository.Mode\n * @enum {number}\n * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value\n * @property {number} STANDARD_REPOSITORY=1 STANDARD_REPOSITORY value\n * @property {number} VIRTUAL_REPOSITORY=2 VIRTUAL_REPOSITORY value\n * @property {number} REMOTE_REPOSITORY=3 REMOTE_REPOSITORY value\n */\n Repository.Mode = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"MODE_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"STANDARD_REPOSITORY\"] = 1;\n values[valuesById[2] = \"VIRTUAL_REPOSITORY\"] = 2;\n values[valuesById[3] = \"REMOTE_REPOSITORY\"] = 3;\n return values;\n })();\n \n return Repository;\n })();\n \n v1.ListRepositoriesRequest = (function() {\n \n /**\n * Properties of a ListRepositoriesRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListRepositoriesRequest\n * @property {string|null} [parent] ListRepositoriesRequest parent\n * @property {number|null} [pageSize] ListRepositoriesRequest pageSize\n * @property {string|null} [pageToken] ListRepositoriesRequest pageToken\n * @property {string|null} [filter] ListRepositoriesRequest filter\n * @property {string|null} [orderBy] ListRepositoriesRequest orderBy\n */\n \n /**\n * Constructs a new ListRepositoriesRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListRepositoriesRequest.\n * @implements IListRepositoriesRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListRepositoriesRequest=} [properties] Properties to set\n */\n function ListRepositoriesRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListRepositoriesRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesRequest\n * @instance\n */\n ListRepositoriesRequest.prototype.parent = \"\";\n \n /**\n * ListRepositoriesRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesRequest\n * @instance\n */\n ListRepositoriesRequest.prototype.pageSize = 0;\n \n /**\n * ListRepositoriesRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesRequest\n * @instance\n */\n ListRepositoriesRequest.prototype.pageToken = \"\";\n \n /**\n * ListRepositoriesRequest filter.\n * @member {string} filter\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesRequest\n * @instance\n */\n ListRepositoriesRequest.prototype.filter = \"\";\n \n /**\n * ListRepositoriesRequest orderBy.\n * @member {string} orderBy\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesRequest\n * @instance\n */\n ListRepositoriesRequest.prototype.orderBy = \"\";\n \n /**\n * Creates a new ListRepositoriesRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListRepositoriesRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListRepositoriesRequest} ListRepositoriesRequest instance\n */\n ListRepositoriesRequest.create = function create(properties) {\n return new ListRepositoriesRequest(properties);\n };\n \n /**\n * Encodes the specified ListRepositoriesRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListRepositoriesRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListRepositoriesRequest} message ListRepositoriesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListRepositoriesRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n if (message.filter != null && Object.hasOwnProperty.call(message, \"filter\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter);\n if (message.orderBy != null && Object.hasOwnProperty.call(message, \"orderBy\"))\n writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy);\n return writer;\n };\n \n /**\n * Encodes the specified ListRepositoriesRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListRepositoriesRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListRepositoriesRequest} message ListRepositoriesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListRepositoriesRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListRepositoriesRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListRepositoriesRequest} ListRepositoriesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListRepositoriesRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListRepositoriesRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n case 4: {\n message.filter = reader.string();\n break;\n }\n case 5: {\n message.orderBy = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListRepositoriesRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListRepositoriesRequest} ListRepositoriesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListRepositoriesRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListRepositoriesRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListRepositoriesRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n if (!$util.isString(message.filter))\n return \"filter: string expected\";\n if (message.orderBy != null && message.hasOwnProperty(\"orderBy\"))\n if (!$util.isString(message.orderBy))\n return \"orderBy: string expected\";\n return null;\n };\n \n /**\n * Creates a ListRepositoriesRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListRepositoriesRequest} ListRepositoriesRequest\n */\n ListRepositoriesRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListRepositoriesRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListRepositoriesRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n if (object.filter != null)\n message.filter = String(object.filter);\n if (object.orderBy != null)\n message.orderBy = String(object.orderBy);\n return message;\n };\n \n /**\n * Creates a plain object from a ListRepositoriesRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ListRepositoriesRequest} message ListRepositoriesRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListRepositoriesRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n object.filter = \"\";\n object.orderBy = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n object.filter = message.filter;\n if (message.orderBy != null && message.hasOwnProperty(\"orderBy\"))\n object.orderBy = message.orderBy;\n return object;\n };\n \n /**\n * Converts this ListRepositoriesRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListRepositoriesRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListRepositoriesRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListRepositoriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListRepositoriesRequest\";\n };\n \n return ListRepositoriesRequest;\n })();\n \n v1.ListRepositoriesResponse = (function() {\n \n /**\n * Properties of a ListRepositoriesResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListRepositoriesResponse\n * @property {Array.|null} [repositories] ListRepositoriesResponse repositories\n * @property {string|null} [nextPageToken] ListRepositoriesResponse nextPageToken\n */\n \n /**\n * Constructs a new ListRepositoriesResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListRepositoriesResponse.\n * @implements IListRepositoriesResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListRepositoriesResponse=} [properties] Properties to set\n */\n function ListRepositoriesResponse(properties) {\n this.repositories = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListRepositoriesResponse repositories.\n * @member {Array.} repositories\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesResponse\n * @instance\n */\n ListRepositoriesResponse.prototype.repositories = $util.emptyArray;\n \n /**\n * ListRepositoriesResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesResponse\n * @instance\n */\n ListRepositoriesResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListRepositoriesResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListRepositoriesResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListRepositoriesResponse} ListRepositoriesResponse instance\n */\n ListRepositoriesResponse.create = function create(properties) {\n return new ListRepositoriesResponse(properties);\n };\n \n /**\n * Encodes the specified ListRepositoriesResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListRepositoriesResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListRepositoriesResponse} message ListRepositoriesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListRepositoriesResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.repositories != null && message.repositories.length)\n for (var i = 0; i < message.repositories.length; ++i)\n $root.google.devtools.artifactregistry.v1.Repository.encode(message.repositories[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListRepositoriesResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListRepositoriesResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListRepositoriesResponse} message ListRepositoriesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListRepositoriesResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListRepositoriesResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListRepositoriesResponse} ListRepositoriesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListRepositoriesResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListRepositoriesResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.repositories && message.repositories.length))\n message.repositories = [];\n message.repositories.push($root.google.devtools.artifactregistry.v1.Repository.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListRepositoriesResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListRepositoriesResponse} ListRepositoriesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListRepositoriesResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListRepositoriesResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListRepositoriesResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.repositories != null && message.hasOwnProperty(\"repositories\")) {\n if (!Array.isArray(message.repositories))\n return \"repositories: array expected\";\n for (var i = 0; i < message.repositories.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.Repository.verify(message.repositories[i]);\n if (error)\n return \"repositories.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListRepositoriesResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListRepositoriesResponse} ListRepositoriesResponse\n */\n ListRepositoriesResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListRepositoriesResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListRepositoriesResponse();\n if (object.repositories) {\n if (!Array.isArray(object.repositories))\n throw TypeError(\".google.devtools.artifactregistry.v1.ListRepositoriesResponse.repositories: array expected\");\n message.repositories = [];\n for (var i = 0; i < object.repositories.length; ++i) {\n if (typeof object.repositories[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ListRepositoriesResponse.repositories: object expected\");\n message.repositories[i] = $root.google.devtools.artifactregistry.v1.Repository.fromObject(object.repositories[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListRepositoriesResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.ListRepositoriesResponse} message ListRepositoriesResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListRepositoriesResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.repositories = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.repositories && message.repositories.length) {\n object.repositories = [];\n for (var j = 0; j < message.repositories.length; ++j)\n object.repositories[j] = $root.google.devtools.artifactregistry.v1.Repository.toObject(message.repositories[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListRepositoriesResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListRepositoriesResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListRepositoriesResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListRepositoriesResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListRepositoriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListRepositoriesResponse\";\n };\n \n return ListRepositoriesResponse;\n })();\n \n v1.GetRepositoryRequest = (function() {\n \n /**\n * Properties of a GetRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IGetRepositoryRequest\n * @property {string|null} [name] GetRepositoryRequest name\n */\n \n /**\n * Constructs a new GetRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a GetRepositoryRequest.\n * @implements IGetRepositoryRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IGetRepositoryRequest=} [properties] Properties to set\n */\n function GetRepositoryRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetRepositoryRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.GetRepositoryRequest\n * @instance\n */\n GetRepositoryRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetRepositoryRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.GetRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetRepositoryRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.GetRepositoryRequest} GetRepositoryRequest instance\n */\n GetRepositoryRequest.create = function create(properties) {\n return new GetRepositoryRequest(properties);\n };\n \n /**\n * Encodes the specified GetRepositoryRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.GetRepositoryRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.GetRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetRepositoryRequest} message GetRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetRepositoryRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetRepositoryRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.GetRepositoryRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetRepositoryRequest} message GetRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetRepositoryRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetRepositoryRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.GetRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.GetRepositoryRequest} GetRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetRepositoryRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.GetRepositoryRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetRepositoryRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.GetRepositoryRequest} GetRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetRepositoryRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetRepositoryRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.GetRepositoryRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetRepositoryRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetRepositoryRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.GetRepositoryRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.GetRepositoryRequest} GetRepositoryRequest\n */\n GetRepositoryRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.GetRepositoryRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.GetRepositoryRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetRepositoryRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.GetRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.GetRepositoryRequest} message GetRepositoryRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetRepositoryRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetRepositoryRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.GetRepositoryRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetRepositoryRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetRepositoryRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.GetRepositoryRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetRepositoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.GetRepositoryRequest\";\n };\n \n return GetRepositoryRequest;\n })();\n \n v1.CreateRepositoryRequest = (function() {\n \n /**\n * Properties of a CreateRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface ICreateRepositoryRequest\n * @property {string|null} [parent] CreateRepositoryRequest parent\n * @property {string|null} [repositoryId] CreateRepositoryRequest repositoryId\n * @property {google.devtools.artifactregistry.v1.IRepository|null} [repository] CreateRepositoryRequest repository\n */\n \n /**\n * Constructs a new CreateRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a CreateRepositoryRequest.\n * @implements ICreateRepositoryRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.ICreateRepositoryRequest=} [properties] Properties to set\n */\n function CreateRepositoryRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CreateRepositoryRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.CreateRepositoryRequest\n * @instance\n */\n CreateRepositoryRequest.prototype.parent = \"\";\n \n /**\n * CreateRepositoryRequest repositoryId.\n * @member {string} repositoryId\n * @memberof google.devtools.artifactregistry.v1.CreateRepositoryRequest\n * @instance\n */\n CreateRepositoryRequest.prototype.repositoryId = \"\";\n \n /**\n * CreateRepositoryRequest repository.\n * @member {google.devtools.artifactregistry.v1.IRepository|null|undefined} repository\n * @memberof google.devtools.artifactregistry.v1.CreateRepositoryRequest\n * @instance\n */\n CreateRepositoryRequest.prototype.repository = null;\n \n /**\n * Creates a new CreateRepositoryRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.CreateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ICreateRepositoryRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.CreateRepositoryRequest} CreateRepositoryRequest instance\n */\n CreateRepositoryRequest.create = function create(properties) {\n return new CreateRepositoryRequest(properties);\n };\n \n /**\n * Encodes the specified CreateRepositoryRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.CreateRepositoryRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.CreateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ICreateRepositoryRequest} message CreateRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CreateRepositoryRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.repositoryId != null && Object.hasOwnProperty.call(message, \"repositoryId\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.repositoryId);\n if (message.repository != null && Object.hasOwnProperty.call(message, \"repository\"))\n $root.google.devtools.artifactregistry.v1.Repository.encode(message.repository, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified CreateRepositoryRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.CreateRepositoryRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.CreateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ICreateRepositoryRequest} message CreateRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CreateRepositoryRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CreateRepositoryRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.CreateRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.CreateRepositoryRequest} CreateRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CreateRepositoryRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.CreateRepositoryRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.repositoryId = reader.string();\n break;\n }\n case 3: {\n message.repository = $root.google.devtools.artifactregistry.v1.Repository.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CreateRepositoryRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.CreateRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.CreateRepositoryRequest} CreateRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CreateRepositoryRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CreateRepositoryRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.CreateRepositoryRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CreateRepositoryRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.repositoryId != null && message.hasOwnProperty(\"repositoryId\"))\n if (!$util.isString(message.repositoryId))\n return \"repositoryId: string expected\";\n if (message.repository != null && message.hasOwnProperty(\"repository\")) {\n var error = $root.google.devtools.artifactregistry.v1.Repository.verify(message.repository);\n if (error)\n return \"repository.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a CreateRepositoryRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.CreateRepositoryRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.CreateRepositoryRequest} CreateRepositoryRequest\n */\n CreateRepositoryRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.CreateRepositoryRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.CreateRepositoryRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.repositoryId != null)\n message.repositoryId = String(object.repositoryId);\n if (object.repository != null) {\n if (typeof object.repository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.CreateRepositoryRequest.repository: object expected\");\n message.repository = $root.google.devtools.artifactregistry.v1.Repository.fromObject(object.repository);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a CreateRepositoryRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.CreateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.CreateRepositoryRequest} message CreateRepositoryRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CreateRepositoryRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.repositoryId = \"\";\n object.repository = null;\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.repositoryId != null && message.hasOwnProperty(\"repositoryId\"))\n object.repositoryId = message.repositoryId;\n if (message.repository != null && message.hasOwnProperty(\"repository\"))\n object.repository = $root.google.devtools.artifactregistry.v1.Repository.toObject(message.repository, options);\n return object;\n };\n \n /**\n * Converts this CreateRepositoryRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.CreateRepositoryRequest\n * @instance\n * @returns {Object.} JSON object\n */\n CreateRepositoryRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CreateRepositoryRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.CreateRepositoryRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CreateRepositoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.CreateRepositoryRequest\";\n };\n \n return CreateRepositoryRequest;\n })();\n \n v1.UpdateRepositoryRequest = (function() {\n \n /**\n * Properties of an UpdateRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IUpdateRepositoryRequest\n * @property {google.devtools.artifactregistry.v1.IRepository|null} [repository] UpdateRepositoryRequest repository\n * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateRepositoryRequest updateMask\n */\n \n /**\n * Constructs a new UpdateRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an UpdateRepositoryRequest.\n * @implements IUpdateRepositoryRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IUpdateRepositoryRequest=} [properties] Properties to set\n */\n function UpdateRepositoryRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * UpdateRepositoryRequest repository.\n * @member {google.devtools.artifactregistry.v1.IRepository|null|undefined} repository\n * @memberof google.devtools.artifactregistry.v1.UpdateRepositoryRequest\n * @instance\n */\n UpdateRepositoryRequest.prototype.repository = null;\n \n /**\n * UpdateRepositoryRequest updateMask.\n * @member {google.protobuf.IFieldMask|null|undefined} updateMask\n * @memberof google.devtools.artifactregistry.v1.UpdateRepositoryRequest\n * @instance\n */\n UpdateRepositoryRequest.prototype.updateMask = null;\n \n /**\n * Creates a new UpdateRepositoryRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.UpdateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateRepositoryRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.UpdateRepositoryRequest} UpdateRepositoryRequest instance\n */\n UpdateRepositoryRequest.create = function create(properties) {\n return new UpdateRepositoryRequest(properties);\n };\n \n /**\n * Encodes the specified UpdateRepositoryRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdateRepositoryRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.UpdateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateRepositoryRequest} message UpdateRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateRepositoryRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.repository != null && Object.hasOwnProperty.call(message, \"repository\"))\n $root.google.devtools.artifactregistry.v1.Repository.encode(message.repository, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.updateMask != null && Object.hasOwnProperty.call(message, \"updateMask\"))\n $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified UpdateRepositoryRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdateRepositoryRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateRepositoryRequest} message UpdateRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateRepositoryRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an UpdateRepositoryRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.UpdateRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.UpdateRepositoryRequest} UpdateRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateRepositoryRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.UpdateRepositoryRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.repository = $root.google.devtools.artifactregistry.v1.Repository.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an UpdateRepositoryRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdateRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.UpdateRepositoryRequest} UpdateRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateRepositoryRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an UpdateRepositoryRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.UpdateRepositoryRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n UpdateRepositoryRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.repository != null && message.hasOwnProperty(\"repository\")) {\n var error = $root.google.devtools.artifactregistry.v1.Repository.verify(message.repository);\n if (error)\n return \"repository.\" + error;\n }\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\")) {\n var error = $root.google.protobuf.FieldMask.verify(message.updateMask);\n if (error)\n return \"updateMask.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an UpdateRepositoryRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.UpdateRepositoryRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.UpdateRepositoryRequest} UpdateRepositoryRequest\n */\n UpdateRepositoryRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.UpdateRepositoryRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.UpdateRepositoryRequest();\n if (object.repository != null) {\n if (typeof object.repository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdateRepositoryRequest.repository: object expected\");\n message.repository = $root.google.devtools.artifactregistry.v1.Repository.fromObject(object.repository);\n }\n if (object.updateMask != null) {\n if (typeof object.updateMask !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdateRepositoryRequest.updateMask: object expected\");\n message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an UpdateRepositoryRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.UpdateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.UpdateRepositoryRequest} message UpdateRepositoryRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n UpdateRepositoryRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.repository = null;\n object.updateMask = null;\n }\n if (message.repository != null && message.hasOwnProperty(\"repository\"))\n object.repository = $root.google.devtools.artifactregistry.v1.Repository.toObject(message.repository, options);\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\"))\n object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);\n return object;\n };\n \n /**\n * Converts this UpdateRepositoryRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.UpdateRepositoryRequest\n * @instance\n * @returns {Object.} JSON object\n */\n UpdateRepositoryRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for UpdateRepositoryRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.UpdateRepositoryRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n UpdateRepositoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.UpdateRepositoryRequest\";\n };\n \n return UpdateRepositoryRequest;\n })();\n \n v1.DeleteRepositoryRequest = (function() {\n \n /**\n * Properties of a DeleteRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IDeleteRepositoryRequest\n * @property {string|null} [name] DeleteRepositoryRequest name\n */\n \n /**\n * Constructs a new DeleteRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a DeleteRepositoryRequest.\n * @implements IDeleteRepositoryRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IDeleteRepositoryRequest=} [properties] Properties to set\n */\n function DeleteRepositoryRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DeleteRepositoryRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.DeleteRepositoryRequest\n * @instance\n */\n DeleteRepositoryRequest.prototype.name = \"\";\n \n /**\n * Creates a new DeleteRepositoryRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.DeleteRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteRepositoryRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.DeleteRepositoryRequest} DeleteRepositoryRequest instance\n */\n DeleteRepositoryRequest.create = function create(properties) {\n return new DeleteRepositoryRequest(properties);\n };\n \n /**\n * Encodes the specified DeleteRepositoryRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.DeleteRepositoryRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.DeleteRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteRepositoryRequest} message DeleteRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteRepositoryRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified DeleteRepositoryRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.DeleteRepositoryRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DeleteRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteRepositoryRequest} message DeleteRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteRepositoryRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DeleteRepositoryRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.DeleteRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.DeleteRepositoryRequest} DeleteRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteRepositoryRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.DeleteRepositoryRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DeleteRepositoryRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DeleteRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.DeleteRepositoryRequest} DeleteRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteRepositoryRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DeleteRepositoryRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.DeleteRepositoryRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DeleteRepositoryRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a DeleteRepositoryRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.DeleteRepositoryRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.DeleteRepositoryRequest} DeleteRepositoryRequest\n */\n DeleteRepositoryRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.DeleteRepositoryRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.DeleteRepositoryRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a DeleteRepositoryRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.DeleteRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.DeleteRepositoryRequest} message DeleteRepositoryRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DeleteRepositoryRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this DeleteRepositoryRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.DeleteRepositoryRequest\n * @instance\n * @returns {Object.} JSON object\n */\n DeleteRepositoryRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DeleteRepositoryRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.DeleteRepositoryRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DeleteRepositoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.DeleteRepositoryRequest\";\n };\n \n return DeleteRepositoryRequest;\n })();\n \n v1.Rule = (function() {\n \n /**\n * Properties of a Rule.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IRule\n * @property {string|null} [name] Rule name\n * @property {google.devtools.artifactregistry.v1.Rule.Action|null} [action] Rule action\n * @property {google.devtools.artifactregistry.v1.Rule.Operation|null} [operation] Rule operation\n * @property {google.type.IExpr|null} [condition] Rule condition\n * @property {string|null} [packageId] Rule packageId\n */\n \n /**\n * Constructs a new Rule.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a Rule.\n * @implements IRule\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IRule=} [properties] Properties to set\n */\n function Rule(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Rule name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.Rule\n * @instance\n */\n Rule.prototype.name = \"\";\n \n /**\n * Rule action.\n * @member {google.devtools.artifactregistry.v1.Rule.Action} action\n * @memberof google.devtools.artifactregistry.v1.Rule\n * @instance\n */\n Rule.prototype.action = 0;\n \n /**\n * Rule operation.\n * @member {google.devtools.artifactregistry.v1.Rule.Operation} operation\n * @memberof google.devtools.artifactregistry.v1.Rule\n * @instance\n */\n Rule.prototype.operation = 0;\n \n /**\n * Rule condition.\n * @member {google.type.IExpr|null|undefined} condition\n * @memberof google.devtools.artifactregistry.v1.Rule\n * @instance\n */\n Rule.prototype.condition = null;\n \n /**\n * Rule packageId.\n * @member {string} packageId\n * @memberof google.devtools.artifactregistry.v1.Rule\n * @instance\n */\n Rule.prototype.packageId = \"\";\n \n /**\n * Creates a new Rule instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.Rule\n * @static\n * @param {google.devtools.artifactregistry.v1.IRule=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.Rule} Rule instance\n */\n Rule.create = function create(properties) {\n return new Rule(properties);\n };\n \n /**\n * Encodes the specified Rule message. Does not implicitly {@link google.devtools.artifactregistry.v1.Rule.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.Rule\n * @static\n * @param {google.devtools.artifactregistry.v1.IRule} message Rule message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Rule.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.action != null && Object.hasOwnProperty.call(message, \"action\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.action);\n if (message.operation != null && Object.hasOwnProperty.call(message, \"operation\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.operation);\n if (message.condition != null && Object.hasOwnProperty.call(message, \"condition\"))\n $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n if (message.packageId != null && Object.hasOwnProperty.call(message, \"packageId\"))\n writer.uint32(/* id 5, wireType 2 =*/42).string(message.packageId);\n return writer;\n };\n \n /**\n * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.Rule.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Rule\n * @static\n * @param {google.devtools.artifactregistry.v1.IRule} message Rule message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Rule.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Rule message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.Rule\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.Rule} Rule\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Rule.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.Rule();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.action = reader.int32();\n break;\n }\n case 3: {\n message.operation = reader.int32();\n break;\n }\n case 4: {\n message.condition = $root.google.type.Expr.decode(reader, reader.uint32());\n break;\n }\n case 5: {\n message.packageId = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Rule message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Rule\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.Rule} Rule\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Rule.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Rule message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.Rule\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Rule.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.action != null && message.hasOwnProperty(\"action\"))\n switch (message.action) {\n default:\n return \"action: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.operation != null && message.hasOwnProperty(\"operation\"))\n switch (message.operation) {\n default:\n return \"operation: enum value expected\";\n case 0:\n case 1:\n break;\n }\n if (message.condition != null && message.hasOwnProperty(\"condition\")) {\n var error = $root.google.type.Expr.verify(message.condition);\n if (error)\n return \"condition.\" + error;\n }\n if (message.packageId != null && message.hasOwnProperty(\"packageId\"))\n if (!$util.isString(message.packageId))\n return \"packageId: string expected\";\n return null;\n };\n \n /**\n * Creates a Rule message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.Rule\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.Rule} Rule\n */\n Rule.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.Rule)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.Rule();\n if (object.name != null)\n message.name = String(object.name);\n switch (object.action) {\n default:\n if (typeof object.action === \"number\") {\n message.action = object.action;\n break;\n }\n break;\n case \"ACTION_UNSPECIFIED\":\n case 0:\n message.action = 0;\n break;\n case \"ALLOW\":\n case 1:\n message.action = 1;\n break;\n case \"DENY\":\n case 2:\n message.action = 2;\n break;\n }\n switch (object.operation) {\n default:\n if (typeof object.operation === \"number\") {\n message.operation = object.operation;\n break;\n }\n break;\n case \"OPERATION_UNSPECIFIED\":\n case 0:\n message.operation = 0;\n break;\n case \"DOWNLOAD\":\n case 1:\n message.operation = 1;\n break;\n }\n if (object.condition != null) {\n if (typeof object.condition !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Rule.condition: object expected\");\n message.condition = $root.google.type.Expr.fromObject(object.condition);\n }\n if (object.packageId != null)\n message.packageId = String(object.packageId);\n return message;\n };\n \n /**\n * Creates a plain object from a Rule message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.Rule\n * @static\n * @param {google.devtools.artifactregistry.v1.Rule} message Rule\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Rule.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.action = options.enums === String ? \"ACTION_UNSPECIFIED\" : 0;\n object.operation = options.enums === String ? \"OPERATION_UNSPECIFIED\" : 0;\n object.condition = null;\n object.packageId = \"\";\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.action != null && message.hasOwnProperty(\"action\"))\n object.action = options.enums === String ? $root.google.devtools.artifactregistry.v1.Rule.Action[message.action] === undefined ? message.action : $root.google.devtools.artifactregistry.v1.Rule.Action[message.action] : message.action;\n if (message.operation != null && message.hasOwnProperty(\"operation\"))\n object.operation = options.enums === String ? $root.google.devtools.artifactregistry.v1.Rule.Operation[message.operation] === undefined ? message.operation : $root.google.devtools.artifactregistry.v1.Rule.Operation[message.operation] : message.operation;\n if (message.condition != null && message.hasOwnProperty(\"condition\"))\n object.condition = $root.google.type.Expr.toObject(message.condition, options);\n if (message.packageId != null && message.hasOwnProperty(\"packageId\"))\n object.packageId = message.packageId;\n return object;\n };\n \n /**\n * Converts this Rule to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.Rule\n * @instance\n * @returns {Object.} JSON object\n */\n Rule.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Rule\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.Rule\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Rule.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.Rule\";\n };\n \n /**\n * Action enum.\n * @name google.devtools.artifactregistry.v1.Rule.Action\n * @enum {number}\n * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value\n * @property {number} ALLOW=1 ALLOW value\n * @property {number} DENY=2 DENY value\n */\n Rule.Action = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"ACTION_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"ALLOW\"] = 1;\n values[valuesById[2] = \"DENY\"] = 2;\n return values;\n })();\n \n /**\n * Operation enum.\n * @name google.devtools.artifactregistry.v1.Rule.Operation\n * @enum {number}\n * @property {number} OPERATION_UNSPECIFIED=0 OPERATION_UNSPECIFIED value\n * @property {number} DOWNLOAD=1 DOWNLOAD value\n */\n Rule.Operation = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"OPERATION_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"DOWNLOAD\"] = 1;\n return values;\n })();\n \n return Rule;\n })();\n \n v1.ListRulesRequest = (function() {\n \n /**\n * Properties of a ListRulesRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListRulesRequest\n * @property {string|null} [parent] ListRulesRequest parent\n * @property {number|null} [pageSize] ListRulesRequest pageSize\n * @property {string|null} [pageToken] ListRulesRequest pageToken\n */\n \n /**\n * Constructs a new ListRulesRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListRulesRequest.\n * @implements IListRulesRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListRulesRequest=} [properties] Properties to set\n */\n function ListRulesRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListRulesRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.ListRulesRequest\n * @instance\n */\n ListRulesRequest.prototype.parent = \"\";\n \n /**\n * ListRulesRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1.ListRulesRequest\n * @instance\n */\n ListRulesRequest.prototype.pageSize = 0;\n \n /**\n * ListRulesRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1.ListRulesRequest\n * @instance\n */\n ListRulesRequest.prototype.pageToken = \"\";\n \n /**\n * Creates a new ListRulesRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListRulesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListRulesRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListRulesRequest} ListRulesRequest instance\n */\n ListRulesRequest.create = function create(properties) {\n return new ListRulesRequest(properties);\n };\n \n /**\n * Encodes the specified ListRulesRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListRulesRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListRulesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListRulesRequest} message ListRulesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListRulesRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListRulesRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListRulesRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListRulesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListRulesRequest} message ListRulesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListRulesRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListRulesRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListRulesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListRulesRequest} ListRulesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListRulesRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListRulesRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListRulesRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListRulesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListRulesRequest} ListRulesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListRulesRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListRulesRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListRulesRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListRulesRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListRulesRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListRulesRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListRulesRequest} ListRulesRequest\n */\n ListRulesRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListRulesRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListRulesRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListRulesRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListRulesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ListRulesRequest} message ListRulesRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListRulesRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n return object;\n };\n \n /**\n * Converts this ListRulesRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListRulesRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListRulesRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListRulesRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListRulesRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListRulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListRulesRequest\";\n };\n \n return ListRulesRequest;\n })();\n \n v1.ListRulesResponse = (function() {\n \n /**\n * Properties of a ListRulesResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListRulesResponse\n * @property {Array.|null} [rules] ListRulesResponse rules\n * @property {string|null} [nextPageToken] ListRulesResponse nextPageToken\n */\n \n /**\n * Constructs a new ListRulesResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListRulesResponse.\n * @implements IListRulesResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListRulesResponse=} [properties] Properties to set\n */\n function ListRulesResponse(properties) {\n this.rules = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListRulesResponse rules.\n * @member {Array.} rules\n * @memberof google.devtools.artifactregistry.v1.ListRulesResponse\n * @instance\n */\n ListRulesResponse.prototype.rules = $util.emptyArray;\n \n /**\n * ListRulesResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1.ListRulesResponse\n * @instance\n */\n ListRulesResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListRulesResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListRulesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListRulesResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListRulesResponse} ListRulesResponse instance\n */\n ListRulesResponse.create = function create(properties) {\n return new ListRulesResponse(properties);\n };\n \n /**\n * Encodes the specified ListRulesResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListRulesResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListRulesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListRulesResponse} message ListRulesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListRulesResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.rules != null && message.rules.length)\n for (var i = 0; i < message.rules.length; ++i)\n $root.google.devtools.artifactregistry.v1.Rule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListRulesResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListRulesResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListRulesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListRulesResponse} message ListRulesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListRulesResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListRulesResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListRulesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListRulesResponse} ListRulesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListRulesResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListRulesResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.rules && message.rules.length))\n message.rules = [];\n message.rules.push($root.google.devtools.artifactregistry.v1.Rule.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListRulesResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListRulesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListRulesResponse} ListRulesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListRulesResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListRulesResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListRulesResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListRulesResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.rules != null && message.hasOwnProperty(\"rules\")) {\n if (!Array.isArray(message.rules))\n return \"rules: array expected\";\n for (var i = 0; i < message.rules.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.Rule.verify(message.rules[i]);\n if (error)\n return \"rules.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListRulesResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListRulesResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListRulesResponse} ListRulesResponse\n */\n ListRulesResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListRulesResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListRulesResponse();\n if (object.rules) {\n if (!Array.isArray(object.rules))\n throw TypeError(\".google.devtools.artifactregistry.v1.ListRulesResponse.rules: array expected\");\n message.rules = [];\n for (var i = 0; i < object.rules.length; ++i) {\n if (typeof object.rules[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ListRulesResponse.rules: object expected\");\n message.rules[i] = $root.google.devtools.artifactregistry.v1.Rule.fromObject(object.rules[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListRulesResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListRulesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.ListRulesResponse} message ListRulesResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListRulesResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.rules = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.rules && message.rules.length) {\n object.rules = [];\n for (var j = 0; j < message.rules.length; ++j)\n object.rules[j] = $root.google.devtools.artifactregistry.v1.Rule.toObject(message.rules[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListRulesResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListRulesResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListRulesResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListRulesResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListRulesResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListRulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListRulesResponse\";\n };\n \n return ListRulesResponse;\n })();\n \n v1.GetRuleRequest = (function() {\n \n /**\n * Properties of a GetRuleRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IGetRuleRequest\n * @property {string|null} [name] GetRuleRequest name\n */\n \n /**\n * Constructs a new GetRuleRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a GetRuleRequest.\n * @implements IGetRuleRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IGetRuleRequest=} [properties] Properties to set\n */\n function GetRuleRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetRuleRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.GetRuleRequest\n * @instance\n */\n GetRuleRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetRuleRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.GetRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetRuleRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.GetRuleRequest} GetRuleRequest instance\n */\n GetRuleRequest.create = function create(properties) {\n return new GetRuleRequest(properties);\n };\n \n /**\n * Encodes the specified GetRuleRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.GetRuleRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.GetRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetRuleRequest} message GetRuleRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetRuleRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetRuleRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.GetRuleRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetRuleRequest} message GetRuleRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetRuleRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetRuleRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.GetRuleRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.GetRuleRequest} GetRuleRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetRuleRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.GetRuleRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetRuleRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetRuleRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.GetRuleRequest} GetRuleRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetRuleRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetRuleRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.GetRuleRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetRuleRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetRuleRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.GetRuleRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.GetRuleRequest} GetRuleRequest\n */\n GetRuleRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.GetRuleRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.GetRuleRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetRuleRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.GetRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.GetRuleRequest} message GetRuleRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetRuleRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetRuleRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.GetRuleRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetRuleRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetRuleRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.GetRuleRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetRuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.GetRuleRequest\";\n };\n \n return GetRuleRequest;\n })();\n \n v1.CreateRuleRequest = (function() {\n \n /**\n * Properties of a CreateRuleRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface ICreateRuleRequest\n * @property {string|null} [parent] CreateRuleRequest parent\n * @property {string|null} [ruleId] CreateRuleRequest ruleId\n * @property {google.devtools.artifactregistry.v1.IRule|null} [rule] CreateRuleRequest rule\n */\n \n /**\n * Constructs a new CreateRuleRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a CreateRuleRequest.\n * @implements ICreateRuleRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.ICreateRuleRequest=} [properties] Properties to set\n */\n function CreateRuleRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CreateRuleRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.CreateRuleRequest\n * @instance\n */\n CreateRuleRequest.prototype.parent = \"\";\n \n /**\n * CreateRuleRequest ruleId.\n * @member {string} ruleId\n * @memberof google.devtools.artifactregistry.v1.CreateRuleRequest\n * @instance\n */\n CreateRuleRequest.prototype.ruleId = \"\";\n \n /**\n * CreateRuleRequest rule.\n * @member {google.devtools.artifactregistry.v1.IRule|null|undefined} rule\n * @memberof google.devtools.artifactregistry.v1.CreateRuleRequest\n * @instance\n */\n CreateRuleRequest.prototype.rule = null;\n \n /**\n * Creates a new CreateRuleRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.CreateRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ICreateRuleRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.CreateRuleRequest} CreateRuleRequest instance\n */\n CreateRuleRequest.create = function create(properties) {\n return new CreateRuleRequest(properties);\n };\n \n /**\n * Encodes the specified CreateRuleRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.CreateRuleRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.CreateRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ICreateRuleRequest} message CreateRuleRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CreateRuleRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.ruleId != null && Object.hasOwnProperty.call(message, \"ruleId\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.ruleId);\n if (message.rule != null && Object.hasOwnProperty.call(message, \"rule\"))\n $root.google.devtools.artifactregistry.v1.Rule.encode(message.rule, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified CreateRuleRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.CreateRuleRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.CreateRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ICreateRuleRequest} message CreateRuleRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CreateRuleRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CreateRuleRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.CreateRuleRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.CreateRuleRequest} CreateRuleRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CreateRuleRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.CreateRuleRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.ruleId = reader.string();\n break;\n }\n case 3: {\n message.rule = $root.google.devtools.artifactregistry.v1.Rule.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CreateRuleRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.CreateRuleRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.CreateRuleRequest} CreateRuleRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CreateRuleRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CreateRuleRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.CreateRuleRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CreateRuleRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.ruleId != null && message.hasOwnProperty(\"ruleId\"))\n if (!$util.isString(message.ruleId))\n return \"ruleId: string expected\";\n if (message.rule != null && message.hasOwnProperty(\"rule\")) {\n var error = $root.google.devtools.artifactregistry.v1.Rule.verify(message.rule);\n if (error)\n return \"rule.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a CreateRuleRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.CreateRuleRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.CreateRuleRequest} CreateRuleRequest\n */\n CreateRuleRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.CreateRuleRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.CreateRuleRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.ruleId != null)\n message.ruleId = String(object.ruleId);\n if (object.rule != null) {\n if (typeof object.rule !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.CreateRuleRequest.rule: object expected\");\n message.rule = $root.google.devtools.artifactregistry.v1.Rule.fromObject(object.rule);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a CreateRuleRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.CreateRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.CreateRuleRequest} message CreateRuleRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CreateRuleRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.ruleId = \"\";\n object.rule = null;\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.ruleId != null && message.hasOwnProperty(\"ruleId\"))\n object.ruleId = message.ruleId;\n if (message.rule != null && message.hasOwnProperty(\"rule\"))\n object.rule = $root.google.devtools.artifactregistry.v1.Rule.toObject(message.rule, options);\n return object;\n };\n \n /**\n * Converts this CreateRuleRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.CreateRuleRequest\n * @instance\n * @returns {Object.} JSON object\n */\n CreateRuleRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CreateRuleRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.CreateRuleRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CreateRuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.CreateRuleRequest\";\n };\n \n return CreateRuleRequest;\n })();\n \n v1.UpdateRuleRequest = (function() {\n \n /**\n * Properties of an UpdateRuleRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IUpdateRuleRequest\n * @property {google.devtools.artifactregistry.v1.IRule|null} [rule] UpdateRuleRequest rule\n * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateRuleRequest updateMask\n */\n \n /**\n * Constructs a new UpdateRuleRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an UpdateRuleRequest.\n * @implements IUpdateRuleRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IUpdateRuleRequest=} [properties] Properties to set\n */\n function UpdateRuleRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * UpdateRuleRequest rule.\n * @member {google.devtools.artifactregistry.v1.IRule|null|undefined} rule\n * @memberof google.devtools.artifactregistry.v1.UpdateRuleRequest\n * @instance\n */\n UpdateRuleRequest.prototype.rule = null;\n \n /**\n * UpdateRuleRequest updateMask.\n * @member {google.protobuf.IFieldMask|null|undefined} updateMask\n * @memberof google.devtools.artifactregistry.v1.UpdateRuleRequest\n * @instance\n */\n UpdateRuleRequest.prototype.updateMask = null;\n \n /**\n * Creates a new UpdateRuleRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.UpdateRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateRuleRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.UpdateRuleRequest} UpdateRuleRequest instance\n */\n UpdateRuleRequest.create = function create(properties) {\n return new UpdateRuleRequest(properties);\n };\n \n /**\n * Encodes the specified UpdateRuleRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdateRuleRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.UpdateRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateRuleRequest} message UpdateRuleRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateRuleRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.rule != null && Object.hasOwnProperty.call(message, \"rule\"))\n $root.google.devtools.artifactregistry.v1.Rule.encode(message.rule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.updateMask != null && Object.hasOwnProperty.call(message, \"updateMask\"))\n $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified UpdateRuleRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdateRuleRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdateRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateRuleRequest} message UpdateRuleRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateRuleRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an UpdateRuleRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.UpdateRuleRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.UpdateRuleRequest} UpdateRuleRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateRuleRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.UpdateRuleRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.rule = $root.google.devtools.artifactregistry.v1.Rule.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an UpdateRuleRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdateRuleRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.UpdateRuleRequest} UpdateRuleRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateRuleRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an UpdateRuleRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.UpdateRuleRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n UpdateRuleRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.rule != null && message.hasOwnProperty(\"rule\")) {\n var error = $root.google.devtools.artifactregistry.v1.Rule.verify(message.rule);\n if (error)\n return \"rule.\" + error;\n }\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\")) {\n var error = $root.google.protobuf.FieldMask.verify(message.updateMask);\n if (error)\n return \"updateMask.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an UpdateRuleRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.UpdateRuleRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.UpdateRuleRequest} UpdateRuleRequest\n */\n UpdateRuleRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.UpdateRuleRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.UpdateRuleRequest();\n if (object.rule != null) {\n if (typeof object.rule !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdateRuleRequest.rule: object expected\");\n message.rule = $root.google.devtools.artifactregistry.v1.Rule.fromObject(object.rule);\n }\n if (object.updateMask != null) {\n if (typeof object.updateMask !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdateRuleRequest.updateMask: object expected\");\n message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an UpdateRuleRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.UpdateRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.UpdateRuleRequest} message UpdateRuleRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n UpdateRuleRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.rule = null;\n object.updateMask = null;\n }\n if (message.rule != null && message.hasOwnProperty(\"rule\"))\n object.rule = $root.google.devtools.artifactregistry.v1.Rule.toObject(message.rule, options);\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\"))\n object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);\n return object;\n };\n \n /**\n * Converts this UpdateRuleRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.UpdateRuleRequest\n * @instance\n * @returns {Object.} JSON object\n */\n UpdateRuleRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for UpdateRuleRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.UpdateRuleRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n UpdateRuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.UpdateRuleRequest\";\n };\n \n return UpdateRuleRequest;\n })();\n \n v1.DeleteRuleRequest = (function() {\n \n /**\n * Properties of a DeleteRuleRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IDeleteRuleRequest\n * @property {string|null} [name] DeleteRuleRequest name\n */\n \n /**\n * Constructs a new DeleteRuleRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a DeleteRuleRequest.\n * @implements IDeleteRuleRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IDeleteRuleRequest=} [properties] Properties to set\n */\n function DeleteRuleRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DeleteRuleRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.DeleteRuleRequest\n * @instance\n */\n DeleteRuleRequest.prototype.name = \"\";\n \n /**\n * Creates a new DeleteRuleRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.DeleteRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteRuleRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.DeleteRuleRequest} DeleteRuleRequest instance\n */\n DeleteRuleRequest.create = function create(properties) {\n return new DeleteRuleRequest(properties);\n };\n \n /**\n * Encodes the specified DeleteRuleRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.DeleteRuleRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.DeleteRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteRuleRequest} message DeleteRuleRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteRuleRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified DeleteRuleRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.DeleteRuleRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DeleteRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteRuleRequest} message DeleteRuleRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteRuleRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DeleteRuleRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.DeleteRuleRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.DeleteRuleRequest} DeleteRuleRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteRuleRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.DeleteRuleRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DeleteRuleRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DeleteRuleRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.DeleteRuleRequest} DeleteRuleRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteRuleRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DeleteRuleRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.DeleteRuleRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DeleteRuleRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a DeleteRuleRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.DeleteRuleRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.DeleteRuleRequest} DeleteRuleRequest\n */\n DeleteRuleRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.DeleteRuleRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.DeleteRuleRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a DeleteRuleRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.DeleteRuleRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.DeleteRuleRequest} message DeleteRuleRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DeleteRuleRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this DeleteRuleRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.DeleteRuleRequest\n * @instance\n * @returns {Object.} JSON object\n */\n DeleteRuleRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DeleteRuleRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.DeleteRuleRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DeleteRuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.DeleteRuleRequest\";\n };\n \n return DeleteRuleRequest;\n })();\n \n v1.ArtifactRegistry = (function() {\n \n /**\n * Constructs a new ArtifactRegistry service.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an ArtifactRegistry\n * @extends $protobuf.rpc.Service\n * @constructor\n * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\n function ArtifactRegistry(rpcImpl, requestDelimited, responseDelimited) {\n $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\n }\n \n (ArtifactRegistry.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ArtifactRegistry;\n \n /**\n * Creates new ArtifactRegistry service using the specified rpc implementation.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @static\n * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n * @returns {ArtifactRegistry} RPC service. Useful where requests and/or responses are streamed.\n */\n ArtifactRegistry.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n return new this(rpcImpl, requestDelimited, responseDelimited);\n };\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|listDockerImages}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef ListDockerImagesCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.ListDockerImagesResponse} [response] ListDockerImagesResponse\n */\n \n /**\n * Calls ListDockerImages.\n * @function listDockerImages\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListDockerImagesRequest} request ListDockerImagesRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.ListDockerImagesCallback} callback Node-style callback called with the error, if any, and ListDockerImagesResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listDockerImages = function listDockerImages(request, callback) {\n return this.rpcCall(listDockerImages, $root.google.devtools.artifactregistry.v1.ListDockerImagesRequest, $root.google.devtools.artifactregistry.v1.ListDockerImagesResponse, request, callback);\n }, \"name\", { value: \"ListDockerImages\" });\n \n /**\n * Calls ListDockerImages.\n * @function listDockerImages\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListDockerImagesRequest} request ListDockerImagesRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|getDockerImage}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef GetDockerImageCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.DockerImage} [response] DockerImage\n */\n \n /**\n * Calls GetDockerImage.\n * @function getDockerImage\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetDockerImageRequest} request GetDockerImageRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.GetDockerImageCallback} callback Node-style callback called with the error, if any, and DockerImage\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getDockerImage = function getDockerImage(request, callback) {\n return this.rpcCall(getDockerImage, $root.google.devtools.artifactregistry.v1.GetDockerImageRequest, $root.google.devtools.artifactregistry.v1.DockerImage, request, callback);\n }, \"name\", { value: \"GetDockerImage\" });\n \n /**\n * Calls GetDockerImage.\n * @function getDockerImage\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetDockerImageRequest} request GetDockerImageRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|listMavenArtifacts}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef ListMavenArtifactsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.ListMavenArtifactsResponse} [response] ListMavenArtifactsResponse\n */\n \n /**\n * Calls ListMavenArtifacts.\n * @function listMavenArtifacts\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListMavenArtifactsRequest} request ListMavenArtifactsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.ListMavenArtifactsCallback} callback Node-style callback called with the error, if any, and ListMavenArtifactsResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listMavenArtifacts = function listMavenArtifacts(request, callback) {\n return this.rpcCall(listMavenArtifacts, $root.google.devtools.artifactregistry.v1.ListMavenArtifactsRequest, $root.google.devtools.artifactregistry.v1.ListMavenArtifactsResponse, request, callback);\n }, \"name\", { value: \"ListMavenArtifacts\" });\n \n /**\n * Calls ListMavenArtifacts.\n * @function listMavenArtifacts\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListMavenArtifactsRequest} request ListMavenArtifactsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|getMavenArtifact}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef GetMavenArtifactCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.MavenArtifact} [response] MavenArtifact\n */\n \n /**\n * Calls GetMavenArtifact.\n * @function getMavenArtifact\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetMavenArtifactRequest} request GetMavenArtifactRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.GetMavenArtifactCallback} callback Node-style callback called with the error, if any, and MavenArtifact\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getMavenArtifact = function getMavenArtifact(request, callback) {\n return this.rpcCall(getMavenArtifact, $root.google.devtools.artifactregistry.v1.GetMavenArtifactRequest, $root.google.devtools.artifactregistry.v1.MavenArtifact, request, callback);\n }, \"name\", { value: \"GetMavenArtifact\" });\n \n /**\n * Calls GetMavenArtifact.\n * @function getMavenArtifact\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetMavenArtifactRequest} request GetMavenArtifactRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|listNpmPackages}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef ListNpmPackagesCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.ListNpmPackagesResponse} [response] ListNpmPackagesResponse\n */\n \n /**\n * Calls ListNpmPackages.\n * @function listNpmPackages\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListNpmPackagesRequest} request ListNpmPackagesRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.ListNpmPackagesCallback} callback Node-style callback called with the error, if any, and ListNpmPackagesResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listNpmPackages = function listNpmPackages(request, callback) {\n return this.rpcCall(listNpmPackages, $root.google.devtools.artifactregistry.v1.ListNpmPackagesRequest, $root.google.devtools.artifactregistry.v1.ListNpmPackagesResponse, request, callback);\n }, \"name\", { value: \"ListNpmPackages\" });\n \n /**\n * Calls ListNpmPackages.\n * @function listNpmPackages\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListNpmPackagesRequest} request ListNpmPackagesRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|getNpmPackage}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef GetNpmPackageCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.NpmPackage} [response] NpmPackage\n */\n \n /**\n * Calls GetNpmPackage.\n * @function getNpmPackage\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetNpmPackageRequest} request GetNpmPackageRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.GetNpmPackageCallback} callback Node-style callback called with the error, if any, and NpmPackage\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getNpmPackage = function getNpmPackage(request, callback) {\n return this.rpcCall(getNpmPackage, $root.google.devtools.artifactregistry.v1.GetNpmPackageRequest, $root.google.devtools.artifactregistry.v1.NpmPackage, request, callback);\n }, \"name\", { value: \"GetNpmPackage\" });\n \n /**\n * Calls GetNpmPackage.\n * @function getNpmPackage\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetNpmPackageRequest} request GetNpmPackageRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|listPythonPackages}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef ListPythonPackagesCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.ListPythonPackagesResponse} [response] ListPythonPackagesResponse\n */\n \n /**\n * Calls ListPythonPackages.\n * @function listPythonPackages\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListPythonPackagesRequest} request ListPythonPackagesRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.ListPythonPackagesCallback} callback Node-style callback called with the error, if any, and ListPythonPackagesResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listPythonPackages = function listPythonPackages(request, callback) {\n return this.rpcCall(listPythonPackages, $root.google.devtools.artifactregistry.v1.ListPythonPackagesRequest, $root.google.devtools.artifactregistry.v1.ListPythonPackagesResponse, request, callback);\n }, \"name\", { value: \"ListPythonPackages\" });\n \n /**\n * Calls ListPythonPackages.\n * @function listPythonPackages\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListPythonPackagesRequest} request ListPythonPackagesRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|getPythonPackage}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef GetPythonPackageCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.PythonPackage} [response] PythonPackage\n */\n \n /**\n * Calls GetPythonPackage.\n * @function getPythonPackage\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetPythonPackageRequest} request GetPythonPackageRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.GetPythonPackageCallback} callback Node-style callback called with the error, if any, and PythonPackage\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getPythonPackage = function getPythonPackage(request, callback) {\n return this.rpcCall(getPythonPackage, $root.google.devtools.artifactregistry.v1.GetPythonPackageRequest, $root.google.devtools.artifactregistry.v1.PythonPackage, request, callback);\n }, \"name\", { value: \"GetPythonPackage\" });\n \n /**\n * Calls GetPythonPackage.\n * @function getPythonPackage\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetPythonPackageRequest} request GetPythonPackageRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|importAptArtifacts}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef ImportAptArtifactsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls ImportAptArtifacts.\n * @function importAptArtifacts\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsRequest} request ImportAptArtifactsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.ImportAptArtifactsCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.importAptArtifacts = function importAptArtifacts(request, callback) {\n return this.rpcCall(importAptArtifacts, $root.google.devtools.artifactregistry.v1.ImportAptArtifactsRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"ImportAptArtifacts\" });\n \n /**\n * Calls ImportAptArtifacts.\n * @function importAptArtifacts\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IImportAptArtifactsRequest} request ImportAptArtifactsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|importYumArtifacts}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef ImportYumArtifactsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls ImportYumArtifacts.\n * @function importYumArtifacts\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsRequest} request ImportYumArtifactsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.ImportYumArtifactsCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.importYumArtifacts = function importYumArtifacts(request, callback) {\n return this.rpcCall(importYumArtifacts, $root.google.devtools.artifactregistry.v1.ImportYumArtifactsRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"ImportYumArtifacts\" });\n \n /**\n * Calls ImportYumArtifacts.\n * @function importYumArtifacts\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsRequest} request ImportYumArtifactsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|listRepositories}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef ListRepositoriesCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.ListRepositoriesResponse} [response] ListRepositoriesResponse\n */\n \n /**\n * Calls ListRepositories.\n * @function listRepositories\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListRepositoriesRequest} request ListRepositoriesRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.ListRepositoriesCallback} callback Node-style callback called with the error, if any, and ListRepositoriesResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listRepositories = function listRepositories(request, callback) {\n return this.rpcCall(listRepositories, $root.google.devtools.artifactregistry.v1.ListRepositoriesRequest, $root.google.devtools.artifactregistry.v1.ListRepositoriesResponse, request, callback);\n }, \"name\", { value: \"ListRepositories\" });\n \n /**\n * Calls ListRepositories.\n * @function listRepositories\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListRepositoriesRequest} request ListRepositoriesRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|getRepository}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef GetRepositoryCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.Repository} [response] Repository\n */\n \n /**\n * Calls GetRepository.\n * @function getRepository\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetRepositoryRequest} request GetRepositoryRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.GetRepositoryCallback} callback Node-style callback called with the error, if any, and Repository\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getRepository = function getRepository(request, callback) {\n return this.rpcCall(getRepository, $root.google.devtools.artifactregistry.v1.GetRepositoryRequest, $root.google.devtools.artifactregistry.v1.Repository, request, callback);\n }, \"name\", { value: \"GetRepository\" });\n \n /**\n * Calls GetRepository.\n * @function getRepository\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetRepositoryRequest} request GetRepositoryRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|createRepository}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef CreateRepositoryCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls CreateRepository.\n * @function createRepository\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.ICreateRepositoryRequest} request CreateRepositoryRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.CreateRepositoryCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.createRepository = function createRepository(request, callback) {\n return this.rpcCall(createRepository, $root.google.devtools.artifactregistry.v1.CreateRepositoryRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"CreateRepository\" });\n \n /**\n * Calls CreateRepository.\n * @function createRepository\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.ICreateRepositoryRequest} request CreateRepositoryRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|updateRepository}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef UpdateRepositoryCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.Repository} [response] Repository\n */\n \n /**\n * Calls UpdateRepository.\n * @function updateRepository\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdateRepositoryRequest} request UpdateRepositoryRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.UpdateRepositoryCallback} callback Node-style callback called with the error, if any, and Repository\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.updateRepository = function updateRepository(request, callback) {\n return this.rpcCall(updateRepository, $root.google.devtools.artifactregistry.v1.UpdateRepositoryRequest, $root.google.devtools.artifactregistry.v1.Repository, request, callback);\n }, \"name\", { value: \"UpdateRepository\" });\n \n /**\n * Calls UpdateRepository.\n * @function updateRepository\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdateRepositoryRequest} request UpdateRepositoryRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|deleteRepository}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef DeleteRepositoryCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls DeleteRepository.\n * @function deleteRepository\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IDeleteRepositoryRequest} request DeleteRepositoryRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.DeleteRepositoryCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.deleteRepository = function deleteRepository(request, callback) {\n return this.rpcCall(deleteRepository, $root.google.devtools.artifactregistry.v1.DeleteRepositoryRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"DeleteRepository\" });\n \n /**\n * Calls DeleteRepository.\n * @function deleteRepository\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IDeleteRepositoryRequest} request DeleteRepositoryRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|listPackages}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef ListPackagesCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.ListPackagesResponse} [response] ListPackagesResponse\n */\n \n /**\n * Calls ListPackages.\n * @function listPackages\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListPackagesRequest} request ListPackagesRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.ListPackagesCallback} callback Node-style callback called with the error, if any, and ListPackagesResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listPackages = function listPackages(request, callback) {\n return this.rpcCall(listPackages, $root.google.devtools.artifactregistry.v1.ListPackagesRequest, $root.google.devtools.artifactregistry.v1.ListPackagesResponse, request, callback);\n }, \"name\", { value: \"ListPackages\" });\n \n /**\n * Calls ListPackages.\n * @function listPackages\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListPackagesRequest} request ListPackagesRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|getPackage}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef GetPackageCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.Package} [response] Package\n */\n \n /**\n * Calls GetPackage.\n * @function getPackage\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetPackageRequest} request GetPackageRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.GetPackageCallback} callback Node-style callback called with the error, if any, and Package\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getPackage = function getPackage(request, callback) {\n return this.rpcCall(getPackage, $root.google.devtools.artifactregistry.v1.GetPackageRequest, $root.google.devtools.artifactregistry.v1.Package, request, callback);\n }, \"name\", { value: \"GetPackage\" });\n \n /**\n * Calls GetPackage.\n * @function getPackage\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetPackageRequest} request GetPackageRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|deletePackage}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef DeletePackageCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls DeletePackage.\n * @function deletePackage\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IDeletePackageRequest} request DeletePackageRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.DeletePackageCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.deletePackage = function deletePackage(request, callback) {\n return this.rpcCall(deletePackage, $root.google.devtools.artifactregistry.v1.DeletePackageRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"DeletePackage\" });\n \n /**\n * Calls DeletePackage.\n * @function deletePackage\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IDeletePackageRequest} request DeletePackageRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|listVersions}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef ListVersionsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.ListVersionsResponse} [response] ListVersionsResponse\n */\n \n /**\n * Calls ListVersions.\n * @function listVersions\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListVersionsRequest} request ListVersionsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.ListVersionsCallback} callback Node-style callback called with the error, if any, and ListVersionsResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listVersions = function listVersions(request, callback) {\n return this.rpcCall(listVersions, $root.google.devtools.artifactregistry.v1.ListVersionsRequest, $root.google.devtools.artifactregistry.v1.ListVersionsResponse, request, callback);\n }, \"name\", { value: \"ListVersions\" });\n \n /**\n * Calls ListVersions.\n * @function listVersions\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListVersionsRequest} request ListVersionsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|getVersion}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef GetVersionCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.Version} [response] Version\n */\n \n /**\n * Calls GetVersion.\n * @function getVersion\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetVersionRequest} request GetVersionRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.GetVersionCallback} callback Node-style callback called with the error, if any, and Version\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getVersion = function getVersion(request, callback) {\n return this.rpcCall(getVersion, $root.google.devtools.artifactregistry.v1.GetVersionRequest, $root.google.devtools.artifactregistry.v1.Version, request, callback);\n }, \"name\", { value: \"GetVersion\" });\n \n /**\n * Calls GetVersion.\n * @function getVersion\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetVersionRequest} request GetVersionRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|deleteVersion}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef DeleteVersionCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls DeleteVersion.\n * @function deleteVersion\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IDeleteVersionRequest} request DeleteVersionRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.DeleteVersionCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.deleteVersion = function deleteVersion(request, callback) {\n return this.rpcCall(deleteVersion, $root.google.devtools.artifactregistry.v1.DeleteVersionRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"DeleteVersion\" });\n \n /**\n * Calls DeleteVersion.\n * @function deleteVersion\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IDeleteVersionRequest} request DeleteVersionRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|batchDeleteVersions}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef BatchDeleteVersionsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls BatchDeleteVersions.\n * @function batchDeleteVersions\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IBatchDeleteVersionsRequest} request BatchDeleteVersionsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.BatchDeleteVersionsCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.batchDeleteVersions = function batchDeleteVersions(request, callback) {\n return this.rpcCall(batchDeleteVersions, $root.google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"BatchDeleteVersions\" });\n \n /**\n * Calls BatchDeleteVersions.\n * @function batchDeleteVersions\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IBatchDeleteVersionsRequest} request BatchDeleteVersionsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|updateVersion}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef UpdateVersionCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.Version} [response] Version\n */\n \n /**\n * Calls UpdateVersion.\n * @function updateVersion\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdateVersionRequest} request UpdateVersionRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.UpdateVersionCallback} callback Node-style callback called with the error, if any, and Version\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.updateVersion = function updateVersion(request, callback) {\n return this.rpcCall(updateVersion, $root.google.devtools.artifactregistry.v1.UpdateVersionRequest, $root.google.devtools.artifactregistry.v1.Version, request, callback);\n }, \"name\", { value: \"UpdateVersion\" });\n \n /**\n * Calls UpdateVersion.\n * @function updateVersion\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdateVersionRequest} request UpdateVersionRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|listFiles}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef ListFilesCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.ListFilesResponse} [response] ListFilesResponse\n */\n \n /**\n * Calls ListFiles.\n * @function listFiles\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListFilesRequest} request ListFilesRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.ListFilesCallback} callback Node-style callback called with the error, if any, and ListFilesResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listFiles = function listFiles(request, callback) {\n return this.rpcCall(listFiles, $root.google.devtools.artifactregistry.v1.ListFilesRequest, $root.google.devtools.artifactregistry.v1.ListFilesResponse, request, callback);\n }, \"name\", { value: \"ListFiles\" });\n \n /**\n * Calls ListFiles.\n * @function listFiles\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListFilesRequest} request ListFilesRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|getFile}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef GetFileCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.File} [response] File\n */\n \n /**\n * Calls GetFile.\n * @function getFile\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetFileRequest} request GetFileRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.GetFileCallback} callback Node-style callback called with the error, if any, and File\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getFile = function getFile(request, callback) {\n return this.rpcCall(getFile, $root.google.devtools.artifactregistry.v1.GetFileRequest, $root.google.devtools.artifactregistry.v1.File, request, callback);\n }, \"name\", { value: \"GetFile\" });\n \n /**\n * Calls GetFile.\n * @function getFile\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetFileRequest} request GetFileRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|deleteFile}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef DeleteFileCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls DeleteFile.\n * @function deleteFile\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IDeleteFileRequest} request DeleteFileRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.DeleteFileCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.deleteFile = function deleteFile(request, callback) {\n return this.rpcCall(deleteFile, $root.google.devtools.artifactregistry.v1.DeleteFileRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"DeleteFile\" });\n \n /**\n * Calls DeleteFile.\n * @function deleteFile\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IDeleteFileRequest} request DeleteFileRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|updateFile}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef UpdateFileCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.File} [response] File\n */\n \n /**\n * Calls UpdateFile.\n * @function updateFile\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdateFileRequest} request UpdateFileRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.UpdateFileCallback} callback Node-style callback called with the error, if any, and File\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.updateFile = function updateFile(request, callback) {\n return this.rpcCall(updateFile, $root.google.devtools.artifactregistry.v1.UpdateFileRequest, $root.google.devtools.artifactregistry.v1.File, request, callback);\n }, \"name\", { value: \"UpdateFile\" });\n \n /**\n * Calls UpdateFile.\n * @function updateFile\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdateFileRequest} request UpdateFileRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|listTags}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef ListTagsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.ListTagsResponse} [response] ListTagsResponse\n */\n \n /**\n * Calls ListTags.\n * @function listTags\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListTagsRequest} request ListTagsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.ListTagsCallback} callback Node-style callback called with the error, if any, and ListTagsResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listTags = function listTags(request, callback) {\n return this.rpcCall(listTags, $root.google.devtools.artifactregistry.v1.ListTagsRequest, $root.google.devtools.artifactregistry.v1.ListTagsResponse, request, callback);\n }, \"name\", { value: \"ListTags\" });\n \n /**\n * Calls ListTags.\n * @function listTags\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListTagsRequest} request ListTagsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|getTag}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef GetTagCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.Tag} [response] Tag\n */\n \n /**\n * Calls GetTag.\n * @function getTag\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetTagRequest} request GetTagRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.GetTagCallback} callback Node-style callback called with the error, if any, and Tag\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getTag = function getTag(request, callback) {\n return this.rpcCall(getTag, $root.google.devtools.artifactregistry.v1.GetTagRequest, $root.google.devtools.artifactregistry.v1.Tag, request, callback);\n }, \"name\", { value: \"GetTag\" });\n \n /**\n * Calls GetTag.\n * @function getTag\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetTagRequest} request GetTagRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|createTag}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef CreateTagCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.Tag} [response] Tag\n */\n \n /**\n * Calls CreateTag.\n * @function createTag\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.ICreateTagRequest} request CreateTagRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.CreateTagCallback} callback Node-style callback called with the error, if any, and Tag\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.createTag = function createTag(request, callback) {\n return this.rpcCall(createTag, $root.google.devtools.artifactregistry.v1.CreateTagRequest, $root.google.devtools.artifactregistry.v1.Tag, request, callback);\n }, \"name\", { value: \"CreateTag\" });\n \n /**\n * Calls CreateTag.\n * @function createTag\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.ICreateTagRequest} request CreateTagRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|updateTag}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef UpdateTagCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.Tag} [response] Tag\n */\n \n /**\n * Calls UpdateTag.\n * @function updateTag\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdateTagRequest} request UpdateTagRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.UpdateTagCallback} callback Node-style callback called with the error, if any, and Tag\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.updateTag = function updateTag(request, callback) {\n return this.rpcCall(updateTag, $root.google.devtools.artifactregistry.v1.UpdateTagRequest, $root.google.devtools.artifactregistry.v1.Tag, request, callback);\n }, \"name\", { value: \"UpdateTag\" });\n \n /**\n * Calls UpdateTag.\n * @function updateTag\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdateTagRequest} request UpdateTagRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|deleteTag}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef DeleteTagCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.protobuf.Empty} [response] Empty\n */\n \n /**\n * Calls DeleteTag.\n * @function deleteTag\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IDeleteTagRequest} request DeleteTagRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.DeleteTagCallback} callback Node-style callback called with the error, if any, and Empty\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.deleteTag = function deleteTag(request, callback) {\n return this.rpcCall(deleteTag, $root.google.devtools.artifactregistry.v1.DeleteTagRequest, $root.google.protobuf.Empty, request, callback);\n }, \"name\", { value: \"DeleteTag\" });\n \n /**\n * Calls DeleteTag.\n * @function deleteTag\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IDeleteTagRequest} request DeleteTagRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|createRule}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef CreateRuleCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.Rule} [response] Rule\n */\n \n /**\n * Calls CreateRule.\n * @function createRule\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.ICreateRuleRequest} request CreateRuleRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.CreateRuleCallback} callback Node-style callback called with the error, if any, and Rule\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.createRule = function createRule(request, callback) {\n return this.rpcCall(createRule, $root.google.devtools.artifactregistry.v1.CreateRuleRequest, $root.google.devtools.artifactregistry.v1.Rule, request, callback);\n }, \"name\", { value: \"CreateRule\" });\n \n /**\n * Calls CreateRule.\n * @function createRule\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.ICreateRuleRequest} request CreateRuleRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|listRules}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef ListRulesCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.ListRulesResponse} [response] ListRulesResponse\n */\n \n /**\n * Calls ListRules.\n * @function listRules\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListRulesRequest} request ListRulesRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.ListRulesCallback} callback Node-style callback called with the error, if any, and ListRulesResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listRules = function listRules(request, callback) {\n return this.rpcCall(listRules, $root.google.devtools.artifactregistry.v1.ListRulesRequest, $root.google.devtools.artifactregistry.v1.ListRulesResponse, request, callback);\n }, \"name\", { value: \"ListRules\" });\n \n /**\n * Calls ListRules.\n * @function listRules\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListRulesRequest} request ListRulesRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|getRule}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef GetRuleCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.Rule} [response] Rule\n */\n \n /**\n * Calls GetRule.\n * @function getRule\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetRuleRequest} request GetRuleRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.GetRuleCallback} callback Node-style callback called with the error, if any, and Rule\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getRule = function getRule(request, callback) {\n return this.rpcCall(getRule, $root.google.devtools.artifactregistry.v1.GetRuleRequest, $root.google.devtools.artifactregistry.v1.Rule, request, callback);\n }, \"name\", { value: \"GetRule\" });\n \n /**\n * Calls GetRule.\n * @function getRule\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetRuleRequest} request GetRuleRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|updateRule}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef UpdateRuleCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.Rule} [response] Rule\n */\n \n /**\n * Calls UpdateRule.\n * @function updateRule\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdateRuleRequest} request UpdateRuleRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.UpdateRuleCallback} callback Node-style callback called with the error, if any, and Rule\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.updateRule = function updateRule(request, callback) {\n return this.rpcCall(updateRule, $root.google.devtools.artifactregistry.v1.UpdateRuleRequest, $root.google.devtools.artifactregistry.v1.Rule, request, callback);\n }, \"name\", { value: \"UpdateRule\" });\n \n /**\n * Calls UpdateRule.\n * @function updateRule\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdateRuleRequest} request UpdateRuleRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|deleteRule}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef DeleteRuleCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.protobuf.Empty} [response] Empty\n */\n \n /**\n * Calls DeleteRule.\n * @function deleteRule\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IDeleteRuleRequest} request DeleteRuleRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.DeleteRuleCallback} callback Node-style callback called with the error, if any, and Empty\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.deleteRule = function deleteRule(request, callback) {\n return this.rpcCall(deleteRule, $root.google.devtools.artifactregistry.v1.DeleteRuleRequest, $root.google.protobuf.Empty, request, callback);\n }, \"name\", { value: \"DeleteRule\" });\n \n /**\n * Calls DeleteRule.\n * @function deleteRule\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IDeleteRuleRequest} request DeleteRuleRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|setIamPolicy}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef SetIamPolicyCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.iam.v1.Policy} [response] Policy\n */\n \n /**\n * Calls SetIamPolicy.\n * @function setIamPolicy\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.setIamPolicy = function setIamPolicy(request, callback) {\n return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback);\n }, \"name\", { value: \"SetIamPolicy\" });\n \n /**\n * Calls SetIamPolicy.\n * @function setIamPolicy\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|getIamPolicy}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef GetIamPolicyCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.iam.v1.Policy} [response] Policy\n */\n \n /**\n * Calls GetIamPolicy.\n * @function getIamPolicy\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getIamPolicy = function getIamPolicy(request, callback) {\n return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback);\n }, \"name\", { value: \"GetIamPolicy\" });\n \n /**\n * Calls GetIamPolicy.\n * @function getIamPolicy\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|testIamPermissions}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef TestIamPermissionsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse\n */\n \n /**\n * Calls TestIamPermissions.\n * @function testIamPermissions\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.testIamPermissions = function testIamPermissions(request, callback) {\n return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback);\n }, \"name\", { value: \"TestIamPermissions\" });\n \n /**\n * Calls TestIamPermissions.\n * @function testIamPermissions\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|getProjectSettings}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef GetProjectSettingsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.ProjectSettings} [response] ProjectSettings\n */\n \n /**\n * Calls GetProjectSettings.\n * @function getProjectSettings\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetProjectSettingsRequest} request GetProjectSettingsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.GetProjectSettingsCallback} callback Node-style callback called with the error, if any, and ProjectSettings\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getProjectSettings = function getProjectSettings(request, callback) {\n return this.rpcCall(getProjectSettings, $root.google.devtools.artifactregistry.v1.GetProjectSettingsRequest, $root.google.devtools.artifactregistry.v1.ProjectSettings, request, callback);\n }, \"name\", { value: \"GetProjectSettings\" });\n \n /**\n * Calls GetProjectSettings.\n * @function getProjectSettings\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetProjectSettingsRequest} request GetProjectSettingsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|updateProjectSettings}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef UpdateProjectSettingsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.ProjectSettings} [response] ProjectSettings\n */\n \n /**\n * Calls UpdateProjectSettings.\n * @function updateProjectSettings\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdateProjectSettingsRequest} request UpdateProjectSettingsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.UpdateProjectSettingsCallback} callback Node-style callback called with the error, if any, and ProjectSettings\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.updateProjectSettings = function updateProjectSettings(request, callback) {\n return this.rpcCall(updateProjectSettings, $root.google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest, $root.google.devtools.artifactregistry.v1.ProjectSettings, request, callback);\n }, \"name\", { value: \"UpdateProjectSettings\" });\n \n /**\n * Calls UpdateProjectSettings.\n * @function updateProjectSettings\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdateProjectSettingsRequest} request UpdateProjectSettingsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|getVPCSCConfig}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef GetVPCSCConfigCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.VPCSCConfig} [response] VPCSCConfig\n */\n \n /**\n * Calls GetVPCSCConfig.\n * @function getVPCSCConfig\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetVPCSCConfigRequest} request GetVPCSCConfigRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.GetVPCSCConfigCallback} callback Node-style callback called with the error, if any, and VPCSCConfig\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getVPCSCConfig = function getVPCSCConfig(request, callback) {\n return this.rpcCall(getVPCSCConfig, $root.google.devtools.artifactregistry.v1.GetVPCSCConfigRequest, $root.google.devtools.artifactregistry.v1.VPCSCConfig, request, callback);\n }, \"name\", { value: \"GetVPCSCConfig\" });\n \n /**\n * Calls GetVPCSCConfig.\n * @function getVPCSCConfig\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetVPCSCConfigRequest} request GetVPCSCConfigRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|updateVPCSCConfig}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef UpdateVPCSCConfigCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.VPCSCConfig} [response] VPCSCConfig\n */\n \n /**\n * Calls UpdateVPCSCConfig.\n * @function updateVPCSCConfig\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdateVPCSCConfigRequest} request UpdateVPCSCConfigRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.UpdateVPCSCConfigCallback} callback Node-style callback called with the error, if any, and VPCSCConfig\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.updateVPCSCConfig = function updateVPCSCConfig(request, callback) {\n return this.rpcCall(updateVPCSCConfig, $root.google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest, $root.google.devtools.artifactregistry.v1.VPCSCConfig, request, callback);\n }, \"name\", { value: \"UpdateVPCSCConfig\" });\n \n /**\n * Calls UpdateVPCSCConfig.\n * @function updateVPCSCConfig\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdateVPCSCConfigRequest} request UpdateVPCSCConfigRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|updatePackage}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef UpdatePackageCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.Package} [response] Package\n */\n \n /**\n * Calls UpdatePackage.\n * @function updatePackage\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdatePackageRequest} request UpdatePackageRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.UpdatePackageCallback} callback Node-style callback called with the error, if any, and Package\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.updatePackage = function updatePackage(request, callback) {\n return this.rpcCall(updatePackage, $root.google.devtools.artifactregistry.v1.UpdatePackageRequest, $root.google.devtools.artifactregistry.v1.Package, request, callback);\n }, \"name\", { value: \"UpdatePackage\" });\n \n /**\n * Calls UpdatePackage.\n * @function updatePackage\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IUpdatePackageRequest} request UpdatePackageRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|listAttachments}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef ListAttachmentsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.ListAttachmentsResponse} [response] ListAttachmentsResponse\n */\n \n /**\n * Calls ListAttachments.\n * @function listAttachments\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListAttachmentsRequest} request ListAttachmentsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.ListAttachmentsCallback} callback Node-style callback called with the error, if any, and ListAttachmentsResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listAttachments = function listAttachments(request, callback) {\n return this.rpcCall(listAttachments, $root.google.devtools.artifactregistry.v1.ListAttachmentsRequest, $root.google.devtools.artifactregistry.v1.ListAttachmentsResponse, request, callback);\n }, \"name\", { value: \"ListAttachments\" });\n \n /**\n * Calls ListAttachments.\n * @function listAttachments\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IListAttachmentsRequest} request ListAttachmentsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|getAttachment}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef GetAttachmentCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1.Attachment} [response] Attachment\n */\n \n /**\n * Calls GetAttachment.\n * @function getAttachment\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetAttachmentRequest} request GetAttachmentRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.GetAttachmentCallback} callback Node-style callback called with the error, if any, and Attachment\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getAttachment = function getAttachment(request, callback) {\n return this.rpcCall(getAttachment, $root.google.devtools.artifactregistry.v1.GetAttachmentRequest, $root.google.devtools.artifactregistry.v1.Attachment, request, callback);\n }, \"name\", { value: \"GetAttachment\" });\n \n /**\n * Calls GetAttachment.\n * @function getAttachment\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IGetAttachmentRequest} request GetAttachmentRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|createAttachment}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef CreateAttachmentCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls CreateAttachment.\n * @function createAttachment\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.ICreateAttachmentRequest} request CreateAttachmentRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.CreateAttachmentCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.createAttachment = function createAttachment(request, callback) {\n return this.rpcCall(createAttachment, $root.google.devtools.artifactregistry.v1.CreateAttachmentRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"CreateAttachment\" });\n \n /**\n * Calls CreateAttachment.\n * @function createAttachment\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.ICreateAttachmentRequest} request CreateAttachmentRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1.ArtifactRegistry|deleteAttachment}.\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @typedef DeleteAttachmentCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls DeleteAttachment.\n * @function deleteAttachment\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IDeleteAttachmentRequest} request DeleteAttachmentRequest message or plain object\n * @param {google.devtools.artifactregistry.v1.ArtifactRegistry.DeleteAttachmentCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.deleteAttachment = function deleteAttachment(request, callback) {\n return this.rpcCall(deleteAttachment, $root.google.devtools.artifactregistry.v1.DeleteAttachmentRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"DeleteAttachment\" });\n \n /**\n * Calls DeleteAttachment.\n * @function deleteAttachment\n * @memberof google.devtools.artifactregistry.v1.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1.IDeleteAttachmentRequest} request DeleteAttachmentRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n return ArtifactRegistry;\n })();\n \n v1.OperationMetadata = (function() {\n \n /**\n * Properties of an OperationMetadata.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IOperationMetadata\n */\n \n /**\n * Constructs a new OperationMetadata.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an OperationMetadata.\n * @implements IOperationMetadata\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IOperationMetadata=} [properties] Properties to set\n */\n function OperationMetadata(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Creates a new OperationMetadata instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.OperationMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.IOperationMetadata=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.OperationMetadata} OperationMetadata instance\n */\n OperationMetadata.create = function create(properties) {\n return new OperationMetadata(properties);\n };\n \n /**\n * Encodes the specified OperationMetadata message. Does not implicitly {@link google.devtools.artifactregistry.v1.OperationMetadata.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.OperationMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.IOperationMetadata} message OperationMetadata message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OperationMetadata.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n return writer;\n };\n \n /**\n * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.OperationMetadata.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.OperationMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.IOperationMetadata} message OperationMetadata message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an OperationMetadata message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.OperationMetadata\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.OperationMetadata} OperationMetadata\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OperationMetadata.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.OperationMetadata();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an OperationMetadata message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.OperationMetadata\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.OperationMetadata} OperationMetadata\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OperationMetadata.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an OperationMetadata message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.OperationMetadata\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n OperationMetadata.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n return null;\n };\n \n /**\n * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.OperationMetadata\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.OperationMetadata} OperationMetadata\n */\n OperationMetadata.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.OperationMetadata)\n return object;\n return new $root.google.devtools.artifactregistry.v1.OperationMetadata();\n };\n \n /**\n * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.OperationMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.OperationMetadata} message OperationMetadata\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n OperationMetadata.toObject = function toObject() {\n return {};\n };\n \n /**\n * Converts this OperationMetadata to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.OperationMetadata\n * @instance\n * @returns {Object.} JSON object\n */\n OperationMetadata.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for OperationMetadata\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.OperationMetadata\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.OperationMetadata\";\n };\n \n return OperationMetadata;\n })();\n \n v1.ProjectSettings = (function() {\n \n /**\n * Properties of a ProjectSettings.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IProjectSettings\n * @property {string|null} [name] ProjectSettings name\n * @property {google.devtools.artifactregistry.v1.ProjectSettings.RedirectionState|null} [legacyRedirectionState] ProjectSettings legacyRedirectionState\n * @property {number|null} [pullPercent] ProjectSettings pullPercent\n */\n \n /**\n * Constructs a new ProjectSettings.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ProjectSettings.\n * @implements IProjectSettings\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IProjectSettings=} [properties] Properties to set\n */\n function ProjectSettings(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ProjectSettings name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.ProjectSettings\n * @instance\n */\n ProjectSettings.prototype.name = \"\";\n \n /**\n * ProjectSettings legacyRedirectionState.\n * @member {google.devtools.artifactregistry.v1.ProjectSettings.RedirectionState} legacyRedirectionState\n * @memberof google.devtools.artifactregistry.v1.ProjectSettings\n * @instance\n */\n ProjectSettings.prototype.legacyRedirectionState = 0;\n \n /**\n * ProjectSettings pullPercent.\n * @member {number} pullPercent\n * @memberof google.devtools.artifactregistry.v1.ProjectSettings\n * @instance\n */\n ProjectSettings.prototype.pullPercent = 0;\n \n /**\n * Creates a new ProjectSettings instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ProjectSettings\n * @static\n * @param {google.devtools.artifactregistry.v1.IProjectSettings=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ProjectSettings} ProjectSettings instance\n */\n ProjectSettings.create = function create(properties) {\n return new ProjectSettings(properties);\n };\n \n /**\n * Encodes the specified ProjectSettings message. Does not implicitly {@link google.devtools.artifactregistry.v1.ProjectSettings.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ProjectSettings\n * @static\n * @param {google.devtools.artifactregistry.v1.IProjectSettings} message ProjectSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ProjectSettings.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.legacyRedirectionState != null && Object.hasOwnProperty.call(message, \"legacyRedirectionState\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.legacyRedirectionState);\n if (message.pullPercent != null && Object.hasOwnProperty.call(message, \"pullPercent\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pullPercent);\n return writer;\n };\n \n /**\n * Encodes the specified ProjectSettings message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ProjectSettings.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ProjectSettings\n * @static\n * @param {google.devtools.artifactregistry.v1.IProjectSettings} message ProjectSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ProjectSettings.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ProjectSettings message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ProjectSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ProjectSettings} ProjectSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ProjectSettings.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ProjectSettings();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.legacyRedirectionState = reader.int32();\n break;\n }\n case 3: {\n message.pullPercent = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ProjectSettings message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ProjectSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ProjectSettings} ProjectSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ProjectSettings.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ProjectSettings message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ProjectSettings\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ProjectSettings.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.legacyRedirectionState != null && message.hasOwnProperty(\"legacyRedirectionState\"))\n switch (message.legacyRedirectionState) {\n default:\n return \"legacyRedirectionState: enum value expected\";\n case 0:\n case 1:\n case 2:\n case 3:\n case 5:\n case 6:\n break;\n }\n if (message.pullPercent != null && message.hasOwnProperty(\"pullPercent\"))\n if (!$util.isInteger(message.pullPercent))\n return \"pullPercent: integer expected\";\n return null;\n };\n \n /**\n * Creates a ProjectSettings message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ProjectSettings\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ProjectSettings} ProjectSettings\n */\n ProjectSettings.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ProjectSettings)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ProjectSettings();\n if (object.name != null)\n message.name = String(object.name);\n switch (object.legacyRedirectionState) {\n default:\n if (typeof object.legacyRedirectionState === \"number\") {\n message.legacyRedirectionState = object.legacyRedirectionState;\n break;\n }\n break;\n case \"REDIRECTION_STATE_UNSPECIFIED\":\n case 0:\n message.legacyRedirectionState = 0;\n break;\n case \"REDIRECTION_FROM_GCR_IO_DISABLED\":\n case 1:\n message.legacyRedirectionState = 1;\n break;\n case \"REDIRECTION_FROM_GCR_IO_ENABLED\":\n case 2:\n message.legacyRedirectionState = 2;\n break;\n case \"REDIRECTION_FROM_GCR_IO_FINALIZED\":\n case 3:\n message.legacyRedirectionState = 3;\n break;\n case \"REDIRECTION_FROM_GCR_IO_ENABLED_AND_COPYING\":\n case 5:\n message.legacyRedirectionState = 5;\n break;\n case \"REDIRECTION_FROM_GCR_IO_PARTIAL_AND_COPYING\":\n case 6:\n message.legacyRedirectionState = 6;\n break;\n }\n if (object.pullPercent != null)\n message.pullPercent = object.pullPercent | 0;\n return message;\n };\n \n /**\n * Creates a plain object from a ProjectSettings message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ProjectSettings\n * @static\n * @param {google.devtools.artifactregistry.v1.ProjectSettings} message ProjectSettings\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ProjectSettings.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.legacyRedirectionState = options.enums === String ? \"REDIRECTION_STATE_UNSPECIFIED\" : 0;\n object.pullPercent = 0;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.legacyRedirectionState != null && message.hasOwnProperty(\"legacyRedirectionState\"))\n object.legacyRedirectionState = options.enums === String ? $root.google.devtools.artifactregistry.v1.ProjectSettings.RedirectionState[message.legacyRedirectionState] === undefined ? message.legacyRedirectionState : $root.google.devtools.artifactregistry.v1.ProjectSettings.RedirectionState[message.legacyRedirectionState] : message.legacyRedirectionState;\n if (message.pullPercent != null && message.hasOwnProperty(\"pullPercent\"))\n object.pullPercent = message.pullPercent;\n return object;\n };\n \n /**\n * Converts this ProjectSettings to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ProjectSettings\n * @instance\n * @returns {Object.} JSON object\n */\n ProjectSettings.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ProjectSettings\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ProjectSettings\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ProjectSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ProjectSettings\";\n };\n \n /**\n * RedirectionState enum.\n * @name google.devtools.artifactregistry.v1.ProjectSettings.RedirectionState\n * @enum {number}\n * @property {number} REDIRECTION_STATE_UNSPECIFIED=0 REDIRECTION_STATE_UNSPECIFIED value\n * @property {number} REDIRECTION_FROM_GCR_IO_DISABLED=1 REDIRECTION_FROM_GCR_IO_DISABLED value\n * @property {number} REDIRECTION_FROM_GCR_IO_ENABLED=2 REDIRECTION_FROM_GCR_IO_ENABLED value\n * @property {number} REDIRECTION_FROM_GCR_IO_FINALIZED=3 REDIRECTION_FROM_GCR_IO_FINALIZED value\n * @property {number} REDIRECTION_FROM_GCR_IO_ENABLED_AND_COPYING=5 REDIRECTION_FROM_GCR_IO_ENABLED_AND_COPYING value\n * @property {number} REDIRECTION_FROM_GCR_IO_PARTIAL_AND_COPYING=6 REDIRECTION_FROM_GCR_IO_PARTIAL_AND_COPYING value\n */\n ProjectSettings.RedirectionState = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"REDIRECTION_STATE_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"REDIRECTION_FROM_GCR_IO_DISABLED\"] = 1;\n values[valuesById[2] = \"REDIRECTION_FROM_GCR_IO_ENABLED\"] = 2;\n values[valuesById[3] = \"REDIRECTION_FROM_GCR_IO_FINALIZED\"] = 3;\n values[valuesById[5] = \"REDIRECTION_FROM_GCR_IO_ENABLED_AND_COPYING\"] = 5;\n values[valuesById[6] = \"REDIRECTION_FROM_GCR_IO_PARTIAL_AND_COPYING\"] = 6;\n return values;\n })();\n \n return ProjectSettings;\n })();\n \n v1.GetProjectSettingsRequest = (function() {\n \n /**\n * Properties of a GetProjectSettingsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IGetProjectSettingsRequest\n * @property {string|null} [name] GetProjectSettingsRequest name\n */\n \n /**\n * Constructs a new GetProjectSettingsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a GetProjectSettingsRequest.\n * @implements IGetProjectSettingsRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IGetProjectSettingsRequest=} [properties] Properties to set\n */\n function GetProjectSettingsRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetProjectSettingsRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.GetProjectSettingsRequest\n * @instance\n */\n GetProjectSettingsRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetProjectSettingsRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.GetProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetProjectSettingsRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.GetProjectSettingsRequest} GetProjectSettingsRequest instance\n */\n GetProjectSettingsRequest.create = function create(properties) {\n return new GetProjectSettingsRequest(properties);\n };\n \n /**\n * Encodes the specified GetProjectSettingsRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.GetProjectSettingsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.GetProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetProjectSettingsRequest} message GetProjectSettingsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetProjectSettingsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetProjectSettingsRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.GetProjectSettingsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetProjectSettingsRequest} message GetProjectSettingsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetProjectSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetProjectSettingsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.GetProjectSettingsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.GetProjectSettingsRequest} GetProjectSettingsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetProjectSettingsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.GetProjectSettingsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetProjectSettingsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetProjectSettingsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.GetProjectSettingsRequest} GetProjectSettingsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetProjectSettingsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetProjectSettingsRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.GetProjectSettingsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetProjectSettingsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetProjectSettingsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.GetProjectSettingsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.GetProjectSettingsRequest} GetProjectSettingsRequest\n */\n GetProjectSettingsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.GetProjectSettingsRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.GetProjectSettingsRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetProjectSettingsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.GetProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.GetProjectSettingsRequest} message GetProjectSettingsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetProjectSettingsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetProjectSettingsRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.GetProjectSettingsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetProjectSettingsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetProjectSettingsRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.GetProjectSettingsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetProjectSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.GetProjectSettingsRequest\";\n };\n \n return GetProjectSettingsRequest;\n })();\n \n v1.UpdateProjectSettingsRequest = (function() {\n \n /**\n * Properties of an UpdateProjectSettingsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IUpdateProjectSettingsRequest\n * @property {google.devtools.artifactregistry.v1.IProjectSettings|null} [projectSettings] UpdateProjectSettingsRequest projectSettings\n * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProjectSettingsRequest updateMask\n */\n \n /**\n * Constructs a new UpdateProjectSettingsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an UpdateProjectSettingsRequest.\n * @implements IUpdateProjectSettingsRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IUpdateProjectSettingsRequest=} [properties] Properties to set\n */\n function UpdateProjectSettingsRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * UpdateProjectSettingsRequest projectSettings.\n * @member {google.devtools.artifactregistry.v1.IProjectSettings|null|undefined} projectSettings\n * @memberof google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest\n * @instance\n */\n UpdateProjectSettingsRequest.prototype.projectSettings = null;\n \n /**\n * UpdateProjectSettingsRequest updateMask.\n * @member {google.protobuf.IFieldMask|null|undefined} updateMask\n * @memberof google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest\n * @instance\n */\n UpdateProjectSettingsRequest.prototype.updateMask = null;\n \n /**\n * Creates a new UpdateProjectSettingsRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateProjectSettingsRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest} UpdateProjectSettingsRequest instance\n */\n UpdateProjectSettingsRequest.create = function create(properties) {\n return new UpdateProjectSettingsRequest(properties);\n };\n \n /**\n * Encodes the specified UpdateProjectSettingsRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateProjectSettingsRequest} message UpdateProjectSettingsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateProjectSettingsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.projectSettings != null && Object.hasOwnProperty.call(message, \"projectSettings\"))\n $root.google.devtools.artifactregistry.v1.ProjectSettings.encode(message.projectSettings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.updateMask != null && Object.hasOwnProperty.call(message, \"updateMask\"))\n $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified UpdateProjectSettingsRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateProjectSettingsRequest} message UpdateProjectSettingsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateProjectSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an UpdateProjectSettingsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest} UpdateProjectSettingsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateProjectSettingsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n message.projectSettings = $root.google.devtools.artifactregistry.v1.ProjectSettings.decode(reader, reader.uint32());\n break;\n }\n case 3: {\n message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an UpdateProjectSettingsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest} UpdateProjectSettingsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateProjectSettingsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an UpdateProjectSettingsRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n UpdateProjectSettingsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.projectSettings != null && message.hasOwnProperty(\"projectSettings\")) {\n var error = $root.google.devtools.artifactregistry.v1.ProjectSettings.verify(message.projectSettings);\n if (error)\n return \"projectSettings.\" + error;\n }\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\")) {\n var error = $root.google.protobuf.FieldMask.verify(message.updateMask);\n if (error)\n return \"updateMask.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an UpdateProjectSettingsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest} UpdateProjectSettingsRequest\n */\n UpdateProjectSettingsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest();\n if (object.projectSettings != null) {\n if (typeof object.projectSettings !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest.projectSettings: object expected\");\n message.projectSettings = $root.google.devtools.artifactregistry.v1.ProjectSettings.fromObject(object.projectSettings);\n }\n if (object.updateMask != null) {\n if (typeof object.updateMask !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest.updateMask: object expected\");\n message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an UpdateProjectSettingsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest} message UpdateProjectSettingsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n UpdateProjectSettingsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.projectSettings = null;\n object.updateMask = null;\n }\n if (message.projectSettings != null && message.hasOwnProperty(\"projectSettings\"))\n object.projectSettings = $root.google.devtools.artifactregistry.v1.ProjectSettings.toObject(message.projectSettings, options);\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\"))\n object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);\n return object;\n };\n \n /**\n * Converts this UpdateProjectSettingsRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n UpdateProjectSettingsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for UpdateProjectSettingsRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n UpdateProjectSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest\";\n };\n \n return UpdateProjectSettingsRequest;\n })();\n \n v1.Tag = (function() {\n \n /**\n * Properties of a Tag.\n * @memberof google.devtools.artifactregistry.v1\n * @interface ITag\n * @property {string|null} [name] Tag name\n * @property {string|null} [version] Tag version\n */\n \n /**\n * Constructs a new Tag.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a Tag.\n * @implements ITag\n * @constructor\n * @param {google.devtools.artifactregistry.v1.ITag=} [properties] Properties to set\n */\n function Tag(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Tag name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.Tag\n * @instance\n */\n Tag.prototype.name = \"\";\n \n /**\n * Tag version.\n * @member {string} version\n * @memberof google.devtools.artifactregistry.v1.Tag\n * @instance\n */\n Tag.prototype.version = \"\";\n \n /**\n * Creates a new Tag instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.Tag\n * @static\n * @param {google.devtools.artifactregistry.v1.ITag=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.Tag} Tag instance\n */\n Tag.create = function create(properties) {\n return new Tag(properties);\n };\n \n /**\n * Encodes the specified Tag message. Does not implicitly {@link google.devtools.artifactregistry.v1.Tag.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.Tag\n * @static\n * @param {google.devtools.artifactregistry.v1.ITag} message Tag message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Tag.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.version != null && Object.hasOwnProperty.call(message, \"version\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.version);\n return writer;\n };\n \n /**\n * Encodes the specified Tag message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.Tag.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Tag\n * @static\n * @param {google.devtools.artifactregistry.v1.ITag} message Tag message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Tag.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Tag message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.Tag\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.Tag} Tag\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Tag.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.Tag();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.version = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Tag message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Tag\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.Tag} Tag\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Tag.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Tag message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.Tag\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Tag.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.version != null && message.hasOwnProperty(\"version\"))\n if (!$util.isString(message.version))\n return \"version: string expected\";\n return null;\n };\n \n /**\n * Creates a Tag message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.Tag\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.Tag} Tag\n */\n Tag.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.Tag)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.Tag();\n if (object.name != null)\n message.name = String(object.name);\n if (object.version != null)\n message.version = String(object.version);\n return message;\n };\n \n /**\n * Creates a plain object from a Tag message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.Tag\n * @static\n * @param {google.devtools.artifactregistry.v1.Tag} message Tag\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Tag.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.version = \"\";\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.version != null && message.hasOwnProperty(\"version\"))\n object.version = message.version;\n return object;\n };\n \n /**\n * Converts this Tag to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.Tag\n * @instance\n * @returns {Object.} JSON object\n */\n Tag.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Tag\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.Tag\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Tag.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.Tag\";\n };\n \n return Tag;\n })();\n \n v1.ListTagsRequest = (function() {\n \n /**\n * Properties of a ListTagsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListTagsRequest\n * @property {string|null} [parent] ListTagsRequest parent\n * @property {string|null} [filter] ListTagsRequest filter\n * @property {number|null} [pageSize] ListTagsRequest pageSize\n * @property {string|null} [pageToken] ListTagsRequest pageToken\n */\n \n /**\n * Constructs a new ListTagsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListTagsRequest.\n * @implements IListTagsRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListTagsRequest=} [properties] Properties to set\n */\n function ListTagsRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListTagsRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.ListTagsRequest\n * @instance\n */\n ListTagsRequest.prototype.parent = \"\";\n \n /**\n * ListTagsRequest filter.\n * @member {string} filter\n * @memberof google.devtools.artifactregistry.v1.ListTagsRequest\n * @instance\n */\n ListTagsRequest.prototype.filter = \"\";\n \n /**\n * ListTagsRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1.ListTagsRequest\n * @instance\n */\n ListTagsRequest.prototype.pageSize = 0;\n \n /**\n * ListTagsRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1.ListTagsRequest\n * @instance\n */\n ListTagsRequest.prototype.pageToken = \"\";\n \n /**\n * Creates a new ListTagsRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListTagsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListTagsRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListTagsRequest} ListTagsRequest instance\n */\n ListTagsRequest.create = function create(properties) {\n return new ListTagsRequest(properties);\n };\n \n /**\n * Encodes the specified ListTagsRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListTagsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListTagsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListTagsRequest} message ListTagsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListTagsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n if (message.filter != null && Object.hasOwnProperty.call(message, \"filter\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter);\n return writer;\n };\n \n /**\n * Encodes the specified ListTagsRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListTagsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListTagsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListTagsRequest} message ListTagsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListTagsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListTagsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListTagsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListTagsRequest} ListTagsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListTagsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListTagsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 4: {\n message.filter = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListTagsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListTagsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListTagsRequest} ListTagsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListTagsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListTagsRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListTagsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListTagsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n if (!$util.isString(message.filter))\n return \"filter: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListTagsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListTagsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListTagsRequest} ListTagsRequest\n */\n ListTagsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListTagsRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListTagsRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.filter != null)\n message.filter = String(object.filter);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListTagsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListTagsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ListTagsRequest} message ListTagsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListTagsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n object.filter = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n object.filter = message.filter;\n return object;\n };\n \n /**\n * Converts this ListTagsRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListTagsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListTagsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListTagsRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListTagsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListTagsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListTagsRequest\";\n };\n \n return ListTagsRequest;\n })();\n \n v1.ListTagsResponse = (function() {\n \n /**\n * Properties of a ListTagsResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListTagsResponse\n * @property {Array.|null} [tags] ListTagsResponse tags\n * @property {string|null} [nextPageToken] ListTagsResponse nextPageToken\n */\n \n /**\n * Constructs a new ListTagsResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListTagsResponse.\n * @implements IListTagsResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListTagsResponse=} [properties] Properties to set\n */\n function ListTagsResponse(properties) {\n this.tags = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListTagsResponse tags.\n * @member {Array.} tags\n * @memberof google.devtools.artifactregistry.v1.ListTagsResponse\n * @instance\n */\n ListTagsResponse.prototype.tags = $util.emptyArray;\n \n /**\n * ListTagsResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1.ListTagsResponse\n * @instance\n */\n ListTagsResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListTagsResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListTagsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListTagsResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListTagsResponse} ListTagsResponse instance\n */\n ListTagsResponse.create = function create(properties) {\n return new ListTagsResponse(properties);\n };\n \n /**\n * Encodes the specified ListTagsResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListTagsResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListTagsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListTagsResponse} message ListTagsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListTagsResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.tags != null && message.tags.length)\n for (var i = 0; i < message.tags.length; ++i)\n $root.google.devtools.artifactregistry.v1.Tag.encode(message.tags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListTagsResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListTagsResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListTagsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListTagsResponse} message ListTagsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListTagsResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListTagsResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListTagsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListTagsResponse} ListTagsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListTagsResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListTagsResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.tags && message.tags.length))\n message.tags = [];\n message.tags.push($root.google.devtools.artifactregistry.v1.Tag.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListTagsResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListTagsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListTagsResponse} ListTagsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListTagsResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListTagsResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListTagsResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListTagsResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.tags != null && message.hasOwnProperty(\"tags\")) {\n if (!Array.isArray(message.tags))\n return \"tags: array expected\";\n for (var i = 0; i < message.tags.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.Tag.verify(message.tags[i]);\n if (error)\n return \"tags.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListTagsResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListTagsResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListTagsResponse} ListTagsResponse\n */\n ListTagsResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListTagsResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListTagsResponse();\n if (object.tags) {\n if (!Array.isArray(object.tags))\n throw TypeError(\".google.devtools.artifactregistry.v1.ListTagsResponse.tags: array expected\");\n message.tags = [];\n for (var i = 0; i < object.tags.length; ++i) {\n if (typeof object.tags[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ListTagsResponse.tags: object expected\");\n message.tags[i] = $root.google.devtools.artifactregistry.v1.Tag.fromObject(object.tags[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListTagsResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListTagsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.ListTagsResponse} message ListTagsResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListTagsResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.tags = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.tags && message.tags.length) {\n object.tags = [];\n for (var j = 0; j < message.tags.length; ++j)\n object.tags[j] = $root.google.devtools.artifactregistry.v1.Tag.toObject(message.tags[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListTagsResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListTagsResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListTagsResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListTagsResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListTagsResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListTagsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListTagsResponse\";\n };\n \n return ListTagsResponse;\n })();\n \n v1.GetTagRequest = (function() {\n \n /**\n * Properties of a GetTagRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IGetTagRequest\n * @property {string|null} [name] GetTagRequest name\n */\n \n /**\n * Constructs a new GetTagRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a GetTagRequest.\n * @implements IGetTagRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IGetTagRequest=} [properties] Properties to set\n */\n function GetTagRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetTagRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.GetTagRequest\n * @instance\n */\n GetTagRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetTagRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.GetTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetTagRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.GetTagRequest} GetTagRequest instance\n */\n GetTagRequest.create = function create(properties) {\n return new GetTagRequest(properties);\n };\n \n /**\n * Encodes the specified GetTagRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.GetTagRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.GetTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetTagRequest} message GetTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetTagRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetTagRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.GetTagRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetTagRequest} message GetTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetTagRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetTagRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.GetTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.GetTagRequest} GetTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetTagRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.GetTagRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetTagRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.GetTagRequest} GetTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetTagRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetTagRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.GetTagRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetTagRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetTagRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.GetTagRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.GetTagRequest} GetTagRequest\n */\n GetTagRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.GetTagRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.GetTagRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetTagRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.GetTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.GetTagRequest} message GetTagRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetTagRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetTagRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.GetTagRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetTagRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetTagRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.GetTagRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetTagRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.GetTagRequest\";\n };\n \n return GetTagRequest;\n })();\n \n v1.CreateTagRequest = (function() {\n \n /**\n * Properties of a CreateTagRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface ICreateTagRequest\n * @property {string|null} [parent] CreateTagRequest parent\n * @property {string|null} [tagId] CreateTagRequest tagId\n * @property {google.devtools.artifactregistry.v1.ITag|null} [tag] CreateTagRequest tag\n */\n \n /**\n * Constructs a new CreateTagRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a CreateTagRequest.\n * @implements ICreateTagRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.ICreateTagRequest=} [properties] Properties to set\n */\n function CreateTagRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CreateTagRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.CreateTagRequest\n * @instance\n */\n CreateTagRequest.prototype.parent = \"\";\n \n /**\n * CreateTagRequest tagId.\n * @member {string} tagId\n * @memberof google.devtools.artifactregistry.v1.CreateTagRequest\n * @instance\n */\n CreateTagRequest.prototype.tagId = \"\";\n \n /**\n * CreateTagRequest tag.\n * @member {google.devtools.artifactregistry.v1.ITag|null|undefined} tag\n * @memberof google.devtools.artifactregistry.v1.CreateTagRequest\n * @instance\n */\n CreateTagRequest.prototype.tag = null;\n \n /**\n * Creates a new CreateTagRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.CreateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ICreateTagRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.CreateTagRequest} CreateTagRequest instance\n */\n CreateTagRequest.create = function create(properties) {\n return new CreateTagRequest(properties);\n };\n \n /**\n * Encodes the specified CreateTagRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.CreateTagRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.CreateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ICreateTagRequest} message CreateTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CreateTagRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.tagId != null && Object.hasOwnProperty.call(message, \"tagId\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.tagId);\n if (message.tag != null && Object.hasOwnProperty.call(message, \"tag\"))\n $root.google.devtools.artifactregistry.v1.Tag.encode(message.tag, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified CreateTagRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.CreateTagRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.CreateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ICreateTagRequest} message CreateTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CreateTagRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CreateTagRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.CreateTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.CreateTagRequest} CreateTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CreateTagRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.CreateTagRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.tagId = reader.string();\n break;\n }\n case 3: {\n message.tag = $root.google.devtools.artifactregistry.v1.Tag.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CreateTagRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.CreateTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.CreateTagRequest} CreateTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CreateTagRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CreateTagRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.CreateTagRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CreateTagRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.tagId != null && message.hasOwnProperty(\"tagId\"))\n if (!$util.isString(message.tagId))\n return \"tagId: string expected\";\n if (message.tag != null && message.hasOwnProperty(\"tag\")) {\n var error = $root.google.devtools.artifactregistry.v1.Tag.verify(message.tag);\n if (error)\n return \"tag.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a CreateTagRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.CreateTagRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.CreateTagRequest} CreateTagRequest\n */\n CreateTagRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.CreateTagRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.CreateTagRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.tagId != null)\n message.tagId = String(object.tagId);\n if (object.tag != null) {\n if (typeof object.tag !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.CreateTagRequest.tag: object expected\");\n message.tag = $root.google.devtools.artifactregistry.v1.Tag.fromObject(object.tag);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a CreateTagRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.CreateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.CreateTagRequest} message CreateTagRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CreateTagRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.tagId = \"\";\n object.tag = null;\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.tagId != null && message.hasOwnProperty(\"tagId\"))\n object.tagId = message.tagId;\n if (message.tag != null && message.hasOwnProperty(\"tag\"))\n object.tag = $root.google.devtools.artifactregistry.v1.Tag.toObject(message.tag, options);\n return object;\n };\n \n /**\n * Converts this CreateTagRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.CreateTagRequest\n * @instance\n * @returns {Object.} JSON object\n */\n CreateTagRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CreateTagRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.CreateTagRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CreateTagRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.CreateTagRequest\";\n };\n \n return CreateTagRequest;\n })();\n \n v1.UpdateTagRequest = (function() {\n \n /**\n * Properties of an UpdateTagRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IUpdateTagRequest\n * @property {google.devtools.artifactregistry.v1.ITag|null} [tag] UpdateTagRequest tag\n * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTagRequest updateMask\n */\n \n /**\n * Constructs a new UpdateTagRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an UpdateTagRequest.\n * @implements IUpdateTagRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IUpdateTagRequest=} [properties] Properties to set\n */\n function UpdateTagRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * UpdateTagRequest tag.\n * @member {google.devtools.artifactregistry.v1.ITag|null|undefined} tag\n * @memberof google.devtools.artifactregistry.v1.UpdateTagRequest\n * @instance\n */\n UpdateTagRequest.prototype.tag = null;\n \n /**\n * UpdateTagRequest updateMask.\n * @member {google.protobuf.IFieldMask|null|undefined} updateMask\n * @memberof google.devtools.artifactregistry.v1.UpdateTagRequest\n * @instance\n */\n UpdateTagRequest.prototype.updateMask = null;\n \n /**\n * Creates a new UpdateTagRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.UpdateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateTagRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.UpdateTagRequest} UpdateTagRequest instance\n */\n UpdateTagRequest.create = function create(properties) {\n return new UpdateTagRequest(properties);\n };\n \n /**\n * Encodes the specified UpdateTagRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdateTagRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.UpdateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateTagRequest} message UpdateTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateTagRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.tag != null && Object.hasOwnProperty.call(message, \"tag\"))\n $root.google.devtools.artifactregistry.v1.Tag.encode(message.tag, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.updateMask != null && Object.hasOwnProperty.call(message, \"updateMask\"))\n $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified UpdateTagRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdateTagRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateTagRequest} message UpdateTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateTagRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an UpdateTagRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.UpdateTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.UpdateTagRequest} UpdateTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateTagRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.UpdateTagRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.tag = $root.google.devtools.artifactregistry.v1.Tag.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an UpdateTagRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdateTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.UpdateTagRequest} UpdateTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateTagRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an UpdateTagRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.UpdateTagRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n UpdateTagRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.tag != null && message.hasOwnProperty(\"tag\")) {\n var error = $root.google.devtools.artifactregistry.v1.Tag.verify(message.tag);\n if (error)\n return \"tag.\" + error;\n }\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\")) {\n var error = $root.google.protobuf.FieldMask.verify(message.updateMask);\n if (error)\n return \"updateMask.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an UpdateTagRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.UpdateTagRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.UpdateTagRequest} UpdateTagRequest\n */\n UpdateTagRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.UpdateTagRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.UpdateTagRequest();\n if (object.tag != null) {\n if (typeof object.tag !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdateTagRequest.tag: object expected\");\n message.tag = $root.google.devtools.artifactregistry.v1.Tag.fromObject(object.tag);\n }\n if (object.updateMask != null) {\n if (typeof object.updateMask !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdateTagRequest.updateMask: object expected\");\n message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an UpdateTagRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.UpdateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.UpdateTagRequest} message UpdateTagRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n UpdateTagRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.tag = null;\n object.updateMask = null;\n }\n if (message.tag != null && message.hasOwnProperty(\"tag\"))\n object.tag = $root.google.devtools.artifactregistry.v1.Tag.toObject(message.tag, options);\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\"))\n object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);\n return object;\n };\n \n /**\n * Converts this UpdateTagRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.UpdateTagRequest\n * @instance\n * @returns {Object.} JSON object\n */\n UpdateTagRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for UpdateTagRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.UpdateTagRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n UpdateTagRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.UpdateTagRequest\";\n };\n \n return UpdateTagRequest;\n })();\n \n v1.DeleteTagRequest = (function() {\n \n /**\n * Properties of a DeleteTagRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IDeleteTagRequest\n * @property {string|null} [name] DeleteTagRequest name\n */\n \n /**\n * Constructs a new DeleteTagRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a DeleteTagRequest.\n * @implements IDeleteTagRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IDeleteTagRequest=} [properties] Properties to set\n */\n function DeleteTagRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DeleteTagRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.DeleteTagRequest\n * @instance\n */\n DeleteTagRequest.prototype.name = \"\";\n \n /**\n * Creates a new DeleteTagRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.DeleteTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteTagRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.DeleteTagRequest} DeleteTagRequest instance\n */\n DeleteTagRequest.create = function create(properties) {\n return new DeleteTagRequest(properties);\n };\n \n /**\n * Encodes the specified DeleteTagRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.DeleteTagRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.DeleteTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteTagRequest} message DeleteTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteTagRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified DeleteTagRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.DeleteTagRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DeleteTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteTagRequest} message DeleteTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteTagRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DeleteTagRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.DeleteTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.DeleteTagRequest} DeleteTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteTagRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.DeleteTagRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DeleteTagRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DeleteTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.DeleteTagRequest} DeleteTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteTagRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DeleteTagRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.DeleteTagRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DeleteTagRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a DeleteTagRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.DeleteTagRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.DeleteTagRequest} DeleteTagRequest\n */\n DeleteTagRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.DeleteTagRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.DeleteTagRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a DeleteTagRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.DeleteTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.DeleteTagRequest} message DeleteTagRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DeleteTagRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this DeleteTagRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.DeleteTagRequest\n * @instance\n * @returns {Object.} JSON object\n */\n DeleteTagRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DeleteTagRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.DeleteTagRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DeleteTagRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.DeleteTagRequest\";\n };\n \n return DeleteTagRequest;\n })();\n \n /**\n * VersionView enum.\n * @name google.devtools.artifactregistry.v1.VersionView\n * @enum {number}\n * @property {number} VERSION_VIEW_UNSPECIFIED=0 VERSION_VIEW_UNSPECIFIED value\n * @property {number} BASIC=1 BASIC value\n * @property {number} FULL=2 FULL value\n */\n v1.VersionView = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"VERSION_VIEW_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"BASIC\"] = 1;\n values[valuesById[2] = \"FULL\"] = 2;\n return values;\n })();\n \n v1.Version = (function() {\n \n /**\n * Properties of a Version.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IVersion\n * @property {string|null} [name] Version name\n * @property {string|null} [description] Version description\n * @property {google.protobuf.ITimestamp|null} [createTime] Version createTime\n * @property {google.protobuf.ITimestamp|null} [updateTime] Version updateTime\n * @property {Array.|null} [relatedTags] Version relatedTags\n * @property {google.protobuf.IStruct|null} [metadata] Version metadata\n * @property {Object.|null} [annotations] Version annotations\n */\n \n /**\n * Constructs a new Version.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a Version.\n * @implements IVersion\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IVersion=} [properties] Properties to set\n */\n function Version(properties) {\n this.relatedTags = [];\n this.annotations = {};\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Version name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.Version\n * @instance\n */\n Version.prototype.name = \"\";\n \n /**\n * Version description.\n * @member {string} description\n * @memberof google.devtools.artifactregistry.v1.Version\n * @instance\n */\n Version.prototype.description = \"\";\n \n /**\n * Version createTime.\n * @member {google.protobuf.ITimestamp|null|undefined} createTime\n * @memberof google.devtools.artifactregistry.v1.Version\n * @instance\n */\n Version.prototype.createTime = null;\n \n /**\n * Version updateTime.\n * @member {google.protobuf.ITimestamp|null|undefined} updateTime\n * @memberof google.devtools.artifactregistry.v1.Version\n * @instance\n */\n Version.prototype.updateTime = null;\n \n /**\n * Version relatedTags.\n * @member {Array.} relatedTags\n * @memberof google.devtools.artifactregistry.v1.Version\n * @instance\n */\n Version.prototype.relatedTags = $util.emptyArray;\n \n /**\n * Version metadata.\n * @member {google.protobuf.IStruct|null|undefined} metadata\n * @memberof google.devtools.artifactregistry.v1.Version\n * @instance\n */\n Version.prototype.metadata = null;\n \n /**\n * Version annotations.\n * @member {Object.} annotations\n * @memberof google.devtools.artifactregistry.v1.Version\n * @instance\n */\n Version.prototype.annotations = $util.emptyObject;\n \n /**\n * Creates a new Version instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.Version\n * @static\n * @param {google.devtools.artifactregistry.v1.IVersion=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.Version} Version instance\n */\n Version.create = function create(properties) {\n return new Version(properties);\n };\n \n /**\n * Encodes the specified Version message. Does not implicitly {@link google.devtools.artifactregistry.v1.Version.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.Version\n * @static\n * @param {google.devtools.artifactregistry.v1.IVersion} message Version message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Version.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.description != null && Object.hasOwnProperty.call(message, \"description\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.description);\n if (message.createTime != null && Object.hasOwnProperty.call(message, \"createTime\"))\n $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.updateTime != null && Object.hasOwnProperty.call(message, \"updateTime\"))\n $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.relatedTags != null && message.relatedTags.length)\n for (var i = 0; i < message.relatedTags.length; ++i)\n $root.google.devtools.artifactregistry.v1.Tag.encode(message.relatedTags[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n if (message.metadata != null && Object.hasOwnProperty.call(message, \"metadata\"))\n $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n if (message.annotations != null && Object.hasOwnProperty.call(message, \"annotations\"))\n for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i)\n writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified Version message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.Version.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Version\n * @static\n * @param {google.devtools.artifactregistry.v1.IVersion} message Version message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Version.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Version message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.Version\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.Version} Version\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Version.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.Version(), key, value;\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 3: {\n message.description = reader.string();\n break;\n }\n case 5: {\n message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 6: {\n message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 7: {\n if (!(message.relatedTags && message.relatedTags.length))\n message.relatedTags = [];\n message.relatedTags.push($root.google.devtools.artifactregistry.v1.Tag.decode(reader, reader.uint32()));\n break;\n }\n case 8: {\n message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32());\n break;\n }\n case 9: {\n if (message.annotations === $util.emptyObject)\n message.annotations = {};\n var end2 = reader.uint32() + reader.pos;\n key = \"\";\n value = \"\";\n while (reader.pos < end2) {\n var tag2 = reader.uint32();\n switch (tag2 >>> 3) {\n case 1:\n key = reader.string();\n break;\n case 2:\n value = reader.string();\n break;\n default:\n reader.skipType(tag2 & 7);\n break;\n }\n }\n message.annotations[key] = value;\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Version message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.Version\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.Version} Version\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Version.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Version message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.Version\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Version.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.description != null && message.hasOwnProperty(\"description\"))\n if (!$util.isString(message.description))\n return \"description: string expected\";\n if (message.createTime != null && message.hasOwnProperty(\"createTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.createTime);\n if (error)\n return \"createTime.\" + error;\n }\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.updateTime);\n if (error)\n return \"updateTime.\" + error;\n }\n if (message.relatedTags != null && message.hasOwnProperty(\"relatedTags\")) {\n if (!Array.isArray(message.relatedTags))\n return \"relatedTags: array expected\";\n for (var i = 0; i < message.relatedTags.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.Tag.verify(message.relatedTags[i]);\n if (error)\n return \"relatedTags.\" + error;\n }\n }\n if (message.metadata != null && message.hasOwnProperty(\"metadata\")) {\n var error = $root.google.protobuf.Struct.verify(message.metadata);\n if (error)\n return \"metadata.\" + error;\n }\n if (message.annotations != null && message.hasOwnProperty(\"annotations\")) {\n if (!$util.isObject(message.annotations))\n return \"annotations: object expected\";\n var key = Object.keys(message.annotations);\n for (var i = 0; i < key.length; ++i)\n if (!$util.isString(message.annotations[key[i]]))\n return \"annotations: string{k:string} expected\";\n }\n return null;\n };\n \n /**\n * Creates a Version message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.Version\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.Version} Version\n */\n Version.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.Version)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.Version();\n if (object.name != null)\n message.name = String(object.name);\n if (object.description != null)\n message.description = String(object.description);\n if (object.createTime != null) {\n if (typeof object.createTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Version.createTime: object expected\");\n message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);\n }\n if (object.updateTime != null) {\n if (typeof object.updateTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Version.updateTime: object expected\");\n message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);\n }\n if (object.relatedTags) {\n if (!Array.isArray(object.relatedTags))\n throw TypeError(\".google.devtools.artifactregistry.v1.Version.relatedTags: array expected\");\n message.relatedTags = [];\n for (var i = 0; i < object.relatedTags.length; ++i) {\n if (typeof object.relatedTags[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Version.relatedTags: object expected\");\n message.relatedTags[i] = $root.google.devtools.artifactregistry.v1.Tag.fromObject(object.relatedTags[i]);\n }\n }\n if (object.metadata != null) {\n if (typeof object.metadata !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Version.metadata: object expected\");\n message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata);\n }\n if (object.annotations) {\n if (typeof object.annotations !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.Version.annotations: object expected\");\n message.annotations = {};\n for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i)\n message.annotations[keys[i]] = String(object.annotations[keys[i]]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a Version message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.Version\n * @static\n * @param {google.devtools.artifactregistry.v1.Version} message Version\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Version.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.relatedTags = [];\n if (options.objects || options.defaults)\n object.annotations = {};\n if (options.defaults) {\n object.name = \"\";\n object.description = \"\";\n object.createTime = null;\n object.updateTime = null;\n object.metadata = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.description != null && message.hasOwnProperty(\"description\"))\n object.description = message.description;\n if (message.createTime != null && message.hasOwnProperty(\"createTime\"))\n object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\"))\n object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);\n if (message.relatedTags && message.relatedTags.length) {\n object.relatedTags = [];\n for (var j = 0; j < message.relatedTags.length; ++j)\n object.relatedTags[j] = $root.google.devtools.artifactregistry.v1.Tag.toObject(message.relatedTags[j], options);\n }\n if (message.metadata != null && message.hasOwnProperty(\"metadata\"))\n object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options);\n var keys2;\n if (message.annotations && (keys2 = Object.keys(message.annotations)).length) {\n object.annotations = {};\n for (var j = 0; j < keys2.length; ++j)\n object.annotations[keys2[j]] = message.annotations[keys2[j]];\n }\n return object;\n };\n \n /**\n * Converts this Version to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.Version\n * @instance\n * @returns {Object.} JSON object\n */\n Version.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Version\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.Version\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Version.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.Version\";\n };\n \n return Version;\n })();\n \n v1.ListVersionsRequest = (function() {\n \n /**\n * Properties of a ListVersionsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListVersionsRequest\n * @property {string|null} [parent] ListVersionsRequest parent\n * @property {number|null} [pageSize] ListVersionsRequest pageSize\n * @property {string|null} [pageToken] ListVersionsRequest pageToken\n * @property {google.devtools.artifactregistry.v1.VersionView|null} [view] ListVersionsRequest view\n * @property {string|null} [orderBy] ListVersionsRequest orderBy\n * @property {string|null} [filter] ListVersionsRequest filter\n */\n \n /**\n * Constructs a new ListVersionsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListVersionsRequest.\n * @implements IListVersionsRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListVersionsRequest=} [properties] Properties to set\n */\n function ListVersionsRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListVersionsRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @instance\n */\n ListVersionsRequest.prototype.parent = \"\";\n \n /**\n * ListVersionsRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @instance\n */\n ListVersionsRequest.prototype.pageSize = 0;\n \n /**\n * ListVersionsRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @instance\n */\n ListVersionsRequest.prototype.pageToken = \"\";\n \n /**\n * ListVersionsRequest view.\n * @member {google.devtools.artifactregistry.v1.VersionView} view\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @instance\n */\n ListVersionsRequest.prototype.view = 0;\n \n /**\n * ListVersionsRequest orderBy.\n * @member {string} orderBy\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @instance\n */\n ListVersionsRequest.prototype.orderBy = \"\";\n \n /**\n * ListVersionsRequest filter.\n * @member {string} filter\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @instance\n */\n ListVersionsRequest.prototype.filter = \"\";\n \n /**\n * Creates a new ListVersionsRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListVersionsRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListVersionsRequest} ListVersionsRequest instance\n */\n ListVersionsRequest.create = function create(properties) {\n return new ListVersionsRequest(properties);\n };\n \n /**\n * Encodes the specified ListVersionsRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListVersionsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListVersionsRequest} message ListVersionsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListVersionsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n if (message.view != null && Object.hasOwnProperty.call(message, \"view\"))\n writer.uint32(/* id 4, wireType 0 =*/32).int32(message.view);\n if (message.orderBy != null && Object.hasOwnProperty.call(message, \"orderBy\"))\n writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy);\n if (message.filter != null && Object.hasOwnProperty.call(message, \"filter\"))\n writer.uint32(/* id 6, wireType 2 =*/50).string(message.filter);\n return writer;\n };\n \n /**\n * Encodes the specified ListVersionsRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListVersionsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IListVersionsRequest} message ListVersionsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListVersionsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListVersionsRequest} ListVersionsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListVersionsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListVersionsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n case 4: {\n message.view = reader.int32();\n break;\n }\n case 5: {\n message.orderBy = reader.string();\n break;\n }\n case 6: {\n message.filter = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListVersionsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListVersionsRequest} ListVersionsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListVersionsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListVersionsRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListVersionsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n if (message.view != null && message.hasOwnProperty(\"view\"))\n switch (message.view) {\n default:\n return \"view: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.orderBy != null && message.hasOwnProperty(\"orderBy\"))\n if (!$util.isString(message.orderBy))\n return \"orderBy: string expected\";\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n if (!$util.isString(message.filter))\n return \"filter: string expected\";\n return null;\n };\n \n /**\n * Creates a ListVersionsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListVersionsRequest} ListVersionsRequest\n */\n ListVersionsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListVersionsRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListVersionsRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n switch (object.view) {\n default:\n if (typeof object.view === \"number\") {\n message.view = object.view;\n break;\n }\n break;\n case \"VERSION_VIEW_UNSPECIFIED\":\n case 0:\n message.view = 0;\n break;\n case \"BASIC\":\n case 1:\n message.view = 1;\n break;\n case \"FULL\":\n case 2:\n message.view = 2;\n break;\n }\n if (object.orderBy != null)\n message.orderBy = String(object.orderBy);\n if (object.filter != null)\n message.filter = String(object.filter);\n return message;\n };\n \n /**\n * Creates a plain object from a ListVersionsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ListVersionsRequest} message ListVersionsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListVersionsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n object.view = options.enums === String ? \"VERSION_VIEW_UNSPECIFIED\" : 0;\n object.orderBy = \"\";\n object.filter = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n if (message.view != null && message.hasOwnProperty(\"view\"))\n object.view = options.enums === String ? $root.google.devtools.artifactregistry.v1.VersionView[message.view] === undefined ? message.view : $root.google.devtools.artifactregistry.v1.VersionView[message.view] : message.view;\n if (message.orderBy != null && message.hasOwnProperty(\"orderBy\"))\n object.orderBy = message.orderBy;\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n object.filter = message.filter;\n return object;\n };\n \n /**\n * Converts this ListVersionsRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListVersionsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListVersionsRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListVersionsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListVersionsRequest\";\n };\n \n return ListVersionsRequest;\n })();\n \n v1.ListVersionsResponse = (function() {\n \n /**\n * Properties of a ListVersionsResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IListVersionsResponse\n * @property {Array.|null} [versions] ListVersionsResponse versions\n * @property {string|null} [nextPageToken] ListVersionsResponse nextPageToken\n */\n \n /**\n * Constructs a new ListVersionsResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a ListVersionsResponse.\n * @implements IListVersionsResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IListVersionsResponse=} [properties] Properties to set\n */\n function ListVersionsResponse(properties) {\n this.versions = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListVersionsResponse versions.\n * @member {Array.} versions\n * @memberof google.devtools.artifactregistry.v1.ListVersionsResponse\n * @instance\n */\n ListVersionsResponse.prototype.versions = $util.emptyArray;\n \n /**\n * ListVersionsResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1.ListVersionsResponse\n * @instance\n */\n ListVersionsResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListVersionsResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ListVersionsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListVersionsResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ListVersionsResponse} ListVersionsResponse instance\n */\n ListVersionsResponse.create = function create(properties) {\n return new ListVersionsResponse(properties);\n };\n \n /**\n * Encodes the specified ListVersionsResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1.ListVersionsResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ListVersionsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListVersionsResponse} message ListVersionsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListVersionsResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.versions != null && message.versions.length)\n for (var i = 0; i < message.versions.length; ++i)\n $root.google.devtools.artifactregistry.v1.Version.encode(message.versions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListVersionsResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ListVersionsResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListVersionsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IListVersionsResponse} message ListVersionsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListVersionsResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ListVersionsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ListVersionsResponse} ListVersionsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListVersionsResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ListVersionsResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.versions && message.versions.length))\n message.versions = [];\n message.versions.push($root.google.devtools.artifactregistry.v1.Version.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListVersionsResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ListVersionsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ListVersionsResponse} ListVersionsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListVersionsResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListVersionsResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ListVersionsResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListVersionsResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.versions != null && message.hasOwnProperty(\"versions\")) {\n if (!Array.isArray(message.versions))\n return \"versions: array expected\";\n for (var i = 0; i < message.versions.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.Version.verify(message.versions[i]);\n if (error)\n return \"versions.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListVersionsResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ListVersionsResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ListVersionsResponse} ListVersionsResponse\n */\n ListVersionsResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ListVersionsResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ListVersionsResponse();\n if (object.versions) {\n if (!Array.isArray(object.versions))\n throw TypeError(\".google.devtools.artifactregistry.v1.ListVersionsResponse.versions: array expected\");\n message.versions = [];\n for (var i = 0; i < object.versions.length; ++i) {\n if (typeof object.versions[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ListVersionsResponse.versions: object expected\");\n message.versions[i] = $root.google.devtools.artifactregistry.v1.Version.fromObject(object.versions[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListVersionsResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ListVersionsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.ListVersionsResponse} message ListVersionsResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListVersionsResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.versions = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.versions && message.versions.length) {\n object.versions = [];\n for (var j = 0; j < message.versions.length; ++j)\n object.versions[j] = $root.google.devtools.artifactregistry.v1.Version.toObject(message.versions[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListVersionsResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ListVersionsResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListVersionsResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListVersionsResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ListVersionsResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ListVersionsResponse\";\n };\n \n return ListVersionsResponse;\n })();\n \n v1.GetVersionRequest = (function() {\n \n /**\n * Properties of a GetVersionRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IGetVersionRequest\n * @property {string|null} [name] GetVersionRequest name\n * @property {google.devtools.artifactregistry.v1.VersionView|null} [view] GetVersionRequest view\n */\n \n /**\n * Constructs a new GetVersionRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a GetVersionRequest.\n * @implements IGetVersionRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IGetVersionRequest=} [properties] Properties to set\n */\n function GetVersionRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetVersionRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.GetVersionRequest\n * @instance\n */\n GetVersionRequest.prototype.name = \"\";\n \n /**\n * GetVersionRequest view.\n * @member {google.devtools.artifactregistry.v1.VersionView} view\n * @memberof google.devtools.artifactregistry.v1.GetVersionRequest\n * @instance\n */\n GetVersionRequest.prototype.view = 0;\n \n /**\n * Creates a new GetVersionRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.GetVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetVersionRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.GetVersionRequest} GetVersionRequest instance\n */\n GetVersionRequest.create = function create(properties) {\n return new GetVersionRequest(properties);\n };\n \n /**\n * Encodes the specified GetVersionRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.GetVersionRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.GetVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetVersionRequest} message GetVersionRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetVersionRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.view != null && Object.hasOwnProperty.call(message, \"view\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view);\n return writer;\n };\n \n /**\n * Encodes the specified GetVersionRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.GetVersionRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetVersionRequest} message GetVersionRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetVersionRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetVersionRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.GetVersionRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.GetVersionRequest} GetVersionRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetVersionRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.GetVersionRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.view = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetVersionRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetVersionRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.GetVersionRequest} GetVersionRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetVersionRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetVersionRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.GetVersionRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetVersionRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.view != null && message.hasOwnProperty(\"view\"))\n switch (message.view) {\n default:\n return \"view: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n return null;\n };\n \n /**\n * Creates a GetVersionRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.GetVersionRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.GetVersionRequest} GetVersionRequest\n */\n GetVersionRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.GetVersionRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.GetVersionRequest();\n if (object.name != null)\n message.name = String(object.name);\n switch (object.view) {\n default:\n if (typeof object.view === \"number\") {\n message.view = object.view;\n break;\n }\n break;\n case \"VERSION_VIEW_UNSPECIFIED\":\n case 0:\n message.view = 0;\n break;\n case \"BASIC\":\n case 1:\n message.view = 1;\n break;\n case \"FULL\":\n case 2:\n message.view = 2;\n break;\n }\n return message;\n };\n \n /**\n * Creates a plain object from a GetVersionRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.GetVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.GetVersionRequest} message GetVersionRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetVersionRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.view = options.enums === String ? \"VERSION_VIEW_UNSPECIFIED\" : 0;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.view != null && message.hasOwnProperty(\"view\"))\n object.view = options.enums === String ? $root.google.devtools.artifactregistry.v1.VersionView[message.view] === undefined ? message.view : $root.google.devtools.artifactregistry.v1.VersionView[message.view] : message.view;\n return object;\n };\n \n /**\n * Converts this GetVersionRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.GetVersionRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetVersionRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetVersionRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.GetVersionRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.GetVersionRequest\";\n };\n \n return GetVersionRequest;\n })();\n \n v1.DeleteVersionRequest = (function() {\n \n /**\n * Properties of a DeleteVersionRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IDeleteVersionRequest\n * @property {string|null} [name] DeleteVersionRequest name\n * @property {boolean|null} [force] DeleteVersionRequest force\n */\n \n /**\n * Constructs a new DeleteVersionRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a DeleteVersionRequest.\n * @implements IDeleteVersionRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IDeleteVersionRequest=} [properties] Properties to set\n */\n function DeleteVersionRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DeleteVersionRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.DeleteVersionRequest\n * @instance\n */\n DeleteVersionRequest.prototype.name = \"\";\n \n /**\n * DeleteVersionRequest force.\n * @member {boolean} force\n * @memberof google.devtools.artifactregistry.v1.DeleteVersionRequest\n * @instance\n */\n DeleteVersionRequest.prototype.force = false;\n \n /**\n * Creates a new DeleteVersionRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.DeleteVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteVersionRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.DeleteVersionRequest} DeleteVersionRequest instance\n */\n DeleteVersionRequest.create = function create(properties) {\n return new DeleteVersionRequest(properties);\n };\n \n /**\n * Encodes the specified DeleteVersionRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.DeleteVersionRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.DeleteVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteVersionRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.force != null && Object.hasOwnProperty.call(message, \"force\"))\n writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force);\n return writer;\n };\n \n /**\n * Encodes the specified DeleteVersionRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.DeleteVersionRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DeleteVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteVersionRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DeleteVersionRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.DeleteVersionRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.DeleteVersionRequest} DeleteVersionRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteVersionRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.DeleteVersionRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.force = reader.bool();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DeleteVersionRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.DeleteVersionRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.DeleteVersionRequest} DeleteVersionRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteVersionRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DeleteVersionRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.DeleteVersionRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DeleteVersionRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.force != null && message.hasOwnProperty(\"force\"))\n if (typeof message.force !== \"boolean\")\n return \"force: boolean expected\";\n return null;\n };\n \n /**\n * Creates a DeleteVersionRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.DeleteVersionRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.DeleteVersionRequest} DeleteVersionRequest\n */\n DeleteVersionRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.DeleteVersionRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.DeleteVersionRequest();\n if (object.name != null)\n message.name = String(object.name);\n if (object.force != null)\n message.force = Boolean(object.force);\n return message;\n };\n \n /**\n * Creates a plain object from a DeleteVersionRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.DeleteVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.DeleteVersionRequest} message DeleteVersionRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DeleteVersionRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.force = false;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.force != null && message.hasOwnProperty(\"force\"))\n object.force = message.force;\n return object;\n };\n \n /**\n * Converts this DeleteVersionRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.DeleteVersionRequest\n * @instance\n * @returns {Object.} JSON object\n */\n DeleteVersionRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DeleteVersionRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.DeleteVersionRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DeleteVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.DeleteVersionRequest\";\n };\n \n return DeleteVersionRequest;\n })();\n \n v1.BatchDeleteVersionsRequest = (function() {\n \n /**\n * Properties of a BatchDeleteVersionsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IBatchDeleteVersionsRequest\n * @property {string|null} [parent] BatchDeleteVersionsRequest parent\n * @property {Array.|null} [names] BatchDeleteVersionsRequest names\n * @property {boolean|null} [validateOnly] BatchDeleteVersionsRequest validateOnly\n */\n \n /**\n * Constructs a new BatchDeleteVersionsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a BatchDeleteVersionsRequest.\n * @implements IBatchDeleteVersionsRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IBatchDeleteVersionsRequest=} [properties] Properties to set\n */\n function BatchDeleteVersionsRequest(properties) {\n this.names = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * BatchDeleteVersionsRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest\n * @instance\n */\n BatchDeleteVersionsRequest.prototype.parent = \"\";\n \n /**\n * BatchDeleteVersionsRequest names.\n * @member {Array.} names\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest\n * @instance\n */\n BatchDeleteVersionsRequest.prototype.names = $util.emptyArray;\n \n /**\n * BatchDeleteVersionsRequest validateOnly.\n * @member {boolean} validateOnly\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest\n * @instance\n */\n BatchDeleteVersionsRequest.prototype.validateOnly = false;\n \n /**\n * Creates a new BatchDeleteVersionsRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IBatchDeleteVersionsRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest} BatchDeleteVersionsRequest instance\n */\n BatchDeleteVersionsRequest.create = function create(properties) {\n return new BatchDeleteVersionsRequest(properties);\n };\n \n /**\n * Encodes the specified BatchDeleteVersionsRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IBatchDeleteVersionsRequest} message BatchDeleteVersionsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n BatchDeleteVersionsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.names != null && message.names.length)\n for (var i = 0; i < message.names.length; ++i)\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.names[i]);\n if (message.validateOnly != null && Object.hasOwnProperty.call(message, \"validateOnly\"))\n writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly);\n return writer;\n };\n \n /**\n * Encodes the specified BatchDeleteVersionsRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IBatchDeleteVersionsRequest} message BatchDeleteVersionsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n BatchDeleteVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a BatchDeleteVersionsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest} BatchDeleteVersionsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n BatchDeleteVersionsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n if (!(message.names && message.names.length))\n message.names = [];\n message.names.push(reader.string());\n break;\n }\n case 3: {\n message.validateOnly = reader.bool();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a BatchDeleteVersionsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest} BatchDeleteVersionsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n BatchDeleteVersionsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a BatchDeleteVersionsRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n BatchDeleteVersionsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.names != null && message.hasOwnProperty(\"names\")) {\n if (!Array.isArray(message.names))\n return \"names: array expected\";\n for (var i = 0; i < message.names.length; ++i)\n if (!$util.isString(message.names[i]))\n return \"names: string[] expected\";\n }\n if (message.validateOnly != null && message.hasOwnProperty(\"validateOnly\"))\n if (typeof message.validateOnly !== \"boolean\")\n return \"validateOnly: boolean expected\";\n return null;\n };\n \n /**\n * Creates a BatchDeleteVersionsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest} BatchDeleteVersionsRequest\n */\n BatchDeleteVersionsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.names) {\n if (!Array.isArray(object.names))\n throw TypeError(\".google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest.names: array expected\");\n message.names = [];\n for (var i = 0; i < object.names.length; ++i)\n message.names[i] = String(object.names[i]);\n }\n if (object.validateOnly != null)\n message.validateOnly = Boolean(object.validateOnly);\n return message;\n };\n \n /**\n * Creates a plain object from a BatchDeleteVersionsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest} message BatchDeleteVersionsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n BatchDeleteVersionsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.names = [];\n if (options.defaults) {\n object.parent = \"\";\n object.validateOnly = false;\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.names && message.names.length) {\n object.names = [];\n for (var j = 0; j < message.names.length; ++j)\n object.names[j] = message.names[j];\n }\n if (message.validateOnly != null && message.hasOwnProperty(\"validateOnly\"))\n object.validateOnly = message.validateOnly;\n return object;\n };\n \n /**\n * Converts this BatchDeleteVersionsRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n BatchDeleteVersionsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for BatchDeleteVersionsRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n BatchDeleteVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest\";\n };\n \n return BatchDeleteVersionsRequest;\n })();\n \n v1.BatchDeleteVersionsMetadata = (function() {\n \n /**\n * Properties of a BatchDeleteVersionsMetadata.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IBatchDeleteVersionsMetadata\n * @property {Array.|null} [failedVersions] BatchDeleteVersionsMetadata failedVersions\n */\n \n /**\n * Constructs a new BatchDeleteVersionsMetadata.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a BatchDeleteVersionsMetadata.\n * @implements IBatchDeleteVersionsMetadata\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IBatchDeleteVersionsMetadata=} [properties] Properties to set\n */\n function BatchDeleteVersionsMetadata(properties) {\n this.failedVersions = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * BatchDeleteVersionsMetadata failedVersions.\n * @member {Array.} failedVersions\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata\n * @instance\n */\n BatchDeleteVersionsMetadata.prototype.failedVersions = $util.emptyArray;\n \n /**\n * Creates a new BatchDeleteVersionsMetadata instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.IBatchDeleteVersionsMetadata=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata} BatchDeleteVersionsMetadata instance\n */\n BatchDeleteVersionsMetadata.create = function create(properties) {\n return new BatchDeleteVersionsMetadata(properties);\n };\n \n /**\n * Encodes the specified BatchDeleteVersionsMetadata message. Does not implicitly {@link google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.IBatchDeleteVersionsMetadata} message BatchDeleteVersionsMetadata message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n BatchDeleteVersionsMetadata.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.failedVersions != null && message.failedVersions.length)\n for (var i = 0; i < message.failedVersions.length; ++i)\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.failedVersions[i]);\n return writer;\n };\n \n /**\n * Encodes the specified BatchDeleteVersionsMetadata message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.IBatchDeleteVersionsMetadata} message BatchDeleteVersionsMetadata message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n BatchDeleteVersionsMetadata.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a BatchDeleteVersionsMetadata message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata} BatchDeleteVersionsMetadata\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n BatchDeleteVersionsMetadata.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n if (!(message.failedVersions && message.failedVersions.length))\n message.failedVersions = [];\n message.failedVersions.push(reader.string());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a BatchDeleteVersionsMetadata message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata} BatchDeleteVersionsMetadata\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n BatchDeleteVersionsMetadata.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a BatchDeleteVersionsMetadata message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n BatchDeleteVersionsMetadata.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.failedVersions != null && message.hasOwnProperty(\"failedVersions\")) {\n if (!Array.isArray(message.failedVersions))\n return \"failedVersions: array expected\";\n for (var i = 0; i < message.failedVersions.length; ++i)\n if (!$util.isString(message.failedVersions[i]))\n return \"failedVersions: string[] expected\";\n }\n return null;\n };\n \n /**\n * Creates a BatchDeleteVersionsMetadata message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata} BatchDeleteVersionsMetadata\n */\n BatchDeleteVersionsMetadata.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata();\n if (object.failedVersions) {\n if (!Array.isArray(object.failedVersions))\n throw TypeError(\".google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata.failedVersions: array expected\");\n message.failedVersions = [];\n for (var i = 0; i < object.failedVersions.length; ++i)\n message.failedVersions[i] = String(object.failedVersions[i]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a BatchDeleteVersionsMetadata message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata} message BatchDeleteVersionsMetadata\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n BatchDeleteVersionsMetadata.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.failedVersions = [];\n if (message.failedVersions && message.failedVersions.length) {\n object.failedVersions = [];\n for (var j = 0; j < message.failedVersions.length; ++j)\n object.failedVersions[j] = message.failedVersions[j];\n }\n return object;\n };\n \n /**\n * Converts this BatchDeleteVersionsMetadata to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata\n * @instance\n * @returns {Object.} JSON object\n */\n BatchDeleteVersionsMetadata.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for BatchDeleteVersionsMetadata\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n BatchDeleteVersionsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata\";\n };\n \n return BatchDeleteVersionsMetadata;\n })();\n \n v1.UpdateVersionRequest = (function() {\n \n /**\n * Properties of an UpdateVersionRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IUpdateVersionRequest\n * @property {google.devtools.artifactregistry.v1.IVersion|null} [version] UpdateVersionRequest version\n * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateVersionRequest updateMask\n */\n \n /**\n * Constructs a new UpdateVersionRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an UpdateVersionRequest.\n * @implements IUpdateVersionRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IUpdateVersionRequest=} [properties] Properties to set\n */\n function UpdateVersionRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * UpdateVersionRequest version.\n * @member {google.devtools.artifactregistry.v1.IVersion|null|undefined} version\n * @memberof google.devtools.artifactregistry.v1.UpdateVersionRequest\n * @instance\n */\n UpdateVersionRequest.prototype.version = null;\n \n /**\n * UpdateVersionRequest updateMask.\n * @member {google.protobuf.IFieldMask|null|undefined} updateMask\n * @memberof google.devtools.artifactregistry.v1.UpdateVersionRequest\n * @instance\n */\n UpdateVersionRequest.prototype.updateMask = null;\n \n /**\n * Creates a new UpdateVersionRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.UpdateVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateVersionRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.UpdateVersionRequest} UpdateVersionRequest instance\n */\n UpdateVersionRequest.create = function create(properties) {\n return new UpdateVersionRequest(properties);\n };\n \n /**\n * Encodes the specified UpdateVersionRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdateVersionRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.UpdateVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateVersionRequest} message UpdateVersionRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateVersionRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.version != null && Object.hasOwnProperty.call(message, \"version\"))\n $root.google.devtools.artifactregistry.v1.Version.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.updateMask != null && Object.hasOwnProperty.call(message, \"updateMask\"))\n $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified UpdateVersionRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdateVersionRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdateVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateVersionRequest} message UpdateVersionRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateVersionRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an UpdateVersionRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.UpdateVersionRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.UpdateVersionRequest} UpdateVersionRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateVersionRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.UpdateVersionRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.version = $root.google.devtools.artifactregistry.v1.Version.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an UpdateVersionRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdateVersionRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.UpdateVersionRequest} UpdateVersionRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateVersionRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an UpdateVersionRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.UpdateVersionRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n UpdateVersionRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.version != null && message.hasOwnProperty(\"version\")) {\n var error = $root.google.devtools.artifactregistry.v1.Version.verify(message.version);\n if (error)\n return \"version.\" + error;\n }\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\")) {\n var error = $root.google.protobuf.FieldMask.verify(message.updateMask);\n if (error)\n return \"updateMask.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an UpdateVersionRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.UpdateVersionRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.UpdateVersionRequest} UpdateVersionRequest\n */\n UpdateVersionRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.UpdateVersionRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.UpdateVersionRequest();\n if (object.version != null) {\n if (typeof object.version !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdateVersionRequest.version: object expected\");\n message.version = $root.google.devtools.artifactregistry.v1.Version.fromObject(object.version);\n }\n if (object.updateMask != null) {\n if (typeof object.updateMask !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdateVersionRequest.updateMask: object expected\");\n message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an UpdateVersionRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.UpdateVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.UpdateVersionRequest} message UpdateVersionRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n UpdateVersionRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.version = null;\n object.updateMask = null;\n }\n if (message.version != null && message.hasOwnProperty(\"version\"))\n object.version = $root.google.devtools.artifactregistry.v1.Version.toObject(message.version, options);\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\"))\n object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);\n return object;\n };\n \n /**\n * Converts this UpdateVersionRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.UpdateVersionRequest\n * @instance\n * @returns {Object.} JSON object\n */\n UpdateVersionRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for UpdateVersionRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.UpdateVersionRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n UpdateVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.UpdateVersionRequest\";\n };\n \n return UpdateVersionRequest;\n })();\n \n v1.VPCSCConfig = (function() {\n \n /**\n * Properties of a VPCSCConfig.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IVPCSCConfig\n * @property {string|null} [name] VPCSCConfig name\n * @property {google.devtools.artifactregistry.v1.VPCSCConfig.VPCSCPolicy|null} [vpcscPolicy] VPCSCConfig vpcscPolicy\n */\n \n /**\n * Constructs a new VPCSCConfig.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a VPCSCConfig.\n * @implements IVPCSCConfig\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IVPCSCConfig=} [properties] Properties to set\n */\n function VPCSCConfig(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * VPCSCConfig name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.VPCSCConfig\n * @instance\n */\n VPCSCConfig.prototype.name = \"\";\n \n /**\n * VPCSCConfig vpcscPolicy.\n * @member {google.devtools.artifactregistry.v1.VPCSCConfig.VPCSCPolicy} vpcscPolicy\n * @memberof google.devtools.artifactregistry.v1.VPCSCConfig\n * @instance\n */\n VPCSCConfig.prototype.vpcscPolicy = 0;\n \n /**\n * Creates a new VPCSCConfig instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.VPCSCConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.IVPCSCConfig=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.VPCSCConfig} VPCSCConfig instance\n */\n VPCSCConfig.create = function create(properties) {\n return new VPCSCConfig(properties);\n };\n \n /**\n * Encodes the specified VPCSCConfig message. Does not implicitly {@link google.devtools.artifactregistry.v1.VPCSCConfig.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.VPCSCConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.IVPCSCConfig} message VPCSCConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n VPCSCConfig.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.vpcscPolicy != null && Object.hasOwnProperty.call(message, \"vpcscPolicy\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.vpcscPolicy);\n return writer;\n };\n \n /**\n * Encodes the specified VPCSCConfig message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.VPCSCConfig.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.VPCSCConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.IVPCSCConfig} message VPCSCConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n VPCSCConfig.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a VPCSCConfig message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.VPCSCConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.VPCSCConfig} VPCSCConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n VPCSCConfig.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.VPCSCConfig();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.vpcscPolicy = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a VPCSCConfig message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.VPCSCConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.VPCSCConfig} VPCSCConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n VPCSCConfig.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a VPCSCConfig message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.VPCSCConfig\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n VPCSCConfig.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.vpcscPolicy != null && message.hasOwnProperty(\"vpcscPolicy\"))\n switch (message.vpcscPolicy) {\n default:\n return \"vpcscPolicy: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n return null;\n };\n \n /**\n * Creates a VPCSCConfig message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.VPCSCConfig\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.VPCSCConfig} VPCSCConfig\n */\n VPCSCConfig.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.VPCSCConfig)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.VPCSCConfig();\n if (object.name != null)\n message.name = String(object.name);\n switch (object.vpcscPolicy) {\n default:\n if (typeof object.vpcscPolicy === \"number\") {\n message.vpcscPolicy = object.vpcscPolicy;\n break;\n }\n break;\n case \"VPCSC_POLICY_UNSPECIFIED\":\n case 0:\n message.vpcscPolicy = 0;\n break;\n case \"DENY\":\n case 1:\n message.vpcscPolicy = 1;\n break;\n case \"ALLOW\":\n case 2:\n message.vpcscPolicy = 2;\n break;\n }\n return message;\n };\n \n /**\n * Creates a plain object from a VPCSCConfig message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.VPCSCConfig\n * @static\n * @param {google.devtools.artifactregistry.v1.VPCSCConfig} message VPCSCConfig\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n VPCSCConfig.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.vpcscPolicy = options.enums === String ? \"VPCSC_POLICY_UNSPECIFIED\" : 0;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.vpcscPolicy != null && message.hasOwnProperty(\"vpcscPolicy\"))\n object.vpcscPolicy = options.enums === String ? $root.google.devtools.artifactregistry.v1.VPCSCConfig.VPCSCPolicy[message.vpcscPolicy] === undefined ? message.vpcscPolicy : $root.google.devtools.artifactregistry.v1.VPCSCConfig.VPCSCPolicy[message.vpcscPolicy] : message.vpcscPolicy;\n return object;\n };\n \n /**\n * Converts this VPCSCConfig to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.VPCSCConfig\n * @instance\n * @returns {Object.} JSON object\n */\n VPCSCConfig.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for VPCSCConfig\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.VPCSCConfig\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n VPCSCConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.VPCSCConfig\";\n };\n \n /**\n * VPCSCPolicy enum.\n * @name google.devtools.artifactregistry.v1.VPCSCConfig.VPCSCPolicy\n * @enum {number}\n * @property {number} VPCSC_POLICY_UNSPECIFIED=0 VPCSC_POLICY_UNSPECIFIED value\n * @property {number} DENY=1 DENY value\n * @property {number} ALLOW=2 ALLOW value\n */\n VPCSCConfig.VPCSCPolicy = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"VPCSC_POLICY_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"DENY\"] = 1;\n values[valuesById[2] = \"ALLOW\"] = 2;\n return values;\n })();\n \n return VPCSCConfig;\n })();\n \n v1.GetVPCSCConfigRequest = (function() {\n \n /**\n * Properties of a GetVPCSCConfigRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IGetVPCSCConfigRequest\n * @property {string|null} [name] GetVPCSCConfigRequest name\n */\n \n /**\n * Constructs a new GetVPCSCConfigRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a GetVPCSCConfigRequest.\n * @implements IGetVPCSCConfigRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IGetVPCSCConfigRequest=} [properties] Properties to set\n */\n function GetVPCSCConfigRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetVPCSCConfigRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.GetVPCSCConfigRequest\n * @instance\n */\n GetVPCSCConfigRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetVPCSCConfigRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.GetVPCSCConfigRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetVPCSCConfigRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.GetVPCSCConfigRequest} GetVPCSCConfigRequest instance\n */\n GetVPCSCConfigRequest.create = function create(properties) {\n return new GetVPCSCConfigRequest(properties);\n };\n \n /**\n * Encodes the specified GetVPCSCConfigRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.GetVPCSCConfigRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.GetVPCSCConfigRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetVPCSCConfigRequest} message GetVPCSCConfigRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetVPCSCConfigRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetVPCSCConfigRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.GetVPCSCConfigRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetVPCSCConfigRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IGetVPCSCConfigRequest} message GetVPCSCConfigRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetVPCSCConfigRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetVPCSCConfigRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.GetVPCSCConfigRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.GetVPCSCConfigRequest} GetVPCSCConfigRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetVPCSCConfigRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.GetVPCSCConfigRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetVPCSCConfigRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.GetVPCSCConfigRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.GetVPCSCConfigRequest} GetVPCSCConfigRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetVPCSCConfigRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetVPCSCConfigRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.GetVPCSCConfigRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetVPCSCConfigRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetVPCSCConfigRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.GetVPCSCConfigRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.GetVPCSCConfigRequest} GetVPCSCConfigRequest\n */\n GetVPCSCConfigRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.GetVPCSCConfigRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.GetVPCSCConfigRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetVPCSCConfigRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.GetVPCSCConfigRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.GetVPCSCConfigRequest} message GetVPCSCConfigRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetVPCSCConfigRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetVPCSCConfigRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.GetVPCSCConfigRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetVPCSCConfigRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetVPCSCConfigRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.GetVPCSCConfigRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetVPCSCConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.GetVPCSCConfigRequest\";\n };\n \n return GetVPCSCConfigRequest;\n })();\n \n v1.UpdateVPCSCConfigRequest = (function() {\n \n /**\n * Properties of an UpdateVPCSCConfigRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IUpdateVPCSCConfigRequest\n * @property {google.devtools.artifactregistry.v1.IVPCSCConfig|null} [vpcscConfig] UpdateVPCSCConfigRequest vpcscConfig\n * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateVPCSCConfigRequest updateMask\n */\n \n /**\n * Constructs a new UpdateVPCSCConfigRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an UpdateVPCSCConfigRequest.\n * @implements IUpdateVPCSCConfigRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IUpdateVPCSCConfigRequest=} [properties] Properties to set\n */\n function UpdateVPCSCConfigRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * UpdateVPCSCConfigRequest vpcscConfig.\n * @member {google.devtools.artifactregistry.v1.IVPCSCConfig|null|undefined} vpcscConfig\n * @memberof google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest\n * @instance\n */\n UpdateVPCSCConfigRequest.prototype.vpcscConfig = null;\n \n /**\n * UpdateVPCSCConfigRequest updateMask.\n * @member {google.protobuf.IFieldMask|null|undefined} updateMask\n * @memberof google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest\n * @instance\n */\n UpdateVPCSCConfigRequest.prototype.updateMask = null;\n \n /**\n * Creates a new UpdateVPCSCConfigRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateVPCSCConfigRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest} UpdateVPCSCConfigRequest instance\n */\n UpdateVPCSCConfigRequest.create = function create(properties) {\n return new UpdateVPCSCConfigRequest(properties);\n };\n \n /**\n * Encodes the specified UpdateVPCSCConfigRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateVPCSCConfigRequest} message UpdateVPCSCConfigRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateVPCSCConfigRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.vpcscConfig != null && Object.hasOwnProperty.call(message, \"vpcscConfig\"))\n $root.google.devtools.artifactregistry.v1.VPCSCConfig.encode(message.vpcscConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.updateMask != null && Object.hasOwnProperty.call(message, \"updateMask\"))\n $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified UpdateVPCSCConfigRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IUpdateVPCSCConfigRequest} message UpdateVPCSCConfigRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateVPCSCConfigRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an UpdateVPCSCConfigRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest} UpdateVPCSCConfigRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateVPCSCConfigRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.vpcscConfig = $root.google.devtools.artifactregistry.v1.VPCSCConfig.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an UpdateVPCSCConfigRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest} UpdateVPCSCConfigRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateVPCSCConfigRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an UpdateVPCSCConfigRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n UpdateVPCSCConfigRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.vpcscConfig != null && message.hasOwnProperty(\"vpcscConfig\")) {\n var error = $root.google.devtools.artifactregistry.v1.VPCSCConfig.verify(message.vpcscConfig);\n if (error)\n return \"vpcscConfig.\" + error;\n }\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\")) {\n var error = $root.google.protobuf.FieldMask.verify(message.updateMask);\n if (error)\n return \"updateMask.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an UpdateVPCSCConfigRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest} UpdateVPCSCConfigRequest\n */\n UpdateVPCSCConfigRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest();\n if (object.vpcscConfig != null) {\n if (typeof object.vpcscConfig !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest.vpcscConfig: object expected\");\n message.vpcscConfig = $root.google.devtools.artifactregistry.v1.VPCSCConfig.fromObject(object.vpcscConfig);\n }\n if (object.updateMask != null) {\n if (typeof object.updateMask !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest.updateMask: object expected\");\n message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an UpdateVPCSCConfigRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest} message UpdateVPCSCConfigRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n UpdateVPCSCConfigRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.vpcscConfig = null;\n object.updateMask = null;\n }\n if (message.vpcscConfig != null && message.hasOwnProperty(\"vpcscConfig\"))\n object.vpcscConfig = $root.google.devtools.artifactregistry.v1.VPCSCConfig.toObject(message.vpcscConfig, options);\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\"))\n object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);\n return object;\n };\n \n /**\n * Converts this UpdateVPCSCConfigRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest\n * @instance\n * @returns {Object.} JSON object\n */\n UpdateVPCSCConfigRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for UpdateVPCSCConfigRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n UpdateVPCSCConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest\";\n };\n \n return UpdateVPCSCConfigRequest;\n })();\n \n v1.YumArtifact = (function() {\n \n /**\n * Properties of a YumArtifact.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IYumArtifact\n * @property {string|null} [name] YumArtifact name\n * @property {string|null} [packageName] YumArtifact packageName\n * @property {google.devtools.artifactregistry.v1.YumArtifact.PackageType|null} [packageType] YumArtifact packageType\n * @property {string|null} [architecture] YumArtifact architecture\n */\n \n /**\n * Constructs a new YumArtifact.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents a YumArtifact.\n * @implements IYumArtifact\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IYumArtifact=} [properties] Properties to set\n */\n function YumArtifact(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * YumArtifact name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1.YumArtifact\n * @instance\n */\n YumArtifact.prototype.name = \"\";\n \n /**\n * YumArtifact packageName.\n * @member {string} packageName\n * @memberof google.devtools.artifactregistry.v1.YumArtifact\n * @instance\n */\n YumArtifact.prototype.packageName = \"\";\n \n /**\n * YumArtifact packageType.\n * @member {google.devtools.artifactregistry.v1.YumArtifact.PackageType} packageType\n * @memberof google.devtools.artifactregistry.v1.YumArtifact\n * @instance\n */\n YumArtifact.prototype.packageType = 0;\n \n /**\n * YumArtifact architecture.\n * @member {string} architecture\n * @memberof google.devtools.artifactregistry.v1.YumArtifact\n * @instance\n */\n YumArtifact.prototype.architecture = \"\";\n \n /**\n * Creates a new YumArtifact instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.YumArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.IYumArtifact=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.YumArtifact} YumArtifact instance\n */\n YumArtifact.create = function create(properties) {\n return new YumArtifact(properties);\n };\n \n /**\n * Encodes the specified YumArtifact message. Does not implicitly {@link google.devtools.artifactregistry.v1.YumArtifact.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.YumArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.IYumArtifact} message YumArtifact message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n YumArtifact.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.packageName != null && Object.hasOwnProperty.call(message, \"packageName\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.packageName);\n if (message.packageType != null && Object.hasOwnProperty.call(message, \"packageType\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.packageType);\n if (message.architecture != null && Object.hasOwnProperty.call(message, \"architecture\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.architecture);\n return writer;\n };\n \n /**\n * Encodes the specified YumArtifact message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.YumArtifact.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.YumArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.IYumArtifact} message YumArtifact message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n YumArtifact.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a YumArtifact message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.YumArtifact\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.YumArtifact} YumArtifact\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n YumArtifact.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.YumArtifact();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.packageName = reader.string();\n break;\n }\n case 3: {\n message.packageType = reader.int32();\n break;\n }\n case 4: {\n message.architecture = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a YumArtifact message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.YumArtifact\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.YumArtifact} YumArtifact\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n YumArtifact.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a YumArtifact message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.YumArtifact\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n YumArtifact.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.packageName != null && message.hasOwnProperty(\"packageName\"))\n if (!$util.isString(message.packageName))\n return \"packageName: string expected\";\n if (message.packageType != null && message.hasOwnProperty(\"packageType\"))\n switch (message.packageType) {\n default:\n return \"packageType: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.architecture != null && message.hasOwnProperty(\"architecture\"))\n if (!$util.isString(message.architecture))\n return \"architecture: string expected\";\n return null;\n };\n \n /**\n * Creates a YumArtifact message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.YumArtifact\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.YumArtifact} YumArtifact\n */\n YumArtifact.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.YumArtifact)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.YumArtifact();\n if (object.name != null)\n message.name = String(object.name);\n if (object.packageName != null)\n message.packageName = String(object.packageName);\n switch (object.packageType) {\n default:\n if (typeof object.packageType === \"number\") {\n message.packageType = object.packageType;\n break;\n }\n break;\n case \"PACKAGE_TYPE_UNSPECIFIED\":\n case 0:\n message.packageType = 0;\n break;\n case \"BINARY\":\n case 1:\n message.packageType = 1;\n break;\n case \"SOURCE\":\n case 2:\n message.packageType = 2;\n break;\n }\n if (object.architecture != null)\n message.architecture = String(object.architecture);\n return message;\n };\n \n /**\n * Creates a plain object from a YumArtifact message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.YumArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1.YumArtifact} message YumArtifact\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n YumArtifact.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.packageName = \"\";\n object.packageType = options.enums === String ? \"PACKAGE_TYPE_UNSPECIFIED\" : 0;\n object.architecture = \"\";\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.packageName != null && message.hasOwnProperty(\"packageName\"))\n object.packageName = message.packageName;\n if (message.packageType != null && message.hasOwnProperty(\"packageType\"))\n object.packageType = options.enums === String ? $root.google.devtools.artifactregistry.v1.YumArtifact.PackageType[message.packageType] === undefined ? message.packageType : $root.google.devtools.artifactregistry.v1.YumArtifact.PackageType[message.packageType] : message.packageType;\n if (message.architecture != null && message.hasOwnProperty(\"architecture\"))\n object.architecture = message.architecture;\n return object;\n };\n \n /**\n * Converts this YumArtifact to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.YumArtifact\n * @instance\n * @returns {Object.} JSON object\n */\n YumArtifact.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for YumArtifact\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.YumArtifact\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n YumArtifact.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.YumArtifact\";\n };\n \n /**\n * PackageType enum.\n * @name google.devtools.artifactregistry.v1.YumArtifact.PackageType\n * @enum {number}\n * @property {number} PACKAGE_TYPE_UNSPECIFIED=0 PACKAGE_TYPE_UNSPECIFIED value\n * @property {number} BINARY=1 BINARY value\n * @property {number} SOURCE=2 SOURCE value\n */\n YumArtifact.PackageType = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"PACKAGE_TYPE_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"BINARY\"] = 1;\n values[valuesById[2] = \"SOURCE\"] = 2;\n return values;\n })();\n \n return YumArtifact;\n })();\n \n v1.ImportYumArtifactsGcsSource = (function() {\n \n /**\n * Properties of an ImportYumArtifactsGcsSource.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IImportYumArtifactsGcsSource\n * @property {Array.|null} [uris] ImportYumArtifactsGcsSource uris\n * @property {boolean|null} [useWildcards] ImportYumArtifactsGcsSource useWildcards\n */\n \n /**\n * Constructs a new ImportYumArtifactsGcsSource.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an ImportYumArtifactsGcsSource.\n * @implements IImportYumArtifactsGcsSource\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsGcsSource=} [properties] Properties to set\n */\n function ImportYumArtifactsGcsSource(properties) {\n this.uris = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportYumArtifactsGcsSource uris.\n * @member {Array.} uris\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource\n * @instance\n */\n ImportYumArtifactsGcsSource.prototype.uris = $util.emptyArray;\n \n /**\n * ImportYumArtifactsGcsSource useWildcards.\n * @member {boolean} useWildcards\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource\n * @instance\n */\n ImportYumArtifactsGcsSource.prototype.useWildcards = false;\n \n /**\n * Creates a new ImportYumArtifactsGcsSource instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsGcsSource=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource} ImportYumArtifactsGcsSource instance\n */\n ImportYumArtifactsGcsSource.create = function create(properties) {\n return new ImportYumArtifactsGcsSource(properties);\n };\n \n /**\n * Encodes the specified ImportYumArtifactsGcsSource message. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsGcsSource} message ImportYumArtifactsGcsSource message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsGcsSource.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.uris != null && message.uris.length)\n for (var i = 0; i < message.uris.length; ++i)\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.uris[i]);\n if (message.useWildcards != null && Object.hasOwnProperty.call(message, \"useWildcards\"))\n writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useWildcards);\n return writer;\n };\n \n /**\n * Encodes the specified ImportYumArtifactsGcsSource message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsGcsSource} message ImportYumArtifactsGcsSource message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsGcsSource.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportYumArtifactsGcsSource message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource} ImportYumArtifactsGcsSource\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsGcsSource.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.uris && message.uris.length))\n message.uris = [];\n message.uris.push(reader.string());\n break;\n }\n case 2: {\n message.useWildcards = reader.bool();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportYumArtifactsGcsSource message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource} ImportYumArtifactsGcsSource\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsGcsSource.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportYumArtifactsGcsSource message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportYumArtifactsGcsSource.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.uris != null && message.hasOwnProperty(\"uris\")) {\n if (!Array.isArray(message.uris))\n return \"uris: array expected\";\n for (var i = 0; i < message.uris.length; ++i)\n if (!$util.isString(message.uris[i]))\n return \"uris: string[] expected\";\n }\n if (message.useWildcards != null && message.hasOwnProperty(\"useWildcards\"))\n if (typeof message.useWildcards !== \"boolean\")\n return \"useWildcards: boolean expected\";\n return null;\n };\n \n /**\n * Creates an ImportYumArtifactsGcsSource message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource} ImportYumArtifactsGcsSource\n */\n ImportYumArtifactsGcsSource.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource();\n if (object.uris) {\n if (!Array.isArray(object.uris))\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource.uris: array expected\");\n message.uris = [];\n for (var i = 0; i < object.uris.length; ++i)\n message.uris[i] = String(object.uris[i]);\n }\n if (object.useWildcards != null)\n message.useWildcards = Boolean(object.useWildcards);\n return message;\n };\n \n /**\n * Creates a plain object from an ImportYumArtifactsGcsSource message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource} message ImportYumArtifactsGcsSource\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportYumArtifactsGcsSource.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.uris = [];\n if (options.defaults)\n object.useWildcards = false;\n if (message.uris && message.uris.length) {\n object.uris = [];\n for (var j = 0; j < message.uris.length; ++j)\n object.uris[j] = message.uris[j];\n }\n if (message.useWildcards != null && message.hasOwnProperty(\"useWildcards\"))\n object.useWildcards = message.useWildcards;\n return object;\n };\n \n /**\n * Converts this ImportYumArtifactsGcsSource to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource\n * @instance\n * @returns {Object.} JSON object\n */\n ImportYumArtifactsGcsSource.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportYumArtifactsGcsSource\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportYumArtifactsGcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource\";\n };\n \n return ImportYumArtifactsGcsSource;\n })();\n \n v1.ImportYumArtifactsRequest = (function() {\n \n /**\n * Properties of an ImportYumArtifactsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IImportYumArtifactsRequest\n * @property {google.devtools.artifactregistry.v1.IImportYumArtifactsGcsSource|null} [gcsSource] ImportYumArtifactsRequest gcsSource\n * @property {string|null} [parent] ImportYumArtifactsRequest parent\n */\n \n /**\n * Constructs a new ImportYumArtifactsRequest.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an ImportYumArtifactsRequest.\n * @implements IImportYumArtifactsRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsRequest=} [properties] Properties to set\n */\n function ImportYumArtifactsRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportYumArtifactsRequest gcsSource.\n * @member {google.devtools.artifactregistry.v1.IImportYumArtifactsGcsSource|null|undefined} gcsSource\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsRequest\n * @instance\n */\n ImportYumArtifactsRequest.prototype.gcsSource = null;\n \n /**\n * ImportYumArtifactsRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsRequest\n * @instance\n */\n ImportYumArtifactsRequest.prototype.parent = \"\";\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * ImportYumArtifactsRequest source.\n * @member {\"gcsSource\"|undefined} source\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsRequest\n * @instance\n */\n Object.defineProperty(ImportYumArtifactsRequest.prototype, \"source\", {\n get: $util.oneOfGetter($oneOfFields = [\"gcsSource\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new ImportYumArtifactsRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsRequest} ImportYumArtifactsRequest instance\n */\n ImportYumArtifactsRequest.create = function create(properties) {\n return new ImportYumArtifactsRequest(properties);\n };\n \n /**\n * Encodes the specified ImportYumArtifactsRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportYumArtifactsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsRequest} message ImportYumArtifactsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.gcsSource != null && Object.hasOwnProperty.call(message, \"gcsSource\"))\n $root.google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ImportYumArtifactsRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportYumArtifactsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsRequest} message ImportYumArtifactsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportYumArtifactsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsRequest} ImportYumArtifactsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ImportYumArtifactsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n message.gcsSource = $root.google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource.decode(reader, reader.uint32());\n break;\n }\n case 1: {\n message.parent = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportYumArtifactsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsRequest} ImportYumArtifactsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportYumArtifactsRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportYumArtifactsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n properties.source = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource.verify(message.gcsSource);\n if (error)\n return \"gcsSource.\" + error;\n }\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n return null;\n };\n \n /**\n * Creates an ImportYumArtifactsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsRequest} ImportYumArtifactsRequest\n */\n ImportYumArtifactsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ImportYumArtifactsRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ImportYumArtifactsRequest();\n if (object.gcsSource != null) {\n if (typeof object.gcsSource !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportYumArtifactsRequest.gcsSource: object expected\");\n message.gcsSource = $root.google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource.fromObject(object.gcsSource);\n }\n if (object.parent != null)\n message.parent = String(object.parent);\n return message;\n };\n \n /**\n * Creates a plain object from an ImportYumArtifactsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1.ImportYumArtifactsRequest} message ImportYumArtifactsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportYumArtifactsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.parent = \"\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n object.gcsSource = $root.google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource.toObject(message.gcsSource, options);\n if (options.oneofs)\n object.source = \"gcsSource\";\n }\n return object;\n };\n \n /**\n * Converts this ImportYumArtifactsRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ImportYumArtifactsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportYumArtifactsRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportYumArtifactsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ImportYumArtifactsRequest\";\n };\n \n return ImportYumArtifactsRequest;\n })();\n \n v1.ImportYumArtifactsErrorInfo = (function() {\n \n /**\n * Properties of an ImportYumArtifactsErrorInfo.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IImportYumArtifactsErrorInfo\n * @property {google.devtools.artifactregistry.v1.IImportYumArtifactsGcsSource|null} [gcsSource] ImportYumArtifactsErrorInfo gcsSource\n * @property {google.rpc.IStatus|null} [error] ImportYumArtifactsErrorInfo error\n */\n \n /**\n * Constructs a new ImportYumArtifactsErrorInfo.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an ImportYumArtifactsErrorInfo.\n * @implements IImportYumArtifactsErrorInfo\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsErrorInfo=} [properties] Properties to set\n */\n function ImportYumArtifactsErrorInfo(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportYumArtifactsErrorInfo gcsSource.\n * @member {google.devtools.artifactregistry.v1.IImportYumArtifactsGcsSource|null|undefined} gcsSource\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo\n * @instance\n */\n ImportYumArtifactsErrorInfo.prototype.gcsSource = null;\n \n /**\n * ImportYumArtifactsErrorInfo error.\n * @member {google.rpc.IStatus|null|undefined} error\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo\n * @instance\n */\n ImportYumArtifactsErrorInfo.prototype.error = null;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * ImportYumArtifactsErrorInfo source.\n * @member {\"gcsSource\"|undefined} source\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo\n * @instance\n */\n Object.defineProperty(ImportYumArtifactsErrorInfo.prototype, \"source\", {\n get: $util.oneOfGetter($oneOfFields = [\"gcsSource\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new ImportYumArtifactsErrorInfo instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsErrorInfo=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo} ImportYumArtifactsErrorInfo instance\n */\n ImportYumArtifactsErrorInfo.create = function create(properties) {\n return new ImportYumArtifactsErrorInfo(properties);\n };\n \n /**\n * Encodes the specified ImportYumArtifactsErrorInfo message. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsErrorInfo} message ImportYumArtifactsErrorInfo message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsErrorInfo.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.gcsSource != null && Object.hasOwnProperty.call(message, \"gcsSource\"))\n $root.google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.error != null && Object.hasOwnProperty.call(message, \"error\"))\n $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ImportYumArtifactsErrorInfo message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsErrorInfo} message ImportYumArtifactsErrorInfo message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsErrorInfo.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportYumArtifactsErrorInfo message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo} ImportYumArtifactsErrorInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsErrorInfo.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.gcsSource = $root.google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.error = $root.google.rpc.Status.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportYumArtifactsErrorInfo message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo} ImportYumArtifactsErrorInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsErrorInfo.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportYumArtifactsErrorInfo message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportYumArtifactsErrorInfo.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n properties.source = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource.verify(message.gcsSource);\n if (error)\n return \"gcsSource.\" + error;\n }\n }\n if (message.error != null && message.hasOwnProperty(\"error\")) {\n var error = $root.google.rpc.Status.verify(message.error);\n if (error)\n return \"error.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an ImportYumArtifactsErrorInfo message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo} ImportYumArtifactsErrorInfo\n */\n ImportYumArtifactsErrorInfo.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo();\n if (object.gcsSource != null) {\n if (typeof object.gcsSource !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo.gcsSource: object expected\");\n message.gcsSource = $root.google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource.fromObject(object.gcsSource);\n }\n if (object.error != null) {\n if (typeof object.error !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo.error: object expected\");\n message.error = $root.google.rpc.Status.fromObject(object.error);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an ImportYumArtifactsErrorInfo message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo} message ImportYumArtifactsErrorInfo\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportYumArtifactsErrorInfo.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.error = null;\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n object.gcsSource = $root.google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource.toObject(message.gcsSource, options);\n if (options.oneofs)\n object.source = \"gcsSource\";\n }\n if (message.error != null && message.hasOwnProperty(\"error\"))\n object.error = $root.google.rpc.Status.toObject(message.error, options);\n return object;\n };\n \n /**\n * Converts this ImportYumArtifactsErrorInfo to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo\n * @instance\n * @returns {Object.} JSON object\n */\n ImportYumArtifactsErrorInfo.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportYumArtifactsErrorInfo\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportYumArtifactsErrorInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo\";\n };\n \n return ImportYumArtifactsErrorInfo;\n })();\n \n v1.ImportYumArtifactsResponse = (function() {\n \n /**\n * Properties of an ImportYumArtifactsResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IImportYumArtifactsResponse\n * @property {Array.|null} [yumArtifacts] ImportYumArtifactsResponse yumArtifacts\n * @property {Array.|null} [errors] ImportYumArtifactsResponse errors\n */\n \n /**\n * Constructs a new ImportYumArtifactsResponse.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an ImportYumArtifactsResponse.\n * @implements IImportYumArtifactsResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsResponse=} [properties] Properties to set\n */\n function ImportYumArtifactsResponse(properties) {\n this.yumArtifacts = [];\n this.errors = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportYumArtifactsResponse yumArtifacts.\n * @member {Array.} yumArtifacts\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsResponse\n * @instance\n */\n ImportYumArtifactsResponse.prototype.yumArtifacts = $util.emptyArray;\n \n /**\n * ImportYumArtifactsResponse errors.\n * @member {Array.} errors\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsResponse\n * @instance\n */\n ImportYumArtifactsResponse.prototype.errors = $util.emptyArray;\n \n /**\n * Creates a new ImportYumArtifactsResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsResponse} ImportYumArtifactsResponse instance\n */\n ImportYumArtifactsResponse.create = function create(properties) {\n return new ImportYumArtifactsResponse(properties);\n };\n \n /**\n * Encodes the specified ImportYumArtifactsResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportYumArtifactsResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsResponse} message ImportYumArtifactsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.yumArtifacts != null && message.yumArtifacts.length)\n for (var i = 0; i < message.yumArtifacts.length; ++i)\n $root.google.devtools.artifactregistry.v1.YumArtifact.encode(message.yumArtifacts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.errors != null && message.errors.length)\n for (var i = 0; i < message.errors.length; ++i)\n $root.google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo.encode(message.errors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ImportYumArtifactsResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportYumArtifactsResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsResponse} message ImportYumArtifactsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportYumArtifactsResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsResponse} ImportYumArtifactsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ImportYumArtifactsResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.yumArtifacts && message.yumArtifacts.length))\n message.yumArtifacts = [];\n message.yumArtifacts.push($root.google.devtools.artifactregistry.v1.YumArtifact.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n if (!(message.errors && message.errors.length))\n message.errors = [];\n message.errors.push($root.google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportYumArtifactsResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsResponse} ImportYumArtifactsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportYumArtifactsResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportYumArtifactsResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.yumArtifacts != null && message.hasOwnProperty(\"yumArtifacts\")) {\n if (!Array.isArray(message.yumArtifacts))\n return \"yumArtifacts: array expected\";\n for (var i = 0; i < message.yumArtifacts.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.YumArtifact.verify(message.yumArtifacts[i]);\n if (error)\n return \"yumArtifacts.\" + error;\n }\n }\n if (message.errors != null && message.hasOwnProperty(\"errors\")) {\n if (!Array.isArray(message.errors))\n return \"errors: array expected\";\n for (var i = 0; i < message.errors.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo.verify(message.errors[i]);\n if (error)\n return \"errors.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates an ImportYumArtifactsResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsResponse} ImportYumArtifactsResponse\n */\n ImportYumArtifactsResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ImportYumArtifactsResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1.ImportYumArtifactsResponse();\n if (object.yumArtifacts) {\n if (!Array.isArray(object.yumArtifacts))\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportYumArtifactsResponse.yumArtifacts: array expected\");\n message.yumArtifacts = [];\n for (var i = 0; i < object.yumArtifacts.length; ++i) {\n if (typeof object.yumArtifacts[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportYumArtifactsResponse.yumArtifacts: object expected\");\n message.yumArtifacts[i] = $root.google.devtools.artifactregistry.v1.YumArtifact.fromObject(object.yumArtifacts[i]);\n }\n }\n if (object.errors) {\n if (!Array.isArray(object.errors))\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportYumArtifactsResponse.errors: array expected\");\n message.errors = [];\n for (var i = 0; i < object.errors.length; ++i) {\n if (typeof object.errors[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1.ImportYumArtifactsResponse.errors: object expected\");\n message.errors[i] = $root.google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo.fromObject(object.errors[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from an ImportYumArtifactsResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1.ImportYumArtifactsResponse} message ImportYumArtifactsResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportYumArtifactsResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.yumArtifacts = [];\n object.errors = [];\n }\n if (message.yumArtifacts && message.yumArtifacts.length) {\n object.yumArtifacts = [];\n for (var j = 0; j < message.yumArtifacts.length; ++j)\n object.yumArtifacts[j] = $root.google.devtools.artifactregistry.v1.YumArtifact.toObject(message.yumArtifacts[j], options);\n }\n if (message.errors && message.errors.length) {\n object.errors = [];\n for (var j = 0; j < message.errors.length; ++j)\n object.errors[j] = $root.google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo.toObject(message.errors[j], options);\n }\n return object;\n };\n \n /**\n * Converts this ImportYumArtifactsResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ImportYumArtifactsResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportYumArtifactsResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportYumArtifactsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ImportYumArtifactsResponse\";\n };\n \n return ImportYumArtifactsResponse;\n })();\n \n v1.ImportYumArtifactsMetadata = (function() {\n \n /**\n * Properties of an ImportYumArtifactsMetadata.\n * @memberof google.devtools.artifactregistry.v1\n * @interface IImportYumArtifactsMetadata\n */\n \n /**\n * Constructs a new ImportYumArtifactsMetadata.\n * @memberof google.devtools.artifactregistry.v1\n * @classdesc Represents an ImportYumArtifactsMetadata.\n * @implements IImportYumArtifactsMetadata\n * @constructor\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsMetadata=} [properties] Properties to set\n */\n function ImportYumArtifactsMetadata(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Creates a new ImportYumArtifactsMetadata instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsMetadata=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata} ImportYumArtifactsMetadata instance\n */\n ImportYumArtifactsMetadata.create = function create(properties) {\n return new ImportYumArtifactsMetadata(properties);\n };\n \n /**\n * Encodes the specified ImportYumArtifactsMetadata message. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsMetadata} message ImportYumArtifactsMetadata message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsMetadata.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n return writer;\n };\n \n /**\n * Encodes the specified ImportYumArtifactsMetadata message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.IImportYumArtifactsMetadata} message ImportYumArtifactsMetadata message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsMetadata.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportYumArtifactsMetadata message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata} ImportYumArtifactsMetadata\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsMetadata.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportYumArtifactsMetadata message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata} ImportYumArtifactsMetadata\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsMetadata.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportYumArtifactsMetadata message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportYumArtifactsMetadata.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n return null;\n };\n \n /**\n * Creates an ImportYumArtifactsMetadata message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata} ImportYumArtifactsMetadata\n */\n ImportYumArtifactsMetadata.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata)\n return object;\n return new $root.google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata();\n };\n \n /**\n * Creates a plain object from an ImportYumArtifactsMetadata message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata} message ImportYumArtifactsMetadata\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportYumArtifactsMetadata.toObject = function toObject() {\n return {};\n };\n \n /**\n * Converts this ImportYumArtifactsMetadata to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata\n * @instance\n * @returns {Object.} JSON object\n */\n ImportYumArtifactsMetadata.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportYumArtifactsMetadata\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportYumArtifactsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata\";\n };\n \n return ImportYumArtifactsMetadata;\n })();\n \n return v1;\n })();\n \n artifactregistry.v1beta2 = (function() {\n \n /**\n * Namespace v1beta2.\n * @memberof google.devtools.artifactregistry\n * @namespace\n */\n var v1beta2 = {};\n \n v1beta2.AptArtifact = (function() {\n \n /**\n * Properties of an AptArtifact.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IAptArtifact\n * @property {string|null} [name] AptArtifact name\n * @property {string|null} [packageName] AptArtifact packageName\n * @property {google.devtools.artifactregistry.v1beta2.AptArtifact.PackageType|null} [packageType] AptArtifact packageType\n * @property {string|null} [architecture] AptArtifact architecture\n * @property {string|null} [component] AptArtifact component\n * @property {Uint8Array|null} [controlFile] AptArtifact controlFile\n */\n \n /**\n * Constructs a new AptArtifact.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an AptArtifact.\n * @implements IAptArtifact\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IAptArtifact=} [properties] Properties to set\n */\n function AptArtifact(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * AptArtifact name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @instance\n */\n AptArtifact.prototype.name = \"\";\n \n /**\n * AptArtifact packageName.\n * @member {string} packageName\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @instance\n */\n AptArtifact.prototype.packageName = \"\";\n \n /**\n * AptArtifact packageType.\n * @member {google.devtools.artifactregistry.v1beta2.AptArtifact.PackageType} packageType\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @instance\n */\n AptArtifact.prototype.packageType = 0;\n \n /**\n * AptArtifact architecture.\n * @member {string} architecture\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @instance\n */\n AptArtifact.prototype.architecture = \"\";\n \n /**\n * AptArtifact component.\n * @member {string} component\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @instance\n */\n AptArtifact.prototype.component = \"\";\n \n /**\n * AptArtifact controlFile.\n * @member {Uint8Array} controlFile\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @instance\n */\n AptArtifact.prototype.controlFile = $util.newBuffer([]);\n \n /**\n * Creates a new AptArtifact instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IAptArtifact=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.AptArtifact} AptArtifact instance\n */\n AptArtifact.create = function create(properties) {\n return new AptArtifact(properties);\n };\n \n /**\n * Encodes the specified AptArtifact message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.AptArtifact.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IAptArtifact} message AptArtifact message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n AptArtifact.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.packageName != null && Object.hasOwnProperty.call(message, \"packageName\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.packageName);\n if (message.packageType != null && Object.hasOwnProperty.call(message, \"packageType\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.packageType);\n if (message.architecture != null && Object.hasOwnProperty.call(message, \"architecture\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.architecture);\n if (message.component != null && Object.hasOwnProperty.call(message, \"component\"))\n writer.uint32(/* id 5, wireType 2 =*/42).string(message.component);\n if (message.controlFile != null && Object.hasOwnProperty.call(message, \"controlFile\"))\n writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.controlFile);\n return writer;\n };\n \n /**\n * Encodes the specified AptArtifact message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.AptArtifact.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IAptArtifact} message AptArtifact message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n AptArtifact.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an AptArtifact message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.AptArtifact} AptArtifact\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n AptArtifact.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.AptArtifact();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.packageName = reader.string();\n break;\n }\n case 3: {\n message.packageType = reader.int32();\n break;\n }\n case 4: {\n message.architecture = reader.string();\n break;\n }\n case 5: {\n message.component = reader.string();\n break;\n }\n case 6: {\n message.controlFile = reader.bytes();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an AptArtifact message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.AptArtifact} AptArtifact\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n AptArtifact.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an AptArtifact message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n AptArtifact.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.packageName != null && message.hasOwnProperty(\"packageName\"))\n if (!$util.isString(message.packageName))\n return \"packageName: string expected\";\n if (message.packageType != null && message.hasOwnProperty(\"packageType\"))\n switch (message.packageType) {\n default:\n return \"packageType: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.architecture != null && message.hasOwnProperty(\"architecture\"))\n if (!$util.isString(message.architecture))\n return \"architecture: string expected\";\n if (message.component != null && message.hasOwnProperty(\"component\"))\n if (!$util.isString(message.component))\n return \"component: string expected\";\n if (message.controlFile != null && message.hasOwnProperty(\"controlFile\"))\n if (!(message.controlFile && typeof message.controlFile.length === \"number\" || $util.isString(message.controlFile)))\n return \"controlFile: buffer expected\";\n return null;\n };\n \n /**\n * Creates an AptArtifact message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.AptArtifact} AptArtifact\n */\n AptArtifact.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.AptArtifact)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.AptArtifact();\n if (object.name != null)\n message.name = String(object.name);\n if (object.packageName != null)\n message.packageName = String(object.packageName);\n switch (object.packageType) {\n default:\n if (typeof object.packageType === \"number\") {\n message.packageType = object.packageType;\n break;\n }\n break;\n case \"PACKAGE_TYPE_UNSPECIFIED\":\n case 0:\n message.packageType = 0;\n break;\n case \"BINARY\":\n case 1:\n message.packageType = 1;\n break;\n case \"SOURCE\":\n case 2:\n message.packageType = 2;\n break;\n }\n if (object.architecture != null)\n message.architecture = String(object.architecture);\n if (object.component != null)\n message.component = String(object.component);\n if (object.controlFile != null)\n if (typeof object.controlFile === \"string\")\n $util.base64.decode(object.controlFile, message.controlFile = $util.newBuffer($util.base64.length(object.controlFile)), 0);\n else if (object.controlFile.length >= 0)\n message.controlFile = object.controlFile;\n return message;\n };\n \n /**\n * Creates a plain object from an AptArtifact message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.AptArtifact} message AptArtifact\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n AptArtifact.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.packageName = \"\";\n object.packageType = options.enums === String ? \"PACKAGE_TYPE_UNSPECIFIED\" : 0;\n object.architecture = \"\";\n object.component = \"\";\n if (options.bytes === String)\n object.controlFile = \"\";\n else {\n object.controlFile = [];\n if (options.bytes !== Array)\n object.controlFile = $util.newBuffer(object.controlFile);\n }\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.packageName != null && message.hasOwnProperty(\"packageName\"))\n object.packageName = message.packageName;\n if (message.packageType != null && message.hasOwnProperty(\"packageType\"))\n object.packageType = options.enums === String ? $root.google.devtools.artifactregistry.v1beta2.AptArtifact.PackageType[message.packageType] === undefined ? message.packageType : $root.google.devtools.artifactregistry.v1beta2.AptArtifact.PackageType[message.packageType] : message.packageType;\n if (message.architecture != null && message.hasOwnProperty(\"architecture\"))\n object.architecture = message.architecture;\n if (message.component != null && message.hasOwnProperty(\"component\"))\n object.component = message.component;\n if (message.controlFile != null && message.hasOwnProperty(\"controlFile\"))\n object.controlFile = options.bytes === String ? $util.base64.encode(message.controlFile, 0, message.controlFile.length) : options.bytes === Array ? Array.prototype.slice.call(message.controlFile) : message.controlFile;\n return object;\n };\n \n /**\n * Converts this AptArtifact to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @instance\n * @returns {Object.} JSON object\n */\n AptArtifact.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for AptArtifact\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.AptArtifact\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n AptArtifact.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.AptArtifact\";\n };\n \n /**\n * PackageType enum.\n * @name google.devtools.artifactregistry.v1beta2.AptArtifact.PackageType\n * @enum {number}\n * @property {number} PACKAGE_TYPE_UNSPECIFIED=0 PACKAGE_TYPE_UNSPECIFIED value\n * @property {number} BINARY=1 BINARY value\n * @property {number} SOURCE=2 SOURCE value\n */\n AptArtifact.PackageType = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"PACKAGE_TYPE_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"BINARY\"] = 1;\n values[valuesById[2] = \"SOURCE\"] = 2;\n return values;\n })();\n \n return AptArtifact;\n })();\n \n v1beta2.ImportAptArtifactsGcsSource = (function() {\n \n /**\n * Properties of an ImportAptArtifactsGcsSource.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IImportAptArtifactsGcsSource\n * @property {Array.|null} [uris] ImportAptArtifactsGcsSource uris\n * @property {boolean|null} [useWildcards] ImportAptArtifactsGcsSource useWildcards\n */\n \n /**\n * Constructs a new ImportAptArtifactsGcsSource.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an ImportAptArtifactsGcsSource.\n * @implements IImportAptArtifactsGcsSource\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsGcsSource=} [properties] Properties to set\n */\n function ImportAptArtifactsGcsSource(properties) {\n this.uris = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportAptArtifactsGcsSource uris.\n * @member {Array.} uris\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource\n * @instance\n */\n ImportAptArtifactsGcsSource.prototype.uris = $util.emptyArray;\n \n /**\n * ImportAptArtifactsGcsSource useWildcards.\n * @member {boolean} useWildcards\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource\n * @instance\n */\n ImportAptArtifactsGcsSource.prototype.useWildcards = false;\n \n /**\n * Creates a new ImportAptArtifactsGcsSource instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsGcsSource=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource} ImportAptArtifactsGcsSource instance\n */\n ImportAptArtifactsGcsSource.create = function create(properties) {\n return new ImportAptArtifactsGcsSource(properties);\n };\n \n /**\n * Encodes the specified ImportAptArtifactsGcsSource message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsGcsSource} message ImportAptArtifactsGcsSource message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsGcsSource.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.uris != null && message.uris.length)\n for (var i = 0; i < message.uris.length; ++i)\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.uris[i]);\n if (message.useWildcards != null && Object.hasOwnProperty.call(message, \"useWildcards\"))\n writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useWildcards);\n return writer;\n };\n \n /**\n * Encodes the specified ImportAptArtifactsGcsSource message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsGcsSource} message ImportAptArtifactsGcsSource message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsGcsSource.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportAptArtifactsGcsSource message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource} ImportAptArtifactsGcsSource\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsGcsSource.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.uris && message.uris.length))\n message.uris = [];\n message.uris.push(reader.string());\n break;\n }\n case 2: {\n message.useWildcards = reader.bool();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportAptArtifactsGcsSource message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource} ImportAptArtifactsGcsSource\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsGcsSource.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportAptArtifactsGcsSource message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportAptArtifactsGcsSource.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.uris != null && message.hasOwnProperty(\"uris\")) {\n if (!Array.isArray(message.uris))\n return \"uris: array expected\";\n for (var i = 0; i < message.uris.length; ++i)\n if (!$util.isString(message.uris[i]))\n return \"uris: string[] expected\";\n }\n if (message.useWildcards != null && message.hasOwnProperty(\"useWildcards\"))\n if (typeof message.useWildcards !== \"boolean\")\n return \"useWildcards: boolean expected\";\n return null;\n };\n \n /**\n * Creates an ImportAptArtifactsGcsSource message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource} ImportAptArtifactsGcsSource\n */\n ImportAptArtifactsGcsSource.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource();\n if (object.uris) {\n if (!Array.isArray(object.uris))\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource.uris: array expected\");\n message.uris = [];\n for (var i = 0; i < object.uris.length; ++i)\n message.uris[i] = String(object.uris[i]);\n }\n if (object.useWildcards != null)\n message.useWildcards = Boolean(object.useWildcards);\n return message;\n };\n \n /**\n * Creates a plain object from an ImportAptArtifactsGcsSource message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource} message ImportAptArtifactsGcsSource\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportAptArtifactsGcsSource.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.uris = [];\n if (options.defaults)\n object.useWildcards = false;\n if (message.uris && message.uris.length) {\n object.uris = [];\n for (var j = 0; j < message.uris.length; ++j)\n object.uris[j] = message.uris[j];\n }\n if (message.useWildcards != null && message.hasOwnProperty(\"useWildcards\"))\n object.useWildcards = message.useWildcards;\n return object;\n };\n \n /**\n * Converts this ImportAptArtifactsGcsSource to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource\n * @instance\n * @returns {Object.} JSON object\n */\n ImportAptArtifactsGcsSource.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportAptArtifactsGcsSource\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportAptArtifactsGcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource\";\n };\n \n return ImportAptArtifactsGcsSource;\n })();\n \n v1beta2.ImportAptArtifactsRequest = (function() {\n \n /**\n * Properties of an ImportAptArtifactsRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IImportAptArtifactsRequest\n * @property {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsGcsSource|null} [gcsSource] ImportAptArtifactsRequest gcsSource\n * @property {string|null} [parent] ImportAptArtifactsRequest parent\n */\n \n /**\n * Constructs a new ImportAptArtifactsRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an ImportAptArtifactsRequest.\n * @implements IImportAptArtifactsRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsRequest=} [properties] Properties to set\n */\n function ImportAptArtifactsRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportAptArtifactsRequest gcsSource.\n * @member {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsGcsSource|null|undefined} gcsSource\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest\n * @instance\n */\n ImportAptArtifactsRequest.prototype.gcsSource = null;\n \n /**\n * ImportAptArtifactsRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest\n * @instance\n */\n ImportAptArtifactsRequest.prototype.parent = \"\";\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * ImportAptArtifactsRequest source.\n * @member {\"gcsSource\"|undefined} source\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest\n * @instance\n */\n Object.defineProperty(ImportAptArtifactsRequest.prototype, \"source\", {\n get: $util.oneOfGetter($oneOfFields = [\"gcsSource\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new ImportAptArtifactsRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest} ImportAptArtifactsRequest instance\n */\n ImportAptArtifactsRequest.create = function create(properties) {\n return new ImportAptArtifactsRequest(properties);\n };\n \n /**\n * Encodes the specified ImportAptArtifactsRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsRequest} message ImportAptArtifactsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.gcsSource != null && Object.hasOwnProperty.call(message, \"gcsSource\"))\n $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ImportAptArtifactsRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsRequest} message ImportAptArtifactsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportAptArtifactsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest} ImportAptArtifactsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n message.gcsSource = $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource.decode(reader, reader.uint32());\n break;\n }\n case 1: {\n message.parent = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportAptArtifactsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest} ImportAptArtifactsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportAptArtifactsRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportAptArtifactsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n properties.source = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource.verify(message.gcsSource);\n if (error)\n return \"gcsSource.\" + error;\n }\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n return null;\n };\n \n /**\n * Creates an ImportAptArtifactsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest} ImportAptArtifactsRequest\n */\n ImportAptArtifactsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest();\n if (object.gcsSource != null) {\n if (typeof object.gcsSource !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest.gcsSource: object expected\");\n message.gcsSource = $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource.fromObject(object.gcsSource);\n }\n if (object.parent != null)\n message.parent = String(object.parent);\n return message;\n };\n \n /**\n * Creates a plain object from an ImportAptArtifactsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest} message ImportAptArtifactsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportAptArtifactsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.parent = \"\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n object.gcsSource = $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource.toObject(message.gcsSource, options);\n if (options.oneofs)\n object.source = \"gcsSource\";\n }\n return object;\n };\n \n /**\n * Converts this ImportAptArtifactsRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ImportAptArtifactsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportAptArtifactsRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportAptArtifactsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest\";\n };\n \n return ImportAptArtifactsRequest;\n })();\n \n v1beta2.ImportAptArtifactsErrorInfo = (function() {\n \n /**\n * Properties of an ImportAptArtifactsErrorInfo.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IImportAptArtifactsErrorInfo\n * @property {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsGcsSource|null} [gcsSource] ImportAptArtifactsErrorInfo gcsSource\n * @property {google.rpc.IStatus|null} [error] ImportAptArtifactsErrorInfo error\n */\n \n /**\n * Constructs a new ImportAptArtifactsErrorInfo.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an ImportAptArtifactsErrorInfo.\n * @implements IImportAptArtifactsErrorInfo\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsErrorInfo=} [properties] Properties to set\n */\n function ImportAptArtifactsErrorInfo(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportAptArtifactsErrorInfo gcsSource.\n * @member {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsGcsSource|null|undefined} gcsSource\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo\n * @instance\n */\n ImportAptArtifactsErrorInfo.prototype.gcsSource = null;\n \n /**\n * ImportAptArtifactsErrorInfo error.\n * @member {google.rpc.IStatus|null|undefined} error\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo\n * @instance\n */\n ImportAptArtifactsErrorInfo.prototype.error = null;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * ImportAptArtifactsErrorInfo source.\n * @member {\"gcsSource\"|undefined} source\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo\n * @instance\n */\n Object.defineProperty(ImportAptArtifactsErrorInfo.prototype, \"source\", {\n get: $util.oneOfGetter($oneOfFields = [\"gcsSource\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new ImportAptArtifactsErrorInfo instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsErrorInfo=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo} ImportAptArtifactsErrorInfo instance\n */\n ImportAptArtifactsErrorInfo.create = function create(properties) {\n return new ImportAptArtifactsErrorInfo(properties);\n };\n \n /**\n * Encodes the specified ImportAptArtifactsErrorInfo message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsErrorInfo} message ImportAptArtifactsErrorInfo message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsErrorInfo.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.gcsSource != null && Object.hasOwnProperty.call(message, \"gcsSource\"))\n $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.error != null && Object.hasOwnProperty.call(message, \"error\"))\n $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ImportAptArtifactsErrorInfo message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsErrorInfo} message ImportAptArtifactsErrorInfo message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsErrorInfo.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportAptArtifactsErrorInfo message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo} ImportAptArtifactsErrorInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsErrorInfo.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.gcsSource = $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.error = $root.google.rpc.Status.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportAptArtifactsErrorInfo message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo} ImportAptArtifactsErrorInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsErrorInfo.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportAptArtifactsErrorInfo message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportAptArtifactsErrorInfo.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n properties.source = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource.verify(message.gcsSource);\n if (error)\n return \"gcsSource.\" + error;\n }\n }\n if (message.error != null && message.hasOwnProperty(\"error\")) {\n var error = $root.google.rpc.Status.verify(message.error);\n if (error)\n return \"error.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an ImportAptArtifactsErrorInfo message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo} ImportAptArtifactsErrorInfo\n */\n ImportAptArtifactsErrorInfo.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo();\n if (object.gcsSource != null) {\n if (typeof object.gcsSource !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo.gcsSource: object expected\");\n message.gcsSource = $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource.fromObject(object.gcsSource);\n }\n if (object.error != null) {\n if (typeof object.error !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo.error: object expected\");\n message.error = $root.google.rpc.Status.fromObject(object.error);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an ImportAptArtifactsErrorInfo message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo} message ImportAptArtifactsErrorInfo\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportAptArtifactsErrorInfo.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.error = null;\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n object.gcsSource = $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource.toObject(message.gcsSource, options);\n if (options.oneofs)\n object.source = \"gcsSource\";\n }\n if (message.error != null && message.hasOwnProperty(\"error\"))\n object.error = $root.google.rpc.Status.toObject(message.error, options);\n return object;\n };\n \n /**\n * Converts this ImportAptArtifactsErrorInfo to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo\n * @instance\n * @returns {Object.} JSON object\n */\n ImportAptArtifactsErrorInfo.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportAptArtifactsErrorInfo\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportAptArtifactsErrorInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo\";\n };\n \n return ImportAptArtifactsErrorInfo;\n })();\n \n v1beta2.ImportAptArtifactsResponse = (function() {\n \n /**\n * Properties of an ImportAptArtifactsResponse.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IImportAptArtifactsResponse\n * @property {Array.|null} [aptArtifacts] ImportAptArtifactsResponse aptArtifacts\n * @property {Array.|null} [errors] ImportAptArtifactsResponse errors\n */\n \n /**\n * Constructs a new ImportAptArtifactsResponse.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an ImportAptArtifactsResponse.\n * @implements IImportAptArtifactsResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsResponse=} [properties] Properties to set\n */\n function ImportAptArtifactsResponse(properties) {\n this.aptArtifacts = [];\n this.errors = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportAptArtifactsResponse aptArtifacts.\n * @member {Array.} aptArtifacts\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse\n * @instance\n */\n ImportAptArtifactsResponse.prototype.aptArtifacts = $util.emptyArray;\n \n /**\n * ImportAptArtifactsResponse errors.\n * @member {Array.} errors\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse\n * @instance\n */\n ImportAptArtifactsResponse.prototype.errors = $util.emptyArray;\n \n /**\n * Creates a new ImportAptArtifactsResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse} ImportAptArtifactsResponse instance\n */\n ImportAptArtifactsResponse.create = function create(properties) {\n return new ImportAptArtifactsResponse(properties);\n };\n \n /**\n * Encodes the specified ImportAptArtifactsResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsResponse} message ImportAptArtifactsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.aptArtifacts != null && message.aptArtifacts.length)\n for (var i = 0; i < message.aptArtifacts.length; ++i)\n $root.google.devtools.artifactregistry.v1beta2.AptArtifact.encode(message.aptArtifacts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.errors != null && message.errors.length)\n for (var i = 0; i < message.errors.length; ++i)\n $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo.encode(message.errors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ImportAptArtifactsResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsResponse} message ImportAptArtifactsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportAptArtifactsResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse} ImportAptArtifactsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.aptArtifacts && message.aptArtifacts.length))\n message.aptArtifacts = [];\n message.aptArtifacts.push($root.google.devtools.artifactregistry.v1beta2.AptArtifact.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n if (!(message.errors && message.errors.length))\n message.errors = [];\n message.errors.push($root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportAptArtifactsResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse} ImportAptArtifactsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportAptArtifactsResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportAptArtifactsResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.aptArtifacts != null && message.hasOwnProperty(\"aptArtifacts\")) {\n if (!Array.isArray(message.aptArtifacts))\n return \"aptArtifacts: array expected\";\n for (var i = 0; i < message.aptArtifacts.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1beta2.AptArtifact.verify(message.aptArtifacts[i]);\n if (error)\n return \"aptArtifacts.\" + error;\n }\n }\n if (message.errors != null && message.hasOwnProperty(\"errors\")) {\n if (!Array.isArray(message.errors))\n return \"errors: array expected\";\n for (var i = 0; i < message.errors.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo.verify(message.errors[i]);\n if (error)\n return \"errors.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates an ImportAptArtifactsResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse} ImportAptArtifactsResponse\n */\n ImportAptArtifactsResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse();\n if (object.aptArtifacts) {\n if (!Array.isArray(object.aptArtifacts))\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse.aptArtifacts: array expected\");\n message.aptArtifacts = [];\n for (var i = 0; i < object.aptArtifacts.length; ++i) {\n if (typeof object.aptArtifacts[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse.aptArtifacts: object expected\");\n message.aptArtifacts[i] = $root.google.devtools.artifactregistry.v1beta2.AptArtifact.fromObject(object.aptArtifacts[i]);\n }\n }\n if (object.errors) {\n if (!Array.isArray(object.errors))\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse.errors: array expected\");\n message.errors = [];\n for (var i = 0; i < object.errors.length; ++i) {\n if (typeof object.errors[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse.errors: object expected\");\n message.errors[i] = $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo.fromObject(object.errors[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from an ImportAptArtifactsResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse} message ImportAptArtifactsResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportAptArtifactsResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.aptArtifacts = [];\n object.errors = [];\n }\n if (message.aptArtifacts && message.aptArtifacts.length) {\n object.aptArtifacts = [];\n for (var j = 0; j < message.aptArtifacts.length; ++j)\n object.aptArtifacts[j] = $root.google.devtools.artifactregistry.v1beta2.AptArtifact.toObject(message.aptArtifacts[j], options);\n }\n if (message.errors && message.errors.length) {\n object.errors = [];\n for (var j = 0; j < message.errors.length; ++j)\n object.errors[j] = $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo.toObject(message.errors[j], options);\n }\n return object;\n };\n \n /**\n * Converts this ImportAptArtifactsResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ImportAptArtifactsResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportAptArtifactsResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportAptArtifactsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse\";\n };\n \n return ImportAptArtifactsResponse;\n })();\n \n v1beta2.ImportAptArtifactsMetadata = (function() {\n \n /**\n * Properties of an ImportAptArtifactsMetadata.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IImportAptArtifactsMetadata\n */\n \n /**\n * Constructs a new ImportAptArtifactsMetadata.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an ImportAptArtifactsMetadata.\n * @implements IImportAptArtifactsMetadata\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsMetadata=} [properties] Properties to set\n */\n function ImportAptArtifactsMetadata(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Creates a new ImportAptArtifactsMetadata instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsMetadata=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata} ImportAptArtifactsMetadata instance\n */\n ImportAptArtifactsMetadata.create = function create(properties) {\n return new ImportAptArtifactsMetadata(properties);\n };\n \n /**\n * Encodes the specified ImportAptArtifactsMetadata message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsMetadata} message ImportAptArtifactsMetadata message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsMetadata.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n return writer;\n };\n \n /**\n * Encodes the specified ImportAptArtifactsMetadata message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsMetadata} message ImportAptArtifactsMetadata message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportAptArtifactsMetadata.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportAptArtifactsMetadata message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata} ImportAptArtifactsMetadata\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsMetadata.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportAptArtifactsMetadata message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata} ImportAptArtifactsMetadata\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportAptArtifactsMetadata.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportAptArtifactsMetadata message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportAptArtifactsMetadata.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n return null;\n };\n \n /**\n * Creates an ImportAptArtifactsMetadata message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata} ImportAptArtifactsMetadata\n */\n ImportAptArtifactsMetadata.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata)\n return object;\n return new $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata();\n };\n \n /**\n * Creates a plain object from an ImportAptArtifactsMetadata message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata} message ImportAptArtifactsMetadata\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportAptArtifactsMetadata.toObject = function toObject() {\n return {};\n };\n \n /**\n * Converts this ImportAptArtifactsMetadata to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata\n * @instance\n * @returns {Object.} JSON object\n */\n ImportAptArtifactsMetadata.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportAptArtifactsMetadata\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportAptArtifactsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata\";\n };\n \n return ImportAptArtifactsMetadata;\n })();\n \n v1beta2.Hash = (function() {\n \n /**\n * Properties of a Hash.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IHash\n * @property {google.devtools.artifactregistry.v1beta2.Hash.HashType|null} [type] Hash type\n * @property {Uint8Array|null} [value] Hash value\n */\n \n /**\n * Constructs a new Hash.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a Hash.\n * @implements IHash\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IHash=} [properties] Properties to set\n */\n function Hash(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Hash type.\n * @member {google.devtools.artifactregistry.v1beta2.Hash.HashType} type\n * @memberof google.devtools.artifactregistry.v1beta2.Hash\n * @instance\n */\n Hash.prototype.type = 0;\n \n /**\n * Hash value.\n * @member {Uint8Array} value\n * @memberof google.devtools.artifactregistry.v1beta2.Hash\n * @instance\n */\n Hash.prototype.value = $util.newBuffer([]);\n \n /**\n * Creates a new Hash instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.Hash\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IHash=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.Hash} Hash instance\n */\n Hash.create = function create(properties) {\n return new Hash(properties);\n };\n \n /**\n * Encodes the specified Hash message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.Hash.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.Hash\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IHash} message Hash message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Hash.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.type != null && Object.hasOwnProperty.call(message, \"type\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type);\n if (message.value != null && Object.hasOwnProperty.call(message, \"value\"))\n writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value);\n return writer;\n };\n \n /**\n * Encodes the specified Hash message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.Hash.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.Hash\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IHash} message Hash message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Hash.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Hash message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.Hash\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.Hash} Hash\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Hash.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.Hash();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.type = reader.int32();\n break;\n }\n case 2: {\n message.value = reader.bytes();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Hash message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.Hash\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.Hash} Hash\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Hash.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Hash message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.Hash\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Hash.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.type != null && message.hasOwnProperty(\"type\"))\n switch (message.type) {\n default:\n return \"type: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.value != null && message.hasOwnProperty(\"value\"))\n if (!(message.value && typeof message.value.length === \"number\" || $util.isString(message.value)))\n return \"value: buffer expected\";\n return null;\n };\n \n /**\n * Creates a Hash message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.Hash\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.Hash} Hash\n */\n Hash.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.Hash)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.Hash();\n switch (object.type) {\n default:\n if (typeof object.type === \"number\") {\n message.type = object.type;\n break;\n }\n break;\n case \"HASH_TYPE_UNSPECIFIED\":\n case 0:\n message.type = 0;\n break;\n case \"SHA256\":\n case 1:\n message.type = 1;\n break;\n case \"MD5\":\n case 2:\n message.type = 2;\n break;\n }\n if (object.value != null)\n if (typeof object.value === \"string\")\n $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0);\n else if (object.value.length >= 0)\n message.value = object.value;\n return message;\n };\n \n /**\n * Creates a plain object from a Hash message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.Hash\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.Hash} message Hash\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Hash.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.type = options.enums === String ? \"HASH_TYPE_UNSPECIFIED\" : 0;\n if (options.bytes === String)\n object.value = \"\";\n else {\n object.value = [];\n if (options.bytes !== Array)\n object.value = $util.newBuffer(object.value);\n }\n }\n if (message.type != null && message.hasOwnProperty(\"type\"))\n object.type = options.enums === String ? $root.google.devtools.artifactregistry.v1beta2.Hash.HashType[message.type] === undefined ? message.type : $root.google.devtools.artifactregistry.v1beta2.Hash.HashType[message.type] : message.type;\n if (message.value != null && message.hasOwnProperty(\"value\"))\n object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value;\n return object;\n };\n \n /**\n * Converts this Hash to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.Hash\n * @instance\n * @returns {Object.} JSON object\n */\n Hash.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Hash\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.Hash\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Hash.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.Hash\";\n };\n \n /**\n * HashType enum.\n * @name google.devtools.artifactregistry.v1beta2.Hash.HashType\n * @enum {number}\n * @property {number} HASH_TYPE_UNSPECIFIED=0 HASH_TYPE_UNSPECIFIED value\n * @property {number} SHA256=1 SHA256 value\n * @property {number} MD5=2 MD5 value\n */\n Hash.HashType = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"HASH_TYPE_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"SHA256\"] = 1;\n values[valuesById[2] = \"MD5\"] = 2;\n return values;\n })();\n \n return Hash;\n })();\n \n v1beta2.File = (function() {\n \n /**\n * Properties of a File.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IFile\n * @property {string|null} [name] File name\n * @property {number|Long|null} [sizeBytes] File sizeBytes\n * @property {Array.|null} [hashes] File hashes\n * @property {google.protobuf.ITimestamp|null} [createTime] File createTime\n * @property {google.protobuf.ITimestamp|null} [updateTime] File updateTime\n * @property {string|null} [owner] File owner\n */\n \n /**\n * Constructs a new File.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a File.\n * @implements IFile\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IFile=} [properties] Properties to set\n */\n function File(properties) {\n this.hashes = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * File name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @instance\n */\n File.prototype.name = \"\";\n \n /**\n * File sizeBytes.\n * @member {number|Long} sizeBytes\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @instance\n */\n File.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n \n /**\n * File hashes.\n * @member {Array.} hashes\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @instance\n */\n File.prototype.hashes = $util.emptyArray;\n \n /**\n * File createTime.\n * @member {google.protobuf.ITimestamp|null|undefined} createTime\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @instance\n */\n File.prototype.createTime = null;\n \n /**\n * File updateTime.\n * @member {google.protobuf.ITimestamp|null|undefined} updateTime\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @instance\n */\n File.prototype.updateTime = null;\n \n /**\n * File owner.\n * @member {string} owner\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @instance\n */\n File.prototype.owner = \"\";\n \n /**\n * Creates a new File instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IFile=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.File} File instance\n */\n File.create = function create(properties) {\n return new File(properties);\n };\n \n /**\n * Encodes the specified File message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.File.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IFile} message File message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n File.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.sizeBytes != null && Object.hasOwnProperty.call(message, \"sizeBytes\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int64(message.sizeBytes);\n if (message.hashes != null && message.hashes.length)\n for (var i = 0; i < message.hashes.length; ++i)\n $root.google.devtools.artifactregistry.v1beta2.Hash.encode(message.hashes[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n if (message.createTime != null && Object.hasOwnProperty.call(message, \"createTime\"))\n $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.updateTime != null && Object.hasOwnProperty.call(message, \"updateTime\"))\n $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.owner != null && Object.hasOwnProperty.call(message, \"owner\"))\n writer.uint32(/* id 7, wireType 2 =*/58).string(message.owner);\n return writer;\n };\n \n /**\n * Encodes the specified File message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.File.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IFile} message File message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n File.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a File message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.File} File\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n File.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.File();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 3: {\n message.sizeBytes = reader.int64();\n break;\n }\n case 4: {\n if (!(message.hashes && message.hashes.length))\n message.hashes = [];\n message.hashes.push($root.google.devtools.artifactregistry.v1beta2.Hash.decode(reader, reader.uint32()));\n break;\n }\n case 5: {\n message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 6: {\n message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 7: {\n message.owner = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a File message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.File} File\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n File.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a File message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n File.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.sizeBytes != null && message.hasOwnProperty(\"sizeBytes\"))\n if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high)))\n return \"sizeBytes: integer|Long expected\";\n if (message.hashes != null && message.hasOwnProperty(\"hashes\")) {\n if (!Array.isArray(message.hashes))\n return \"hashes: array expected\";\n for (var i = 0; i < message.hashes.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1beta2.Hash.verify(message.hashes[i]);\n if (error)\n return \"hashes.\" + error;\n }\n }\n if (message.createTime != null && message.hasOwnProperty(\"createTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.createTime);\n if (error)\n return \"createTime.\" + error;\n }\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.updateTime);\n if (error)\n return \"updateTime.\" + error;\n }\n if (message.owner != null && message.hasOwnProperty(\"owner\"))\n if (!$util.isString(message.owner))\n return \"owner: string expected\";\n return null;\n };\n \n /**\n * Creates a File message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.File} File\n */\n File.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.File)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.File();\n if (object.name != null)\n message.name = String(object.name);\n if (object.sizeBytes != null)\n if ($util.Long)\n (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false;\n else if (typeof object.sizeBytes === \"string\")\n message.sizeBytes = parseInt(object.sizeBytes, 10);\n else if (typeof object.sizeBytes === \"number\")\n message.sizeBytes = object.sizeBytes;\n else if (typeof object.sizeBytes === \"object\")\n message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber();\n if (object.hashes) {\n if (!Array.isArray(object.hashes))\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.File.hashes: array expected\");\n message.hashes = [];\n for (var i = 0; i < object.hashes.length; ++i) {\n if (typeof object.hashes[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.File.hashes: object expected\");\n message.hashes[i] = $root.google.devtools.artifactregistry.v1beta2.Hash.fromObject(object.hashes[i]);\n }\n }\n if (object.createTime != null) {\n if (typeof object.createTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.File.createTime: object expected\");\n message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);\n }\n if (object.updateTime != null) {\n if (typeof object.updateTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.File.updateTime: object expected\");\n message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);\n }\n if (object.owner != null)\n message.owner = String(object.owner);\n return message;\n };\n \n /**\n * Creates a plain object from a File message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.File} message File\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n File.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.hashes = [];\n if (options.defaults) {\n object.name = \"\";\n if ($util.Long) {\n var long = new $util.Long(0, 0, false);\n object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.sizeBytes = options.longs === String ? \"0\" : 0;\n object.createTime = null;\n object.updateTime = null;\n object.owner = \"\";\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.sizeBytes != null && message.hasOwnProperty(\"sizeBytes\"))\n if (typeof message.sizeBytes === \"number\")\n object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes;\n else\n object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes;\n if (message.hashes && message.hashes.length) {\n object.hashes = [];\n for (var j = 0; j < message.hashes.length; ++j)\n object.hashes[j] = $root.google.devtools.artifactregistry.v1beta2.Hash.toObject(message.hashes[j], options);\n }\n if (message.createTime != null && message.hasOwnProperty(\"createTime\"))\n object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\"))\n object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);\n if (message.owner != null && message.hasOwnProperty(\"owner\"))\n object.owner = message.owner;\n return object;\n };\n \n /**\n * Converts this File to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @instance\n * @returns {Object.} JSON object\n */\n File.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for File\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.File\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n File.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.File\";\n };\n \n return File;\n })();\n \n v1beta2.ListFilesRequest = (function() {\n \n /**\n * Properties of a ListFilesRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IListFilesRequest\n * @property {string|null} [parent] ListFilesRequest parent\n * @property {string|null} [filter] ListFilesRequest filter\n * @property {number|null} [pageSize] ListFilesRequest pageSize\n * @property {string|null} [pageToken] ListFilesRequest pageToken\n */\n \n /**\n * Constructs a new ListFilesRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a ListFilesRequest.\n * @implements IListFilesRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IListFilesRequest=} [properties] Properties to set\n */\n function ListFilesRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListFilesRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesRequest\n * @instance\n */\n ListFilesRequest.prototype.parent = \"\";\n \n /**\n * ListFilesRequest filter.\n * @member {string} filter\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesRequest\n * @instance\n */\n ListFilesRequest.prototype.filter = \"\";\n \n /**\n * ListFilesRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesRequest\n * @instance\n */\n ListFilesRequest.prototype.pageSize = 0;\n \n /**\n * ListFilesRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesRequest\n * @instance\n */\n ListFilesRequest.prototype.pageToken = \"\";\n \n /**\n * Creates a new ListFilesRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListFilesRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ListFilesRequest} ListFilesRequest instance\n */\n ListFilesRequest.create = function create(properties) {\n return new ListFilesRequest(properties);\n };\n \n /**\n * Encodes the specified ListFilesRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListFilesRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListFilesRequest} message ListFilesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListFilesRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n if (message.filter != null && Object.hasOwnProperty.call(message, \"filter\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter);\n return writer;\n };\n \n /**\n * Encodes the specified ListFilesRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListFilesRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListFilesRequest} message ListFilesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListFilesRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListFilesRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ListFilesRequest} ListFilesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListFilesRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ListFilesRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 4: {\n message.filter = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListFilesRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ListFilesRequest} ListFilesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListFilesRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListFilesRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListFilesRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n if (!$util.isString(message.filter))\n return \"filter: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListFilesRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ListFilesRequest} ListFilesRequest\n */\n ListFilesRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ListFilesRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ListFilesRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.filter != null)\n message.filter = String(object.filter);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListFilesRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ListFilesRequest} message ListFilesRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListFilesRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n object.filter = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n object.filter = message.filter;\n return object;\n };\n \n /**\n * Converts this ListFilesRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListFilesRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListFilesRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListFilesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ListFilesRequest\";\n };\n \n return ListFilesRequest;\n })();\n \n v1beta2.ListFilesResponse = (function() {\n \n /**\n * Properties of a ListFilesResponse.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IListFilesResponse\n * @property {Array.|null} [files] ListFilesResponse files\n * @property {string|null} [nextPageToken] ListFilesResponse nextPageToken\n */\n \n /**\n * Constructs a new ListFilesResponse.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a ListFilesResponse.\n * @implements IListFilesResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IListFilesResponse=} [properties] Properties to set\n */\n function ListFilesResponse(properties) {\n this.files = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListFilesResponse files.\n * @member {Array.} files\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesResponse\n * @instance\n */\n ListFilesResponse.prototype.files = $util.emptyArray;\n \n /**\n * ListFilesResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesResponse\n * @instance\n */\n ListFilesResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListFilesResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListFilesResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ListFilesResponse} ListFilesResponse instance\n */\n ListFilesResponse.create = function create(properties) {\n return new ListFilesResponse(properties);\n };\n \n /**\n * Encodes the specified ListFilesResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListFilesResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListFilesResponse} message ListFilesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListFilesResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.files != null && message.files.length)\n for (var i = 0; i < message.files.length; ++i)\n $root.google.devtools.artifactregistry.v1beta2.File.encode(message.files[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListFilesResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListFilesResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListFilesResponse} message ListFilesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListFilesResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListFilesResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ListFilesResponse} ListFilesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListFilesResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ListFilesResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.files && message.files.length))\n message.files = [];\n message.files.push($root.google.devtools.artifactregistry.v1beta2.File.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListFilesResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ListFilesResponse} ListFilesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListFilesResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListFilesResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListFilesResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.files != null && message.hasOwnProperty(\"files\")) {\n if (!Array.isArray(message.files))\n return \"files: array expected\";\n for (var i = 0; i < message.files.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1beta2.File.verify(message.files[i]);\n if (error)\n return \"files.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListFilesResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ListFilesResponse} ListFilesResponse\n */\n ListFilesResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ListFilesResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ListFilesResponse();\n if (object.files) {\n if (!Array.isArray(object.files))\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ListFilesResponse.files: array expected\");\n message.files = [];\n for (var i = 0; i < object.files.length; ++i) {\n if (typeof object.files[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ListFilesResponse.files: object expected\");\n message.files[i] = $root.google.devtools.artifactregistry.v1beta2.File.fromObject(object.files[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListFilesResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ListFilesResponse} message ListFilesResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListFilesResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.files = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.files && message.files.length) {\n object.files = [];\n for (var j = 0; j < message.files.length; ++j)\n object.files[j] = $root.google.devtools.artifactregistry.v1beta2.File.toObject(message.files[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListFilesResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListFilesResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListFilesResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ListFilesResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListFilesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ListFilesResponse\";\n };\n \n return ListFilesResponse;\n })();\n \n v1beta2.GetFileRequest = (function() {\n \n /**\n * Properties of a GetFileRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IGetFileRequest\n * @property {string|null} [name] GetFileRequest name\n */\n \n /**\n * Constructs a new GetFileRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a GetFileRequest.\n * @implements IGetFileRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IGetFileRequest=} [properties] Properties to set\n */\n function GetFileRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetFileRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.GetFileRequest\n * @instance\n */\n GetFileRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetFileRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.GetFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetFileRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.GetFileRequest} GetFileRequest instance\n */\n GetFileRequest.create = function create(properties) {\n return new GetFileRequest(properties);\n };\n \n /**\n * Encodes the specified GetFileRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.GetFileRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.GetFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetFileRequest} message GetFileRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetFileRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetFileRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.GetFileRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.GetFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetFileRequest} message GetFileRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetFileRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetFileRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.GetFileRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.GetFileRequest} GetFileRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetFileRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.GetFileRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetFileRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.GetFileRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.GetFileRequest} GetFileRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetFileRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetFileRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.GetFileRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetFileRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetFileRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.GetFileRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.GetFileRequest} GetFileRequest\n */\n GetFileRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.GetFileRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.GetFileRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetFileRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.GetFileRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.GetFileRequest} message GetFileRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetFileRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetFileRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.GetFileRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetFileRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetFileRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.GetFileRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.GetFileRequest\";\n };\n \n return GetFileRequest;\n })();\n \n v1beta2.Package = (function() {\n \n /**\n * Properties of a Package.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IPackage\n * @property {string|null} [name] Package name\n * @property {string|null} [displayName] Package displayName\n * @property {google.protobuf.ITimestamp|null} [createTime] Package createTime\n * @property {google.protobuf.ITimestamp|null} [updateTime] Package updateTime\n */\n \n /**\n * Constructs a new Package.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a Package.\n * @implements IPackage\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IPackage=} [properties] Properties to set\n */\n function Package(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Package name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.Package\n * @instance\n */\n Package.prototype.name = \"\";\n \n /**\n * Package displayName.\n * @member {string} displayName\n * @memberof google.devtools.artifactregistry.v1beta2.Package\n * @instance\n */\n Package.prototype.displayName = \"\";\n \n /**\n * Package createTime.\n * @member {google.protobuf.ITimestamp|null|undefined} createTime\n * @memberof google.devtools.artifactregistry.v1beta2.Package\n * @instance\n */\n Package.prototype.createTime = null;\n \n /**\n * Package updateTime.\n * @member {google.protobuf.ITimestamp|null|undefined} updateTime\n * @memberof google.devtools.artifactregistry.v1beta2.Package\n * @instance\n */\n Package.prototype.updateTime = null;\n \n /**\n * Creates a new Package instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.Package\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IPackage=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.Package} Package instance\n */\n Package.create = function create(properties) {\n return new Package(properties);\n };\n \n /**\n * Encodes the specified Package message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.Package.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.Package\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IPackage} message Package message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Package.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.displayName != null && Object.hasOwnProperty.call(message, \"displayName\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName);\n if (message.createTime != null && Object.hasOwnProperty.call(message, \"createTime\"))\n $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.updateTime != null && Object.hasOwnProperty.call(message, \"updateTime\"))\n $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified Package message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.Package.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.Package\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IPackage} message Package message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Package.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Package message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.Package\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.Package} Package\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Package.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.Package();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.displayName = reader.string();\n break;\n }\n case 5: {\n message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 6: {\n message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Package message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.Package\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.Package} Package\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Package.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Package message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.Package\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Package.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.displayName != null && message.hasOwnProperty(\"displayName\"))\n if (!$util.isString(message.displayName))\n return \"displayName: string expected\";\n if (message.createTime != null && message.hasOwnProperty(\"createTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.createTime);\n if (error)\n return \"createTime.\" + error;\n }\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.updateTime);\n if (error)\n return \"updateTime.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a Package message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.Package\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.Package} Package\n */\n Package.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.Package)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.Package();\n if (object.name != null)\n message.name = String(object.name);\n if (object.displayName != null)\n message.displayName = String(object.displayName);\n if (object.createTime != null) {\n if (typeof object.createTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.Package.createTime: object expected\");\n message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);\n }\n if (object.updateTime != null) {\n if (typeof object.updateTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.Package.updateTime: object expected\");\n message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a Package message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.Package\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.Package} message Package\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Package.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.displayName = \"\";\n object.createTime = null;\n object.updateTime = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.displayName != null && message.hasOwnProperty(\"displayName\"))\n object.displayName = message.displayName;\n if (message.createTime != null && message.hasOwnProperty(\"createTime\"))\n object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\"))\n object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);\n return object;\n };\n \n /**\n * Converts this Package to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.Package\n * @instance\n * @returns {Object.} JSON object\n */\n Package.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Package\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.Package\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Package.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.Package\";\n };\n \n return Package;\n })();\n \n v1beta2.ListPackagesRequest = (function() {\n \n /**\n * Properties of a ListPackagesRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IListPackagesRequest\n * @property {string|null} [parent] ListPackagesRequest parent\n * @property {number|null} [pageSize] ListPackagesRequest pageSize\n * @property {string|null} [pageToken] ListPackagesRequest pageToken\n */\n \n /**\n * Constructs a new ListPackagesRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a ListPackagesRequest.\n * @implements IListPackagesRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IListPackagesRequest=} [properties] Properties to set\n */\n function ListPackagesRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListPackagesRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesRequest\n * @instance\n */\n ListPackagesRequest.prototype.parent = \"\";\n \n /**\n * ListPackagesRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesRequest\n * @instance\n */\n ListPackagesRequest.prototype.pageSize = 0;\n \n /**\n * ListPackagesRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesRequest\n * @instance\n */\n ListPackagesRequest.prototype.pageToken = \"\";\n \n /**\n * Creates a new ListPackagesRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListPackagesRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ListPackagesRequest} ListPackagesRequest instance\n */\n ListPackagesRequest.create = function create(properties) {\n return new ListPackagesRequest(properties);\n };\n \n /**\n * Encodes the specified ListPackagesRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListPackagesRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListPackagesRequest} message ListPackagesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListPackagesRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListPackagesRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListPackagesRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListPackagesRequest} message ListPackagesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListPackagesRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListPackagesRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ListPackagesRequest} ListPackagesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListPackagesRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ListPackagesRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListPackagesRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ListPackagesRequest} ListPackagesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListPackagesRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListPackagesRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListPackagesRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListPackagesRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ListPackagesRequest} ListPackagesRequest\n */\n ListPackagesRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ListPackagesRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ListPackagesRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListPackagesRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ListPackagesRequest} message ListPackagesRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListPackagesRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n return object;\n };\n \n /**\n * Converts this ListPackagesRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListPackagesRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListPackagesRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListPackagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ListPackagesRequest\";\n };\n \n return ListPackagesRequest;\n })();\n \n v1beta2.ListPackagesResponse = (function() {\n \n /**\n * Properties of a ListPackagesResponse.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IListPackagesResponse\n * @property {Array.|null} [packages] ListPackagesResponse packages\n * @property {string|null} [nextPageToken] ListPackagesResponse nextPageToken\n */\n \n /**\n * Constructs a new ListPackagesResponse.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a ListPackagesResponse.\n * @implements IListPackagesResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IListPackagesResponse=} [properties] Properties to set\n */\n function ListPackagesResponse(properties) {\n this.packages = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListPackagesResponse packages.\n * @member {Array.} packages\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesResponse\n * @instance\n */\n ListPackagesResponse.prototype.packages = $util.emptyArray;\n \n /**\n * ListPackagesResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesResponse\n * @instance\n */\n ListPackagesResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListPackagesResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListPackagesResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ListPackagesResponse} ListPackagesResponse instance\n */\n ListPackagesResponse.create = function create(properties) {\n return new ListPackagesResponse(properties);\n };\n \n /**\n * Encodes the specified ListPackagesResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListPackagesResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListPackagesResponse} message ListPackagesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListPackagesResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.packages != null && message.packages.length)\n for (var i = 0; i < message.packages.length; ++i)\n $root.google.devtools.artifactregistry.v1beta2.Package.encode(message.packages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListPackagesResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListPackagesResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListPackagesResponse} message ListPackagesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListPackagesResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListPackagesResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ListPackagesResponse} ListPackagesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListPackagesResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ListPackagesResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.packages && message.packages.length))\n message.packages = [];\n message.packages.push($root.google.devtools.artifactregistry.v1beta2.Package.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListPackagesResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ListPackagesResponse} ListPackagesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListPackagesResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListPackagesResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListPackagesResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.packages != null && message.hasOwnProperty(\"packages\")) {\n if (!Array.isArray(message.packages))\n return \"packages: array expected\";\n for (var i = 0; i < message.packages.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1beta2.Package.verify(message.packages[i]);\n if (error)\n return \"packages.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListPackagesResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ListPackagesResponse} ListPackagesResponse\n */\n ListPackagesResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ListPackagesResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ListPackagesResponse();\n if (object.packages) {\n if (!Array.isArray(object.packages))\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ListPackagesResponse.packages: array expected\");\n message.packages = [];\n for (var i = 0; i < object.packages.length; ++i) {\n if (typeof object.packages[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ListPackagesResponse.packages: object expected\");\n message.packages[i] = $root.google.devtools.artifactregistry.v1beta2.Package.fromObject(object.packages[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListPackagesResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ListPackagesResponse} message ListPackagesResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListPackagesResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.packages = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.packages && message.packages.length) {\n object.packages = [];\n for (var j = 0; j < message.packages.length; ++j)\n object.packages[j] = $root.google.devtools.artifactregistry.v1beta2.Package.toObject(message.packages[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListPackagesResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListPackagesResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListPackagesResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ListPackagesResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListPackagesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ListPackagesResponse\";\n };\n \n return ListPackagesResponse;\n })();\n \n v1beta2.GetPackageRequest = (function() {\n \n /**\n * Properties of a GetPackageRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IGetPackageRequest\n * @property {string|null} [name] GetPackageRequest name\n */\n \n /**\n * Constructs a new GetPackageRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a GetPackageRequest.\n * @implements IGetPackageRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IGetPackageRequest=} [properties] Properties to set\n */\n function GetPackageRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetPackageRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.GetPackageRequest\n * @instance\n */\n GetPackageRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetPackageRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.GetPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetPackageRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.GetPackageRequest} GetPackageRequest instance\n */\n GetPackageRequest.create = function create(properties) {\n return new GetPackageRequest(properties);\n };\n \n /**\n * Encodes the specified GetPackageRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.GetPackageRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.GetPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetPackageRequest} message GetPackageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetPackageRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetPackageRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.GetPackageRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.GetPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetPackageRequest} message GetPackageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetPackageRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetPackageRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.GetPackageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.GetPackageRequest} GetPackageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetPackageRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.GetPackageRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetPackageRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.GetPackageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.GetPackageRequest} GetPackageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetPackageRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetPackageRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.GetPackageRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetPackageRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetPackageRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.GetPackageRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.GetPackageRequest} GetPackageRequest\n */\n GetPackageRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.GetPackageRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.GetPackageRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetPackageRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.GetPackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.GetPackageRequest} message GetPackageRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetPackageRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetPackageRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.GetPackageRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetPackageRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetPackageRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.GetPackageRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetPackageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.GetPackageRequest\";\n };\n \n return GetPackageRequest;\n })();\n \n v1beta2.DeletePackageRequest = (function() {\n \n /**\n * Properties of a DeletePackageRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IDeletePackageRequest\n * @property {string|null} [name] DeletePackageRequest name\n */\n \n /**\n * Constructs a new DeletePackageRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a DeletePackageRequest.\n * @implements IDeletePackageRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IDeletePackageRequest=} [properties] Properties to set\n */\n function DeletePackageRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DeletePackageRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.DeletePackageRequest\n * @instance\n */\n DeletePackageRequest.prototype.name = \"\";\n \n /**\n * Creates a new DeletePackageRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.DeletePackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IDeletePackageRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.DeletePackageRequest} DeletePackageRequest instance\n */\n DeletePackageRequest.create = function create(properties) {\n return new DeletePackageRequest(properties);\n };\n \n /**\n * Encodes the specified DeletePackageRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.DeletePackageRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.DeletePackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IDeletePackageRequest} message DeletePackageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeletePackageRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified DeletePackageRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.DeletePackageRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.DeletePackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IDeletePackageRequest} message DeletePackageRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeletePackageRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DeletePackageRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.DeletePackageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.DeletePackageRequest} DeletePackageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeletePackageRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.DeletePackageRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DeletePackageRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.DeletePackageRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.DeletePackageRequest} DeletePackageRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeletePackageRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DeletePackageRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.DeletePackageRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DeletePackageRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a DeletePackageRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.DeletePackageRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.DeletePackageRequest} DeletePackageRequest\n */\n DeletePackageRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.DeletePackageRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.DeletePackageRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a DeletePackageRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.DeletePackageRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.DeletePackageRequest} message DeletePackageRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DeletePackageRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this DeletePackageRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.DeletePackageRequest\n * @instance\n * @returns {Object.} JSON object\n */\n DeletePackageRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DeletePackageRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.DeletePackageRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DeletePackageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.DeletePackageRequest\";\n };\n \n return DeletePackageRequest;\n })();\n \n v1beta2.Repository = (function() {\n \n /**\n * Properties of a Repository.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IRepository\n * @property {google.devtools.artifactregistry.v1beta2.Repository.IMavenRepositoryConfig|null} [mavenConfig] Repository mavenConfig\n * @property {string|null} [name] Repository name\n * @property {google.devtools.artifactregistry.v1beta2.Repository.Format|null} [format] Repository format\n * @property {string|null} [description] Repository description\n * @property {Object.|null} [labels] Repository labels\n * @property {google.protobuf.ITimestamp|null} [createTime] Repository createTime\n * @property {google.protobuf.ITimestamp|null} [updateTime] Repository updateTime\n * @property {string|null} [kmsKeyName] Repository kmsKeyName\n */\n \n /**\n * Constructs a new Repository.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a Repository.\n * @implements IRepository\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IRepository=} [properties] Properties to set\n */\n function Repository(properties) {\n this.labels = {};\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Repository mavenConfig.\n * @member {google.devtools.artifactregistry.v1beta2.Repository.IMavenRepositoryConfig|null|undefined} mavenConfig\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @instance\n */\n Repository.prototype.mavenConfig = null;\n \n /**\n * Repository name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @instance\n */\n Repository.prototype.name = \"\";\n \n /**\n * Repository format.\n * @member {google.devtools.artifactregistry.v1beta2.Repository.Format} format\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @instance\n */\n Repository.prototype.format = 0;\n \n /**\n * Repository description.\n * @member {string} description\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @instance\n */\n Repository.prototype.description = \"\";\n \n /**\n * Repository labels.\n * @member {Object.} labels\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @instance\n */\n Repository.prototype.labels = $util.emptyObject;\n \n /**\n * Repository createTime.\n * @member {google.protobuf.ITimestamp|null|undefined} createTime\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @instance\n */\n Repository.prototype.createTime = null;\n \n /**\n * Repository updateTime.\n * @member {google.protobuf.ITimestamp|null|undefined} updateTime\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @instance\n */\n Repository.prototype.updateTime = null;\n \n /**\n * Repository kmsKeyName.\n * @member {string} kmsKeyName\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @instance\n */\n Repository.prototype.kmsKeyName = \"\";\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * Repository formatConfig.\n * @member {\"mavenConfig\"|undefined} formatConfig\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @instance\n */\n Object.defineProperty(Repository.prototype, \"formatConfig\", {\n get: $util.oneOfGetter($oneOfFields = [\"mavenConfig\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new Repository instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IRepository=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.Repository} Repository instance\n */\n Repository.create = function create(properties) {\n return new Repository(properties);\n };\n \n /**\n * Encodes the specified Repository message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.Repository.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IRepository} message Repository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Repository.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.format != null && Object.hasOwnProperty.call(message, \"format\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.format);\n if (message.description != null && Object.hasOwnProperty.call(message, \"description\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.description);\n if (message.labels != null && Object.hasOwnProperty.call(message, \"labels\"))\n for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i)\n writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim();\n if (message.createTime != null && Object.hasOwnProperty.call(message, \"createTime\"))\n $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.updateTime != null && Object.hasOwnProperty.call(message, \"updateTime\"))\n $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, \"kmsKeyName\"))\n writer.uint32(/* id 8, wireType 2 =*/66).string(message.kmsKeyName);\n if (message.mavenConfig != null && Object.hasOwnProperty.call(message, \"mavenConfig\"))\n $root.google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.encode(message.mavenConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified Repository message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.Repository.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IRepository} message Repository message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Repository.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Repository message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.Repository} Repository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Repository.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.Repository(), key, value;\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 9: {\n message.mavenConfig = $root.google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.decode(reader, reader.uint32());\n break;\n }\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.format = reader.int32();\n break;\n }\n case 3: {\n message.description = reader.string();\n break;\n }\n case 4: {\n if (message.labels === $util.emptyObject)\n message.labels = {};\n var end2 = reader.uint32() + reader.pos;\n key = \"\";\n value = \"\";\n while (reader.pos < end2) {\n var tag2 = reader.uint32();\n switch (tag2 >>> 3) {\n case 1:\n key = reader.string();\n break;\n case 2:\n value = reader.string();\n break;\n default:\n reader.skipType(tag2 & 7);\n break;\n }\n }\n message.labels[key] = value;\n break;\n }\n case 5: {\n message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 6: {\n message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 8: {\n message.kmsKeyName = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Repository message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.Repository} Repository\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Repository.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Repository message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Repository.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.mavenConfig != null && message.hasOwnProperty(\"mavenConfig\")) {\n properties.formatConfig = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.verify(message.mavenConfig);\n if (error)\n return \"mavenConfig.\" + error;\n }\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.format != null && message.hasOwnProperty(\"format\"))\n switch (message.format) {\n default:\n return \"format: enum value expected\";\n case 0:\n case 1:\n case 2:\n case 3:\n case 5:\n case 6:\n case 8:\n break;\n }\n if (message.description != null && message.hasOwnProperty(\"description\"))\n if (!$util.isString(message.description))\n return \"description: string expected\";\n if (message.labels != null && message.hasOwnProperty(\"labels\")) {\n if (!$util.isObject(message.labels))\n return \"labels: object expected\";\n var key = Object.keys(message.labels);\n for (var i = 0; i < key.length; ++i)\n if (!$util.isString(message.labels[key[i]]))\n return \"labels: string{k:string} expected\";\n }\n if (message.createTime != null && message.hasOwnProperty(\"createTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.createTime);\n if (error)\n return \"createTime.\" + error;\n }\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.updateTime);\n if (error)\n return \"updateTime.\" + error;\n }\n if (message.kmsKeyName != null && message.hasOwnProperty(\"kmsKeyName\"))\n if (!$util.isString(message.kmsKeyName))\n return \"kmsKeyName: string expected\";\n return null;\n };\n \n /**\n * Creates a Repository message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.Repository} Repository\n */\n Repository.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.Repository)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.Repository();\n if (object.mavenConfig != null) {\n if (typeof object.mavenConfig !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.Repository.mavenConfig: object expected\");\n message.mavenConfig = $root.google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.fromObject(object.mavenConfig);\n }\n if (object.name != null)\n message.name = String(object.name);\n switch (object.format) {\n default:\n if (typeof object.format === \"number\") {\n message.format = object.format;\n break;\n }\n break;\n case \"FORMAT_UNSPECIFIED\":\n case 0:\n message.format = 0;\n break;\n case \"DOCKER\":\n case 1:\n message.format = 1;\n break;\n case \"MAVEN\":\n case 2:\n message.format = 2;\n break;\n case \"NPM\":\n case 3:\n message.format = 3;\n break;\n case \"APT\":\n case 5:\n message.format = 5;\n break;\n case \"YUM\":\n case 6:\n message.format = 6;\n break;\n case \"PYTHON\":\n case 8:\n message.format = 8;\n break;\n }\n if (object.description != null)\n message.description = String(object.description);\n if (object.labels) {\n if (typeof object.labels !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.Repository.labels: object expected\");\n message.labels = {};\n for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i)\n message.labels[keys[i]] = String(object.labels[keys[i]]);\n }\n if (object.createTime != null) {\n if (typeof object.createTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.Repository.createTime: object expected\");\n message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);\n }\n if (object.updateTime != null) {\n if (typeof object.updateTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.Repository.updateTime: object expected\");\n message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);\n }\n if (object.kmsKeyName != null)\n message.kmsKeyName = String(object.kmsKeyName);\n return message;\n };\n \n /**\n * Creates a plain object from a Repository message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.Repository} message Repository\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Repository.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.objects || options.defaults)\n object.labels = {};\n if (options.defaults) {\n object.name = \"\";\n object.format = options.enums === String ? \"FORMAT_UNSPECIFIED\" : 0;\n object.description = \"\";\n object.createTime = null;\n object.updateTime = null;\n object.kmsKeyName = \"\";\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.format != null && message.hasOwnProperty(\"format\"))\n object.format = options.enums === String ? $root.google.devtools.artifactregistry.v1beta2.Repository.Format[message.format] === undefined ? message.format : $root.google.devtools.artifactregistry.v1beta2.Repository.Format[message.format] : message.format;\n if (message.description != null && message.hasOwnProperty(\"description\"))\n object.description = message.description;\n var keys2;\n if (message.labels && (keys2 = Object.keys(message.labels)).length) {\n object.labels = {};\n for (var j = 0; j < keys2.length; ++j)\n object.labels[keys2[j]] = message.labels[keys2[j]];\n }\n if (message.createTime != null && message.hasOwnProperty(\"createTime\"))\n object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\"))\n object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);\n if (message.kmsKeyName != null && message.hasOwnProperty(\"kmsKeyName\"))\n object.kmsKeyName = message.kmsKeyName;\n if (message.mavenConfig != null && message.hasOwnProperty(\"mavenConfig\")) {\n object.mavenConfig = $root.google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.toObject(message.mavenConfig, options);\n if (options.oneofs)\n object.formatConfig = \"mavenConfig\";\n }\n return object;\n };\n \n /**\n * Converts this Repository to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @instance\n * @returns {Object.} JSON object\n */\n Repository.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Repository\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Repository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.Repository\";\n };\n \n Repository.MavenRepositoryConfig = (function() {\n \n /**\n * Properties of a MavenRepositoryConfig.\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @interface IMavenRepositoryConfig\n * @property {boolean|null} [allowSnapshotOverwrites] MavenRepositoryConfig allowSnapshotOverwrites\n * @property {google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.VersionPolicy|null} [versionPolicy] MavenRepositoryConfig versionPolicy\n */\n \n /**\n * Constructs a new MavenRepositoryConfig.\n * @memberof google.devtools.artifactregistry.v1beta2.Repository\n * @classdesc Represents a MavenRepositoryConfig.\n * @implements IMavenRepositoryConfig\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.Repository.IMavenRepositoryConfig=} [properties] Properties to set\n */\n function MavenRepositoryConfig(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * MavenRepositoryConfig allowSnapshotOverwrites.\n * @member {boolean} allowSnapshotOverwrites\n * @memberof google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig\n * @instance\n */\n MavenRepositoryConfig.prototype.allowSnapshotOverwrites = false;\n \n /**\n * MavenRepositoryConfig versionPolicy.\n * @member {google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.VersionPolicy} versionPolicy\n * @memberof google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig\n * @instance\n */\n MavenRepositoryConfig.prototype.versionPolicy = 0;\n \n /**\n * Creates a new MavenRepositoryConfig instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.Repository.IMavenRepositoryConfig=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig} MavenRepositoryConfig instance\n */\n MavenRepositoryConfig.create = function create(properties) {\n return new MavenRepositoryConfig(properties);\n };\n \n /**\n * Encodes the specified MavenRepositoryConfig message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.Repository.IMavenRepositoryConfig} message MavenRepositoryConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MavenRepositoryConfig.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.allowSnapshotOverwrites != null && Object.hasOwnProperty.call(message, \"allowSnapshotOverwrites\"))\n writer.uint32(/* id 1, wireType 0 =*/8).bool(message.allowSnapshotOverwrites);\n if (message.versionPolicy != null && Object.hasOwnProperty.call(message, \"versionPolicy\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.versionPolicy);\n return writer;\n };\n \n /**\n * Encodes the specified MavenRepositoryConfig message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.Repository.IMavenRepositoryConfig} message MavenRepositoryConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MavenRepositoryConfig.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a MavenRepositoryConfig message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig} MavenRepositoryConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MavenRepositoryConfig.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.allowSnapshotOverwrites = reader.bool();\n break;\n }\n case 2: {\n message.versionPolicy = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a MavenRepositoryConfig message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig} MavenRepositoryConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MavenRepositoryConfig.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a MavenRepositoryConfig message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n MavenRepositoryConfig.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.allowSnapshotOverwrites != null && message.hasOwnProperty(\"allowSnapshotOverwrites\"))\n if (typeof message.allowSnapshotOverwrites !== \"boolean\")\n return \"allowSnapshotOverwrites: boolean expected\";\n if (message.versionPolicy != null && message.hasOwnProperty(\"versionPolicy\"))\n switch (message.versionPolicy) {\n default:\n return \"versionPolicy: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n return null;\n };\n \n /**\n * Creates a MavenRepositoryConfig message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig} MavenRepositoryConfig\n */\n MavenRepositoryConfig.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig();\n if (object.allowSnapshotOverwrites != null)\n message.allowSnapshotOverwrites = Boolean(object.allowSnapshotOverwrites);\n switch (object.versionPolicy) {\n default:\n if (typeof object.versionPolicy === \"number\") {\n message.versionPolicy = object.versionPolicy;\n break;\n }\n break;\n case \"VERSION_POLICY_UNSPECIFIED\":\n case 0:\n message.versionPolicy = 0;\n break;\n case \"RELEASE\":\n case 1:\n message.versionPolicy = 1;\n break;\n case \"SNAPSHOT\":\n case 2:\n message.versionPolicy = 2;\n break;\n }\n return message;\n };\n \n /**\n * Creates a plain object from a MavenRepositoryConfig message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig} message MavenRepositoryConfig\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n MavenRepositoryConfig.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.allowSnapshotOverwrites = false;\n object.versionPolicy = options.enums === String ? \"VERSION_POLICY_UNSPECIFIED\" : 0;\n }\n if (message.allowSnapshotOverwrites != null && message.hasOwnProperty(\"allowSnapshotOverwrites\"))\n object.allowSnapshotOverwrites = message.allowSnapshotOverwrites;\n if (message.versionPolicy != null && message.hasOwnProperty(\"versionPolicy\"))\n object.versionPolicy = options.enums === String ? $root.google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.VersionPolicy[message.versionPolicy] === undefined ? message.versionPolicy : $root.google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.VersionPolicy[message.versionPolicy] : message.versionPolicy;\n return object;\n };\n \n /**\n * Converts this MavenRepositoryConfig to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig\n * @instance\n * @returns {Object.} JSON object\n */\n MavenRepositoryConfig.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for MavenRepositoryConfig\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n MavenRepositoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig\";\n };\n \n /**\n * VersionPolicy enum.\n * @name google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.VersionPolicy\n * @enum {number}\n * @property {number} VERSION_POLICY_UNSPECIFIED=0 VERSION_POLICY_UNSPECIFIED value\n * @property {number} RELEASE=1 RELEASE value\n * @property {number} SNAPSHOT=2 SNAPSHOT value\n */\n MavenRepositoryConfig.VersionPolicy = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"VERSION_POLICY_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"RELEASE\"] = 1;\n values[valuesById[2] = \"SNAPSHOT\"] = 2;\n return values;\n })();\n \n return MavenRepositoryConfig;\n })();\n \n /**\n * Format enum.\n * @name google.devtools.artifactregistry.v1beta2.Repository.Format\n * @enum {number}\n * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value\n * @property {number} DOCKER=1 DOCKER value\n * @property {number} MAVEN=2 MAVEN value\n * @property {number} NPM=3 NPM value\n * @property {number} APT=5 APT value\n * @property {number} YUM=6 YUM value\n * @property {number} PYTHON=8 PYTHON value\n */\n Repository.Format = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"FORMAT_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"DOCKER\"] = 1;\n values[valuesById[2] = \"MAVEN\"] = 2;\n values[valuesById[3] = \"NPM\"] = 3;\n values[valuesById[5] = \"APT\"] = 5;\n values[valuesById[6] = \"YUM\"] = 6;\n values[valuesById[8] = \"PYTHON\"] = 8;\n return values;\n })();\n \n return Repository;\n })();\n \n v1beta2.ListRepositoriesRequest = (function() {\n \n /**\n * Properties of a ListRepositoriesRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IListRepositoriesRequest\n * @property {string|null} [parent] ListRepositoriesRequest parent\n * @property {number|null} [pageSize] ListRepositoriesRequest pageSize\n * @property {string|null} [pageToken] ListRepositoriesRequest pageToken\n */\n \n /**\n * Constructs a new ListRepositoriesRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a ListRepositoriesRequest.\n * @implements IListRepositoriesRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IListRepositoriesRequest=} [properties] Properties to set\n */\n function ListRepositoriesRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListRepositoriesRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest\n * @instance\n */\n ListRepositoriesRequest.prototype.parent = \"\";\n \n /**\n * ListRepositoriesRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest\n * @instance\n */\n ListRepositoriesRequest.prototype.pageSize = 0;\n \n /**\n * ListRepositoriesRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest\n * @instance\n */\n ListRepositoriesRequest.prototype.pageToken = \"\";\n \n /**\n * Creates a new ListRepositoriesRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListRepositoriesRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest} ListRepositoriesRequest instance\n */\n ListRepositoriesRequest.create = function create(properties) {\n return new ListRepositoriesRequest(properties);\n };\n \n /**\n * Encodes the specified ListRepositoriesRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListRepositoriesRequest} message ListRepositoriesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListRepositoriesRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListRepositoriesRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListRepositoriesRequest} message ListRepositoriesRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListRepositoriesRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListRepositoriesRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest} ListRepositoriesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListRepositoriesRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListRepositoriesRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest} ListRepositoriesRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListRepositoriesRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListRepositoriesRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListRepositoriesRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListRepositoriesRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest} ListRepositoriesRequest\n */\n ListRepositoriesRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListRepositoriesRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest} message ListRepositoriesRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListRepositoriesRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n return object;\n };\n \n /**\n * Converts this ListRepositoriesRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListRepositoriesRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListRepositoriesRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListRepositoriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest\";\n };\n \n return ListRepositoriesRequest;\n })();\n \n v1beta2.ListRepositoriesResponse = (function() {\n \n /**\n * Properties of a ListRepositoriesResponse.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IListRepositoriesResponse\n * @property {Array.|null} [repositories] ListRepositoriesResponse repositories\n * @property {string|null} [nextPageToken] ListRepositoriesResponse nextPageToken\n */\n \n /**\n * Constructs a new ListRepositoriesResponse.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a ListRepositoriesResponse.\n * @implements IListRepositoriesResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IListRepositoriesResponse=} [properties] Properties to set\n */\n function ListRepositoriesResponse(properties) {\n this.repositories = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListRepositoriesResponse repositories.\n * @member {Array.} repositories\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse\n * @instance\n */\n ListRepositoriesResponse.prototype.repositories = $util.emptyArray;\n \n /**\n * ListRepositoriesResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse\n * @instance\n */\n ListRepositoriesResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListRepositoriesResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListRepositoriesResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse} ListRepositoriesResponse instance\n */\n ListRepositoriesResponse.create = function create(properties) {\n return new ListRepositoriesResponse(properties);\n };\n \n /**\n * Encodes the specified ListRepositoriesResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListRepositoriesResponse} message ListRepositoriesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListRepositoriesResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.repositories != null && message.repositories.length)\n for (var i = 0; i < message.repositories.length; ++i)\n $root.google.devtools.artifactregistry.v1beta2.Repository.encode(message.repositories[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListRepositoriesResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListRepositoriesResponse} message ListRepositoriesResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListRepositoriesResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListRepositoriesResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse} ListRepositoriesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListRepositoriesResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.repositories && message.repositories.length))\n message.repositories = [];\n message.repositories.push($root.google.devtools.artifactregistry.v1beta2.Repository.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListRepositoriesResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse} ListRepositoriesResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListRepositoriesResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListRepositoriesResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListRepositoriesResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.repositories != null && message.hasOwnProperty(\"repositories\")) {\n if (!Array.isArray(message.repositories))\n return \"repositories: array expected\";\n for (var i = 0; i < message.repositories.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1beta2.Repository.verify(message.repositories[i]);\n if (error)\n return \"repositories.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListRepositoriesResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse} ListRepositoriesResponse\n */\n ListRepositoriesResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse();\n if (object.repositories) {\n if (!Array.isArray(object.repositories))\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse.repositories: array expected\");\n message.repositories = [];\n for (var i = 0; i < object.repositories.length; ++i) {\n if (typeof object.repositories[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse.repositories: object expected\");\n message.repositories[i] = $root.google.devtools.artifactregistry.v1beta2.Repository.fromObject(object.repositories[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListRepositoriesResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse} message ListRepositoriesResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListRepositoriesResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.repositories = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.repositories && message.repositories.length) {\n object.repositories = [];\n for (var j = 0; j < message.repositories.length; ++j)\n object.repositories[j] = $root.google.devtools.artifactregistry.v1beta2.Repository.toObject(message.repositories[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListRepositoriesResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListRepositoriesResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListRepositoriesResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListRepositoriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse\";\n };\n \n return ListRepositoriesResponse;\n })();\n \n v1beta2.GetRepositoryRequest = (function() {\n \n /**\n * Properties of a GetRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IGetRepositoryRequest\n * @property {string|null} [name] GetRepositoryRequest name\n */\n \n /**\n * Constructs a new GetRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a GetRepositoryRequest.\n * @implements IGetRepositoryRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IGetRepositoryRequest=} [properties] Properties to set\n */\n function GetRepositoryRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetRepositoryRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.GetRepositoryRequest\n * @instance\n */\n GetRepositoryRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetRepositoryRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.GetRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetRepositoryRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.GetRepositoryRequest} GetRepositoryRequest instance\n */\n GetRepositoryRequest.create = function create(properties) {\n return new GetRepositoryRequest(properties);\n };\n \n /**\n * Encodes the specified GetRepositoryRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.GetRepositoryRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.GetRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetRepositoryRequest} message GetRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetRepositoryRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetRepositoryRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.GetRepositoryRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.GetRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetRepositoryRequest} message GetRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetRepositoryRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetRepositoryRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.GetRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.GetRepositoryRequest} GetRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetRepositoryRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.GetRepositoryRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetRepositoryRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.GetRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.GetRepositoryRequest} GetRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetRepositoryRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetRepositoryRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.GetRepositoryRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetRepositoryRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetRepositoryRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.GetRepositoryRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.GetRepositoryRequest} GetRepositoryRequest\n */\n GetRepositoryRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.GetRepositoryRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.GetRepositoryRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetRepositoryRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.GetRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.GetRepositoryRequest} message GetRepositoryRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetRepositoryRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetRepositoryRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.GetRepositoryRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetRepositoryRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetRepositoryRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.GetRepositoryRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetRepositoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.GetRepositoryRequest\";\n };\n \n return GetRepositoryRequest;\n })();\n \n v1beta2.CreateRepositoryRequest = (function() {\n \n /**\n * Properties of a CreateRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface ICreateRepositoryRequest\n * @property {string|null} [parent] CreateRepositoryRequest parent\n * @property {string|null} [repositoryId] CreateRepositoryRequest repositoryId\n * @property {google.devtools.artifactregistry.v1beta2.IRepository|null} [repository] CreateRepositoryRequest repository\n */\n \n /**\n * Constructs a new CreateRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a CreateRepositoryRequest.\n * @implements ICreateRepositoryRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.ICreateRepositoryRequest=} [properties] Properties to set\n */\n function CreateRepositoryRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CreateRepositoryRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest\n * @instance\n */\n CreateRepositoryRequest.prototype.parent = \"\";\n \n /**\n * CreateRepositoryRequest repositoryId.\n * @member {string} repositoryId\n * @memberof google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest\n * @instance\n */\n CreateRepositoryRequest.prototype.repositoryId = \"\";\n \n /**\n * CreateRepositoryRequest repository.\n * @member {google.devtools.artifactregistry.v1beta2.IRepository|null|undefined} repository\n * @memberof google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest\n * @instance\n */\n CreateRepositoryRequest.prototype.repository = null;\n \n /**\n * Creates a new CreateRepositoryRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ICreateRepositoryRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest} CreateRepositoryRequest instance\n */\n CreateRepositoryRequest.create = function create(properties) {\n return new CreateRepositoryRequest(properties);\n };\n \n /**\n * Encodes the specified CreateRepositoryRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ICreateRepositoryRequest} message CreateRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CreateRepositoryRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.repositoryId != null && Object.hasOwnProperty.call(message, \"repositoryId\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.repositoryId);\n if (message.repository != null && Object.hasOwnProperty.call(message, \"repository\"))\n $root.google.devtools.artifactregistry.v1beta2.Repository.encode(message.repository, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified CreateRepositoryRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ICreateRepositoryRequest} message CreateRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CreateRepositoryRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CreateRepositoryRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest} CreateRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CreateRepositoryRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.repositoryId = reader.string();\n break;\n }\n case 3: {\n message.repository = $root.google.devtools.artifactregistry.v1beta2.Repository.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CreateRepositoryRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest} CreateRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CreateRepositoryRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CreateRepositoryRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CreateRepositoryRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.repositoryId != null && message.hasOwnProperty(\"repositoryId\"))\n if (!$util.isString(message.repositoryId))\n return \"repositoryId: string expected\";\n if (message.repository != null && message.hasOwnProperty(\"repository\")) {\n var error = $root.google.devtools.artifactregistry.v1beta2.Repository.verify(message.repository);\n if (error)\n return \"repository.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a CreateRepositoryRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest} CreateRepositoryRequest\n */\n CreateRepositoryRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.repositoryId != null)\n message.repositoryId = String(object.repositoryId);\n if (object.repository != null) {\n if (typeof object.repository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest.repository: object expected\");\n message.repository = $root.google.devtools.artifactregistry.v1beta2.Repository.fromObject(object.repository);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a CreateRepositoryRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest} message CreateRepositoryRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CreateRepositoryRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.repositoryId = \"\";\n object.repository = null;\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.repositoryId != null && message.hasOwnProperty(\"repositoryId\"))\n object.repositoryId = message.repositoryId;\n if (message.repository != null && message.hasOwnProperty(\"repository\"))\n object.repository = $root.google.devtools.artifactregistry.v1beta2.Repository.toObject(message.repository, options);\n return object;\n };\n \n /**\n * Converts this CreateRepositoryRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest\n * @instance\n * @returns {Object.} JSON object\n */\n CreateRepositoryRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CreateRepositoryRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CreateRepositoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest\";\n };\n \n return CreateRepositoryRequest;\n })();\n \n v1beta2.UpdateRepositoryRequest = (function() {\n \n /**\n * Properties of an UpdateRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IUpdateRepositoryRequest\n * @property {google.devtools.artifactregistry.v1beta2.IRepository|null} [repository] UpdateRepositoryRequest repository\n * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateRepositoryRequest updateMask\n */\n \n /**\n * Constructs a new UpdateRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an UpdateRepositoryRequest.\n * @implements IUpdateRepositoryRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateRepositoryRequest=} [properties] Properties to set\n */\n function UpdateRepositoryRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * UpdateRepositoryRequest repository.\n * @member {google.devtools.artifactregistry.v1beta2.IRepository|null|undefined} repository\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest\n * @instance\n */\n UpdateRepositoryRequest.prototype.repository = null;\n \n /**\n * UpdateRepositoryRequest updateMask.\n * @member {google.protobuf.IFieldMask|null|undefined} updateMask\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest\n * @instance\n */\n UpdateRepositoryRequest.prototype.updateMask = null;\n \n /**\n * Creates a new UpdateRepositoryRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateRepositoryRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest} UpdateRepositoryRequest instance\n */\n UpdateRepositoryRequest.create = function create(properties) {\n return new UpdateRepositoryRequest(properties);\n };\n \n /**\n * Encodes the specified UpdateRepositoryRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateRepositoryRequest} message UpdateRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateRepositoryRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.repository != null && Object.hasOwnProperty.call(message, \"repository\"))\n $root.google.devtools.artifactregistry.v1beta2.Repository.encode(message.repository, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.updateMask != null && Object.hasOwnProperty.call(message, \"updateMask\"))\n $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified UpdateRepositoryRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateRepositoryRequest} message UpdateRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateRepositoryRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an UpdateRepositoryRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest} UpdateRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateRepositoryRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.repository = $root.google.devtools.artifactregistry.v1beta2.Repository.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an UpdateRepositoryRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest} UpdateRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateRepositoryRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an UpdateRepositoryRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n UpdateRepositoryRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.repository != null && message.hasOwnProperty(\"repository\")) {\n var error = $root.google.devtools.artifactregistry.v1beta2.Repository.verify(message.repository);\n if (error)\n return \"repository.\" + error;\n }\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\")) {\n var error = $root.google.protobuf.FieldMask.verify(message.updateMask);\n if (error)\n return \"updateMask.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an UpdateRepositoryRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest} UpdateRepositoryRequest\n */\n UpdateRepositoryRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest();\n if (object.repository != null) {\n if (typeof object.repository !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest.repository: object expected\");\n message.repository = $root.google.devtools.artifactregistry.v1beta2.Repository.fromObject(object.repository);\n }\n if (object.updateMask != null) {\n if (typeof object.updateMask !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest.updateMask: object expected\");\n message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an UpdateRepositoryRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest} message UpdateRepositoryRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n UpdateRepositoryRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.repository = null;\n object.updateMask = null;\n }\n if (message.repository != null && message.hasOwnProperty(\"repository\"))\n object.repository = $root.google.devtools.artifactregistry.v1beta2.Repository.toObject(message.repository, options);\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\"))\n object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);\n return object;\n };\n \n /**\n * Converts this UpdateRepositoryRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest\n * @instance\n * @returns {Object.} JSON object\n */\n UpdateRepositoryRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for UpdateRepositoryRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n UpdateRepositoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest\";\n };\n \n return UpdateRepositoryRequest;\n })();\n \n v1beta2.DeleteRepositoryRequest = (function() {\n \n /**\n * Properties of a DeleteRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IDeleteRepositoryRequest\n * @property {string|null} [name] DeleteRepositoryRequest name\n */\n \n /**\n * Constructs a new DeleteRepositoryRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a DeleteRepositoryRequest.\n * @implements IDeleteRepositoryRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteRepositoryRequest=} [properties] Properties to set\n */\n function DeleteRepositoryRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DeleteRepositoryRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest\n * @instance\n */\n DeleteRepositoryRequest.prototype.name = \"\";\n \n /**\n * Creates a new DeleteRepositoryRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteRepositoryRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest} DeleteRepositoryRequest instance\n */\n DeleteRepositoryRequest.create = function create(properties) {\n return new DeleteRepositoryRequest(properties);\n };\n \n /**\n * Encodes the specified DeleteRepositoryRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteRepositoryRequest} message DeleteRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteRepositoryRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified DeleteRepositoryRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteRepositoryRequest} message DeleteRepositoryRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteRepositoryRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DeleteRepositoryRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest} DeleteRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteRepositoryRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DeleteRepositoryRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest} DeleteRepositoryRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteRepositoryRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DeleteRepositoryRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DeleteRepositoryRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a DeleteRepositoryRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest} DeleteRepositoryRequest\n */\n DeleteRepositoryRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a DeleteRepositoryRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest} message DeleteRepositoryRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DeleteRepositoryRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this DeleteRepositoryRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest\n * @instance\n * @returns {Object.} JSON object\n */\n DeleteRepositoryRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DeleteRepositoryRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DeleteRepositoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest\";\n };\n \n return DeleteRepositoryRequest;\n })();\n \n v1beta2.ArtifactRegistry = (function() {\n \n /**\n * Constructs a new ArtifactRegistry service.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an ArtifactRegistry\n * @extends $protobuf.rpc.Service\n * @constructor\n * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\n function ArtifactRegistry(rpcImpl, requestDelimited, responseDelimited) {\n $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\n }\n \n (ArtifactRegistry.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ArtifactRegistry;\n \n /**\n * Creates new ArtifactRegistry service using the specified rpc implementation.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @static\n * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n * @returns {ArtifactRegistry} RPC service. Useful where requests and/or responses are streamed.\n */\n ArtifactRegistry.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n return new this(rpcImpl, requestDelimited, responseDelimited);\n };\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|importAptArtifacts}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef ImportAptArtifactsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls ImportAptArtifacts.\n * @function importAptArtifacts\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsRequest} request ImportAptArtifactsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.ImportAptArtifactsCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.importAptArtifacts = function importAptArtifacts(request, callback) {\n return this.rpcCall(importAptArtifacts, $root.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"ImportAptArtifacts\" });\n \n /**\n * Calls ImportAptArtifacts.\n * @function importAptArtifacts\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IImportAptArtifactsRequest} request ImportAptArtifactsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|importYumArtifacts}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef ImportYumArtifactsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls ImportYumArtifacts.\n * @function importYumArtifacts\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsRequest} request ImportYumArtifactsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.ImportYumArtifactsCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.importYumArtifacts = function importYumArtifacts(request, callback) {\n return this.rpcCall(importYumArtifacts, $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"ImportYumArtifacts\" });\n \n /**\n * Calls ImportYumArtifacts.\n * @function importYumArtifacts\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsRequest} request ImportYumArtifactsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|listRepositories}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef ListRepositoriesCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse} [response] ListRepositoriesResponse\n */\n \n /**\n * Calls ListRepositories.\n * @function listRepositories\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IListRepositoriesRequest} request ListRepositoriesRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.ListRepositoriesCallback} callback Node-style callback called with the error, if any, and ListRepositoriesResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listRepositories = function listRepositories(request, callback) {\n return this.rpcCall(listRepositories, $root.google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest, $root.google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse, request, callback);\n }, \"name\", { value: \"ListRepositories\" });\n \n /**\n * Calls ListRepositories.\n * @function listRepositories\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IListRepositoriesRequest} request ListRepositoriesRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|getRepository}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef GetRepositoryCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1beta2.Repository} [response] Repository\n */\n \n /**\n * Calls GetRepository.\n * @function getRepository\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IGetRepositoryRequest} request GetRepositoryRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.GetRepositoryCallback} callback Node-style callback called with the error, if any, and Repository\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getRepository = function getRepository(request, callback) {\n return this.rpcCall(getRepository, $root.google.devtools.artifactregistry.v1beta2.GetRepositoryRequest, $root.google.devtools.artifactregistry.v1beta2.Repository, request, callback);\n }, \"name\", { value: \"GetRepository\" });\n \n /**\n * Calls GetRepository.\n * @function getRepository\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IGetRepositoryRequest} request GetRepositoryRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|createRepository}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef CreateRepositoryCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls CreateRepository.\n * @function createRepository\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.ICreateRepositoryRequest} request CreateRepositoryRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.CreateRepositoryCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.createRepository = function createRepository(request, callback) {\n return this.rpcCall(createRepository, $root.google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"CreateRepository\" });\n \n /**\n * Calls CreateRepository.\n * @function createRepository\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.ICreateRepositoryRequest} request CreateRepositoryRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|updateRepository}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef UpdateRepositoryCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1beta2.Repository} [response] Repository\n */\n \n /**\n * Calls UpdateRepository.\n * @function updateRepository\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateRepositoryRequest} request UpdateRepositoryRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.UpdateRepositoryCallback} callback Node-style callback called with the error, if any, and Repository\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.updateRepository = function updateRepository(request, callback) {\n return this.rpcCall(updateRepository, $root.google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest, $root.google.devtools.artifactregistry.v1beta2.Repository, request, callback);\n }, \"name\", { value: \"UpdateRepository\" });\n \n /**\n * Calls UpdateRepository.\n * @function updateRepository\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateRepositoryRequest} request UpdateRepositoryRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|deleteRepository}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef DeleteRepositoryCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls DeleteRepository.\n * @function deleteRepository\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteRepositoryRequest} request DeleteRepositoryRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.DeleteRepositoryCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.deleteRepository = function deleteRepository(request, callback) {\n return this.rpcCall(deleteRepository, $root.google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"DeleteRepository\" });\n \n /**\n * Calls DeleteRepository.\n * @function deleteRepository\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteRepositoryRequest} request DeleteRepositoryRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|listPackages}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef ListPackagesCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1beta2.ListPackagesResponse} [response] ListPackagesResponse\n */\n \n /**\n * Calls ListPackages.\n * @function listPackages\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IListPackagesRequest} request ListPackagesRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.ListPackagesCallback} callback Node-style callback called with the error, if any, and ListPackagesResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listPackages = function listPackages(request, callback) {\n return this.rpcCall(listPackages, $root.google.devtools.artifactregistry.v1beta2.ListPackagesRequest, $root.google.devtools.artifactregistry.v1beta2.ListPackagesResponse, request, callback);\n }, \"name\", { value: \"ListPackages\" });\n \n /**\n * Calls ListPackages.\n * @function listPackages\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IListPackagesRequest} request ListPackagesRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|getPackage}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef GetPackageCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1beta2.Package} [response] Package\n */\n \n /**\n * Calls GetPackage.\n * @function getPackage\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IGetPackageRequest} request GetPackageRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.GetPackageCallback} callback Node-style callback called with the error, if any, and Package\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getPackage = function getPackage(request, callback) {\n return this.rpcCall(getPackage, $root.google.devtools.artifactregistry.v1beta2.GetPackageRequest, $root.google.devtools.artifactregistry.v1beta2.Package, request, callback);\n }, \"name\", { value: \"GetPackage\" });\n \n /**\n * Calls GetPackage.\n * @function getPackage\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IGetPackageRequest} request GetPackageRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|deletePackage}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef DeletePackageCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls DeletePackage.\n * @function deletePackage\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IDeletePackageRequest} request DeletePackageRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.DeletePackageCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.deletePackage = function deletePackage(request, callback) {\n return this.rpcCall(deletePackage, $root.google.devtools.artifactregistry.v1beta2.DeletePackageRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"DeletePackage\" });\n \n /**\n * Calls DeletePackage.\n * @function deletePackage\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IDeletePackageRequest} request DeletePackageRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|listVersions}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef ListVersionsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1beta2.ListVersionsResponse} [response] ListVersionsResponse\n */\n \n /**\n * Calls ListVersions.\n * @function listVersions\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IListVersionsRequest} request ListVersionsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.ListVersionsCallback} callback Node-style callback called with the error, if any, and ListVersionsResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listVersions = function listVersions(request, callback) {\n return this.rpcCall(listVersions, $root.google.devtools.artifactregistry.v1beta2.ListVersionsRequest, $root.google.devtools.artifactregistry.v1beta2.ListVersionsResponse, request, callback);\n }, \"name\", { value: \"ListVersions\" });\n \n /**\n * Calls ListVersions.\n * @function listVersions\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IListVersionsRequest} request ListVersionsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|getVersion}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef GetVersionCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1beta2.Version} [response] Version\n */\n \n /**\n * Calls GetVersion.\n * @function getVersion\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IGetVersionRequest} request GetVersionRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.GetVersionCallback} callback Node-style callback called with the error, if any, and Version\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getVersion = function getVersion(request, callback) {\n return this.rpcCall(getVersion, $root.google.devtools.artifactregistry.v1beta2.GetVersionRequest, $root.google.devtools.artifactregistry.v1beta2.Version, request, callback);\n }, \"name\", { value: \"GetVersion\" });\n \n /**\n * Calls GetVersion.\n * @function getVersion\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IGetVersionRequest} request GetVersionRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|deleteVersion}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef DeleteVersionCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls DeleteVersion.\n * @function deleteVersion\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteVersionRequest} request DeleteVersionRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.DeleteVersionCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.deleteVersion = function deleteVersion(request, callback) {\n return this.rpcCall(deleteVersion, $root.google.devtools.artifactregistry.v1beta2.DeleteVersionRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"DeleteVersion\" });\n \n /**\n * Calls DeleteVersion.\n * @function deleteVersion\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteVersionRequest} request DeleteVersionRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|listFiles}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef ListFilesCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1beta2.ListFilesResponse} [response] ListFilesResponse\n */\n \n /**\n * Calls ListFiles.\n * @function listFiles\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IListFilesRequest} request ListFilesRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.ListFilesCallback} callback Node-style callback called with the error, if any, and ListFilesResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listFiles = function listFiles(request, callback) {\n return this.rpcCall(listFiles, $root.google.devtools.artifactregistry.v1beta2.ListFilesRequest, $root.google.devtools.artifactregistry.v1beta2.ListFilesResponse, request, callback);\n }, \"name\", { value: \"ListFiles\" });\n \n /**\n * Calls ListFiles.\n * @function listFiles\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IListFilesRequest} request ListFilesRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|getFile}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef GetFileCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1beta2.File} [response] File\n */\n \n /**\n * Calls GetFile.\n * @function getFile\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IGetFileRequest} request GetFileRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.GetFileCallback} callback Node-style callback called with the error, if any, and File\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getFile = function getFile(request, callback) {\n return this.rpcCall(getFile, $root.google.devtools.artifactregistry.v1beta2.GetFileRequest, $root.google.devtools.artifactregistry.v1beta2.File, request, callback);\n }, \"name\", { value: \"GetFile\" });\n \n /**\n * Calls GetFile.\n * @function getFile\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IGetFileRequest} request GetFileRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|listTags}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef ListTagsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1beta2.ListTagsResponse} [response] ListTagsResponse\n */\n \n /**\n * Calls ListTags.\n * @function listTags\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IListTagsRequest} request ListTagsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.ListTagsCallback} callback Node-style callback called with the error, if any, and ListTagsResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.listTags = function listTags(request, callback) {\n return this.rpcCall(listTags, $root.google.devtools.artifactregistry.v1beta2.ListTagsRequest, $root.google.devtools.artifactregistry.v1beta2.ListTagsResponse, request, callback);\n }, \"name\", { value: \"ListTags\" });\n \n /**\n * Calls ListTags.\n * @function listTags\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IListTagsRequest} request ListTagsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|getTag}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef GetTagCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1beta2.Tag} [response] Tag\n */\n \n /**\n * Calls GetTag.\n * @function getTag\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IGetTagRequest} request GetTagRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.GetTagCallback} callback Node-style callback called with the error, if any, and Tag\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getTag = function getTag(request, callback) {\n return this.rpcCall(getTag, $root.google.devtools.artifactregistry.v1beta2.GetTagRequest, $root.google.devtools.artifactregistry.v1beta2.Tag, request, callback);\n }, \"name\", { value: \"GetTag\" });\n \n /**\n * Calls GetTag.\n * @function getTag\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IGetTagRequest} request GetTagRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|createTag}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef CreateTagCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1beta2.Tag} [response] Tag\n */\n \n /**\n * Calls CreateTag.\n * @function createTag\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.ICreateTagRequest} request CreateTagRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.CreateTagCallback} callback Node-style callback called with the error, if any, and Tag\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.createTag = function createTag(request, callback) {\n return this.rpcCall(createTag, $root.google.devtools.artifactregistry.v1beta2.CreateTagRequest, $root.google.devtools.artifactregistry.v1beta2.Tag, request, callback);\n }, \"name\", { value: \"CreateTag\" });\n \n /**\n * Calls CreateTag.\n * @function createTag\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.ICreateTagRequest} request CreateTagRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|updateTag}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef UpdateTagCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1beta2.Tag} [response] Tag\n */\n \n /**\n * Calls UpdateTag.\n * @function updateTag\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateTagRequest} request UpdateTagRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.UpdateTagCallback} callback Node-style callback called with the error, if any, and Tag\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.updateTag = function updateTag(request, callback) {\n return this.rpcCall(updateTag, $root.google.devtools.artifactregistry.v1beta2.UpdateTagRequest, $root.google.devtools.artifactregistry.v1beta2.Tag, request, callback);\n }, \"name\", { value: \"UpdateTag\" });\n \n /**\n * Calls UpdateTag.\n * @function updateTag\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateTagRequest} request UpdateTagRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|deleteTag}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef DeleteTagCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.protobuf.Empty} [response] Empty\n */\n \n /**\n * Calls DeleteTag.\n * @function deleteTag\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteTagRequest} request DeleteTagRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.DeleteTagCallback} callback Node-style callback called with the error, if any, and Empty\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.deleteTag = function deleteTag(request, callback) {\n return this.rpcCall(deleteTag, $root.google.devtools.artifactregistry.v1beta2.DeleteTagRequest, $root.google.protobuf.Empty, request, callback);\n }, \"name\", { value: \"DeleteTag\" });\n \n /**\n * Calls DeleteTag.\n * @function deleteTag\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteTagRequest} request DeleteTagRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|setIamPolicy}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef SetIamPolicyCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.iam.v1.Policy} [response] Policy\n */\n \n /**\n * Calls SetIamPolicy.\n * @function setIamPolicy\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.setIamPolicy = function setIamPolicy(request, callback) {\n return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback);\n }, \"name\", { value: \"SetIamPolicy\" });\n \n /**\n * Calls SetIamPolicy.\n * @function setIamPolicy\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|getIamPolicy}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef GetIamPolicyCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.iam.v1.Policy} [response] Policy\n */\n \n /**\n * Calls GetIamPolicy.\n * @function getIamPolicy\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getIamPolicy = function getIamPolicy(request, callback) {\n return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback);\n }, \"name\", { value: \"GetIamPolicy\" });\n \n /**\n * Calls GetIamPolicy.\n * @function getIamPolicy\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|testIamPermissions}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef TestIamPermissionsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse\n */\n \n /**\n * Calls TestIamPermissions.\n * @function testIamPermissions\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.testIamPermissions = function testIamPermissions(request, callback) {\n return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback);\n }, \"name\", { value: \"TestIamPermissions\" });\n \n /**\n * Calls TestIamPermissions.\n * @function testIamPermissions\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|getProjectSettings}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef GetProjectSettingsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1beta2.ProjectSettings} [response] ProjectSettings\n */\n \n /**\n * Calls GetProjectSettings.\n * @function getProjectSettings\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IGetProjectSettingsRequest} request GetProjectSettingsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.GetProjectSettingsCallback} callback Node-style callback called with the error, if any, and ProjectSettings\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.getProjectSettings = function getProjectSettings(request, callback) {\n return this.rpcCall(getProjectSettings, $root.google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest, $root.google.devtools.artifactregistry.v1beta2.ProjectSettings, request, callback);\n }, \"name\", { value: \"GetProjectSettings\" });\n \n /**\n * Calls GetProjectSettings.\n * @function getProjectSettings\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IGetProjectSettingsRequest} request GetProjectSettingsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.devtools.artifactregistry.v1beta2.ArtifactRegistry|updateProjectSettings}.\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @typedef UpdateProjectSettingsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.devtools.artifactregistry.v1beta2.ProjectSettings} [response] ProjectSettings\n */\n \n /**\n * Calls UpdateProjectSettings.\n * @function updateProjectSettings\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateProjectSettingsRequest} request UpdateProjectSettingsRequest message or plain object\n * @param {google.devtools.artifactregistry.v1beta2.ArtifactRegistry.UpdateProjectSettingsCallback} callback Node-style callback called with the error, if any, and ProjectSettings\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(ArtifactRegistry.prototype.updateProjectSettings = function updateProjectSettings(request, callback) {\n return this.rpcCall(updateProjectSettings, $root.google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest, $root.google.devtools.artifactregistry.v1beta2.ProjectSettings, request, callback);\n }, \"name\", { value: \"UpdateProjectSettings\" });\n \n /**\n * Calls UpdateProjectSettings.\n * @function updateProjectSettings\n * @memberof google.devtools.artifactregistry.v1beta2.ArtifactRegistry\n * @instance\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateProjectSettingsRequest} request UpdateProjectSettingsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n return ArtifactRegistry;\n })();\n \n v1beta2.OperationMetadata = (function() {\n \n /**\n * Properties of an OperationMetadata.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IOperationMetadata\n */\n \n /**\n * Constructs a new OperationMetadata.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an OperationMetadata.\n * @implements IOperationMetadata\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IOperationMetadata=} [properties] Properties to set\n */\n function OperationMetadata(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Creates a new OperationMetadata instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.OperationMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IOperationMetadata=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.OperationMetadata} OperationMetadata instance\n */\n OperationMetadata.create = function create(properties) {\n return new OperationMetadata(properties);\n };\n \n /**\n * Encodes the specified OperationMetadata message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.OperationMetadata.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.OperationMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IOperationMetadata} message OperationMetadata message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OperationMetadata.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n return writer;\n };\n \n /**\n * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.OperationMetadata.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.OperationMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IOperationMetadata} message OperationMetadata message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an OperationMetadata message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.OperationMetadata\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.OperationMetadata} OperationMetadata\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OperationMetadata.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.OperationMetadata();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an OperationMetadata message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.OperationMetadata\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.OperationMetadata} OperationMetadata\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OperationMetadata.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an OperationMetadata message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.OperationMetadata\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n OperationMetadata.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n return null;\n };\n \n /**\n * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.OperationMetadata\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.OperationMetadata} OperationMetadata\n */\n OperationMetadata.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.OperationMetadata)\n return object;\n return new $root.google.devtools.artifactregistry.v1beta2.OperationMetadata();\n };\n \n /**\n * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.OperationMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.OperationMetadata} message OperationMetadata\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n OperationMetadata.toObject = function toObject() {\n return {};\n };\n \n /**\n * Converts this OperationMetadata to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.OperationMetadata\n * @instance\n * @returns {Object.} JSON object\n */\n OperationMetadata.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for OperationMetadata\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.OperationMetadata\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.OperationMetadata\";\n };\n \n return OperationMetadata;\n })();\n \n v1beta2.ProjectSettings = (function() {\n \n /**\n * Properties of a ProjectSettings.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IProjectSettings\n * @property {string|null} [name] ProjectSettings name\n * @property {google.devtools.artifactregistry.v1beta2.ProjectSettings.RedirectionState|null} [legacyRedirectionState] ProjectSettings legacyRedirectionState\n */\n \n /**\n * Constructs a new ProjectSettings.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a ProjectSettings.\n * @implements IProjectSettings\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IProjectSettings=} [properties] Properties to set\n */\n function ProjectSettings(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ProjectSettings name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.ProjectSettings\n * @instance\n */\n ProjectSettings.prototype.name = \"\";\n \n /**\n * ProjectSettings legacyRedirectionState.\n * @member {google.devtools.artifactregistry.v1beta2.ProjectSettings.RedirectionState} legacyRedirectionState\n * @memberof google.devtools.artifactregistry.v1beta2.ProjectSettings\n * @instance\n */\n ProjectSettings.prototype.legacyRedirectionState = 0;\n \n /**\n * Creates a new ProjectSettings instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ProjectSettings\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IProjectSettings=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ProjectSettings} ProjectSettings instance\n */\n ProjectSettings.create = function create(properties) {\n return new ProjectSettings(properties);\n };\n \n /**\n * Encodes the specified ProjectSettings message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ProjectSettings.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ProjectSettings\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IProjectSettings} message ProjectSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ProjectSettings.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.legacyRedirectionState != null && Object.hasOwnProperty.call(message, \"legacyRedirectionState\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.legacyRedirectionState);\n return writer;\n };\n \n /**\n * Encodes the specified ProjectSettings message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ProjectSettings.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ProjectSettings\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IProjectSettings} message ProjectSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ProjectSettings.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ProjectSettings message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ProjectSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ProjectSettings} ProjectSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ProjectSettings.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ProjectSettings();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.legacyRedirectionState = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ProjectSettings message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ProjectSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ProjectSettings} ProjectSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ProjectSettings.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ProjectSettings message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ProjectSettings\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ProjectSettings.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.legacyRedirectionState != null && message.hasOwnProperty(\"legacyRedirectionState\"))\n switch (message.legacyRedirectionState) {\n default:\n return \"legacyRedirectionState: enum value expected\";\n case 0:\n case 1:\n case 2:\n case 3:\n break;\n }\n return null;\n };\n \n /**\n * Creates a ProjectSettings message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ProjectSettings\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ProjectSettings} ProjectSettings\n */\n ProjectSettings.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ProjectSettings)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ProjectSettings();\n if (object.name != null)\n message.name = String(object.name);\n switch (object.legacyRedirectionState) {\n default:\n if (typeof object.legacyRedirectionState === \"number\") {\n message.legacyRedirectionState = object.legacyRedirectionState;\n break;\n }\n break;\n case \"REDIRECTION_STATE_UNSPECIFIED\":\n case 0:\n message.legacyRedirectionState = 0;\n break;\n case \"REDIRECTION_FROM_GCR_IO_DISABLED\":\n case 1:\n message.legacyRedirectionState = 1;\n break;\n case \"REDIRECTION_FROM_GCR_IO_ENABLED\":\n case 2:\n message.legacyRedirectionState = 2;\n break;\n case \"REDIRECTION_FROM_GCR_IO_FINALIZED\":\n case 3:\n message.legacyRedirectionState = 3;\n break;\n }\n return message;\n };\n \n /**\n * Creates a plain object from a ProjectSettings message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ProjectSettings\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ProjectSettings} message ProjectSettings\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ProjectSettings.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.legacyRedirectionState = options.enums === String ? \"REDIRECTION_STATE_UNSPECIFIED\" : 0;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.legacyRedirectionState != null && message.hasOwnProperty(\"legacyRedirectionState\"))\n object.legacyRedirectionState = options.enums === String ? $root.google.devtools.artifactregistry.v1beta2.ProjectSettings.RedirectionState[message.legacyRedirectionState] === undefined ? message.legacyRedirectionState : $root.google.devtools.artifactregistry.v1beta2.ProjectSettings.RedirectionState[message.legacyRedirectionState] : message.legacyRedirectionState;\n return object;\n };\n \n /**\n * Converts this ProjectSettings to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ProjectSettings\n * @instance\n * @returns {Object.} JSON object\n */\n ProjectSettings.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ProjectSettings\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ProjectSettings\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ProjectSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ProjectSettings\";\n };\n \n /**\n * RedirectionState enum.\n * @name google.devtools.artifactregistry.v1beta2.ProjectSettings.RedirectionState\n * @enum {number}\n * @property {number} REDIRECTION_STATE_UNSPECIFIED=0 REDIRECTION_STATE_UNSPECIFIED value\n * @property {number} REDIRECTION_FROM_GCR_IO_DISABLED=1 REDIRECTION_FROM_GCR_IO_DISABLED value\n * @property {number} REDIRECTION_FROM_GCR_IO_ENABLED=2 REDIRECTION_FROM_GCR_IO_ENABLED value\n * @property {number} REDIRECTION_FROM_GCR_IO_FINALIZED=3 REDIRECTION_FROM_GCR_IO_FINALIZED value\n */\n ProjectSettings.RedirectionState = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"REDIRECTION_STATE_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"REDIRECTION_FROM_GCR_IO_DISABLED\"] = 1;\n values[valuesById[2] = \"REDIRECTION_FROM_GCR_IO_ENABLED\"] = 2;\n values[valuesById[3] = \"REDIRECTION_FROM_GCR_IO_FINALIZED\"] = 3;\n return values;\n })();\n \n return ProjectSettings;\n })();\n \n v1beta2.GetProjectSettingsRequest = (function() {\n \n /**\n * Properties of a GetProjectSettingsRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IGetProjectSettingsRequest\n * @property {string|null} [name] GetProjectSettingsRequest name\n */\n \n /**\n * Constructs a new GetProjectSettingsRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a GetProjectSettingsRequest.\n * @implements IGetProjectSettingsRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IGetProjectSettingsRequest=} [properties] Properties to set\n */\n function GetProjectSettingsRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetProjectSettingsRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest\n * @instance\n */\n GetProjectSettingsRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetProjectSettingsRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetProjectSettingsRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest} GetProjectSettingsRequest instance\n */\n GetProjectSettingsRequest.create = function create(properties) {\n return new GetProjectSettingsRequest(properties);\n };\n \n /**\n * Encodes the specified GetProjectSettingsRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetProjectSettingsRequest} message GetProjectSettingsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetProjectSettingsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetProjectSettingsRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetProjectSettingsRequest} message GetProjectSettingsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetProjectSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetProjectSettingsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest} GetProjectSettingsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetProjectSettingsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetProjectSettingsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest} GetProjectSettingsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetProjectSettingsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetProjectSettingsRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetProjectSettingsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetProjectSettingsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest} GetProjectSettingsRequest\n */\n GetProjectSettingsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetProjectSettingsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest} message GetProjectSettingsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetProjectSettingsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetProjectSettingsRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetProjectSettingsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetProjectSettingsRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetProjectSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest\";\n };\n \n return GetProjectSettingsRequest;\n })();\n \n v1beta2.UpdateProjectSettingsRequest = (function() {\n \n /**\n * Properties of an UpdateProjectSettingsRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IUpdateProjectSettingsRequest\n * @property {google.devtools.artifactregistry.v1beta2.IProjectSettings|null} [projectSettings] UpdateProjectSettingsRequest projectSettings\n * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProjectSettingsRequest updateMask\n */\n \n /**\n * Constructs a new UpdateProjectSettingsRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an UpdateProjectSettingsRequest.\n * @implements IUpdateProjectSettingsRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateProjectSettingsRequest=} [properties] Properties to set\n */\n function UpdateProjectSettingsRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * UpdateProjectSettingsRequest projectSettings.\n * @member {google.devtools.artifactregistry.v1beta2.IProjectSettings|null|undefined} projectSettings\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest\n * @instance\n */\n UpdateProjectSettingsRequest.prototype.projectSettings = null;\n \n /**\n * UpdateProjectSettingsRequest updateMask.\n * @member {google.protobuf.IFieldMask|null|undefined} updateMask\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest\n * @instance\n */\n UpdateProjectSettingsRequest.prototype.updateMask = null;\n \n /**\n * Creates a new UpdateProjectSettingsRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateProjectSettingsRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest} UpdateProjectSettingsRequest instance\n */\n UpdateProjectSettingsRequest.create = function create(properties) {\n return new UpdateProjectSettingsRequest(properties);\n };\n \n /**\n * Encodes the specified UpdateProjectSettingsRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateProjectSettingsRequest} message UpdateProjectSettingsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateProjectSettingsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.projectSettings != null && Object.hasOwnProperty.call(message, \"projectSettings\"))\n $root.google.devtools.artifactregistry.v1beta2.ProjectSettings.encode(message.projectSettings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.updateMask != null && Object.hasOwnProperty.call(message, \"updateMask\"))\n $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified UpdateProjectSettingsRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateProjectSettingsRequest} message UpdateProjectSettingsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateProjectSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an UpdateProjectSettingsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest} UpdateProjectSettingsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateProjectSettingsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n message.projectSettings = $root.google.devtools.artifactregistry.v1beta2.ProjectSettings.decode(reader, reader.uint32());\n break;\n }\n case 3: {\n message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an UpdateProjectSettingsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest} UpdateProjectSettingsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateProjectSettingsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an UpdateProjectSettingsRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n UpdateProjectSettingsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.projectSettings != null && message.hasOwnProperty(\"projectSettings\")) {\n var error = $root.google.devtools.artifactregistry.v1beta2.ProjectSettings.verify(message.projectSettings);\n if (error)\n return \"projectSettings.\" + error;\n }\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\")) {\n var error = $root.google.protobuf.FieldMask.verify(message.updateMask);\n if (error)\n return \"updateMask.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an UpdateProjectSettingsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest} UpdateProjectSettingsRequest\n */\n UpdateProjectSettingsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest();\n if (object.projectSettings != null) {\n if (typeof object.projectSettings !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest.projectSettings: object expected\");\n message.projectSettings = $root.google.devtools.artifactregistry.v1beta2.ProjectSettings.fromObject(object.projectSettings);\n }\n if (object.updateMask != null) {\n if (typeof object.updateMask !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest.updateMask: object expected\");\n message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an UpdateProjectSettingsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest} message UpdateProjectSettingsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n UpdateProjectSettingsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.projectSettings = null;\n object.updateMask = null;\n }\n if (message.projectSettings != null && message.hasOwnProperty(\"projectSettings\"))\n object.projectSettings = $root.google.devtools.artifactregistry.v1beta2.ProjectSettings.toObject(message.projectSettings, options);\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\"))\n object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);\n return object;\n };\n \n /**\n * Converts this UpdateProjectSettingsRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n UpdateProjectSettingsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for UpdateProjectSettingsRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n UpdateProjectSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest\";\n };\n \n return UpdateProjectSettingsRequest;\n })();\n \n v1beta2.Tag = (function() {\n \n /**\n * Properties of a Tag.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface ITag\n * @property {string|null} [name] Tag name\n * @property {string|null} [version] Tag version\n */\n \n /**\n * Constructs a new Tag.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a Tag.\n * @implements ITag\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.ITag=} [properties] Properties to set\n */\n function Tag(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Tag name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.Tag\n * @instance\n */\n Tag.prototype.name = \"\";\n \n /**\n * Tag version.\n * @member {string} version\n * @memberof google.devtools.artifactregistry.v1beta2.Tag\n * @instance\n */\n Tag.prototype.version = \"\";\n \n /**\n * Creates a new Tag instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.Tag\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ITag=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.Tag} Tag instance\n */\n Tag.create = function create(properties) {\n return new Tag(properties);\n };\n \n /**\n * Encodes the specified Tag message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.Tag.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.Tag\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ITag} message Tag message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Tag.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.version != null && Object.hasOwnProperty.call(message, \"version\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.version);\n return writer;\n };\n \n /**\n * Encodes the specified Tag message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.Tag.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.Tag\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ITag} message Tag message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Tag.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Tag message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.Tag\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.Tag} Tag\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Tag.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.Tag();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.version = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Tag message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.Tag\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.Tag} Tag\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Tag.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Tag message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.Tag\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Tag.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.version != null && message.hasOwnProperty(\"version\"))\n if (!$util.isString(message.version))\n return \"version: string expected\";\n return null;\n };\n \n /**\n * Creates a Tag message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.Tag\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.Tag} Tag\n */\n Tag.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.Tag)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.Tag();\n if (object.name != null)\n message.name = String(object.name);\n if (object.version != null)\n message.version = String(object.version);\n return message;\n };\n \n /**\n * Creates a plain object from a Tag message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.Tag\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.Tag} message Tag\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Tag.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.version = \"\";\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.version != null && message.hasOwnProperty(\"version\"))\n object.version = message.version;\n return object;\n };\n \n /**\n * Converts this Tag to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.Tag\n * @instance\n * @returns {Object.} JSON object\n */\n Tag.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Tag\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.Tag\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Tag.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.Tag\";\n };\n \n return Tag;\n })();\n \n v1beta2.ListTagsRequest = (function() {\n \n /**\n * Properties of a ListTagsRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IListTagsRequest\n * @property {string|null} [parent] ListTagsRequest parent\n * @property {string|null} [filter] ListTagsRequest filter\n * @property {number|null} [pageSize] ListTagsRequest pageSize\n * @property {string|null} [pageToken] ListTagsRequest pageToken\n */\n \n /**\n * Constructs a new ListTagsRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a ListTagsRequest.\n * @implements IListTagsRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IListTagsRequest=} [properties] Properties to set\n */\n function ListTagsRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListTagsRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsRequest\n * @instance\n */\n ListTagsRequest.prototype.parent = \"\";\n \n /**\n * ListTagsRequest filter.\n * @member {string} filter\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsRequest\n * @instance\n */\n ListTagsRequest.prototype.filter = \"\";\n \n /**\n * ListTagsRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsRequest\n * @instance\n */\n ListTagsRequest.prototype.pageSize = 0;\n \n /**\n * ListTagsRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsRequest\n * @instance\n */\n ListTagsRequest.prototype.pageToken = \"\";\n \n /**\n * Creates a new ListTagsRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListTagsRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ListTagsRequest} ListTagsRequest instance\n */\n ListTagsRequest.create = function create(properties) {\n return new ListTagsRequest(properties);\n };\n \n /**\n * Encodes the specified ListTagsRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListTagsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListTagsRequest} message ListTagsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListTagsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n if (message.filter != null && Object.hasOwnProperty.call(message, \"filter\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter);\n return writer;\n };\n \n /**\n * Encodes the specified ListTagsRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListTagsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListTagsRequest} message ListTagsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListTagsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListTagsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ListTagsRequest} ListTagsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListTagsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ListTagsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 4: {\n message.filter = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListTagsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ListTagsRequest} ListTagsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListTagsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListTagsRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListTagsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n if (!$util.isString(message.filter))\n return \"filter: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListTagsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ListTagsRequest} ListTagsRequest\n */\n ListTagsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ListTagsRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ListTagsRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.filter != null)\n message.filter = String(object.filter);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListTagsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ListTagsRequest} message ListTagsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListTagsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n object.filter = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n object.filter = message.filter;\n return object;\n };\n \n /**\n * Converts this ListTagsRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListTagsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListTagsRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListTagsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ListTagsRequest\";\n };\n \n return ListTagsRequest;\n })();\n \n v1beta2.ListTagsResponse = (function() {\n \n /**\n * Properties of a ListTagsResponse.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IListTagsResponse\n * @property {Array.|null} [tags] ListTagsResponse tags\n * @property {string|null} [nextPageToken] ListTagsResponse nextPageToken\n */\n \n /**\n * Constructs a new ListTagsResponse.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a ListTagsResponse.\n * @implements IListTagsResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IListTagsResponse=} [properties] Properties to set\n */\n function ListTagsResponse(properties) {\n this.tags = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListTagsResponse tags.\n * @member {Array.} tags\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsResponse\n * @instance\n */\n ListTagsResponse.prototype.tags = $util.emptyArray;\n \n /**\n * ListTagsResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsResponse\n * @instance\n */\n ListTagsResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListTagsResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListTagsResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ListTagsResponse} ListTagsResponse instance\n */\n ListTagsResponse.create = function create(properties) {\n return new ListTagsResponse(properties);\n };\n \n /**\n * Encodes the specified ListTagsResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListTagsResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListTagsResponse} message ListTagsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListTagsResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.tags != null && message.tags.length)\n for (var i = 0; i < message.tags.length; ++i)\n $root.google.devtools.artifactregistry.v1beta2.Tag.encode(message.tags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListTagsResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListTagsResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListTagsResponse} message ListTagsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListTagsResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListTagsResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ListTagsResponse} ListTagsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListTagsResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ListTagsResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.tags && message.tags.length))\n message.tags = [];\n message.tags.push($root.google.devtools.artifactregistry.v1beta2.Tag.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListTagsResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ListTagsResponse} ListTagsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListTagsResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListTagsResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListTagsResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.tags != null && message.hasOwnProperty(\"tags\")) {\n if (!Array.isArray(message.tags))\n return \"tags: array expected\";\n for (var i = 0; i < message.tags.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1beta2.Tag.verify(message.tags[i]);\n if (error)\n return \"tags.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListTagsResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ListTagsResponse} ListTagsResponse\n */\n ListTagsResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ListTagsResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ListTagsResponse();\n if (object.tags) {\n if (!Array.isArray(object.tags))\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ListTagsResponse.tags: array expected\");\n message.tags = [];\n for (var i = 0; i < object.tags.length; ++i) {\n if (typeof object.tags[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ListTagsResponse.tags: object expected\");\n message.tags[i] = $root.google.devtools.artifactregistry.v1beta2.Tag.fromObject(object.tags[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListTagsResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ListTagsResponse} message ListTagsResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListTagsResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.tags = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.tags && message.tags.length) {\n object.tags = [];\n for (var j = 0; j < message.tags.length; ++j)\n object.tags[j] = $root.google.devtools.artifactregistry.v1beta2.Tag.toObject(message.tags[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListTagsResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListTagsResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListTagsResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ListTagsResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListTagsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ListTagsResponse\";\n };\n \n return ListTagsResponse;\n })();\n \n v1beta2.GetTagRequest = (function() {\n \n /**\n * Properties of a GetTagRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IGetTagRequest\n * @property {string|null} [name] GetTagRequest name\n */\n \n /**\n * Constructs a new GetTagRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a GetTagRequest.\n * @implements IGetTagRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IGetTagRequest=} [properties] Properties to set\n */\n function GetTagRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetTagRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.GetTagRequest\n * @instance\n */\n GetTagRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetTagRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.GetTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetTagRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.GetTagRequest} GetTagRequest instance\n */\n GetTagRequest.create = function create(properties) {\n return new GetTagRequest(properties);\n };\n \n /**\n * Encodes the specified GetTagRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.GetTagRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.GetTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetTagRequest} message GetTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetTagRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetTagRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.GetTagRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.GetTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetTagRequest} message GetTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetTagRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetTagRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.GetTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.GetTagRequest} GetTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetTagRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.GetTagRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetTagRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.GetTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.GetTagRequest} GetTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetTagRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetTagRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.GetTagRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetTagRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetTagRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.GetTagRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.GetTagRequest} GetTagRequest\n */\n GetTagRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.GetTagRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.GetTagRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetTagRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.GetTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.GetTagRequest} message GetTagRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetTagRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetTagRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.GetTagRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetTagRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetTagRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.GetTagRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetTagRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.GetTagRequest\";\n };\n \n return GetTagRequest;\n })();\n \n v1beta2.CreateTagRequest = (function() {\n \n /**\n * Properties of a CreateTagRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface ICreateTagRequest\n * @property {string|null} [parent] CreateTagRequest parent\n * @property {string|null} [tagId] CreateTagRequest tagId\n * @property {google.devtools.artifactregistry.v1beta2.ITag|null} [tag] CreateTagRequest tag\n */\n \n /**\n * Constructs a new CreateTagRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a CreateTagRequest.\n * @implements ICreateTagRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.ICreateTagRequest=} [properties] Properties to set\n */\n function CreateTagRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CreateTagRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1beta2.CreateTagRequest\n * @instance\n */\n CreateTagRequest.prototype.parent = \"\";\n \n /**\n * CreateTagRequest tagId.\n * @member {string} tagId\n * @memberof google.devtools.artifactregistry.v1beta2.CreateTagRequest\n * @instance\n */\n CreateTagRequest.prototype.tagId = \"\";\n \n /**\n * CreateTagRequest tag.\n * @member {google.devtools.artifactregistry.v1beta2.ITag|null|undefined} tag\n * @memberof google.devtools.artifactregistry.v1beta2.CreateTagRequest\n * @instance\n */\n CreateTagRequest.prototype.tag = null;\n \n /**\n * Creates a new CreateTagRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.CreateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ICreateTagRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.CreateTagRequest} CreateTagRequest instance\n */\n CreateTagRequest.create = function create(properties) {\n return new CreateTagRequest(properties);\n };\n \n /**\n * Encodes the specified CreateTagRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.CreateTagRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.CreateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ICreateTagRequest} message CreateTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CreateTagRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.tagId != null && Object.hasOwnProperty.call(message, \"tagId\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.tagId);\n if (message.tag != null && Object.hasOwnProperty.call(message, \"tag\"))\n $root.google.devtools.artifactregistry.v1beta2.Tag.encode(message.tag, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified CreateTagRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.CreateTagRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.CreateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ICreateTagRequest} message CreateTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CreateTagRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CreateTagRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.CreateTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.CreateTagRequest} CreateTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CreateTagRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.CreateTagRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.tagId = reader.string();\n break;\n }\n case 3: {\n message.tag = $root.google.devtools.artifactregistry.v1beta2.Tag.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CreateTagRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.CreateTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.CreateTagRequest} CreateTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CreateTagRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CreateTagRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.CreateTagRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CreateTagRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.tagId != null && message.hasOwnProperty(\"tagId\"))\n if (!$util.isString(message.tagId))\n return \"tagId: string expected\";\n if (message.tag != null && message.hasOwnProperty(\"tag\")) {\n var error = $root.google.devtools.artifactregistry.v1beta2.Tag.verify(message.tag);\n if (error)\n return \"tag.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a CreateTagRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.CreateTagRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.CreateTagRequest} CreateTagRequest\n */\n CreateTagRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.CreateTagRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.CreateTagRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.tagId != null)\n message.tagId = String(object.tagId);\n if (object.tag != null) {\n if (typeof object.tag !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.CreateTagRequest.tag: object expected\");\n message.tag = $root.google.devtools.artifactregistry.v1beta2.Tag.fromObject(object.tag);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a CreateTagRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.CreateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.CreateTagRequest} message CreateTagRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CreateTagRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.tagId = \"\";\n object.tag = null;\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.tagId != null && message.hasOwnProperty(\"tagId\"))\n object.tagId = message.tagId;\n if (message.tag != null && message.hasOwnProperty(\"tag\"))\n object.tag = $root.google.devtools.artifactregistry.v1beta2.Tag.toObject(message.tag, options);\n return object;\n };\n \n /**\n * Converts this CreateTagRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.CreateTagRequest\n * @instance\n * @returns {Object.} JSON object\n */\n CreateTagRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CreateTagRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.CreateTagRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CreateTagRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.CreateTagRequest\";\n };\n \n return CreateTagRequest;\n })();\n \n v1beta2.UpdateTagRequest = (function() {\n \n /**\n * Properties of an UpdateTagRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IUpdateTagRequest\n * @property {google.devtools.artifactregistry.v1beta2.ITag|null} [tag] UpdateTagRequest tag\n * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTagRequest updateMask\n */\n \n /**\n * Constructs a new UpdateTagRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an UpdateTagRequest.\n * @implements IUpdateTagRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateTagRequest=} [properties] Properties to set\n */\n function UpdateTagRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * UpdateTagRequest tag.\n * @member {google.devtools.artifactregistry.v1beta2.ITag|null|undefined} tag\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateTagRequest\n * @instance\n */\n UpdateTagRequest.prototype.tag = null;\n \n /**\n * UpdateTagRequest updateMask.\n * @member {google.protobuf.IFieldMask|null|undefined} updateMask\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateTagRequest\n * @instance\n */\n UpdateTagRequest.prototype.updateMask = null;\n \n /**\n * Creates a new UpdateTagRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateTagRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.UpdateTagRequest} UpdateTagRequest instance\n */\n UpdateTagRequest.create = function create(properties) {\n return new UpdateTagRequest(properties);\n };\n \n /**\n * Encodes the specified UpdateTagRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.UpdateTagRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateTagRequest} message UpdateTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateTagRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.tag != null && Object.hasOwnProperty.call(message, \"tag\"))\n $root.google.devtools.artifactregistry.v1beta2.Tag.encode(message.tag, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.updateMask != null && Object.hasOwnProperty.call(message, \"updateMask\"))\n $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified UpdateTagRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.UpdateTagRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IUpdateTagRequest} message UpdateTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UpdateTagRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an UpdateTagRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.UpdateTagRequest} UpdateTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateTagRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.UpdateTagRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.tag = $root.google.devtools.artifactregistry.v1beta2.Tag.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an UpdateTagRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.UpdateTagRequest} UpdateTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UpdateTagRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an UpdateTagRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateTagRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n UpdateTagRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.tag != null && message.hasOwnProperty(\"tag\")) {\n var error = $root.google.devtools.artifactregistry.v1beta2.Tag.verify(message.tag);\n if (error)\n return \"tag.\" + error;\n }\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\")) {\n var error = $root.google.protobuf.FieldMask.verify(message.updateMask);\n if (error)\n return \"updateMask.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an UpdateTagRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateTagRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.UpdateTagRequest} UpdateTagRequest\n */\n UpdateTagRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.UpdateTagRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.UpdateTagRequest();\n if (object.tag != null) {\n if (typeof object.tag !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.UpdateTagRequest.tag: object expected\");\n message.tag = $root.google.devtools.artifactregistry.v1beta2.Tag.fromObject(object.tag);\n }\n if (object.updateMask != null) {\n if (typeof object.updateMask !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.UpdateTagRequest.updateMask: object expected\");\n message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an UpdateTagRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.UpdateTagRequest} message UpdateTagRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n UpdateTagRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.tag = null;\n object.updateMask = null;\n }\n if (message.tag != null && message.hasOwnProperty(\"tag\"))\n object.tag = $root.google.devtools.artifactregistry.v1beta2.Tag.toObject(message.tag, options);\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\"))\n object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);\n return object;\n };\n \n /**\n * Converts this UpdateTagRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateTagRequest\n * @instance\n * @returns {Object.} JSON object\n */\n UpdateTagRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for UpdateTagRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.UpdateTagRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n UpdateTagRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.UpdateTagRequest\";\n };\n \n return UpdateTagRequest;\n })();\n \n v1beta2.DeleteTagRequest = (function() {\n \n /**\n * Properties of a DeleteTagRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IDeleteTagRequest\n * @property {string|null} [name] DeleteTagRequest name\n */\n \n /**\n * Constructs a new DeleteTagRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a DeleteTagRequest.\n * @implements IDeleteTagRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteTagRequest=} [properties] Properties to set\n */\n function DeleteTagRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DeleteTagRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteTagRequest\n * @instance\n */\n DeleteTagRequest.prototype.name = \"\";\n \n /**\n * Creates a new DeleteTagRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteTagRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.DeleteTagRequest} DeleteTagRequest instance\n */\n DeleteTagRequest.create = function create(properties) {\n return new DeleteTagRequest(properties);\n };\n \n /**\n * Encodes the specified DeleteTagRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.DeleteTagRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteTagRequest} message DeleteTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteTagRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified DeleteTagRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.DeleteTagRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteTagRequest} message DeleteTagRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteTagRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DeleteTagRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.DeleteTagRequest} DeleteTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteTagRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.DeleteTagRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DeleteTagRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteTagRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.DeleteTagRequest} DeleteTagRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteTagRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DeleteTagRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteTagRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DeleteTagRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a DeleteTagRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteTagRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.DeleteTagRequest} DeleteTagRequest\n */\n DeleteTagRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.DeleteTagRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.DeleteTagRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a DeleteTagRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteTagRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.DeleteTagRequest} message DeleteTagRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DeleteTagRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this DeleteTagRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteTagRequest\n * @instance\n * @returns {Object.} JSON object\n */\n DeleteTagRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DeleteTagRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteTagRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DeleteTagRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.DeleteTagRequest\";\n };\n \n return DeleteTagRequest;\n })();\n \n /**\n * VersionView enum.\n * @name google.devtools.artifactregistry.v1beta2.VersionView\n * @enum {number}\n * @property {number} VERSION_VIEW_UNSPECIFIED=0 VERSION_VIEW_UNSPECIFIED value\n * @property {number} BASIC=1 BASIC value\n * @property {number} FULL=2 FULL value\n */\n v1beta2.VersionView = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"VERSION_VIEW_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"BASIC\"] = 1;\n values[valuesById[2] = \"FULL\"] = 2;\n return values;\n })();\n \n v1beta2.Version = (function() {\n \n /**\n * Properties of a Version.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IVersion\n * @property {string|null} [name] Version name\n * @property {string|null} [description] Version description\n * @property {google.protobuf.ITimestamp|null} [createTime] Version createTime\n * @property {google.protobuf.ITimestamp|null} [updateTime] Version updateTime\n * @property {Array.|null} [relatedTags] Version relatedTags\n * @property {google.protobuf.IStruct|null} [metadata] Version metadata\n */\n \n /**\n * Constructs a new Version.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a Version.\n * @implements IVersion\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IVersion=} [properties] Properties to set\n */\n function Version(properties) {\n this.relatedTags = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Version name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @instance\n */\n Version.prototype.name = \"\";\n \n /**\n * Version description.\n * @member {string} description\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @instance\n */\n Version.prototype.description = \"\";\n \n /**\n * Version createTime.\n * @member {google.protobuf.ITimestamp|null|undefined} createTime\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @instance\n */\n Version.prototype.createTime = null;\n \n /**\n * Version updateTime.\n * @member {google.protobuf.ITimestamp|null|undefined} updateTime\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @instance\n */\n Version.prototype.updateTime = null;\n \n /**\n * Version relatedTags.\n * @member {Array.} relatedTags\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @instance\n */\n Version.prototype.relatedTags = $util.emptyArray;\n \n /**\n * Version metadata.\n * @member {google.protobuf.IStruct|null|undefined} metadata\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @instance\n */\n Version.prototype.metadata = null;\n \n /**\n * Creates a new Version instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IVersion=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.Version} Version instance\n */\n Version.create = function create(properties) {\n return new Version(properties);\n };\n \n /**\n * Encodes the specified Version message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.Version.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IVersion} message Version message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Version.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.description != null && Object.hasOwnProperty.call(message, \"description\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.description);\n if (message.createTime != null && Object.hasOwnProperty.call(message, \"createTime\"))\n $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.updateTime != null && Object.hasOwnProperty.call(message, \"updateTime\"))\n $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.relatedTags != null && message.relatedTags.length)\n for (var i = 0; i < message.relatedTags.length; ++i)\n $root.google.devtools.artifactregistry.v1beta2.Tag.encode(message.relatedTags[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n if (message.metadata != null && Object.hasOwnProperty.call(message, \"metadata\"))\n $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified Version message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.Version.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IVersion} message Version message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Version.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Version message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.Version} Version\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Version.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.Version();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 3: {\n message.description = reader.string();\n break;\n }\n case 5: {\n message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 6: {\n message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());\n break;\n }\n case 7: {\n if (!(message.relatedTags && message.relatedTags.length))\n message.relatedTags = [];\n message.relatedTags.push($root.google.devtools.artifactregistry.v1beta2.Tag.decode(reader, reader.uint32()));\n break;\n }\n case 8: {\n message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Version message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.Version} Version\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Version.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Version message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Version.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.description != null && message.hasOwnProperty(\"description\"))\n if (!$util.isString(message.description))\n return \"description: string expected\";\n if (message.createTime != null && message.hasOwnProperty(\"createTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.createTime);\n if (error)\n return \"createTime.\" + error;\n }\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\")) {\n var error = $root.google.protobuf.Timestamp.verify(message.updateTime);\n if (error)\n return \"updateTime.\" + error;\n }\n if (message.relatedTags != null && message.hasOwnProperty(\"relatedTags\")) {\n if (!Array.isArray(message.relatedTags))\n return \"relatedTags: array expected\";\n for (var i = 0; i < message.relatedTags.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1beta2.Tag.verify(message.relatedTags[i]);\n if (error)\n return \"relatedTags.\" + error;\n }\n }\n if (message.metadata != null && message.hasOwnProperty(\"metadata\")) {\n var error = $root.google.protobuf.Struct.verify(message.metadata);\n if (error)\n return \"metadata.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a Version message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.Version} Version\n */\n Version.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.Version)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.Version();\n if (object.name != null)\n message.name = String(object.name);\n if (object.description != null)\n message.description = String(object.description);\n if (object.createTime != null) {\n if (typeof object.createTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.Version.createTime: object expected\");\n message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);\n }\n if (object.updateTime != null) {\n if (typeof object.updateTime !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.Version.updateTime: object expected\");\n message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);\n }\n if (object.relatedTags) {\n if (!Array.isArray(object.relatedTags))\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.Version.relatedTags: array expected\");\n message.relatedTags = [];\n for (var i = 0; i < object.relatedTags.length; ++i) {\n if (typeof object.relatedTags[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.Version.relatedTags: object expected\");\n message.relatedTags[i] = $root.google.devtools.artifactregistry.v1beta2.Tag.fromObject(object.relatedTags[i]);\n }\n }\n if (object.metadata != null) {\n if (typeof object.metadata !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.Version.metadata: object expected\");\n message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a Version message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.Version} message Version\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Version.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.relatedTags = [];\n if (options.defaults) {\n object.name = \"\";\n object.description = \"\";\n object.createTime = null;\n object.updateTime = null;\n object.metadata = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.description != null && message.hasOwnProperty(\"description\"))\n object.description = message.description;\n if (message.createTime != null && message.hasOwnProperty(\"createTime\"))\n object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);\n if (message.updateTime != null && message.hasOwnProperty(\"updateTime\"))\n object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);\n if (message.relatedTags && message.relatedTags.length) {\n object.relatedTags = [];\n for (var j = 0; j < message.relatedTags.length; ++j)\n object.relatedTags[j] = $root.google.devtools.artifactregistry.v1beta2.Tag.toObject(message.relatedTags[j], options);\n }\n if (message.metadata != null && message.hasOwnProperty(\"metadata\"))\n object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options);\n return object;\n };\n \n /**\n * Converts this Version to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @instance\n * @returns {Object.} JSON object\n */\n Version.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Version\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.Version\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Version.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.Version\";\n };\n \n return Version;\n })();\n \n v1beta2.ListVersionsRequest = (function() {\n \n /**\n * Properties of a ListVersionsRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IListVersionsRequest\n * @property {string|null} [parent] ListVersionsRequest parent\n * @property {number|null} [pageSize] ListVersionsRequest pageSize\n * @property {string|null} [pageToken] ListVersionsRequest pageToken\n * @property {google.devtools.artifactregistry.v1beta2.VersionView|null} [view] ListVersionsRequest view\n * @property {string|null} [orderBy] ListVersionsRequest orderBy\n */\n \n /**\n * Constructs a new ListVersionsRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a ListVersionsRequest.\n * @implements IListVersionsRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IListVersionsRequest=} [properties] Properties to set\n */\n function ListVersionsRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListVersionsRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsRequest\n * @instance\n */\n ListVersionsRequest.prototype.parent = \"\";\n \n /**\n * ListVersionsRequest pageSize.\n * @member {number} pageSize\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsRequest\n * @instance\n */\n ListVersionsRequest.prototype.pageSize = 0;\n \n /**\n * ListVersionsRequest pageToken.\n * @member {string} pageToken\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsRequest\n * @instance\n */\n ListVersionsRequest.prototype.pageToken = \"\";\n \n /**\n * ListVersionsRequest view.\n * @member {google.devtools.artifactregistry.v1beta2.VersionView} view\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsRequest\n * @instance\n */\n ListVersionsRequest.prototype.view = 0;\n \n /**\n * ListVersionsRequest orderBy.\n * @member {string} orderBy\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsRequest\n * @instance\n */\n ListVersionsRequest.prototype.orderBy = \"\";\n \n /**\n * Creates a new ListVersionsRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListVersionsRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ListVersionsRequest} ListVersionsRequest instance\n */\n ListVersionsRequest.create = function create(properties) {\n return new ListVersionsRequest(properties);\n };\n \n /**\n * Encodes the specified ListVersionsRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListVersionsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListVersionsRequest} message ListVersionsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListVersionsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n if (message.view != null && Object.hasOwnProperty.call(message, \"view\"))\n writer.uint32(/* id 4, wireType 0 =*/32).int32(message.view);\n if (message.orderBy != null && Object.hasOwnProperty.call(message, \"orderBy\"))\n writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy);\n return writer;\n };\n \n /**\n * Encodes the specified ListVersionsRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListVersionsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListVersionsRequest} message ListVersionsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListVersionsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ListVersionsRequest} ListVersionsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListVersionsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ListVersionsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.parent = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n case 4: {\n message.view = reader.int32();\n break;\n }\n case 5: {\n message.orderBy = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListVersionsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ListVersionsRequest} ListVersionsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListVersionsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListVersionsRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListVersionsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n if (message.view != null && message.hasOwnProperty(\"view\"))\n switch (message.view) {\n default:\n return \"view: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.orderBy != null && message.hasOwnProperty(\"orderBy\"))\n if (!$util.isString(message.orderBy))\n return \"orderBy: string expected\";\n return null;\n };\n \n /**\n * Creates a ListVersionsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ListVersionsRequest} ListVersionsRequest\n */\n ListVersionsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ListVersionsRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ListVersionsRequest();\n if (object.parent != null)\n message.parent = String(object.parent);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n switch (object.view) {\n default:\n if (typeof object.view === \"number\") {\n message.view = object.view;\n break;\n }\n break;\n case \"VERSION_VIEW_UNSPECIFIED\":\n case 0:\n message.view = 0;\n break;\n case \"BASIC\":\n case 1:\n message.view = 1;\n break;\n case \"FULL\":\n case 2:\n message.view = 2;\n break;\n }\n if (object.orderBy != null)\n message.orderBy = String(object.orderBy);\n return message;\n };\n \n /**\n * Creates a plain object from a ListVersionsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ListVersionsRequest} message ListVersionsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListVersionsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.parent = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n object.view = options.enums === String ? \"VERSION_VIEW_UNSPECIFIED\" : 0;\n object.orderBy = \"\";\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n if (message.view != null && message.hasOwnProperty(\"view\"))\n object.view = options.enums === String ? $root.google.devtools.artifactregistry.v1beta2.VersionView[message.view] === undefined ? message.view : $root.google.devtools.artifactregistry.v1beta2.VersionView[message.view] : message.view;\n if (message.orderBy != null && message.hasOwnProperty(\"orderBy\"))\n object.orderBy = message.orderBy;\n return object;\n };\n \n /**\n * Converts this ListVersionsRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListVersionsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListVersionsRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ListVersionsRequest\";\n };\n \n return ListVersionsRequest;\n })();\n \n v1beta2.ListVersionsResponse = (function() {\n \n /**\n * Properties of a ListVersionsResponse.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IListVersionsResponse\n * @property {Array.|null} [versions] ListVersionsResponse versions\n * @property {string|null} [nextPageToken] ListVersionsResponse nextPageToken\n */\n \n /**\n * Constructs a new ListVersionsResponse.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a ListVersionsResponse.\n * @implements IListVersionsResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IListVersionsResponse=} [properties] Properties to set\n */\n function ListVersionsResponse(properties) {\n this.versions = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListVersionsResponse versions.\n * @member {Array.} versions\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsResponse\n * @instance\n */\n ListVersionsResponse.prototype.versions = $util.emptyArray;\n \n /**\n * ListVersionsResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsResponse\n * @instance\n */\n ListVersionsResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListVersionsResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListVersionsResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ListVersionsResponse} ListVersionsResponse instance\n */\n ListVersionsResponse.create = function create(properties) {\n return new ListVersionsResponse(properties);\n };\n \n /**\n * Encodes the specified ListVersionsResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListVersionsResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListVersionsResponse} message ListVersionsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListVersionsResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.versions != null && message.versions.length)\n for (var i = 0; i < message.versions.length; ++i)\n $root.google.devtools.artifactregistry.v1beta2.Version.encode(message.versions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListVersionsResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ListVersionsResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IListVersionsResponse} message ListVersionsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListVersionsResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ListVersionsResponse} ListVersionsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListVersionsResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ListVersionsResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.versions && message.versions.length))\n message.versions = [];\n message.versions.push($root.google.devtools.artifactregistry.v1beta2.Version.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListVersionsResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ListVersionsResponse} ListVersionsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListVersionsResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListVersionsResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListVersionsResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.versions != null && message.hasOwnProperty(\"versions\")) {\n if (!Array.isArray(message.versions))\n return \"versions: array expected\";\n for (var i = 0; i < message.versions.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1beta2.Version.verify(message.versions[i]);\n if (error)\n return \"versions.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListVersionsResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ListVersionsResponse} ListVersionsResponse\n */\n ListVersionsResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ListVersionsResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ListVersionsResponse();\n if (object.versions) {\n if (!Array.isArray(object.versions))\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ListVersionsResponse.versions: array expected\");\n message.versions = [];\n for (var i = 0; i < object.versions.length; ++i) {\n if (typeof object.versions[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ListVersionsResponse.versions: object expected\");\n message.versions[i] = $root.google.devtools.artifactregistry.v1beta2.Version.fromObject(object.versions[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListVersionsResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ListVersionsResponse} message ListVersionsResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListVersionsResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.versions = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.versions && message.versions.length) {\n object.versions = [];\n for (var j = 0; j < message.versions.length; ++j)\n object.versions[j] = $root.google.devtools.artifactregistry.v1beta2.Version.toObject(message.versions[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListVersionsResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListVersionsResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListVersionsResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ListVersionsResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ListVersionsResponse\";\n };\n \n return ListVersionsResponse;\n })();\n \n v1beta2.GetVersionRequest = (function() {\n \n /**\n * Properties of a GetVersionRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IGetVersionRequest\n * @property {string|null} [name] GetVersionRequest name\n * @property {google.devtools.artifactregistry.v1beta2.VersionView|null} [view] GetVersionRequest view\n */\n \n /**\n * Constructs a new GetVersionRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a GetVersionRequest.\n * @implements IGetVersionRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IGetVersionRequest=} [properties] Properties to set\n */\n function GetVersionRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetVersionRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.GetVersionRequest\n * @instance\n */\n GetVersionRequest.prototype.name = \"\";\n \n /**\n * GetVersionRequest view.\n * @member {google.devtools.artifactregistry.v1beta2.VersionView} view\n * @memberof google.devtools.artifactregistry.v1beta2.GetVersionRequest\n * @instance\n */\n GetVersionRequest.prototype.view = 0;\n \n /**\n * Creates a new GetVersionRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.GetVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetVersionRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.GetVersionRequest} GetVersionRequest instance\n */\n GetVersionRequest.create = function create(properties) {\n return new GetVersionRequest(properties);\n };\n \n /**\n * Encodes the specified GetVersionRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.GetVersionRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.GetVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetVersionRequest} message GetVersionRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetVersionRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.view != null && Object.hasOwnProperty.call(message, \"view\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view);\n return writer;\n };\n \n /**\n * Encodes the specified GetVersionRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.GetVersionRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.GetVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IGetVersionRequest} message GetVersionRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetVersionRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetVersionRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.GetVersionRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.GetVersionRequest} GetVersionRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetVersionRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.GetVersionRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.view = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetVersionRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.GetVersionRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.GetVersionRequest} GetVersionRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetVersionRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetVersionRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.GetVersionRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetVersionRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.view != null && message.hasOwnProperty(\"view\"))\n switch (message.view) {\n default:\n return \"view: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n return null;\n };\n \n /**\n * Creates a GetVersionRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.GetVersionRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.GetVersionRequest} GetVersionRequest\n */\n GetVersionRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.GetVersionRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.GetVersionRequest();\n if (object.name != null)\n message.name = String(object.name);\n switch (object.view) {\n default:\n if (typeof object.view === \"number\") {\n message.view = object.view;\n break;\n }\n break;\n case \"VERSION_VIEW_UNSPECIFIED\":\n case 0:\n message.view = 0;\n break;\n case \"BASIC\":\n case 1:\n message.view = 1;\n break;\n case \"FULL\":\n case 2:\n message.view = 2;\n break;\n }\n return message;\n };\n \n /**\n * Creates a plain object from a GetVersionRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.GetVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.GetVersionRequest} message GetVersionRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetVersionRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.view = options.enums === String ? \"VERSION_VIEW_UNSPECIFIED\" : 0;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.view != null && message.hasOwnProperty(\"view\"))\n object.view = options.enums === String ? $root.google.devtools.artifactregistry.v1beta2.VersionView[message.view] === undefined ? message.view : $root.google.devtools.artifactregistry.v1beta2.VersionView[message.view] : message.view;\n return object;\n };\n \n /**\n * Converts this GetVersionRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.GetVersionRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetVersionRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetVersionRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.GetVersionRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.GetVersionRequest\";\n };\n \n return GetVersionRequest;\n })();\n \n v1beta2.DeleteVersionRequest = (function() {\n \n /**\n * Properties of a DeleteVersionRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IDeleteVersionRequest\n * @property {string|null} [name] DeleteVersionRequest name\n * @property {boolean|null} [force] DeleteVersionRequest force\n */\n \n /**\n * Constructs a new DeleteVersionRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a DeleteVersionRequest.\n * @implements IDeleteVersionRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteVersionRequest=} [properties] Properties to set\n */\n function DeleteVersionRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DeleteVersionRequest name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteVersionRequest\n * @instance\n */\n DeleteVersionRequest.prototype.name = \"\";\n \n /**\n * DeleteVersionRequest force.\n * @member {boolean} force\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteVersionRequest\n * @instance\n */\n DeleteVersionRequest.prototype.force = false;\n \n /**\n * Creates a new DeleteVersionRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteVersionRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.DeleteVersionRequest} DeleteVersionRequest instance\n */\n DeleteVersionRequest.create = function create(properties) {\n return new DeleteVersionRequest(properties);\n };\n \n /**\n * Encodes the specified DeleteVersionRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.DeleteVersionRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteVersionRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.force != null && Object.hasOwnProperty.call(message, \"force\"))\n writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force);\n return writer;\n };\n \n /**\n * Encodes the specified DeleteVersionRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.DeleteVersionRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteVersionRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DeleteVersionRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteVersionRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.DeleteVersionRequest} DeleteVersionRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteVersionRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.DeleteVersionRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.force = reader.bool();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DeleteVersionRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteVersionRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.DeleteVersionRequest} DeleteVersionRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteVersionRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DeleteVersionRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteVersionRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DeleteVersionRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.force != null && message.hasOwnProperty(\"force\"))\n if (typeof message.force !== \"boolean\")\n return \"force: boolean expected\";\n return null;\n };\n \n /**\n * Creates a DeleteVersionRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteVersionRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.DeleteVersionRequest} DeleteVersionRequest\n */\n DeleteVersionRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.DeleteVersionRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.DeleteVersionRequest();\n if (object.name != null)\n message.name = String(object.name);\n if (object.force != null)\n message.force = Boolean(object.force);\n return message;\n };\n \n /**\n * Creates a plain object from a DeleteVersionRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteVersionRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.DeleteVersionRequest} message DeleteVersionRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DeleteVersionRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.force = false;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.force != null && message.hasOwnProperty(\"force\"))\n object.force = message.force;\n return object;\n };\n \n /**\n * Converts this DeleteVersionRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteVersionRequest\n * @instance\n * @returns {Object.} JSON object\n */\n DeleteVersionRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DeleteVersionRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.DeleteVersionRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DeleteVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.DeleteVersionRequest\";\n };\n \n return DeleteVersionRequest;\n })();\n \n v1beta2.YumArtifact = (function() {\n \n /**\n * Properties of a YumArtifact.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IYumArtifact\n * @property {string|null} [name] YumArtifact name\n * @property {string|null} [packageName] YumArtifact packageName\n * @property {google.devtools.artifactregistry.v1beta2.YumArtifact.PackageType|null} [packageType] YumArtifact packageType\n * @property {string|null} [architecture] YumArtifact architecture\n */\n \n /**\n * Constructs a new YumArtifact.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents a YumArtifact.\n * @implements IYumArtifact\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IYumArtifact=} [properties] Properties to set\n */\n function YumArtifact(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * YumArtifact name.\n * @member {string} name\n * @memberof google.devtools.artifactregistry.v1beta2.YumArtifact\n * @instance\n */\n YumArtifact.prototype.name = \"\";\n \n /**\n * YumArtifact packageName.\n * @member {string} packageName\n * @memberof google.devtools.artifactregistry.v1beta2.YumArtifact\n * @instance\n */\n YumArtifact.prototype.packageName = \"\";\n \n /**\n * YumArtifact packageType.\n * @member {google.devtools.artifactregistry.v1beta2.YumArtifact.PackageType} packageType\n * @memberof google.devtools.artifactregistry.v1beta2.YumArtifact\n * @instance\n */\n YumArtifact.prototype.packageType = 0;\n \n /**\n * YumArtifact architecture.\n * @member {string} architecture\n * @memberof google.devtools.artifactregistry.v1beta2.YumArtifact\n * @instance\n */\n YumArtifact.prototype.architecture = \"\";\n \n /**\n * Creates a new YumArtifact instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.YumArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IYumArtifact=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.YumArtifact} YumArtifact instance\n */\n YumArtifact.create = function create(properties) {\n return new YumArtifact(properties);\n };\n \n /**\n * Encodes the specified YumArtifact message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.YumArtifact.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.YumArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IYumArtifact} message YumArtifact message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n YumArtifact.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.packageName != null && Object.hasOwnProperty.call(message, \"packageName\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.packageName);\n if (message.packageType != null && Object.hasOwnProperty.call(message, \"packageType\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.packageType);\n if (message.architecture != null && Object.hasOwnProperty.call(message, \"architecture\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.architecture);\n return writer;\n };\n \n /**\n * Encodes the specified YumArtifact message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.YumArtifact.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.YumArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IYumArtifact} message YumArtifact message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n YumArtifact.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a YumArtifact message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.YumArtifact\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.YumArtifact} YumArtifact\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n YumArtifact.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.YumArtifact();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.packageName = reader.string();\n break;\n }\n case 3: {\n message.packageType = reader.int32();\n break;\n }\n case 4: {\n message.architecture = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a YumArtifact message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.YumArtifact\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.YumArtifact} YumArtifact\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n YumArtifact.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a YumArtifact message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.YumArtifact\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n YumArtifact.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.packageName != null && message.hasOwnProperty(\"packageName\"))\n if (!$util.isString(message.packageName))\n return \"packageName: string expected\";\n if (message.packageType != null && message.hasOwnProperty(\"packageType\"))\n switch (message.packageType) {\n default:\n return \"packageType: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.architecture != null && message.hasOwnProperty(\"architecture\"))\n if (!$util.isString(message.architecture))\n return \"architecture: string expected\";\n return null;\n };\n \n /**\n * Creates a YumArtifact message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.YumArtifact\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.YumArtifact} YumArtifact\n */\n YumArtifact.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.YumArtifact)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.YumArtifact();\n if (object.name != null)\n message.name = String(object.name);\n if (object.packageName != null)\n message.packageName = String(object.packageName);\n switch (object.packageType) {\n default:\n if (typeof object.packageType === \"number\") {\n message.packageType = object.packageType;\n break;\n }\n break;\n case \"PACKAGE_TYPE_UNSPECIFIED\":\n case 0:\n message.packageType = 0;\n break;\n case \"BINARY\":\n case 1:\n message.packageType = 1;\n break;\n case \"SOURCE\":\n case 2:\n message.packageType = 2;\n break;\n }\n if (object.architecture != null)\n message.architecture = String(object.architecture);\n return message;\n };\n \n /**\n * Creates a plain object from a YumArtifact message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.YumArtifact\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.YumArtifact} message YumArtifact\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n YumArtifact.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.packageName = \"\";\n object.packageType = options.enums === String ? \"PACKAGE_TYPE_UNSPECIFIED\" : 0;\n object.architecture = \"\";\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.packageName != null && message.hasOwnProperty(\"packageName\"))\n object.packageName = message.packageName;\n if (message.packageType != null && message.hasOwnProperty(\"packageType\"))\n object.packageType = options.enums === String ? $root.google.devtools.artifactregistry.v1beta2.YumArtifact.PackageType[message.packageType] === undefined ? message.packageType : $root.google.devtools.artifactregistry.v1beta2.YumArtifact.PackageType[message.packageType] : message.packageType;\n if (message.architecture != null && message.hasOwnProperty(\"architecture\"))\n object.architecture = message.architecture;\n return object;\n };\n \n /**\n * Converts this YumArtifact to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.YumArtifact\n * @instance\n * @returns {Object.} JSON object\n */\n YumArtifact.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for YumArtifact\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.YumArtifact\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n YumArtifact.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.YumArtifact\";\n };\n \n /**\n * PackageType enum.\n * @name google.devtools.artifactregistry.v1beta2.YumArtifact.PackageType\n * @enum {number}\n * @property {number} PACKAGE_TYPE_UNSPECIFIED=0 PACKAGE_TYPE_UNSPECIFIED value\n * @property {number} BINARY=1 BINARY value\n * @property {number} SOURCE=2 SOURCE value\n */\n YumArtifact.PackageType = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"PACKAGE_TYPE_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"BINARY\"] = 1;\n values[valuesById[2] = \"SOURCE\"] = 2;\n return values;\n })();\n \n return YumArtifact;\n })();\n \n v1beta2.ImportYumArtifactsGcsSource = (function() {\n \n /**\n * Properties of an ImportYumArtifactsGcsSource.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IImportYumArtifactsGcsSource\n * @property {Array.|null} [uris] ImportYumArtifactsGcsSource uris\n * @property {boolean|null} [useWildcards] ImportYumArtifactsGcsSource useWildcards\n */\n \n /**\n * Constructs a new ImportYumArtifactsGcsSource.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an ImportYumArtifactsGcsSource.\n * @implements IImportYumArtifactsGcsSource\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsGcsSource=} [properties] Properties to set\n */\n function ImportYumArtifactsGcsSource(properties) {\n this.uris = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportYumArtifactsGcsSource uris.\n * @member {Array.} uris\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource\n * @instance\n */\n ImportYumArtifactsGcsSource.prototype.uris = $util.emptyArray;\n \n /**\n * ImportYumArtifactsGcsSource useWildcards.\n * @member {boolean} useWildcards\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource\n * @instance\n */\n ImportYumArtifactsGcsSource.prototype.useWildcards = false;\n \n /**\n * Creates a new ImportYumArtifactsGcsSource instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsGcsSource=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource} ImportYumArtifactsGcsSource instance\n */\n ImportYumArtifactsGcsSource.create = function create(properties) {\n return new ImportYumArtifactsGcsSource(properties);\n };\n \n /**\n * Encodes the specified ImportYumArtifactsGcsSource message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsGcsSource} message ImportYumArtifactsGcsSource message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsGcsSource.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.uris != null && message.uris.length)\n for (var i = 0; i < message.uris.length; ++i)\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.uris[i]);\n if (message.useWildcards != null && Object.hasOwnProperty.call(message, \"useWildcards\"))\n writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useWildcards);\n return writer;\n };\n \n /**\n * Encodes the specified ImportYumArtifactsGcsSource message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsGcsSource} message ImportYumArtifactsGcsSource message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsGcsSource.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportYumArtifactsGcsSource message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource} ImportYumArtifactsGcsSource\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsGcsSource.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.uris && message.uris.length))\n message.uris = [];\n message.uris.push(reader.string());\n break;\n }\n case 2: {\n message.useWildcards = reader.bool();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportYumArtifactsGcsSource message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource} ImportYumArtifactsGcsSource\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsGcsSource.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportYumArtifactsGcsSource message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportYumArtifactsGcsSource.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.uris != null && message.hasOwnProperty(\"uris\")) {\n if (!Array.isArray(message.uris))\n return \"uris: array expected\";\n for (var i = 0; i < message.uris.length; ++i)\n if (!$util.isString(message.uris[i]))\n return \"uris: string[] expected\";\n }\n if (message.useWildcards != null && message.hasOwnProperty(\"useWildcards\"))\n if (typeof message.useWildcards !== \"boolean\")\n return \"useWildcards: boolean expected\";\n return null;\n };\n \n /**\n * Creates an ImportYumArtifactsGcsSource message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource} ImportYumArtifactsGcsSource\n */\n ImportYumArtifactsGcsSource.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource();\n if (object.uris) {\n if (!Array.isArray(object.uris))\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource.uris: array expected\");\n message.uris = [];\n for (var i = 0; i < object.uris.length; ++i)\n message.uris[i] = String(object.uris[i]);\n }\n if (object.useWildcards != null)\n message.useWildcards = Boolean(object.useWildcards);\n return message;\n };\n \n /**\n * Creates a plain object from an ImportYumArtifactsGcsSource message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource} message ImportYumArtifactsGcsSource\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportYumArtifactsGcsSource.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.uris = [];\n if (options.defaults)\n object.useWildcards = false;\n if (message.uris && message.uris.length) {\n object.uris = [];\n for (var j = 0; j < message.uris.length; ++j)\n object.uris[j] = message.uris[j];\n }\n if (message.useWildcards != null && message.hasOwnProperty(\"useWildcards\"))\n object.useWildcards = message.useWildcards;\n return object;\n };\n \n /**\n * Converts this ImportYumArtifactsGcsSource to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource\n * @instance\n * @returns {Object.} JSON object\n */\n ImportYumArtifactsGcsSource.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportYumArtifactsGcsSource\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportYumArtifactsGcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource\";\n };\n \n return ImportYumArtifactsGcsSource;\n })();\n \n v1beta2.ImportYumArtifactsRequest = (function() {\n \n /**\n * Properties of an ImportYumArtifactsRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IImportYumArtifactsRequest\n * @property {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsGcsSource|null} [gcsSource] ImportYumArtifactsRequest gcsSource\n * @property {string|null} [parent] ImportYumArtifactsRequest parent\n */\n \n /**\n * Constructs a new ImportYumArtifactsRequest.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an ImportYumArtifactsRequest.\n * @implements IImportYumArtifactsRequest\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsRequest=} [properties] Properties to set\n */\n function ImportYumArtifactsRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportYumArtifactsRequest gcsSource.\n * @member {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsGcsSource|null|undefined} gcsSource\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest\n * @instance\n */\n ImportYumArtifactsRequest.prototype.gcsSource = null;\n \n /**\n * ImportYumArtifactsRequest parent.\n * @member {string} parent\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest\n * @instance\n */\n ImportYumArtifactsRequest.prototype.parent = \"\";\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * ImportYumArtifactsRequest source.\n * @member {\"gcsSource\"|undefined} source\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest\n * @instance\n */\n Object.defineProperty(ImportYumArtifactsRequest.prototype, \"source\", {\n get: $util.oneOfGetter($oneOfFields = [\"gcsSource\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new ImportYumArtifactsRequest instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsRequest=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest} ImportYumArtifactsRequest instance\n */\n ImportYumArtifactsRequest.create = function create(properties) {\n return new ImportYumArtifactsRequest(properties);\n };\n \n /**\n * Encodes the specified ImportYumArtifactsRequest message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsRequest} message ImportYumArtifactsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.parent != null && Object.hasOwnProperty.call(message, \"parent\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);\n if (message.gcsSource != null && Object.hasOwnProperty.call(message, \"gcsSource\"))\n $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ImportYumArtifactsRequest message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsRequest} message ImportYumArtifactsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportYumArtifactsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest} ImportYumArtifactsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n message.gcsSource = $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource.decode(reader, reader.uint32());\n break;\n }\n case 1: {\n message.parent = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportYumArtifactsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest} ImportYumArtifactsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportYumArtifactsRequest message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportYumArtifactsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n properties.source = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource.verify(message.gcsSource);\n if (error)\n return \"gcsSource.\" + error;\n }\n }\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n if (!$util.isString(message.parent))\n return \"parent: string expected\";\n return null;\n };\n \n /**\n * Creates an ImportYumArtifactsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest} ImportYumArtifactsRequest\n */\n ImportYumArtifactsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest();\n if (object.gcsSource != null) {\n if (typeof object.gcsSource !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest.gcsSource: object expected\");\n message.gcsSource = $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource.fromObject(object.gcsSource);\n }\n if (object.parent != null)\n message.parent = String(object.parent);\n return message;\n };\n \n /**\n * Creates a plain object from an ImportYumArtifactsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest} message ImportYumArtifactsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportYumArtifactsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.parent = \"\";\n if (message.parent != null && message.hasOwnProperty(\"parent\"))\n object.parent = message.parent;\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n object.gcsSource = $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource.toObject(message.gcsSource, options);\n if (options.oneofs)\n object.source = \"gcsSource\";\n }\n return object;\n };\n \n /**\n * Converts this ImportYumArtifactsRequest to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ImportYumArtifactsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportYumArtifactsRequest\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportYumArtifactsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest\";\n };\n \n return ImportYumArtifactsRequest;\n })();\n \n v1beta2.ImportYumArtifactsErrorInfo = (function() {\n \n /**\n * Properties of an ImportYumArtifactsErrorInfo.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IImportYumArtifactsErrorInfo\n * @property {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsGcsSource|null} [gcsSource] ImportYumArtifactsErrorInfo gcsSource\n * @property {google.rpc.IStatus|null} [error] ImportYumArtifactsErrorInfo error\n */\n \n /**\n * Constructs a new ImportYumArtifactsErrorInfo.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an ImportYumArtifactsErrorInfo.\n * @implements IImportYumArtifactsErrorInfo\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsErrorInfo=} [properties] Properties to set\n */\n function ImportYumArtifactsErrorInfo(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportYumArtifactsErrorInfo gcsSource.\n * @member {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsGcsSource|null|undefined} gcsSource\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo\n * @instance\n */\n ImportYumArtifactsErrorInfo.prototype.gcsSource = null;\n \n /**\n * ImportYumArtifactsErrorInfo error.\n * @member {google.rpc.IStatus|null|undefined} error\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo\n * @instance\n */\n ImportYumArtifactsErrorInfo.prototype.error = null;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * ImportYumArtifactsErrorInfo source.\n * @member {\"gcsSource\"|undefined} source\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo\n * @instance\n */\n Object.defineProperty(ImportYumArtifactsErrorInfo.prototype, \"source\", {\n get: $util.oneOfGetter($oneOfFields = [\"gcsSource\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new ImportYumArtifactsErrorInfo instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsErrorInfo=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo} ImportYumArtifactsErrorInfo instance\n */\n ImportYumArtifactsErrorInfo.create = function create(properties) {\n return new ImportYumArtifactsErrorInfo(properties);\n };\n \n /**\n * Encodes the specified ImportYumArtifactsErrorInfo message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsErrorInfo} message ImportYumArtifactsErrorInfo message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsErrorInfo.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.gcsSource != null && Object.hasOwnProperty.call(message, \"gcsSource\"))\n $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.error != null && Object.hasOwnProperty.call(message, \"error\"))\n $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ImportYumArtifactsErrorInfo message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsErrorInfo} message ImportYumArtifactsErrorInfo message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsErrorInfo.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportYumArtifactsErrorInfo message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo} ImportYumArtifactsErrorInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsErrorInfo.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.gcsSource = $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.error = $root.google.rpc.Status.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportYumArtifactsErrorInfo message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo} ImportYumArtifactsErrorInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsErrorInfo.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportYumArtifactsErrorInfo message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportYumArtifactsErrorInfo.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n properties.source = 1;\n {\n var error = $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource.verify(message.gcsSource);\n if (error)\n return \"gcsSource.\" + error;\n }\n }\n if (message.error != null && message.hasOwnProperty(\"error\")) {\n var error = $root.google.rpc.Status.verify(message.error);\n if (error)\n return \"error.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an ImportYumArtifactsErrorInfo message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo} ImportYumArtifactsErrorInfo\n */\n ImportYumArtifactsErrorInfo.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo();\n if (object.gcsSource != null) {\n if (typeof object.gcsSource !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo.gcsSource: object expected\");\n message.gcsSource = $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource.fromObject(object.gcsSource);\n }\n if (object.error != null) {\n if (typeof object.error !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo.error: object expected\");\n message.error = $root.google.rpc.Status.fromObject(object.error);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an ImportYumArtifactsErrorInfo message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo} message ImportYumArtifactsErrorInfo\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportYumArtifactsErrorInfo.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.error = null;\n if (message.gcsSource != null && message.hasOwnProperty(\"gcsSource\")) {\n object.gcsSource = $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource.toObject(message.gcsSource, options);\n if (options.oneofs)\n object.source = \"gcsSource\";\n }\n if (message.error != null && message.hasOwnProperty(\"error\"))\n object.error = $root.google.rpc.Status.toObject(message.error, options);\n return object;\n };\n \n /**\n * Converts this ImportYumArtifactsErrorInfo to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo\n * @instance\n * @returns {Object.} JSON object\n */\n ImportYumArtifactsErrorInfo.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportYumArtifactsErrorInfo\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportYumArtifactsErrorInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo\";\n };\n \n return ImportYumArtifactsErrorInfo;\n })();\n \n v1beta2.ImportYumArtifactsResponse = (function() {\n \n /**\n * Properties of an ImportYumArtifactsResponse.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IImportYumArtifactsResponse\n * @property {Array.|null} [yumArtifacts] ImportYumArtifactsResponse yumArtifacts\n * @property {Array.|null} [errors] ImportYumArtifactsResponse errors\n */\n \n /**\n * Constructs a new ImportYumArtifactsResponse.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an ImportYumArtifactsResponse.\n * @implements IImportYumArtifactsResponse\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsResponse=} [properties] Properties to set\n */\n function ImportYumArtifactsResponse(properties) {\n this.yumArtifacts = [];\n this.errors = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ImportYumArtifactsResponse yumArtifacts.\n * @member {Array.} yumArtifacts\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse\n * @instance\n */\n ImportYumArtifactsResponse.prototype.yumArtifacts = $util.emptyArray;\n \n /**\n * ImportYumArtifactsResponse errors.\n * @member {Array.} errors\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse\n * @instance\n */\n ImportYumArtifactsResponse.prototype.errors = $util.emptyArray;\n \n /**\n * Creates a new ImportYumArtifactsResponse instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsResponse=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse} ImportYumArtifactsResponse instance\n */\n ImportYumArtifactsResponse.create = function create(properties) {\n return new ImportYumArtifactsResponse(properties);\n };\n \n /**\n * Encodes the specified ImportYumArtifactsResponse message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsResponse} message ImportYumArtifactsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.yumArtifacts != null && message.yumArtifacts.length)\n for (var i = 0; i < message.yumArtifacts.length; ++i)\n $root.google.devtools.artifactregistry.v1beta2.YumArtifact.encode(message.yumArtifacts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.errors != null && message.errors.length)\n for (var i = 0; i < message.errors.length; ++i)\n $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo.encode(message.errors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ImportYumArtifactsResponse message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsResponse} message ImportYumArtifactsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportYumArtifactsResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse} ImportYumArtifactsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.yumArtifacts && message.yumArtifacts.length))\n message.yumArtifacts = [];\n message.yumArtifacts.push($root.google.devtools.artifactregistry.v1beta2.YumArtifact.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n if (!(message.errors && message.errors.length))\n message.errors = [];\n message.errors.push($root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportYumArtifactsResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse} ImportYumArtifactsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportYumArtifactsResponse message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportYumArtifactsResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.yumArtifacts != null && message.hasOwnProperty(\"yumArtifacts\")) {\n if (!Array.isArray(message.yumArtifacts))\n return \"yumArtifacts: array expected\";\n for (var i = 0; i < message.yumArtifacts.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1beta2.YumArtifact.verify(message.yumArtifacts[i]);\n if (error)\n return \"yumArtifacts.\" + error;\n }\n }\n if (message.errors != null && message.hasOwnProperty(\"errors\")) {\n if (!Array.isArray(message.errors))\n return \"errors: array expected\";\n for (var i = 0; i < message.errors.length; ++i) {\n var error = $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo.verify(message.errors[i]);\n if (error)\n return \"errors.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates an ImportYumArtifactsResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse} ImportYumArtifactsResponse\n */\n ImportYumArtifactsResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse)\n return object;\n var message = new $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse();\n if (object.yumArtifacts) {\n if (!Array.isArray(object.yumArtifacts))\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse.yumArtifacts: array expected\");\n message.yumArtifacts = [];\n for (var i = 0; i < object.yumArtifacts.length; ++i) {\n if (typeof object.yumArtifacts[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse.yumArtifacts: object expected\");\n message.yumArtifacts[i] = $root.google.devtools.artifactregistry.v1beta2.YumArtifact.fromObject(object.yumArtifacts[i]);\n }\n }\n if (object.errors) {\n if (!Array.isArray(object.errors))\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse.errors: array expected\");\n message.errors = [];\n for (var i = 0; i < object.errors.length; ++i) {\n if (typeof object.errors[i] !== \"object\")\n throw TypeError(\".google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse.errors: object expected\");\n message.errors[i] = $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo.fromObject(object.errors[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from an ImportYumArtifactsResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse} message ImportYumArtifactsResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportYumArtifactsResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.yumArtifacts = [];\n object.errors = [];\n }\n if (message.yumArtifacts && message.yumArtifacts.length) {\n object.yumArtifacts = [];\n for (var j = 0; j < message.yumArtifacts.length; ++j)\n object.yumArtifacts[j] = $root.google.devtools.artifactregistry.v1beta2.YumArtifact.toObject(message.yumArtifacts[j], options);\n }\n if (message.errors && message.errors.length) {\n object.errors = [];\n for (var j = 0; j < message.errors.length; ++j)\n object.errors[j] = $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo.toObject(message.errors[j], options);\n }\n return object;\n };\n \n /**\n * Converts this ImportYumArtifactsResponse to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ImportYumArtifactsResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportYumArtifactsResponse\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportYumArtifactsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse\";\n };\n \n return ImportYumArtifactsResponse;\n })();\n \n v1beta2.ImportYumArtifactsMetadata = (function() {\n \n /**\n * Properties of an ImportYumArtifactsMetadata.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @interface IImportYumArtifactsMetadata\n */\n \n /**\n * Constructs a new ImportYumArtifactsMetadata.\n * @memberof google.devtools.artifactregistry.v1beta2\n * @classdesc Represents an ImportYumArtifactsMetadata.\n * @implements IImportYumArtifactsMetadata\n * @constructor\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsMetadata=} [properties] Properties to set\n */\n function ImportYumArtifactsMetadata(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Creates a new ImportYumArtifactsMetadata instance using the specified properties.\n * @function create\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsMetadata=} [properties] Properties to set\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata} ImportYumArtifactsMetadata instance\n */\n ImportYumArtifactsMetadata.create = function create(properties) {\n return new ImportYumArtifactsMetadata(properties);\n };\n \n /**\n * Encodes the specified ImportYumArtifactsMetadata message. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata.verify|verify} messages.\n * @function encode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsMetadata} message ImportYumArtifactsMetadata message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsMetadata.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n return writer;\n };\n \n /**\n * Encodes the specified ImportYumArtifactsMetadata message, length delimited. Does not implicitly {@link google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.IImportYumArtifactsMetadata} message ImportYumArtifactsMetadata message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ImportYumArtifactsMetadata.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ImportYumArtifactsMetadata message from the specified reader or buffer.\n * @function decode\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata} ImportYumArtifactsMetadata\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsMetadata.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ImportYumArtifactsMetadata message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata} ImportYumArtifactsMetadata\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ImportYumArtifactsMetadata.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ImportYumArtifactsMetadata message.\n * @function verify\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ImportYumArtifactsMetadata.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n return null;\n };\n \n /**\n * Creates an ImportYumArtifactsMetadata message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata\n * @static\n * @param {Object.} object Plain object\n * @returns {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata} ImportYumArtifactsMetadata\n */\n ImportYumArtifactsMetadata.fromObject = function fromObject(object) {\n if (object instanceof $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata)\n return object;\n return new $root.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata();\n };\n \n /**\n * Creates a plain object from an ImportYumArtifactsMetadata message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata\n * @static\n * @param {google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata} message ImportYumArtifactsMetadata\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ImportYumArtifactsMetadata.toObject = function toObject() {\n return {};\n };\n \n /**\n * Converts this ImportYumArtifactsMetadata to JSON.\n * @function toJSON\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata\n * @instance\n * @returns {Object.} JSON object\n */\n ImportYumArtifactsMetadata.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ImportYumArtifactsMetadata\n * @function getTypeUrl\n * @memberof google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ImportYumArtifactsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata\";\n };\n \n return ImportYumArtifactsMetadata;\n })();\n \n return v1beta2;\n })();\n \n return artifactregistry;\n })();\n \n return devtools;\n })();\n \n google.api = (function() {\n \n /**\n * Namespace api.\n * @memberof google\n * @namespace\n */\n var api = {};\n \n /**\n * FieldBehavior enum.\n * @name google.api.FieldBehavior\n * @enum {number}\n * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value\n * @property {number} OPTIONAL=1 OPTIONAL value\n * @property {number} REQUIRED=2 REQUIRED value\n * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value\n * @property {number} INPUT_ONLY=4 INPUT_ONLY value\n * @property {number} IMMUTABLE=5 IMMUTABLE value\n * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value\n * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value\n * @property {number} IDENTIFIER=8 IDENTIFIER value\n */\n api.FieldBehavior = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"FIELD_BEHAVIOR_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"OPTIONAL\"] = 1;\n values[valuesById[2] = \"REQUIRED\"] = 2;\n values[valuesById[3] = \"OUTPUT_ONLY\"] = 3;\n values[valuesById[4] = \"INPUT_ONLY\"] = 4;\n values[valuesById[5] = \"IMMUTABLE\"] = 5;\n values[valuesById[6] = \"UNORDERED_LIST\"] = 6;\n values[valuesById[7] = \"NON_EMPTY_DEFAULT\"] = 7;\n values[valuesById[8] = \"IDENTIFIER\"] = 8;\n return values;\n })();\n \n api.ResourceDescriptor = (function() {\n \n /**\n * Properties of a ResourceDescriptor.\n * @memberof google.api\n * @interface IResourceDescriptor\n * @property {string|null} [type] ResourceDescriptor type\n * @property {Array.|null} [pattern] ResourceDescriptor pattern\n * @property {string|null} [nameField] ResourceDescriptor nameField\n * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history\n * @property {string|null} [plural] ResourceDescriptor plural\n * @property {string|null} [singular] ResourceDescriptor singular\n * @property {Array.|null} [style] ResourceDescriptor style\n */\n \n /**\n * Constructs a new ResourceDescriptor.\n * @memberof google.api\n * @classdesc Represents a ResourceDescriptor.\n * @implements IResourceDescriptor\n * @constructor\n * @param {google.api.IResourceDescriptor=} [properties] Properties to set\n */\n function ResourceDescriptor(properties) {\n this.pattern = [];\n this.style = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ResourceDescriptor type.\n * @member {string} type\n * @memberof google.api.ResourceDescriptor\n * @instance\n */\n ResourceDescriptor.prototype.type = \"\";\n \n /**\n * ResourceDescriptor pattern.\n * @member {Array.} pattern\n * @memberof google.api.ResourceDescriptor\n * @instance\n */\n ResourceDescriptor.prototype.pattern = $util.emptyArray;\n \n /**\n * ResourceDescriptor nameField.\n * @member {string} nameField\n * @memberof google.api.ResourceDescriptor\n * @instance\n */\n ResourceDescriptor.prototype.nameField = \"\";\n \n /**\n * ResourceDescriptor history.\n * @member {google.api.ResourceDescriptor.History} history\n * @memberof google.api.ResourceDescriptor\n * @instance\n */\n ResourceDescriptor.prototype.history = 0;\n \n /**\n * ResourceDescriptor plural.\n * @member {string} plural\n * @memberof google.api.ResourceDescriptor\n * @instance\n */\n ResourceDescriptor.prototype.plural = \"\";\n \n /**\n * ResourceDescriptor singular.\n * @member {string} singular\n * @memberof google.api.ResourceDescriptor\n * @instance\n */\n ResourceDescriptor.prototype.singular = \"\";\n \n /**\n * ResourceDescriptor style.\n * @member {Array.} style\n * @memberof google.api.ResourceDescriptor\n * @instance\n */\n ResourceDescriptor.prototype.style = $util.emptyArray;\n \n /**\n * Creates a new ResourceDescriptor instance using the specified properties.\n * @function create\n * @memberof google.api.ResourceDescriptor\n * @static\n * @param {google.api.IResourceDescriptor=} [properties] Properties to set\n * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance\n */\n ResourceDescriptor.create = function create(properties) {\n return new ResourceDescriptor(properties);\n };\n \n /**\n * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages.\n * @function encode\n * @memberof google.api.ResourceDescriptor\n * @static\n * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ResourceDescriptor.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.type != null && Object.hasOwnProperty.call(message, \"type\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.type);\n if (message.pattern != null && message.pattern.length)\n for (var i = 0; i < message.pattern.length; ++i)\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]);\n if (message.nameField != null && Object.hasOwnProperty.call(message, \"nameField\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField);\n if (message.history != null && Object.hasOwnProperty.call(message, \"history\"))\n writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history);\n if (message.plural != null && Object.hasOwnProperty.call(message, \"plural\"))\n writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural);\n if (message.singular != null && Object.hasOwnProperty.call(message, \"singular\"))\n writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular);\n if (message.style != null && message.style.length) {\n writer.uint32(/* id 10, wireType 2 =*/82).fork();\n for (var i = 0; i < message.style.length; ++i)\n writer.int32(message.style[i]);\n writer.ldelim();\n }\n return writer;\n };\n \n /**\n * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.ResourceDescriptor\n * @static\n * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ResourceDescriptor message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.ResourceDescriptor\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.ResourceDescriptor} ResourceDescriptor\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ResourceDescriptor.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.type = reader.string();\n break;\n }\n case 2: {\n if (!(message.pattern && message.pattern.length))\n message.pattern = [];\n message.pattern.push(reader.string());\n break;\n }\n case 3: {\n message.nameField = reader.string();\n break;\n }\n case 4: {\n message.history = reader.int32();\n break;\n }\n case 5: {\n message.plural = reader.string();\n break;\n }\n case 6: {\n message.singular = reader.string();\n break;\n }\n case 10: {\n if (!(message.style && message.style.length))\n message.style = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.style.push(reader.int32());\n } else\n message.style.push(reader.int32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.ResourceDescriptor\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.ResourceDescriptor} ResourceDescriptor\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ResourceDescriptor message.\n * @function verify\n * @memberof google.api.ResourceDescriptor\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ResourceDescriptor.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.type != null && message.hasOwnProperty(\"type\"))\n if (!$util.isString(message.type))\n return \"type: string expected\";\n if (message.pattern != null && message.hasOwnProperty(\"pattern\")) {\n if (!Array.isArray(message.pattern))\n return \"pattern: array expected\";\n for (var i = 0; i < message.pattern.length; ++i)\n if (!$util.isString(message.pattern[i]))\n return \"pattern: string[] expected\";\n }\n if (message.nameField != null && message.hasOwnProperty(\"nameField\"))\n if (!$util.isString(message.nameField))\n return \"nameField: string expected\";\n if (message.history != null && message.hasOwnProperty(\"history\"))\n switch (message.history) {\n default:\n return \"history: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.plural != null && message.hasOwnProperty(\"plural\"))\n if (!$util.isString(message.plural))\n return \"plural: string expected\";\n if (message.singular != null && message.hasOwnProperty(\"singular\"))\n if (!$util.isString(message.singular))\n return \"singular: string expected\";\n if (message.style != null && message.hasOwnProperty(\"style\")) {\n if (!Array.isArray(message.style))\n return \"style: array expected\";\n for (var i = 0; i < message.style.length; ++i)\n switch (message.style[i]) {\n default:\n return \"style: enum value[] expected\";\n case 0:\n case 1:\n break;\n }\n }\n return null;\n };\n \n /**\n * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.ResourceDescriptor\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.ResourceDescriptor} ResourceDescriptor\n */\n ResourceDescriptor.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.ResourceDescriptor)\n return object;\n var message = new $root.google.api.ResourceDescriptor();\n if (object.type != null)\n message.type = String(object.type);\n if (object.pattern) {\n if (!Array.isArray(object.pattern))\n throw TypeError(\".google.api.ResourceDescriptor.pattern: array expected\");\n message.pattern = [];\n for (var i = 0; i < object.pattern.length; ++i)\n message.pattern[i] = String(object.pattern[i]);\n }\n if (object.nameField != null)\n message.nameField = String(object.nameField);\n switch (object.history) {\n default:\n if (typeof object.history === \"number\") {\n message.history = object.history;\n break;\n }\n break;\n case \"HISTORY_UNSPECIFIED\":\n case 0:\n message.history = 0;\n break;\n case \"ORIGINALLY_SINGLE_PATTERN\":\n case 1:\n message.history = 1;\n break;\n case \"FUTURE_MULTI_PATTERN\":\n case 2:\n message.history = 2;\n break;\n }\n if (object.plural != null)\n message.plural = String(object.plural);\n if (object.singular != null)\n message.singular = String(object.singular);\n if (object.style) {\n if (!Array.isArray(object.style))\n throw TypeError(\".google.api.ResourceDescriptor.style: array expected\");\n message.style = [];\n for (var i = 0; i < object.style.length; ++i)\n switch (object.style[i]) {\n default:\n if (typeof object.style[i] === \"number\") {\n message.style[i] = object.style[i];\n break;\n }\n case \"STYLE_UNSPECIFIED\":\n case 0:\n message.style[i] = 0;\n break;\n case \"DECLARATIVE_FRIENDLY\":\n case 1:\n message.style[i] = 1;\n break;\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.ResourceDescriptor\n * @static\n * @param {google.api.ResourceDescriptor} message ResourceDescriptor\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ResourceDescriptor.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.pattern = [];\n object.style = [];\n }\n if (options.defaults) {\n object.type = \"\";\n object.nameField = \"\";\n object.history = options.enums === String ? \"HISTORY_UNSPECIFIED\" : 0;\n object.plural = \"\";\n object.singular = \"\";\n }\n if (message.type != null && message.hasOwnProperty(\"type\"))\n object.type = message.type;\n if (message.pattern && message.pattern.length) {\n object.pattern = [];\n for (var j = 0; j < message.pattern.length; ++j)\n object.pattern[j] = message.pattern[j];\n }\n if (message.nameField != null && message.hasOwnProperty(\"nameField\"))\n object.nameField = message.nameField;\n if (message.history != null && message.hasOwnProperty(\"history\"))\n object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history;\n if (message.plural != null && message.hasOwnProperty(\"plural\"))\n object.plural = message.plural;\n if (message.singular != null && message.hasOwnProperty(\"singular\"))\n object.singular = message.singular;\n if (message.style && message.style.length) {\n object.style = [];\n for (var j = 0; j < message.style.length; ++j)\n object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j];\n }\n return object;\n };\n \n /**\n * Converts this ResourceDescriptor to JSON.\n * @function toJSON\n * @memberof google.api.ResourceDescriptor\n * @instance\n * @returns {Object.} JSON object\n */\n ResourceDescriptor.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ResourceDescriptor\n * @function getTypeUrl\n * @memberof google.api.ResourceDescriptor\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.ResourceDescriptor\";\n };\n \n /**\n * History enum.\n * @name google.api.ResourceDescriptor.History\n * @enum {number}\n * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value\n * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value\n * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value\n */\n ResourceDescriptor.History = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"HISTORY_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"ORIGINALLY_SINGLE_PATTERN\"] = 1;\n values[valuesById[2] = \"FUTURE_MULTI_PATTERN\"] = 2;\n return values;\n })();\n \n /**\n * Style enum.\n * @name google.api.ResourceDescriptor.Style\n * @enum {number}\n * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value\n * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value\n */\n ResourceDescriptor.Style = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"STYLE_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"DECLARATIVE_FRIENDLY\"] = 1;\n return values;\n })();\n \n return ResourceDescriptor;\n })();\n \n api.ResourceReference = (function() {\n \n /**\n * Properties of a ResourceReference.\n * @memberof google.api\n * @interface IResourceReference\n * @property {string|null} [type] ResourceReference type\n * @property {string|null} [childType] ResourceReference childType\n */\n \n /**\n * Constructs a new ResourceReference.\n * @memberof google.api\n * @classdesc Represents a ResourceReference.\n * @implements IResourceReference\n * @constructor\n * @param {google.api.IResourceReference=} [properties] Properties to set\n */\n function ResourceReference(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ResourceReference type.\n * @member {string} type\n * @memberof google.api.ResourceReference\n * @instance\n */\n ResourceReference.prototype.type = \"\";\n \n /**\n * ResourceReference childType.\n * @member {string} childType\n * @memberof google.api.ResourceReference\n * @instance\n */\n ResourceReference.prototype.childType = \"\";\n \n /**\n * Creates a new ResourceReference instance using the specified properties.\n * @function create\n * @memberof google.api.ResourceReference\n * @static\n * @param {google.api.IResourceReference=} [properties] Properties to set\n * @returns {google.api.ResourceReference} ResourceReference instance\n */\n ResourceReference.create = function create(properties) {\n return new ResourceReference(properties);\n };\n \n /**\n * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages.\n * @function encode\n * @memberof google.api.ResourceReference\n * @static\n * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ResourceReference.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.type != null && Object.hasOwnProperty.call(message, \"type\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.type);\n if (message.childType != null && Object.hasOwnProperty.call(message, \"childType\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType);\n return writer;\n };\n \n /**\n * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.ResourceReference\n * @static\n * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ResourceReference.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ResourceReference message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.ResourceReference\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.ResourceReference} ResourceReference\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ResourceReference.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.type = reader.string();\n break;\n }\n case 2: {\n message.childType = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ResourceReference message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.ResourceReference\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.ResourceReference} ResourceReference\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ResourceReference.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ResourceReference message.\n * @function verify\n * @memberof google.api.ResourceReference\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ResourceReference.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.type != null && message.hasOwnProperty(\"type\"))\n if (!$util.isString(message.type))\n return \"type: string expected\";\n if (message.childType != null && message.hasOwnProperty(\"childType\"))\n if (!$util.isString(message.childType))\n return \"childType: string expected\";\n return null;\n };\n \n /**\n * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.ResourceReference\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.ResourceReference} ResourceReference\n */\n ResourceReference.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.ResourceReference)\n return object;\n var message = new $root.google.api.ResourceReference();\n if (object.type != null)\n message.type = String(object.type);\n if (object.childType != null)\n message.childType = String(object.childType);\n return message;\n };\n \n /**\n * Creates a plain object from a ResourceReference message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.ResourceReference\n * @static\n * @param {google.api.ResourceReference} message ResourceReference\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ResourceReference.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.type = \"\";\n object.childType = \"\";\n }\n if (message.type != null && message.hasOwnProperty(\"type\"))\n object.type = message.type;\n if (message.childType != null && message.hasOwnProperty(\"childType\"))\n object.childType = message.childType;\n return object;\n };\n \n /**\n * Converts this ResourceReference to JSON.\n * @function toJSON\n * @memberof google.api.ResourceReference\n * @instance\n * @returns {Object.} JSON object\n */\n ResourceReference.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ResourceReference\n * @function getTypeUrl\n * @memberof google.api.ResourceReference\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.ResourceReference\";\n };\n \n return ResourceReference;\n })();\n \n api.Http = (function() {\n \n /**\n * Properties of a Http.\n * @memberof google.api\n * @interface IHttp\n * @property {Array.|null} [rules] Http rules\n * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion\n */\n \n /**\n * Constructs a new Http.\n * @memberof google.api\n * @classdesc Represents a Http.\n * @implements IHttp\n * @constructor\n * @param {google.api.IHttp=} [properties] Properties to set\n */\n function Http(properties) {\n this.rules = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Http rules.\n * @member {Array.} rules\n * @memberof google.api.Http\n * @instance\n */\n Http.prototype.rules = $util.emptyArray;\n \n /**\n * Http fullyDecodeReservedExpansion.\n * @member {boolean} fullyDecodeReservedExpansion\n * @memberof google.api.Http\n * @instance\n */\n Http.prototype.fullyDecodeReservedExpansion = false;\n \n /**\n * Creates a new Http instance using the specified properties.\n * @function create\n * @memberof google.api.Http\n * @static\n * @param {google.api.IHttp=} [properties] Properties to set\n * @returns {google.api.Http} Http instance\n */\n Http.create = function create(properties) {\n return new Http(properties);\n };\n \n /**\n * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages.\n * @function encode\n * @memberof google.api.Http\n * @static\n * @param {google.api.IHttp} message Http message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Http.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.rules != null && message.rules.length)\n for (var i = 0; i < message.rules.length; ++i)\n $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, \"fullyDecodeReservedExpansion\"))\n writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion);\n return writer;\n };\n \n /**\n * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.Http\n * @static\n * @param {google.api.IHttp} message Http message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Http.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Http message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.Http\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.Http} Http\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Http.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.rules && message.rules.length))\n message.rules = [];\n message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.fullyDecodeReservedExpansion = reader.bool();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Http message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.Http\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.Http} Http\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Http.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Http message.\n * @function verify\n * @memberof google.api.Http\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Http.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.rules != null && message.hasOwnProperty(\"rules\")) {\n if (!Array.isArray(message.rules))\n return \"rules: array expected\";\n for (var i = 0; i < message.rules.length; ++i) {\n var error = $root.google.api.HttpRule.verify(message.rules[i]);\n if (error)\n return \"rules.\" + error;\n }\n }\n if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty(\"fullyDecodeReservedExpansion\"))\n if (typeof message.fullyDecodeReservedExpansion !== \"boolean\")\n return \"fullyDecodeReservedExpansion: boolean expected\";\n return null;\n };\n \n /**\n * Creates a Http message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.Http\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.Http} Http\n */\n Http.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.Http)\n return object;\n var message = new $root.google.api.Http();\n if (object.rules) {\n if (!Array.isArray(object.rules))\n throw TypeError(\".google.api.Http.rules: array expected\");\n message.rules = [];\n for (var i = 0; i < object.rules.length; ++i) {\n if (typeof object.rules[i] !== \"object\")\n throw TypeError(\".google.api.Http.rules: object expected\");\n message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]);\n }\n }\n if (object.fullyDecodeReservedExpansion != null)\n message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion);\n return message;\n };\n \n /**\n * Creates a plain object from a Http message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.Http\n * @static\n * @param {google.api.Http} message Http\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Http.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.rules = [];\n if (options.defaults)\n object.fullyDecodeReservedExpansion = false;\n if (message.rules && message.rules.length) {\n object.rules = [];\n for (var j = 0; j < message.rules.length; ++j)\n object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options);\n }\n if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty(\"fullyDecodeReservedExpansion\"))\n object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion;\n return object;\n };\n \n /**\n * Converts this Http to JSON.\n * @function toJSON\n * @memberof google.api.Http\n * @instance\n * @returns {Object.} JSON object\n */\n Http.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Http\n * @function getTypeUrl\n * @memberof google.api.Http\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.Http\";\n };\n \n return Http;\n })();\n \n api.HttpRule = (function() {\n \n /**\n * Properties of a HttpRule.\n * @memberof google.api\n * @interface IHttpRule\n * @property {string|null} [selector] HttpRule selector\n * @property {string|null} [get] HttpRule get\n * @property {string|null} [put] HttpRule put\n * @property {string|null} [post] HttpRule post\n * @property {string|null} [\"delete\"] HttpRule delete\n * @property {string|null} [patch] HttpRule patch\n * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom\n * @property {string|null} [body] HttpRule body\n * @property {string|null} [responseBody] HttpRule responseBody\n * @property {Array.|null} [additionalBindings] HttpRule additionalBindings\n */\n \n /**\n * Constructs a new HttpRule.\n * @memberof google.api\n * @classdesc Represents a HttpRule.\n * @implements IHttpRule\n * @constructor\n * @param {google.api.IHttpRule=} [properties] Properties to set\n */\n function HttpRule(properties) {\n this.additionalBindings = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * HttpRule selector.\n * @member {string} selector\n * @memberof google.api.HttpRule\n * @instance\n */\n HttpRule.prototype.selector = \"\";\n \n /**\n * HttpRule get.\n * @member {string|null|undefined} get\n * @memberof google.api.HttpRule\n * @instance\n */\n HttpRule.prototype.get = null;\n \n /**\n * HttpRule put.\n * @member {string|null|undefined} put\n * @memberof google.api.HttpRule\n * @instance\n */\n HttpRule.prototype.put = null;\n \n /**\n * HttpRule post.\n * @member {string|null|undefined} post\n * @memberof google.api.HttpRule\n * @instance\n */\n HttpRule.prototype.post = null;\n \n /**\n * HttpRule delete.\n * @member {string|null|undefined} delete\n * @memberof google.api.HttpRule\n * @instance\n */\n HttpRule.prototype[\"delete\"] = null;\n \n /**\n * HttpRule patch.\n * @member {string|null|undefined} patch\n * @memberof google.api.HttpRule\n * @instance\n */\n HttpRule.prototype.patch = null;\n \n /**\n * HttpRule custom.\n * @member {google.api.ICustomHttpPattern|null|undefined} custom\n * @memberof google.api.HttpRule\n * @instance\n */\n HttpRule.prototype.custom = null;\n \n /**\n * HttpRule body.\n * @member {string} body\n * @memberof google.api.HttpRule\n * @instance\n */\n HttpRule.prototype.body = \"\";\n \n /**\n * HttpRule responseBody.\n * @member {string} responseBody\n * @memberof google.api.HttpRule\n * @instance\n */\n HttpRule.prototype.responseBody = \"\";\n \n /**\n * HttpRule additionalBindings.\n * @member {Array.} additionalBindings\n * @memberof google.api.HttpRule\n * @instance\n */\n HttpRule.prototype.additionalBindings = $util.emptyArray;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * HttpRule pattern.\n * @member {\"get\"|\"put\"|\"post\"|\"delete\"|\"patch\"|\"custom\"|undefined} pattern\n * @memberof google.api.HttpRule\n * @instance\n */\n Object.defineProperty(HttpRule.prototype, \"pattern\", {\n get: $util.oneOfGetter($oneOfFields = [\"get\", \"put\", \"post\", \"delete\", \"patch\", \"custom\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new HttpRule instance using the specified properties.\n * @function create\n * @memberof google.api.HttpRule\n * @static\n * @param {google.api.IHttpRule=} [properties] Properties to set\n * @returns {google.api.HttpRule} HttpRule instance\n */\n HttpRule.create = function create(properties) {\n return new HttpRule(properties);\n };\n \n /**\n * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages.\n * @function encode\n * @memberof google.api.HttpRule\n * @static\n * @param {google.api.IHttpRule} message HttpRule message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n HttpRule.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.selector != null && Object.hasOwnProperty.call(message, \"selector\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector);\n if (message.get != null && Object.hasOwnProperty.call(message, \"get\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.get);\n if (message.put != null && Object.hasOwnProperty.call(message, \"put\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.put);\n if (message.post != null && Object.hasOwnProperty.call(message, \"post\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.post);\n if (message[\"delete\"] != null && Object.hasOwnProperty.call(message, \"delete\"))\n writer.uint32(/* id 5, wireType 2 =*/42).string(message[\"delete\"]);\n if (message.patch != null && Object.hasOwnProperty.call(message, \"patch\"))\n writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch);\n if (message.body != null && Object.hasOwnProperty.call(message, \"body\"))\n writer.uint32(/* id 7, wireType 2 =*/58).string(message.body);\n if (message.custom != null && Object.hasOwnProperty.call(message, \"custom\"))\n $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n if (message.additionalBindings != null && message.additionalBindings.length)\n for (var i = 0; i < message.additionalBindings.length; ++i)\n $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();\n if (message.responseBody != null && Object.hasOwnProperty.call(message, \"responseBody\"))\n writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody);\n return writer;\n };\n \n /**\n * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.HttpRule\n * @static\n * @param {google.api.IHttpRule} message HttpRule message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n HttpRule.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a HttpRule message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.HttpRule\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.HttpRule} HttpRule\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n HttpRule.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.selector = reader.string();\n break;\n }\n case 2: {\n message.get = reader.string();\n break;\n }\n case 3: {\n message.put = reader.string();\n break;\n }\n case 4: {\n message.post = reader.string();\n break;\n }\n case 5: {\n message[\"delete\"] = reader.string();\n break;\n }\n case 6: {\n message.patch = reader.string();\n break;\n }\n case 8: {\n message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32());\n break;\n }\n case 7: {\n message.body = reader.string();\n break;\n }\n case 12: {\n message.responseBody = reader.string();\n break;\n }\n case 11: {\n if (!(message.additionalBindings && message.additionalBindings.length))\n message.additionalBindings = [];\n message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a HttpRule message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.HttpRule\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.HttpRule} HttpRule\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n HttpRule.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a HttpRule message.\n * @function verify\n * @memberof google.api.HttpRule\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n HttpRule.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.selector != null && message.hasOwnProperty(\"selector\"))\n if (!$util.isString(message.selector))\n return \"selector: string expected\";\n if (message.get != null && message.hasOwnProperty(\"get\")) {\n properties.pattern = 1;\n if (!$util.isString(message.get))\n return \"get: string expected\";\n }\n if (message.put != null && message.hasOwnProperty(\"put\")) {\n if (properties.pattern === 1)\n return \"pattern: multiple values\";\n properties.pattern = 1;\n if (!$util.isString(message.put))\n return \"put: string expected\";\n }\n if (message.post != null && message.hasOwnProperty(\"post\")) {\n if (properties.pattern === 1)\n return \"pattern: multiple values\";\n properties.pattern = 1;\n if (!$util.isString(message.post))\n return \"post: string expected\";\n }\n if (message[\"delete\"] != null && message.hasOwnProperty(\"delete\")) {\n if (properties.pattern === 1)\n return \"pattern: multiple values\";\n properties.pattern = 1;\n if (!$util.isString(message[\"delete\"]))\n return \"delete: string expected\";\n }\n if (message.patch != null && message.hasOwnProperty(\"patch\")) {\n if (properties.pattern === 1)\n return \"pattern: multiple values\";\n properties.pattern = 1;\n if (!$util.isString(message.patch))\n return \"patch: string expected\";\n }\n if (message.custom != null && message.hasOwnProperty(\"custom\")) {\n if (properties.pattern === 1)\n return \"pattern: multiple values\";\n properties.pattern = 1;\n {\n var error = $root.google.api.CustomHttpPattern.verify(message.custom);\n if (error)\n return \"custom.\" + error;\n }\n }\n if (message.body != null && message.hasOwnProperty(\"body\"))\n if (!$util.isString(message.body))\n return \"body: string expected\";\n if (message.responseBody != null && message.hasOwnProperty(\"responseBody\"))\n if (!$util.isString(message.responseBody))\n return \"responseBody: string expected\";\n if (message.additionalBindings != null && message.hasOwnProperty(\"additionalBindings\")) {\n if (!Array.isArray(message.additionalBindings))\n return \"additionalBindings: array expected\";\n for (var i = 0; i < message.additionalBindings.length; ++i) {\n var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]);\n if (error)\n return \"additionalBindings.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a HttpRule message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.HttpRule\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.HttpRule} HttpRule\n */\n HttpRule.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.HttpRule)\n return object;\n var message = new $root.google.api.HttpRule();\n if (object.selector != null)\n message.selector = String(object.selector);\n if (object.get != null)\n message.get = String(object.get);\n if (object.put != null)\n message.put = String(object.put);\n if (object.post != null)\n message.post = String(object.post);\n if (object[\"delete\"] != null)\n message[\"delete\"] = String(object[\"delete\"]);\n if (object.patch != null)\n message.patch = String(object.patch);\n if (object.custom != null) {\n if (typeof object.custom !== \"object\")\n throw TypeError(\".google.api.HttpRule.custom: object expected\");\n message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom);\n }\n if (object.body != null)\n message.body = String(object.body);\n if (object.responseBody != null)\n message.responseBody = String(object.responseBody);\n if (object.additionalBindings) {\n if (!Array.isArray(object.additionalBindings))\n throw TypeError(\".google.api.HttpRule.additionalBindings: array expected\");\n message.additionalBindings = [];\n for (var i = 0; i < object.additionalBindings.length; ++i) {\n if (typeof object.additionalBindings[i] !== \"object\")\n throw TypeError(\".google.api.HttpRule.additionalBindings: object expected\");\n message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from a HttpRule message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.HttpRule\n * @static\n * @param {google.api.HttpRule} message HttpRule\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n HttpRule.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.additionalBindings = [];\n if (options.defaults) {\n object.selector = \"\";\n object.body = \"\";\n object.responseBody = \"\";\n }\n if (message.selector != null && message.hasOwnProperty(\"selector\"))\n object.selector = message.selector;\n if (message.get != null && message.hasOwnProperty(\"get\")) {\n object.get = message.get;\n if (options.oneofs)\n object.pattern = \"get\";\n }\n if (message.put != null && message.hasOwnProperty(\"put\")) {\n object.put = message.put;\n if (options.oneofs)\n object.pattern = \"put\";\n }\n if (message.post != null && message.hasOwnProperty(\"post\")) {\n object.post = message.post;\n if (options.oneofs)\n object.pattern = \"post\";\n }\n if (message[\"delete\"] != null && message.hasOwnProperty(\"delete\")) {\n object[\"delete\"] = message[\"delete\"];\n if (options.oneofs)\n object.pattern = \"delete\";\n }\n if (message.patch != null && message.hasOwnProperty(\"patch\")) {\n object.patch = message.patch;\n if (options.oneofs)\n object.pattern = \"patch\";\n }\n if (message.body != null && message.hasOwnProperty(\"body\"))\n object.body = message.body;\n if (message.custom != null && message.hasOwnProperty(\"custom\")) {\n object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options);\n if (options.oneofs)\n object.pattern = \"custom\";\n }\n if (message.additionalBindings && message.additionalBindings.length) {\n object.additionalBindings = [];\n for (var j = 0; j < message.additionalBindings.length; ++j)\n object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options);\n }\n if (message.responseBody != null && message.hasOwnProperty(\"responseBody\"))\n object.responseBody = message.responseBody;\n return object;\n };\n \n /**\n * Converts this HttpRule to JSON.\n * @function toJSON\n * @memberof google.api.HttpRule\n * @instance\n * @returns {Object.} JSON object\n */\n HttpRule.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for HttpRule\n * @function getTypeUrl\n * @memberof google.api.HttpRule\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.HttpRule\";\n };\n \n return HttpRule;\n })();\n \n api.CustomHttpPattern = (function() {\n \n /**\n * Properties of a CustomHttpPattern.\n * @memberof google.api\n * @interface ICustomHttpPattern\n * @property {string|null} [kind] CustomHttpPattern kind\n * @property {string|null} [path] CustomHttpPattern path\n */\n \n /**\n * Constructs a new CustomHttpPattern.\n * @memberof google.api\n * @classdesc Represents a CustomHttpPattern.\n * @implements ICustomHttpPattern\n * @constructor\n * @param {google.api.ICustomHttpPattern=} [properties] Properties to set\n */\n function CustomHttpPattern(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CustomHttpPattern kind.\n * @member {string} kind\n * @memberof google.api.CustomHttpPattern\n * @instance\n */\n CustomHttpPattern.prototype.kind = \"\";\n \n /**\n * CustomHttpPattern path.\n * @member {string} path\n * @memberof google.api.CustomHttpPattern\n * @instance\n */\n CustomHttpPattern.prototype.path = \"\";\n \n /**\n * Creates a new CustomHttpPattern instance using the specified properties.\n * @function create\n * @memberof google.api.CustomHttpPattern\n * @static\n * @param {google.api.ICustomHttpPattern=} [properties] Properties to set\n * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance\n */\n CustomHttpPattern.create = function create(properties) {\n return new CustomHttpPattern(properties);\n };\n \n /**\n * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages.\n * @function encode\n * @memberof google.api.CustomHttpPattern\n * @static\n * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CustomHttpPattern.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.kind != null && Object.hasOwnProperty.call(message, \"kind\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind);\n if (message.path != null && Object.hasOwnProperty.call(message, \"path\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.path);\n return writer;\n };\n \n /**\n * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.CustomHttpPattern\n * @static\n * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CustomHttpPattern message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.CustomHttpPattern\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.CustomHttpPattern} CustomHttpPattern\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CustomHttpPattern.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.kind = reader.string();\n break;\n }\n case 2: {\n message.path = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.CustomHttpPattern\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.CustomHttpPattern} CustomHttpPattern\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CustomHttpPattern message.\n * @function verify\n * @memberof google.api.CustomHttpPattern\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CustomHttpPattern.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.kind != null && message.hasOwnProperty(\"kind\"))\n if (!$util.isString(message.kind))\n return \"kind: string expected\";\n if (message.path != null && message.hasOwnProperty(\"path\"))\n if (!$util.isString(message.path))\n return \"path: string expected\";\n return null;\n };\n \n /**\n * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.CustomHttpPattern\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.CustomHttpPattern} CustomHttpPattern\n */\n CustomHttpPattern.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.CustomHttpPattern)\n return object;\n var message = new $root.google.api.CustomHttpPattern();\n if (object.kind != null)\n message.kind = String(object.kind);\n if (object.path != null)\n message.path = String(object.path);\n return message;\n };\n \n /**\n * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.CustomHttpPattern\n * @static\n * @param {google.api.CustomHttpPattern} message CustomHttpPattern\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CustomHttpPattern.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.kind = \"\";\n object.path = \"\";\n }\n if (message.kind != null && message.hasOwnProperty(\"kind\"))\n object.kind = message.kind;\n if (message.path != null && message.hasOwnProperty(\"path\"))\n object.path = message.path;\n return object;\n };\n \n /**\n * Converts this CustomHttpPattern to JSON.\n * @function toJSON\n * @memberof google.api.CustomHttpPattern\n * @instance\n * @returns {Object.} JSON object\n */\n CustomHttpPattern.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CustomHttpPattern\n * @function getTypeUrl\n * @memberof google.api.CustomHttpPattern\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.CustomHttpPattern\";\n };\n \n return CustomHttpPattern;\n })();\n \n api.CommonLanguageSettings = (function() {\n \n /**\n * Properties of a CommonLanguageSettings.\n * @memberof google.api\n * @interface ICommonLanguageSettings\n * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri\n * @property {Array.|null} [destinations] CommonLanguageSettings destinations\n */\n \n /**\n * Constructs a new CommonLanguageSettings.\n * @memberof google.api\n * @classdesc Represents a CommonLanguageSettings.\n * @implements ICommonLanguageSettings\n * @constructor\n * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set\n */\n function CommonLanguageSettings(properties) {\n this.destinations = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CommonLanguageSettings referenceDocsUri.\n * @member {string} referenceDocsUri\n * @memberof google.api.CommonLanguageSettings\n * @instance\n */\n CommonLanguageSettings.prototype.referenceDocsUri = \"\";\n \n /**\n * CommonLanguageSettings destinations.\n * @member {Array.} destinations\n * @memberof google.api.CommonLanguageSettings\n * @instance\n */\n CommonLanguageSettings.prototype.destinations = $util.emptyArray;\n \n /**\n * Creates a new CommonLanguageSettings instance using the specified properties.\n * @function create\n * @memberof google.api.CommonLanguageSettings\n * @static\n * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set\n * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance\n */\n CommonLanguageSettings.create = function create(properties) {\n return new CommonLanguageSettings(properties);\n };\n \n /**\n * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages.\n * @function encode\n * @memberof google.api.CommonLanguageSettings\n * @static\n * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CommonLanguageSettings.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, \"referenceDocsUri\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri);\n if (message.destinations != null && message.destinations.length) {\n writer.uint32(/* id 2, wireType 2 =*/18).fork();\n for (var i = 0; i < message.destinations.length; ++i)\n writer.int32(message.destinations[i]);\n writer.ldelim();\n }\n return writer;\n };\n \n /**\n * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.CommonLanguageSettings\n * @static\n * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CommonLanguageSettings message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.CommonLanguageSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CommonLanguageSettings.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.referenceDocsUri = reader.string();\n break;\n }\n case 2: {\n if (!(message.destinations && message.destinations.length))\n message.destinations = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.destinations.push(reader.int32());\n } else\n message.destinations.push(reader.int32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.CommonLanguageSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CommonLanguageSettings message.\n * @function verify\n * @memberof google.api.CommonLanguageSettings\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CommonLanguageSettings.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.referenceDocsUri != null && message.hasOwnProperty(\"referenceDocsUri\"))\n if (!$util.isString(message.referenceDocsUri))\n return \"referenceDocsUri: string expected\";\n if (message.destinations != null && message.hasOwnProperty(\"destinations\")) {\n if (!Array.isArray(message.destinations))\n return \"destinations: array expected\";\n for (var i = 0; i < message.destinations.length; ++i)\n switch (message.destinations[i]) {\n default:\n return \"destinations: enum value[] expected\";\n case 0:\n case 10:\n case 20:\n break;\n }\n }\n return null;\n };\n \n /**\n * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.CommonLanguageSettings\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings\n */\n CommonLanguageSettings.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.CommonLanguageSettings)\n return object;\n var message = new $root.google.api.CommonLanguageSettings();\n if (object.referenceDocsUri != null)\n message.referenceDocsUri = String(object.referenceDocsUri);\n if (object.destinations) {\n if (!Array.isArray(object.destinations))\n throw TypeError(\".google.api.CommonLanguageSettings.destinations: array expected\");\n message.destinations = [];\n for (var i = 0; i < object.destinations.length; ++i)\n switch (object.destinations[i]) {\n default:\n if (typeof object.destinations[i] === \"number\") {\n message.destinations[i] = object.destinations[i];\n break;\n }\n case \"CLIENT_LIBRARY_DESTINATION_UNSPECIFIED\":\n case 0:\n message.destinations[i] = 0;\n break;\n case \"GITHUB\":\n case 10:\n message.destinations[i] = 10;\n break;\n case \"PACKAGE_MANAGER\":\n case 20:\n message.destinations[i] = 20;\n break;\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.CommonLanguageSettings\n * @static\n * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CommonLanguageSettings.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.destinations = [];\n if (options.defaults)\n object.referenceDocsUri = \"\";\n if (message.referenceDocsUri != null && message.hasOwnProperty(\"referenceDocsUri\"))\n object.referenceDocsUri = message.referenceDocsUri;\n if (message.destinations && message.destinations.length) {\n object.destinations = [];\n for (var j = 0; j < message.destinations.length; ++j)\n object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j];\n }\n return object;\n };\n \n /**\n * Converts this CommonLanguageSettings to JSON.\n * @function toJSON\n * @memberof google.api.CommonLanguageSettings\n * @instance\n * @returns {Object.} JSON object\n */\n CommonLanguageSettings.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CommonLanguageSettings\n * @function getTypeUrl\n * @memberof google.api.CommonLanguageSettings\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.CommonLanguageSettings\";\n };\n \n return CommonLanguageSettings;\n })();\n \n api.ClientLibrarySettings = (function() {\n \n /**\n * Properties of a ClientLibrarySettings.\n * @memberof google.api\n * @interface IClientLibrarySettings\n * @property {string|null} [version] ClientLibrarySettings version\n * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage\n * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums\n * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings\n * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings\n * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings\n * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings\n * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings\n * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings\n * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings\n * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings\n */\n \n /**\n * Constructs a new ClientLibrarySettings.\n * @memberof google.api\n * @classdesc Represents a ClientLibrarySettings.\n * @implements IClientLibrarySettings\n * @constructor\n * @param {google.api.IClientLibrarySettings=} [properties] Properties to set\n */\n function ClientLibrarySettings(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ClientLibrarySettings version.\n * @member {string} version\n * @memberof google.api.ClientLibrarySettings\n * @instance\n */\n ClientLibrarySettings.prototype.version = \"\";\n \n /**\n * ClientLibrarySettings launchStage.\n * @member {google.api.LaunchStage} launchStage\n * @memberof google.api.ClientLibrarySettings\n * @instance\n */\n ClientLibrarySettings.prototype.launchStage = 0;\n \n /**\n * ClientLibrarySettings restNumericEnums.\n * @member {boolean} restNumericEnums\n * @memberof google.api.ClientLibrarySettings\n * @instance\n */\n ClientLibrarySettings.prototype.restNumericEnums = false;\n \n /**\n * ClientLibrarySettings javaSettings.\n * @member {google.api.IJavaSettings|null|undefined} javaSettings\n * @memberof google.api.ClientLibrarySettings\n * @instance\n */\n ClientLibrarySettings.prototype.javaSettings = null;\n \n /**\n * ClientLibrarySettings cppSettings.\n * @member {google.api.ICppSettings|null|undefined} cppSettings\n * @memberof google.api.ClientLibrarySettings\n * @instance\n */\n ClientLibrarySettings.prototype.cppSettings = null;\n \n /**\n * ClientLibrarySettings phpSettings.\n * @member {google.api.IPhpSettings|null|undefined} phpSettings\n * @memberof google.api.ClientLibrarySettings\n * @instance\n */\n ClientLibrarySettings.prototype.phpSettings = null;\n \n /**\n * ClientLibrarySettings pythonSettings.\n * @member {google.api.IPythonSettings|null|undefined} pythonSettings\n * @memberof google.api.ClientLibrarySettings\n * @instance\n */\n ClientLibrarySettings.prototype.pythonSettings = null;\n \n /**\n * ClientLibrarySettings nodeSettings.\n * @member {google.api.INodeSettings|null|undefined} nodeSettings\n * @memberof google.api.ClientLibrarySettings\n * @instance\n */\n ClientLibrarySettings.prototype.nodeSettings = null;\n \n /**\n * ClientLibrarySettings dotnetSettings.\n * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings\n * @memberof google.api.ClientLibrarySettings\n * @instance\n */\n ClientLibrarySettings.prototype.dotnetSettings = null;\n \n /**\n * ClientLibrarySettings rubySettings.\n * @member {google.api.IRubySettings|null|undefined} rubySettings\n * @memberof google.api.ClientLibrarySettings\n * @instance\n */\n ClientLibrarySettings.prototype.rubySettings = null;\n \n /**\n * ClientLibrarySettings goSettings.\n * @member {google.api.IGoSettings|null|undefined} goSettings\n * @memberof google.api.ClientLibrarySettings\n * @instance\n */\n ClientLibrarySettings.prototype.goSettings = null;\n \n /**\n * Creates a new ClientLibrarySettings instance using the specified properties.\n * @function create\n * @memberof google.api.ClientLibrarySettings\n * @static\n * @param {google.api.IClientLibrarySettings=} [properties] Properties to set\n * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance\n */\n ClientLibrarySettings.create = function create(properties) {\n return new ClientLibrarySettings(properties);\n };\n \n /**\n * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages.\n * @function encode\n * @memberof google.api.ClientLibrarySettings\n * @static\n * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ClientLibrarySettings.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.version != null && Object.hasOwnProperty.call(message, \"version\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.version);\n if (message.launchStage != null && Object.hasOwnProperty.call(message, \"launchStage\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage);\n if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, \"restNumericEnums\"))\n writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums);\n if (message.javaSettings != null && Object.hasOwnProperty.call(message, \"javaSettings\"))\n $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim();\n if (message.cppSettings != null && Object.hasOwnProperty.call(message, \"cppSettings\"))\n $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim();\n if (message.phpSettings != null && Object.hasOwnProperty.call(message, \"phpSettings\"))\n $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim();\n if (message.pythonSettings != null && Object.hasOwnProperty.call(message, \"pythonSettings\"))\n $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim();\n if (message.nodeSettings != null && Object.hasOwnProperty.call(message, \"nodeSettings\"))\n $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim();\n if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, \"dotnetSettings\"))\n $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim();\n if (message.rubySettings != null && Object.hasOwnProperty.call(message, \"rubySettings\"))\n $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim();\n if (message.goSettings != null && Object.hasOwnProperty.call(message, \"goSettings\"))\n $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.ClientLibrarySettings\n * @static\n * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ClientLibrarySettings message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.ClientLibrarySettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ClientLibrarySettings.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.version = reader.string();\n break;\n }\n case 2: {\n message.launchStage = reader.int32();\n break;\n }\n case 3: {\n message.restNumericEnums = reader.bool();\n break;\n }\n case 21: {\n message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32());\n break;\n }\n case 22: {\n message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32());\n break;\n }\n case 23: {\n message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32());\n break;\n }\n case 24: {\n message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32());\n break;\n }\n case 25: {\n message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32());\n break;\n }\n case 26: {\n message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32());\n break;\n }\n case 27: {\n message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32());\n break;\n }\n case 28: {\n message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.ClientLibrarySettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ClientLibrarySettings message.\n * @function verify\n * @memberof google.api.ClientLibrarySettings\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ClientLibrarySettings.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.version != null && message.hasOwnProperty(\"version\"))\n if (!$util.isString(message.version))\n return \"version: string expected\";\n if (message.launchStage != null && message.hasOwnProperty(\"launchStage\"))\n switch (message.launchStage) {\n default:\n return \"launchStage: enum value expected\";\n case 0:\n case 6:\n case 7:\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n break;\n }\n if (message.restNumericEnums != null && message.hasOwnProperty(\"restNumericEnums\"))\n if (typeof message.restNumericEnums !== \"boolean\")\n return \"restNumericEnums: boolean expected\";\n if (message.javaSettings != null && message.hasOwnProperty(\"javaSettings\")) {\n var error = $root.google.api.JavaSettings.verify(message.javaSettings);\n if (error)\n return \"javaSettings.\" + error;\n }\n if (message.cppSettings != null && message.hasOwnProperty(\"cppSettings\")) {\n var error = $root.google.api.CppSettings.verify(message.cppSettings);\n if (error)\n return \"cppSettings.\" + error;\n }\n if (message.phpSettings != null && message.hasOwnProperty(\"phpSettings\")) {\n var error = $root.google.api.PhpSettings.verify(message.phpSettings);\n if (error)\n return \"phpSettings.\" + error;\n }\n if (message.pythonSettings != null && message.hasOwnProperty(\"pythonSettings\")) {\n var error = $root.google.api.PythonSettings.verify(message.pythonSettings);\n if (error)\n return \"pythonSettings.\" + error;\n }\n if (message.nodeSettings != null && message.hasOwnProperty(\"nodeSettings\")) {\n var error = $root.google.api.NodeSettings.verify(message.nodeSettings);\n if (error)\n return \"nodeSettings.\" + error;\n }\n if (message.dotnetSettings != null && message.hasOwnProperty(\"dotnetSettings\")) {\n var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings);\n if (error)\n return \"dotnetSettings.\" + error;\n }\n if (message.rubySettings != null && message.hasOwnProperty(\"rubySettings\")) {\n var error = $root.google.api.RubySettings.verify(message.rubySettings);\n if (error)\n return \"rubySettings.\" + error;\n }\n if (message.goSettings != null && message.hasOwnProperty(\"goSettings\")) {\n var error = $root.google.api.GoSettings.verify(message.goSettings);\n if (error)\n return \"goSettings.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.ClientLibrarySettings\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings\n */\n ClientLibrarySettings.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.ClientLibrarySettings)\n return object;\n var message = new $root.google.api.ClientLibrarySettings();\n if (object.version != null)\n message.version = String(object.version);\n switch (object.launchStage) {\n default:\n if (typeof object.launchStage === \"number\") {\n message.launchStage = object.launchStage;\n break;\n }\n break;\n case \"LAUNCH_STAGE_UNSPECIFIED\":\n case 0:\n message.launchStage = 0;\n break;\n case \"UNIMPLEMENTED\":\n case 6:\n message.launchStage = 6;\n break;\n case \"PRELAUNCH\":\n case 7:\n message.launchStage = 7;\n break;\n case \"EARLY_ACCESS\":\n case 1:\n message.launchStage = 1;\n break;\n case \"ALPHA\":\n case 2:\n message.launchStage = 2;\n break;\n case \"BETA\":\n case 3:\n message.launchStage = 3;\n break;\n case \"GA\":\n case 4:\n message.launchStage = 4;\n break;\n case \"DEPRECATED\":\n case 5:\n message.launchStage = 5;\n break;\n }\n if (object.restNumericEnums != null)\n message.restNumericEnums = Boolean(object.restNumericEnums);\n if (object.javaSettings != null) {\n if (typeof object.javaSettings !== \"object\")\n throw TypeError(\".google.api.ClientLibrarySettings.javaSettings: object expected\");\n message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings);\n }\n if (object.cppSettings != null) {\n if (typeof object.cppSettings !== \"object\")\n throw TypeError(\".google.api.ClientLibrarySettings.cppSettings: object expected\");\n message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings);\n }\n if (object.phpSettings != null) {\n if (typeof object.phpSettings !== \"object\")\n throw TypeError(\".google.api.ClientLibrarySettings.phpSettings: object expected\");\n message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings);\n }\n if (object.pythonSettings != null) {\n if (typeof object.pythonSettings !== \"object\")\n throw TypeError(\".google.api.ClientLibrarySettings.pythonSettings: object expected\");\n message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings);\n }\n if (object.nodeSettings != null) {\n if (typeof object.nodeSettings !== \"object\")\n throw TypeError(\".google.api.ClientLibrarySettings.nodeSettings: object expected\");\n message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings);\n }\n if (object.dotnetSettings != null) {\n if (typeof object.dotnetSettings !== \"object\")\n throw TypeError(\".google.api.ClientLibrarySettings.dotnetSettings: object expected\");\n message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings);\n }\n if (object.rubySettings != null) {\n if (typeof object.rubySettings !== \"object\")\n throw TypeError(\".google.api.ClientLibrarySettings.rubySettings: object expected\");\n message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings);\n }\n if (object.goSettings != null) {\n if (typeof object.goSettings !== \"object\")\n throw TypeError(\".google.api.ClientLibrarySettings.goSettings: object expected\");\n message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.ClientLibrarySettings\n * @static\n * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ClientLibrarySettings.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.version = \"\";\n object.launchStage = options.enums === String ? \"LAUNCH_STAGE_UNSPECIFIED\" : 0;\n object.restNumericEnums = false;\n object.javaSettings = null;\n object.cppSettings = null;\n object.phpSettings = null;\n object.pythonSettings = null;\n object.nodeSettings = null;\n object.dotnetSettings = null;\n object.rubySettings = null;\n object.goSettings = null;\n }\n if (message.version != null && message.hasOwnProperty(\"version\"))\n object.version = message.version;\n if (message.launchStage != null && message.hasOwnProperty(\"launchStage\"))\n object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage;\n if (message.restNumericEnums != null && message.hasOwnProperty(\"restNumericEnums\"))\n object.restNumericEnums = message.restNumericEnums;\n if (message.javaSettings != null && message.hasOwnProperty(\"javaSettings\"))\n object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options);\n if (message.cppSettings != null && message.hasOwnProperty(\"cppSettings\"))\n object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options);\n if (message.phpSettings != null && message.hasOwnProperty(\"phpSettings\"))\n object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options);\n if (message.pythonSettings != null && message.hasOwnProperty(\"pythonSettings\"))\n object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options);\n if (message.nodeSettings != null && message.hasOwnProperty(\"nodeSettings\"))\n object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options);\n if (message.dotnetSettings != null && message.hasOwnProperty(\"dotnetSettings\"))\n object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options);\n if (message.rubySettings != null && message.hasOwnProperty(\"rubySettings\"))\n object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options);\n if (message.goSettings != null && message.hasOwnProperty(\"goSettings\"))\n object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options);\n return object;\n };\n \n /**\n * Converts this ClientLibrarySettings to JSON.\n * @function toJSON\n * @memberof google.api.ClientLibrarySettings\n * @instance\n * @returns {Object.} JSON object\n */\n ClientLibrarySettings.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ClientLibrarySettings\n * @function getTypeUrl\n * @memberof google.api.ClientLibrarySettings\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.ClientLibrarySettings\";\n };\n \n return ClientLibrarySettings;\n })();\n \n api.Publishing = (function() {\n \n /**\n * Properties of a Publishing.\n * @memberof google.api\n * @interface IPublishing\n * @property {Array.|null} [methodSettings] Publishing methodSettings\n * @property {string|null} [newIssueUri] Publishing newIssueUri\n * @property {string|null} [documentationUri] Publishing documentationUri\n * @property {string|null} [apiShortName] Publishing apiShortName\n * @property {string|null} [githubLabel] Publishing githubLabel\n * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams\n * @property {string|null} [docTagPrefix] Publishing docTagPrefix\n * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization\n * @property {Array.|null} [librarySettings] Publishing librarySettings\n * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri\n */\n \n /**\n * Constructs a new Publishing.\n * @memberof google.api\n * @classdesc Represents a Publishing.\n * @implements IPublishing\n * @constructor\n * @param {google.api.IPublishing=} [properties] Properties to set\n */\n function Publishing(properties) {\n this.methodSettings = [];\n this.codeownerGithubTeams = [];\n this.librarySettings = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Publishing methodSettings.\n * @member {Array.} methodSettings\n * @memberof google.api.Publishing\n * @instance\n */\n Publishing.prototype.methodSettings = $util.emptyArray;\n \n /**\n * Publishing newIssueUri.\n * @member {string} newIssueUri\n * @memberof google.api.Publishing\n * @instance\n */\n Publishing.prototype.newIssueUri = \"\";\n \n /**\n * Publishing documentationUri.\n * @member {string} documentationUri\n * @memberof google.api.Publishing\n * @instance\n */\n Publishing.prototype.documentationUri = \"\";\n \n /**\n * Publishing apiShortName.\n * @member {string} apiShortName\n * @memberof google.api.Publishing\n * @instance\n */\n Publishing.prototype.apiShortName = \"\";\n \n /**\n * Publishing githubLabel.\n * @member {string} githubLabel\n * @memberof google.api.Publishing\n * @instance\n */\n Publishing.prototype.githubLabel = \"\";\n \n /**\n * Publishing codeownerGithubTeams.\n * @member {Array.} codeownerGithubTeams\n * @memberof google.api.Publishing\n * @instance\n */\n Publishing.prototype.codeownerGithubTeams = $util.emptyArray;\n \n /**\n * Publishing docTagPrefix.\n * @member {string} docTagPrefix\n * @memberof google.api.Publishing\n * @instance\n */\n Publishing.prototype.docTagPrefix = \"\";\n \n /**\n * Publishing organization.\n * @member {google.api.ClientLibraryOrganization} organization\n * @memberof google.api.Publishing\n * @instance\n */\n Publishing.prototype.organization = 0;\n \n /**\n * Publishing librarySettings.\n * @member {Array.} librarySettings\n * @memberof google.api.Publishing\n * @instance\n */\n Publishing.prototype.librarySettings = $util.emptyArray;\n \n /**\n * Publishing protoReferenceDocumentationUri.\n * @member {string} protoReferenceDocumentationUri\n * @memberof google.api.Publishing\n * @instance\n */\n Publishing.prototype.protoReferenceDocumentationUri = \"\";\n \n /**\n * Creates a new Publishing instance using the specified properties.\n * @function create\n * @memberof google.api.Publishing\n * @static\n * @param {google.api.IPublishing=} [properties] Properties to set\n * @returns {google.api.Publishing} Publishing instance\n */\n Publishing.create = function create(properties) {\n return new Publishing(properties);\n };\n \n /**\n * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages.\n * @function encode\n * @memberof google.api.Publishing\n * @static\n * @param {google.api.IPublishing} message Publishing message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Publishing.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.methodSettings != null && message.methodSettings.length)\n for (var i = 0; i < message.methodSettings.length; ++i)\n $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.newIssueUri != null && Object.hasOwnProperty.call(message, \"newIssueUri\"))\n writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri);\n if (message.documentationUri != null && Object.hasOwnProperty.call(message, \"documentationUri\"))\n writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri);\n if (message.apiShortName != null && Object.hasOwnProperty.call(message, \"apiShortName\"))\n writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName);\n if (message.githubLabel != null && Object.hasOwnProperty.call(message, \"githubLabel\"))\n writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel);\n if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length)\n for (var i = 0; i < message.codeownerGithubTeams.length; ++i)\n writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]);\n if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, \"docTagPrefix\"))\n writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix);\n if (message.organization != null && Object.hasOwnProperty.call(message, \"organization\"))\n writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization);\n if (message.librarySettings != null && message.librarySettings.length)\n for (var i = 0; i < message.librarySettings.length; ++i)\n $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim();\n if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, \"protoReferenceDocumentationUri\"))\n writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri);\n return writer;\n };\n \n /**\n * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.Publishing\n * @static\n * @param {google.api.IPublishing} message Publishing message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Publishing.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Publishing message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.Publishing\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.Publishing} Publishing\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Publishing.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n if (!(message.methodSettings && message.methodSettings.length))\n message.methodSettings = [];\n message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32()));\n break;\n }\n case 101: {\n message.newIssueUri = reader.string();\n break;\n }\n case 102: {\n message.documentationUri = reader.string();\n break;\n }\n case 103: {\n message.apiShortName = reader.string();\n break;\n }\n case 104: {\n message.githubLabel = reader.string();\n break;\n }\n case 105: {\n if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length))\n message.codeownerGithubTeams = [];\n message.codeownerGithubTeams.push(reader.string());\n break;\n }\n case 106: {\n message.docTagPrefix = reader.string();\n break;\n }\n case 107: {\n message.organization = reader.int32();\n break;\n }\n case 109: {\n if (!(message.librarySettings && message.librarySettings.length))\n message.librarySettings = [];\n message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32()));\n break;\n }\n case 110: {\n message.protoReferenceDocumentationUri = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Publishing message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.Publishing\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.Publishing} Publishing\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Publishing.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Publishing message.\n * @function verify\n * @memberof google.api.Publishing\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Publishing.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.methodSettings != null && message.hasOwnProperty(\"methodSettings\")) {\n if (!Array.isArray(message.methodSettings))\n return \"methodSettings: array expected\";\n for (var i = 0; i < message.methodSettings.length; ++i) {\n var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]);\n if (error)\n return \"methodSettings.\" + error;\n }\n }\n if (message.newIssueUri != null && message.hasOwnProperty(\"newIssueUri\"))\n if (!$util.isString(message.newIssueUri))\n return \"newIssueUri: string expected\";\n if (message.documentationUri != null && message.hasOwnProperty(\"documentationUri\"))\n if (!$util.isString(message.documentationUri))\n return \"documentationUri: string expected\";\n if (message.apiShortName != null && message.hasOwnProperty(\"apiShortName\"))\n if (!$util.isString(message.apiShortName))\n return \"apiShortName: string expected\";\n if (message.githubLabel != null && message.hasOwnProperty(\"githubLabel\"))\n if (!$util.isString(message.githubLabel))\n return \"githubLabel: string expected\";\n if (message.codeownerGithubTeams != null && message.hasOwnProperty(\"codeownerGithubTeams\")) {\n if (!Array.isArray(message.codeownerGithubTeams))\n return \"codeownerGithubTeams: array expected\";\n for (var i = 0; i < message.codeownerGithubTeams.length; ++i)\n if (!$util.isString(message.codeownerGithubTeams[i]))\n return \"codeownerGithubTeams: string[] expected\";\n }\n if (message.docTagPrefix != null && message.hasOwnProperty(\"docTagPrefix\"))\n if (!$util.isString(message.docTagPrefix))\n return \"docTagPrefix: string expected\";\n if (message.organization != null && message.hasOwnProperty(\"organization\"))\n switch (message.organization) {\n default:\n return \"organization: enum value expected\";\n case 0:\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n case 7:\n break;\n }\n if (message.librarySettings != null && message.hasOwnProperty(\"librarySettings\")) {\n if (!Array.isArray(message.librarySettings))\n return \"librarySettings: array expected\";\n for (var i = 0; i < message.librarySettings.length; ++i) {\n var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]);\n if (error)\n return \"librarySettings.\" + error;\n }\n }\n if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty(\"protoReferenceDocumentationUri\"))\n if (!$util.isString(message.protoReferenceDocumentationUri))\n return \"protoReferenceDocumentationUri: string expected\";\n return null;\n };\n \n /**\n * Creates a Publishing message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.Publishing\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.Publishing} Publishing\n */\n Publishing.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.Publishing)\n return object;\n var message = new $root.google.api.Publishing();\n if (object.methodSettings) {\n if (!Array.isArray(object.methodSettings))\n throw TypeError(\".google.api.Publishing.methodSettings: array expected\");\n message.methodSettings = [];\n for (var i = 0; i < object.methodSettings.length; ++i) {\n if (typeof object.methodSettings[i] !== \"object\")\n throw TypeError(\".google.api.Publishing.methodSettings: object expected\");\n message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]);\n }\n }\n if (object.newIssueUri != null)\n message.newIssueUri = String(object.newIssueUri);\n if (object.documentationUri != null)\n message.documentationUri = String(object.documentationUri);\n if (object.apiShortName != null)\n message.apiShortName = String(object.apiShortName);\n if (object.githubLabel != null)\n message.githubLabel = String(object.githubLabel);\n if (object.codeownerGithubTeams) {\n if (!Array.isArray(object.codeownerGithubTeams))\n throw TypeError(\".google.api.Publishing.codeownerGithubTeams: array expected\");\n message.codeownerGithubTeams = [];\n for (var i = 0; i < object.codeownerGithubTeams.length; ++i)\n message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]);\n }\n if (object.docTagPrefix != null)\n message.docTagPrefix = String(object.docTagPrefix);\n switch (object.organization) {\n default:\n if (typeof object.organization === \"number\") {\n message.organization = object.organization;\n break;\n }\n break;\n case \"CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED\":\n case 0:\n message.organization = 0;\n break;\n case \"CLOUD\":\n case 1:\n message.organization = 1;\n break;\n case \"ADS\":\n case 2:\n message.organization = 2;\n break;\n case \"PHOTOS\":\n case 3:\n message.organization = 3;\n break;\n case \"STREET_VIEW\":\n case 4:\n message.organization = 4;\n break;\n case \"SHOPPING\":\n case 5:\n message.organization = 5;\n break;\n case \"GEO\":\n case 6:\n message.organization = 6;\n break;\n case \"GENERATIVE_AI\":\n case 7:\n message.organization = 7;\n break;\n }\n if (object.librarySettings) {\n if (!Array.isArray(object.librarySettings))\n throw TypeError(\".google.api.Publishing.librarySettings: array expected\");\n message.librarySettings = [];\n for (var i = 0; i < object.librarySettings.length; ++i) {\n if (typeof object.librarySettings[i] !== \"object\")\n throw TypeError(\".google.api.Publishing.librarySettings: object expected\");\n message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]);\n }\n }\n if (object.protoReferenceDocumentationUri != null)\n message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri);\n return message;\n };\n \n /**\n * Creates a plain object from a Publishing message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.Publishing\n * @static\n * @param {google.api.Publishing} message Publishing\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Publishing.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.methodSettings = [];\n object.codeownerGithubTeams = [];\n object.librarySettings = [];\n }\n if (options.defaults) {\n object.newIssueUri = \"\";\n object.documentationUri = \"\";\n object.apiShortName = \"\";\n object.githubLabel = \"\";\n object.docTagPrefix = \"\";\n object.organization = options.enums === String ? \"CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED\" : 0;\n object.protoReferenceDocumentationUri = \"\";\n }\n if (message.methodSettings && message.methodSettings.length) {\n object.methodSettings = [];\n for (var j = 0; j < message.methodSettings.length; ++j)\n object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options);\n }\n if (message.newIssueUri != null && message.hasOwnProperty(\"newIssueUri\"))\n object.newIssueUri = message.newIssueUri;\n if (message.documentationUri != null && message.hasOwnProperty(\"documentationUri\"))\n object.documentationUri = message.documentationUri;\n if (message.apiShortName != null && message.hasOwnProperty(\"apiShortName\"))\n object.apiShortName = message.apiShortName;\n if (message.githubLabel != null && message.hasOwnProperty(\"githubLabel\"))\n object.githubLabel = message.githubLabel;\n if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) {\n object.codeownerGithubTeams = [];\n for (var j = 0; j < message.codeownerGithubTeams.length; ++j)\n object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j];\n }\n if (message.docTagPrefix != null && message.hasOwnProperty(\"docTagPrefix\"))\n object.docTagPrefix = message.docTagPrefix;\n if (message.organization != null && message.hasOwnProperty(\"organization\"))\n object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization;\n if (message.librarySettings && message.librarySettings.length) {\n object.librarySettings = [];\n for (var j = 0; j < message.librarySettings.length; ++j)\n object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options);\n }\n if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty(\"protoReferenceDocumentationUri\"))\n object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri;\n return object;\n };\n \n /**\n * Converts this Publishing to JSON.\n * @function toJSON\n * @memberof google.api.Publishing\n * @instance\n * @returns {Object.} JSON object\n */\n Publishing.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Publishing\n * @function getTypeUrl\n * @memberof google.api.Publishing\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.Publishing\";\n };\n \n return Publishing;\n })();\n \n api.JavaSettings = (function() {\n \n /**\n * Properties of a JavaSettings.\n * @memberof google.api\n * @interface IJavaSettings\n * @property {string|null} [libraryPackage] JavaSettings libraryPackage\n * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames\n * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common\n */\n \n /**\n * Constructs a new JavaSettings.\n * @memberof google.api\n * @classdesc Represents a JavaSettings.\n * @implements IJavaSettings\n * @constructor\n * @param {google.api.IJavaSettings=} [properties] Properties to set\n */\n function JavaSettings(properties) {\n this.serviceClassNames = {};\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * JavaSettings libraryPackage.\n * @member {string} libraryPackage\n * @memberof google.api.JavaSettings\n * @instance\n */\n JavaSettings.prototype.libraryPackage = \"\";\n \n /**\n * JavaSettings serviceClassNames.\n * @member {Object.} serviceClassNames\n * @memberof google.api.JavaSettings\n * @instance\n */\n JavaSettings.prototype.serviceClassNames = $util.emptyObject;\n \n /**\n * JavaSettings common.\n * @member {google.api.ICommonLanguageSettings|null|undefined} common\n * @memberof google.api.JavaSettings\n * @instance\n */\n JavaSettings.prototype.common = null;\n \n /**\n * Creates a new JavaSettings instance using the specified properties.\n * @function create\n * @memberof google.api.JavaSettings\n * @static\n * @param {google.api.IJavaSettings=} [properties] Properties to set\n * @returns {google.api.JavaSettings} JavaSettings instance\n */\n JavaSettings.create = function create(properties) {\n return new JavaSettings(properties);\n };\n \n /**\n * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages.\n * @function encode\n * @memberof google.api.JavaSettings\n * @static\n * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n JavaSettings.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.libraryPackage != null && Object.hasOwnProperty.call(message, \"libraryPackage\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage);\n if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, \"serviceClassNames\"))\n for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i)\n writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim();\n if (message.common != null && Object.hasOwnProperty.call(message, \"common\"))\n $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.JavaSettings\n * @static\n * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n JavaSettings.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a JavaSettings message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.JavaSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.JavaSettings} JavaSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n JavaSettings.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value;\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.libraryPackage = reader.string();\n break;\n }\n case 2: {\n if (message.serviceClassNames === $util.emptyObject)\n message.serviceClassNames = {};\n var end2 = reader.uint32() + reader.pos;\n key = \"\";\n value = \"\";\n while (reader.pos < end2) {\n var tag2 = reader.uint32();\n switch (tag2 >>> 3) {\n case 1:\n key = reader.string();\n break;\n case 2:\n value = reader.string();\n break;\n default:\n reader.skipType(tag2 & 7);\n break;\n }\n }\n message.serviceClassNames[key] = value;\n break;\n }\n case 3: {\n message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a JavaSettings message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.JavaSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.JavaSettings} JavaSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n JavaSettings.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a JavaSettings message.\n * @function verify\n * @memberof google.api.JavaSettings\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n JavaSettings.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.libraryPackage != null && message.hasOwnProperty(\"libraryPackage\"))\n if (!$util.isString(message.libraryPackage))\n return \"libraryPackage: string expected\";\n if (message.serviceClassNames != null && message.hasOwnProperty(\"serviceClassNames\")) {\n if (!$util.isObject(message.serviceClassNames))\n return \"serviceClassNames: object expected\";\n var key = Object.keys(message.serviceClassNames);\n for (var i = 0; i < key.length; ++i)\n if (!$util.isString(message.serviceClassNames[key[i]]))\n return \"serviceClassNames: string{k:string} expected\";\n }\n if (message.common != null && message.hasOwnProperty(\"common\")) {\n var error = $root.google.api.CommonLanguageSettings.verify(message.common);\n if (error)\n return \"common.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.JavaSettings\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.JavaSettings} JavaSettings\n */\n JavaSettings.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.JavaSettings)\n return object;\n var message = new $root.google.api.JavaSettings();\n if (object.libraryPackage != null)\n message.libraryPackage = String(object.libraryPackage);\n if (object.serviceClassNames) {\n if (typeof object.serviceClassNames !== \"object\")\n throw TypeError(\".google.api.JavaSettings.serviceClassNames: object expected\");\n message.serviceClassNames = {};\n for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i)\n message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]);\n }\n if (object.common != null) {\n if (typeof object.common !== \"object\")\n throw TypeError(\".google.api.JavaSettings.common: object expected\");\n message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a JavaSettings message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.JavaSettings\n * @static\n * @param {google.api.JavaSettings} message JavaSettings\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n JavaSettings.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.objects || options.defaults)\n object.serviceClassNames = {};\n if (options.defaults) {\n object.libraryPackage = \"\";\n object.common = null;\n }\n if (message.libraryPackage != null && message.hasOwnProperty(\"libraryPackage\"))\n object.libraryPackage = message.libraryPackage;\n var keys2;\n if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) {\n object.serviceClassNames = {};\n for (var j = 0; j < keys2.length; ++j)\n object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]];\n }\n if (message.common != null && message.hasOwnProperty(\"common\"))\n object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);\n return object;\n };\n \n /**\n * Converts this JavaSettings to JSON.\n * @function toJSON\n * @memberof google.api.JavaSettings\n * @instance\n * @returns {Object.} JSON object\n */\n JavaSettings.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for JavaSettings\n * @function getTypeUrl\n * @memberof google.api.JavaSettings\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.JavaSettings\";\n };\n \n return JavaSettings;\n })();\n \n api.CppSettings = (function() {\n \n /**\n * Properties of a CppSettings.\n * @memberof google.api\n * @interface ICppSettings\n * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common\n */\n \n /**\n * Constructs a new CppSettings.\n * @memberof google.api\n * @classdesc Represents a CppSettings.\n * @implements ICppSettings\n * @constructor\n * @param {google.api.ICppSettings=} [properties] Properties to set\n */\n function CppSettings(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CppSettings common.\n * @member {google.api.ICommonLanguageSettings|null|undefined} common\n * @memberof google.api.CppSettings\n * @instance\n */\n CppSettings.prototype.common = null;\n \n /**\n * Creates a new CppSettings instance using the specified properties.\n * @function create\n * @memberof google.api.CppSettings\n * @static\n * @param {google.api.ICppSettings=} [properties] Properties to set\n * @returns {google.api.CppSettings} CppSettings instance\n */\n CppSettings.create = function create(properties) {\n return new CppSettings(properties);\n };\n \n /**\n * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages.\n * @function encode\n * @memberof google.api.CppSettings\n * @static\n * @param {google.api.ICppSettings} message CppSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CppSettings.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.common != null && Object.hasOwnProperty.call(message, \"common\"))\n $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.CppSettings\n * @static\n * @param {google.api.ICppSettings} message CppSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CppSettings.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CppSettings message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.CppSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.CppSettings} CppSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CppSettings.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CppSettings message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.CppSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.CppSettings} CppSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CppSettings.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CppSettings message.\n * @function verify\n * @memberof google.api.CppSettings\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CppSettings.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.common != null && message.hasOwnProperty(\"common\")) {\n var error = $root.google.api.CommonLanguageSettings.verify(message.common);\n if (error)\n return \"common.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a CppSettings message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.CppSettings\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.CppSettings} CppSettings\n */\n CppSettings.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.CppSettings)\n return object;\n var message = new $root.google.api.CppSettings();\n if (object.common != null) {\n if (typeof object.common !== \"object\")\n throw TypeError(\".google.api.CppSettings.common: object expected\");\n message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a CppSettings message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.CppSettings\n * @static\n * @param {google.api.CppSettings} message CppSettings\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CppSettings.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.common = null;\n if (message.common != null && message.hasOwnProperty(\"common\"))\n object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);\n return object;\n };\n \n /**\n * Converts this CppSettings to JSON.\n * @function toJSON\n * @memberof google.api.CppSettings\n * @instance\n * @returns {Object.} JSON object\n */\n CppSettings.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CppSettings\n * @function getTypeUrl\n * @memberof google.api.CppSettings\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.CppSettings\";\n };\n \n return CppSettings;\n })();\n \n api.PhpSettings = (function() {\n \n /**\n * Properties of a PhpSettings.\n * @memberof google.api\n * @interface IPhpSettings\n * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common\n */\n \n /**\n * Constructs a new PhpSettings.\n * @memberof google.api\n * @classdesc Represents a PhpSettings.\n * @implements IPhpSettings\n * @constructor\n * @param {google.api.IPhpSettings=} [properties] Properties to set\n */\n function PhpSettings(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * PhpSettings common.\n * @member {google.api.ICommonLanguageSettings|null|undefined} common\n * @memberof google.api.PhpSettings\n * @instance\n */\n PhpSettings.prototype.common = null;\n \n /**\n * Creates a new PhpSettings instance using the specified properties.\n * @function create\n * @memberof google.api.PhpSettings\n * @static\n * @param {google.api.IPhpSettings=} [properties] Properties to set\n * @returns {google.api.PhpSettings} PhpSettings instance\n */\n PhpSettings.create = function create(properties) {\n return new PhpSettings(properties);\n };\n \n /**\n * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages.\n * @function encode\n * @memberof google.api.PhpSettings\n * @static\n * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PhpSettings.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.common != null && Object.hasOwnProperty.call(message, \"common\"))\n $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.PhpSettings\n * @static\n * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PhpSettings.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a PhpSettings message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.PhpSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.PhpSettings} PhpSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PhpSettings.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a PhpSettings message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.PhpSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.PhpSettings} PhpSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PhpSettings.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a PhpSettings message.\n * @function verify\n * @memberof google.api.PhpSettings\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n PhpSettings.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.common != null && message.hasOwnProperty(\"common\")) {\n var error = $root.google.api.CommonLanguageSettings.verify(message.common);\n if (error)\n return \"common.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.PhpSettings\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.PhpSettings} PhpSettings\n */\n PhpSettings.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.PhpSettings)\n return object;\n var message = new $root.google.api.PhpSettings();\n if (object.common != null) {\n if (typeof object.common !== \"object\")\n throw TypeError(\".google.api.PhpSettings.common: object expected\");\n message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a PhpSettings message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.PhpSettings\n * @static\n * @param {google.api.PhpSettings} message PhpSettings\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n PhpSettings.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.common = null;\n if (message.common != null && message.hasOwnProperty(\"common\"))\n object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);\n return object;\n };\n \n /**\n * Converts this PhpSettings to JSON.\n * @function toJSON\n * @memberof google.api.PhpSettings\n * @instance\n * @returns {Object.} JSON object\n */\n PhpSettings.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for PhpSettings\n * @function getTypeUrl\n * @memberof google.api.PhpSettings\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.PhpSettings\";\n };\n \n return PhpSettings;\n })();\n \n api.PythonSettings = (function() {\n \n /**\n * Properties of a PythonSettings.\n * @memberof google.api\n * @interface IPythonSettings\n * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common\n */\n \n /**\n * Constructs a new PythonSettings.\n * @memberof google.api\n * @classdesc Represents a PythonSettings.\n * @implements IPythonSettings\n * @constructor\n * @param {google.api.IPythonSettings=} [properties] Properties to set\n */\n function PythonSettings(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * PythonSettings common.\n * @member {google.api.ICommonLanguageSettings|null|undefined} common\n * @memberof google.api.PythonSettings\n * @instance\n */\n PythonSettings.prototype.common = null;\n \n /**\n * Creates a new PythonSettings instance using the specified properties.\n * @function create\n * @memberof google.api.PythonSettings\n * @static\n * @param {google.api.IPythonSettings=} [properties] Properties to set\n * @returns {google.api.PythonSettings} PythonSettings instance\n */\n PythonSettings.create = function create(properties) {\n return new PythonSettings(properties);\n };\n \n /**\n * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages.\n * @function encode\n * @memberof google.api.PythonSettings\n * @static\n * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PythonSettings.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.common != null && Object.hasOwnProperty.call(message, \"common\"))\n $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.PythonSettings\n * @static\n * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PythonSettings.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a PythonSettings message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.PythonSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.PythonSettings} PythonSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PythonSettings.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a PythonSettings message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.PythonSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.PythonSettings} PythonSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PythonSettings.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a PythonSettings message.\n * @function verify\n * @memberof google.api.PythonSettings\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n PythonSettings.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.common != null && message.hasOwnProperty(\"common\")) {\n var error = $root.google.api.CommonLanguageSettings.verify(message.common);\n if (error)\n return \"common.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.PythonSettings\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.PythonSettings} PythonSettings\n */\n PythonSettings.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.PythonSettings)\n return object;\n var message = new $root.google.api.PythonSettings();\n if (object.common != null) {\n if (typeof object.common !== \"object\")\n throw TypeError(\".google.api.PythonSettings.common: object expected\");\n message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a PythonSettings message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.PythonSettings\n * @static\n * @param {google.api.PythonSettings} message PythonSettings\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n PythonSettings.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.common = null;\n if (message.common != null && message.hasOwnProperty(\"common\"))\n object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);\n return object;\n };\n \n /**\n * Converts this PythonSettings to JSON.\n * @function toJSON\n * @memberof google.api.PythonSettings\n * @instance\n * @returns {Object.} JSON object\n */\n PythonSettings.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for PythonSettings\n * @function getTypeUrl\n * @memberof google.api.PythonSettings\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.PythonSettings\";\n };\n \n return PythonSettings;\n })();\n \n api.NodeSettings = (function() {\n \n /**\n * Properties of a NodeSettings.\n * @memberof google.api\n * @interface INodeSettings\n * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common\n */\n \n /**\n * Constructs a new NodeSettings.\n * @memberof google.api\n * @classdesc Represents a NodeSettings.\n * @implements INodeSettings\n * @constructor\n * @param {google.api.INodeSettings=} [properties] Properties to set\n */\n function NodeSettings(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * NodeSettings common.\n * @member {google.api.ICommonLanguageSettings|null|undefined} common\n * @memberof google.api.NodeSettings\n * @instance\n */\n NodeSettings.prototype.common = null;\n \n /**\n * Creates a new NodeSettings instance using the specified properties.\n * @function create\n * @memberof google.api.NodeSettings\n * @static\n * @param {google.api.INodeSettings=} [properties] Properties to set\n * @returns {google.api.NodeSettings} NodeSettings instance\n */\n NodeSettings.create = function create(properties) {\n return new NodeSettings(properties);\n };\n \n /**\n * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages.\n * @function encode\n * @memberof google.api.NodeSettings\n * @static\n * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n NodeSettings.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.common != null && Object.hasOwnProperty.call(message, \"common\"))\n $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.NodeSettings\n * @static\n * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n NodeSettings.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a NodeSettings message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.NodeSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.NodeSettings} NodeSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n NodeSettings.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a NodeSettings message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.NodeSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.NodeSettings} NodeSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n NodeSettings.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a NodeSettings message.\n * @function verify\n * @memberof google.api.NodeSettings\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n NodeSettings.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.common != null && message.hasOwnProperty(\"common\")) {\n var error = $root.google.api.CommonLanguageSettings.verify(message.common);\n if (error)\n return \"common.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.NodeSettings\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.NodeSettings} NodeSettings\n */\n NodeSettings.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.NodeSettings)\n return object;\n var message = new $root.google.api.NodeSettings();\n if (object.common != null) {\n if (typeof object.common !== \"object\")\n throw TypeError(\".google.api.NodeSettings.common: object expected\");\n message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a NodeSettings message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.NodeSettings\n * @static\n * @param {google.api.NodeSettings} message NodeSettings\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n NodeSettings.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.common = null;\n if (message.common != null && message.hasOwnProperty(\"common\"))\n object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);\n return object;\n };\n \n /**\n * Converts this NodeSettings to JSON.\n * @function toJSON\n * @memberof google.api.NodeSettings\n * @instance\n * @returns {Object.} JSON object\n */\n NodeSettings.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for NodeSettings\n * @function getTypeUrl\n * @memberof google.api.NodeSettings\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.NodeSettings\";\n };\n \n return NodeSettings;\n })();\n \n api.DotnetSettings = (function() {\n \n /**\n * Properties of a DotnetSettings.\n * @memberof google.api\n * @interface IDotnetSettings\n * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common\n * @property {Object.|null} [renamedServices] DotnetSettings renamedServices\n * @property {Object.|null} [renamedResources] DotnetSettings renamedResources\n * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources\n * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases\n * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures\n */\n \n /**\n * Constructs a new DotnetSettings.\n * @memberof google.api\n * @classdesc Represents a DotnetSettings.\n * @implements IDotnetSettings\n * @constructor\n * @param {google.api.IDotnetSettings=} [properties] Properties to set\n */\n function DotnetSettings(properties) {\n this.renamedServices = {};\n this.renamedResources = {};\n this.ignoredResources = [];\n this.forcedNamespaceAliases = [];\n this.handwrittenSignatures = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DotnetSettings common.\n * @member {google.api.ICommonLanguageSettings|null|undefined} common\n * @memberof google.api.DotnetSettings\n * @instance\n */\n DotnetSettings.prototype.common = null;\n \n /**\n * DotnetSettings renamedServices.\n * @member {Object.} renamedServices\n * @memberof google.api.DotnetSettings\n * @instance\n */\n DotnetSettings.prototype.renamedServices = $util.emptyObject;\n \n /**\n * DotnetSettings renamedResources.\n * @member {Object.} renamedResources\n * @memberof google.api.DotnetSettings\n * @instance\n */\n DotnetSettings.prototype.renamedResources = $util.emptyObject;\n \n /**\n * DotnetSettings ignoredResources.\n * @member {Array.} ignoredResources\n * @memberof google.api.DotnetSettings\n * @instance\n */\n DotnetSettings.prototype.ignoredResources = $util.emptyArray;\n \n /**\n * DotnetSettings forcedNamespaceAliases.\n * @member {Array.} forcedNamespaceAliases\n * @memberof google.api.DotnetSettings\n * @instance\n */\n DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray;\n \n /**\n * DotnetSettings handwrittenSignatures.\n * @member {Array.} handwrittenSignatures\n * @memberof google.api.DotnetSettings\n * @instance\n */\n DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray;\n \n /**\n * Creates a new DotnetSettings instance using the specified properties.\n * @function create\n * @memberof google.api.DotnetSettings\n * @static\n * @param {google.api.IDotnetSettings=} [properties] Properties to set\n * @returns {google.api.DotnetSettings} DotnetSettings instance\n */\n DotnetSettings.create = function create(properties) {\n return new DotnetSettings(properties);\n };\n \n /**\n * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages.\n * @function encode\n * @memberof google.api.DotnetSettings\n * @static\n * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DotnetSettings.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.common != null && Object.hasOwnProperty.call(message, \"common\"))\n $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.renamedServices != null && Object.hasOwnProperty.call(message, \"renamedServices\"))\n for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i)\n writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim();\n if (message.renamedResources != null && Object.hasOwnProperty.call(message, \"renamedResources\"))\n for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i)\n writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim();\n if (message.ignoredResources != null && message.ignoredResources.length)\n for (var i = 0; i < message.ignoredResources.length; ++i)\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]);\n if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length)\n for (var i = 0; i < message.forcedNamespaceAliases.length; ++i)\n writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]);\n if (message.handwrittenSignatures != null && message.handwrittenSignatures.length)\n for (var i = 0; i < message.handwrittenSignatures.length; ++i)\n writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]);\n return writer;\n };\n \n /**\n * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.DotnetSettings\n * @static\n * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DotnetSettings message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.DotnetSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.DotnetSettings} DotnetSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DotnetSettings.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value;\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n if (message.renamedServices === $util.emptyObject)\n message.renamedServices = {};\n var end2 = reader.uint32() + reader.pos;\n key = \"\";\n value = \"\";\n while (reader.pos < end2) {\n var tag2 = reader.uint32();\n switch (tag2 >>> 3) {\n case 1:\n key = reader.string();\n break;\n case 2:\n value = reader.string();\n break;\n default:\n reader.skipType(tag2 & 7);\n break;\n }\n }\n message.renamedServices[key] = value;\n break;\n }\n case 3: {\n if (message.renamedResources === $util.emptyObject)\n message.renamedResources = {};\n var end2 = reader.uint32() + reader.pos;\n key = \"\";\n value = \"\";\n while (reader.pos < end2) {\n var tag2 = reader.uint32();\n switch (tag2 >>> 3) {\n case 1:\n key = reader.string();\n break;\n case 2:\n value = reader.string();\n break;\n default:\n reader.skipType(tag2 & 7);\n break;\n }\n }\n message.renamedResources[key] = value;\n break;\n }\n case 4: {\n if (!(message.ignoredResources && message.ignoredResources.length))\n message.ignoredResources = [];\n message.ignoredResources.push(reader.string());\n break;\n }\n case 5: {\n if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length))\n message.forcedNamespaceAliases = [];\n message.forcedNamespaceAliases.push(reader.string());\n break;\n }\n case 6: {\n if (!(message.handwrittenSignatures && message.handwrittenSignatures.length))\n message.handwrittenSignatures = [];\n message.handwrittenSignatures.push(reader.string());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DotnetSettings message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.DotnetSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.DotnetSettings} DotnetSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DotnetSettings.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DotnetSettings message.\n * @function verify\n * @memberof google.api.DotnetSettings\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DotnetSettings.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.common != null && message.hasOwnProperty(\"common\")) {\n var error = $root.google.api.CommonLanguageSettings.verify(message.common);\n if (error)\n return \"common.\" + error;\n }\n if (message.renamedServices != null && message.hasOwnProperty(\"renamedServices\")) {\n if (!$util.isObject(message.renamedServices))\n return \"renamedServices: object expected\";\n var key = Object.keys(message.renamedServices);\n for (var i = 0; i < key.length; ++i)\n if (!$util.isString(message.renamedServices[key[i]]))\n return \"renamedServices: string{k:string} expected\";\n }\n if (message.renamedResources != null && message.hasOwnProperty(\"renamedResources\")) {\n if (!$util.isObject(message.renamedResources))\n return \"renamedResources: object expected\";\n var key = Object.keys(message.renamedResources);\n for (var i = 0; i < key.length; ++i)\n if (!$util.isString(message.renamedResources[key[i]]))\n return \"renamedResources: string{k:string} expected\";\n }\n if (message.ignoredResources != null && message.hasOwnProperty(\"ignoredResources\")) {\n if (!Array.isArray(message.ignoredResources))\n return \"ignoredResources: array expected\";\n for (var i = 0; i < message.ignoredResources.length; ++i)\n if (!$util.isString(message.ignoredResources[i]))\n return \"ignoredResources: string[] expected\";\n }\n if (message.forcedNamespaceAliases != null && message.hasOwnProperty(\"forcedNamespaceAliases\")) {\n if (!Array.isArray(message.forcedNamespaceAliases))\n return \"forcedNamespaceAliases: array expected\";\n for (var i = 0; i < message.forcedNamespaceAliases.length; ++i)\n if (!$util.isString(message.forcedNamespaceAliases[i]))\n return \"forcedNamespaceAliases: string[] expected\";\n }\n if (message.handwrittenSignatures != null && message.hasOwnProperty(\"handwrittenSignatures\")) {\n if (!Array.isArray(message.handwrittenSignatures))\n return \"handwrittenSignatures: array expected\";\n for (var i = 0; i < message.handwrittenSignatures.length; ++i)\n if (!$util.isString(message.handwrittenSignatures[i]))\n return \"handwrittenSignatures: string[] expected\";\n }\n return null;\n };\n \n /**\n * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.DotnetSettings\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.DotnetSettings} DotnetSettings\n */\n DotnetSettings.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.DotnetSettings)\n return object;\n var message = new $root.google.api.DotnetSettings();\n if (object.common != null) {\n if (typeof object.common !== \"object\")\n throw TypeError(\".google.api.DotnetSettings.common: object expected\");\n message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);\n }\n if (object.renamedServices) {\n if (typeof object.renamedServices !== \"object\")\n throw TypeError(\".google.api.DotnetSettings.renamedServices: object expected\");\n message.renamedServices = {};\n for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i)\n message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]);\n }\n if (object.renamedResources) {\n if (typeof object.renamedResources !== \"object\")\n throw TypeError(\".google.api.DotnetSettings.renamedResources: object expected\");\n message.renamedResources = {};\n for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i)\n message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]);\n }\n if (object.ignoredResources) {\n if (!Array.isArray(object.ignoredResources))\n throw TypeError(\".google.api.DotnetSettings.ignoredResources: array expected\");\n message.ignoredResources = [];\n for (var i = 0; i < object.ignoredResources.length; ++i)\n message.ignoredResources[i] = String(object.ignoredResources[i]);\n }\n if (object.forcedNamespaceAliases) {\n if (!Array.isArray(object.forcedNamespaceAliases))\n throw TypeError(\".google.api.DotnetSettings.forcedNamespaceAliases: array expected\");\n message.forcedNamespaceAliases = [];\n for (var i = 0; i < object.forcedNamespaceAliases.length; ++i)\n message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]);\n }\n if (object.handwrittenSignatures) {\n if (!Array.isArray(object.handwrittenSignatures))\n throw TypeError(\".google.api.DotnetSettings.handwrittenSignatures: array expected\");\n message.handwrittenSignatures = [];\n for (var i = 0; i < object.handwrittenSignatures.length; ++i)\n message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.DotnetSettings\n * @static\n * @param {google.api.DotnetSettings} message DotnetSettings\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DotnetSettings.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.ignoredResources = [];\n object.forcedNamespaceAliases = [];\n object.handwrittenSignatures = [];\n }\n if (options.objects || options.defaults) {\n object.renamedServices = {};\n object.renamedResources = {};\n }\n if (options.defaults)\n object.common = null;\n if (message.common != null && message.hasOwnProperty(\"common\"))\n object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);\n var keys2;\n if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) {\n object.renamedServices = {};\n for (var j = 0; j < keys2.length; ++j)\n object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]];\n }\n if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) {\n object.renamedResources = {};\n for (var j = 0; j < keys2.length; ++j)\n object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]];\n }\n if (message.ignoredResources && message.ignoredResources.length) {\n object.ignoredResources = [];\n for (var j = 0; j < message.ignoredResources.length; ++j)\n object.ignoredResources[j] = message.ignoredResources[j];\n }\n if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) {\n object.forcedNamespaceAliases = [];\n for (var j = 0; j < message.forcedNamespaceAliases.length; ++j)\n object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j];\n }\n if (message.handwrittenSignatures && message.handwrittenSignatures.length) {\n object.handwrittenSignatures = [];\n for (var j = 0; j < message.handwrittenSignatures.length; ++j)\n object.handwrittenSignatures[j] = message.handwrittenSignatures[j];\n }\n return object;\n };\n \n /**\n * Converts this DotnetSettings to JSON.\n * @function toJSON\n * @memberof google.api.DotnetSettings\n * @instance\n * @returns {Object.} JSON object\n */\n DotnetSettings.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DotnetSettings\n * @function getTypeUrl\n * @memberof google.api.DotnetSettings\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.DotnetSettings\";\n };\n \n return DotnetSettings;\n })();\n \n api.RubySettings = (function() {\n \n /**\n * Properties of a RubySettings.\n * @memberof google.api\n * @interface IRubySettings\n * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common\n */\n \n /**\n * Constructs a new RubySettings.\n * @memberof google.api\n * @classdesc Represents a RubySettings.\n * @implements IRubySettings\n * @constructor\n * @param {google.api.IRubySettings=} [properties] Properties to set\n */\n function RubySettings(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * RubySettings common.\n * @member {google.api.ICommonLanguageSettings|null|undefined} common\n * @memberof google.api.RubySettings\n * @instance\n */\n RubySettings.prototype.common = null;\n \n /**\n * Creates a new RubySettings instance using the specified properties.\n * @function create\n * @memberof google.api.RubySettings\n * @static\n * @param {google.api.IRubySettings=} [properties] Properties to set\n * @returns {google.api.RubySettings} RubySettings instance\n */\n RubySettings.create = function create(properties) {\n return new RubySettings(properties);\n };\n \n /**\n * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages.\n * @function encode\n * @memberof google.api.RubySettings\n * @static\n * @param {google.api.IRubySettings} message RubySettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n RubySettings.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.common != null && Object.hasOwnProperty.call(message, \"common\"))\n $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.RubySettings\n * @static\n * @param {google.api.IRubySettings} message RubySettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n RubySettings.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a RubySettings message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.RubySettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.RubySettings} RubySettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n RubySettings.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a RubySettings message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.RubySettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.RubySettings} RubySettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n RubySettings.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a RubySettings message.\n * @function verify\n * @memberof google.api.RubySettings\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n RubySettings.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.common != null && message.hasOwnProperty(\"common\")) {\n var error = $root.google.api.CommonLanguageSettings.verify(message.common);\n if (error)\n return \"common.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a RubySettings message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.RubySettings\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.RubySettings} RubySettings\n */\n RubySettings.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.RubySettings)\n return object;\n var message = new $root.google.api.RubySettings();\n if (object.common != null) {\n if (typeof object.common !== \"object\")\n throw TypeError(\".google.api.RubySettings.common: object expected\");\n message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a RubySettings message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.RubySettings\n * @static\n * @param {google.api.RubySettings} message RubySettings\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n RubySettings.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.common = null;\n if (message.common != null && message.hasOwnProperty(\"common\"))\n object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);\n return object;\n };\n \n /**\n * Converts this RubySettings to JSON.\n * @function toJSON\n * @memberof google.api.RubySettings\n * @instance\n * @returns {Object.} JSON object\n */\n RubySettings.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for RubySettings\n * @function getTypeUrl\n * @memberof google.api.RubySettings\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.RubySettings\";\n };\n \n return RubySettings;\n })();\n \n api.GoSettings = (function() {\n \n /**\n * Properties of a GoSettings.\n * @memberof google.api\n * @interface IGoSettings\n * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common\n */\n \n /**\n * Constructs a new GoSettings.\n * @memberof google.api\n * @classdesc Represents a GoSettings.\n * @implements IGoSettings\n * @constructor\n * @param {google.api.IGoSettings=} [properties] Properties to set\n */\n function GoSettings(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GoSettings common.\n * @member {google.api.ICommonLanguageSettings|null|undefined} common\n * @memberof google.api.GoSettings\n * @instance\n */\n GoSettings.prototype.common = null;\n \n /**\n * Creates a new GoSettings instance using the specified properties.\n * @function create\n * @memberof google.api.GoSettings\n * @static\n * @param {google.api.IGoSettings=} [properties] Properties to set\n * @returns {google.api.GoSettings} GoSettings instance\n */\n GoSettings.create = function create(properties) {\n return new GoSettings(properties);\n };\n \n /**\n * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages.\n * @function encode\n * @memberof google.api.GoSettings\n * @static\n * @param {google.api.IGoSettings} message GoSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GoSettings.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.common != null && Object.hasOwnProperty.call(message, \"common\"))\n $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.GoSettings\n * @static\n * @param {google.api.IGoSettings} message GoSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GoSettings.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GoSettings message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.GoSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.GoSettings} GoSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GoSettings.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GoSettings message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.GoSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.GoSettings} GoSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GoSettings.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GoSettings message.\n * @function verify\n * @memberof google.api.GoSettings\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GoSettings.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.common != null && message.hasOwnProperty(\"common\")) {\n var error = $root.google.api.CommonLanguageSettings.verify(message.common);\n if (error)\n return \"common.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a GoSettings message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.GoSettings\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.GoSettings} GoSettings\n */\n GoSettings.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.GoSettings)\n return object;\n var message = new $root.google.api.GoSettings();\n if (object.common != null) {\n if (typeof object.common !== \"object\")\n throw TypeError(\".google.api.GoSettings.common: object expected\");\n message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a GoSettings message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.GoSettings\n * @static\n * @param {google.api.GoSettings} message GoSettings\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GoSettings.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.common = null;\n if (message.common != null && message.hasOwnProperty(\"common\"))\n object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);\n return object;\n };\n \n /**\n * Converts this GoSettings to JSON.\n * @function toJSON\n * @memberof google.api.GoSettings\n * @instance\n * @returns {Object.} JSON object\n */\n GoSettings.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GoSettings\n * @function getTypeUrl\n * @memberof google.api.GoSettings\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.GoSettings\";\n };\n \n return GoSettings;\n })();\n \n api.MethodSettings = (function() {\n \n /**\n * Properties of a MethodSettings.\n * @memberof google.api\n * @interface IMethodSettings\n * @property {string|null} [selector] MethodSettings selector\n * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning\n * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields\n */\n \n /**\n * Constructs a new MethodSettings.\n * @memberof google.api\n * @classdesc Represents a MethodSettings.\n * @implements IMethodSettings\n * @constructor\n * @param {google.api.IMethodSettings=} [properties] Properties to set\n */\n function MethodSettings(properties) {\n this.autoPopulatedFields = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * MethodSettings selector.\n * @member {string} selector\n * @memberof google.api.MethodSettings\n * @instance\n */\n MethodSettings.prototype.selector = \"\";\n \n /**\n * MethodSettings longRunning.\n * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning\n * @memberof google.api.MethodSettings\n * @instance\n */\n MethodSettings.prototype.longRunning = null;\n \n /**\n * MethodSettings autoPopulatedFields.\n * @member {Array.} autoPopulatedFields\n * @memberof google.api.MethodSettings\n * @instance\n */\n MethodSettings.prototype.autoPopulatedFields = $util.emptyArray;\n \n /**\n * Creates a new MethodSettings instance using the specified properties.\n * @function create\n * @memberof google.api.MethodSettings\n * @static\n * @param {google.api.IMethodSettings=} [properties] Properties to set\n * @returns {google.api.MethodSettings} MethodSettings instance\n */\n MethodSettings.create = function create(properties) {\n return new MethodSettings(properties);\n };\n \n /**\n * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages.\n * @function encode\n * @memberof google.api.MethodSettings\n * @static\n * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MethodSettings.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.selector != null && Object.hasOwnProperty.call(message, \"selector\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector);\n if (message.longRunning != null && Object.hasOwnProperty.call(message, \"longRunning\"))\n $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.autoPopulatedFields != null && message.autoPopulatedFields.length)\n for (var i = 0; i < message.autoPopulatedFields.length; ++i)\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]);\n return writer;\n };\n \n /**\n * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.MethodSettings\n * @static\n * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MethodSettings.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a MethodSettings message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.MethodSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.MethodSettings} MethodSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MethodSettings.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.selector = reader.string();\n break;\n }\n case 2: {\n message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32());\n break;\n }\n case 3: {\n if (!(message.autoPopulatedFields && message.autoPopulatedFields.length))\n message.autoPopulatedFields = [];\n message.autoPopulatedFields.push(reader.string());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a MethodSettings message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.MethodSettings\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.MethodSettings} MethodSettings\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MethodSettings.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a MethodSettings message.\n * @function verify\n * @memberof google.api.MethodSettings\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n MethodSettings.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.selector != null && message.hasOwnProperty(\"selector\"))\n if (!$util.isString(message.selector))\n return \"selector: string expected\";\n if (message.longRunning != null && message.hasOwnProperty(\"longRunning\")) {\n var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning);\n if (error)\n return \"longRunning.\" + error;\n }\n if (message.autoPopulatedFields != null && message.hasOwnProperty(\"autoPopulatedFields\")) {\n if (!Array.isArray(message.autoPopulatedFields))\n return \"autoPopulatedFields: array expected\";\n for (var i = 0; i < message.autoPopulatedFields.length; ++i)\n if (!$util.isString(message.autoPopulatedFields[i]))\n return \"autoPopulatedFields: string[] expected\";\n }\n return null;\n };\n \n /**\n * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.MethodSettings\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.MethodSettings} MethodSettings\n */\n MethodSettings.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.MethodSettings)\n return object;\n var message = new $root.google.api.MethodSettings();\n if (object.selector != null)\n message.selector = String(object.selector);\n if (object.longRunning != null) {\n if (typeof object.longRunning !== \"object\")\n throw TypeError(\".google.api.MethodSettings.longRunning: object expected\");\n message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning);\n }\n if (object.autoPopulatedFields) {\n if (!Array.isArray(object.autoPopulatedFields))\n throw TypeError(\".google.api.MethodSettings.autoPopulatedFields: array expected\");\n message.autoPopulatedFields = [];\n for (var i = 0; i < object.autoPopulatedFields.length; ++i)\n message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a MethodSettings message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.MethodSettings\n * @static\n * @param {google.api.MethodSettings} message MethodSettings\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n MethodSettings.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.autoPopulatedFields = [];\n if (options.defaults) {\n object.selector = \"\";\n object.longRunning = null;\n }\n if (message.selector != null && message.hasOwnProperty(\"selector\"))\n object.selector = message.selector;\n if (message.longRunning != null && message.hasOwnProperty(\"longRunning\"))\n object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options);\n if (message.autoPopulatedFields && message.autoPopulatedFields.length) {\n object.autoPopulatedFields = [];\n for (var j = 0; j < message.autoPopulatedFields.length; ++j)\n object.autoPopulatedFields[j] = message.autoPopulatedFields[j];\n }\n return object;\n };\n \n /**\n * Converts this MethodSettings to JSON.\n * @function toJSON\n * @memberof google.api.MethodSettings\n * @instance\n * @returns {Object.} JSON object\n */\n MethodSettings.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for MethodSettings\n * @function getTypeUrl\n * @memberof google.api.MethodSettings\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.MethodSettings\";\n };\n \n MethodSettings.LongRunning = (function() {\n \n /**\n * Properties of a LongRunning.\n * @memberof google.api.MethodSettings\n * @interface ILongRunning\n * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay\n * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier\n * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay\n * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout\n */\n \n /**\n * Constructs a new LongRunning.\n * @memberof google.api.MethodSettings\n * @classdesc Represents a LongRunning.\n * @implements ILongRunning\n * @constructor\n * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set\n */\n function LongRunning(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * LongRunning initialPollDelay.\n * @member {google.protobuf.IDuration|null|undefined} initialPollDelay\n * @memberof google.api.MethodSettings.LongRunning\n * @instance\n */\n LongRunning.prototype.initialPollDelay = null;\n \n /**\n * LongRunning pollDelayMultiplier.\n * @member {number} pollDelayMultiplier\n * @memberof google.api.MethodSettings.LongRunning\n * @instance\n */\n LongRunning.prototype.pollDelayMultiplier = 0;\n \n /**\n * LongRunning maxPollDelay.\n * @member {google.protobuf.IDuration|null|undefined} maxPollDelay\n * @memberof google.api.MethodSettings.LongRunning\n * @instance\n */\n LongRunning.prototype.maxPollDelay = null;\n \n /**\n * LongRunning totalPollTimeout.\n * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout\n * @memberof google.api.MethodSettings.LongRunning\n * @instance\n */\n LongRunning.prototype.totalPollTimeout = null;\n \n /**\n * Creates a new LongRunning instance using the specified properties.\n * @function create\n * @memberof google.api.MethodSettings.LongRunning\n * @static\n * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set\n * @returns {google.api.MethodSettings.LongRunning} LongRunning instance\n */\n LongRunning.create = function create(properties) {\n return new LongRunning(properties);\n };\n \n /**\n * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages.\n * @function encode\n * @memberof google.api.MethodSettings.LongRunning\n * @static\n * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n LongRunning.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, \"initialPollDelay\"))\n $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, \"pollDelayMultiplier\"))\n writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier);\n if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, \"maxPollDelay\"))\n $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, \"totalPollTimeout\"))\n $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.api.MethodSettings.LongRunning\n * @static\n * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n LongRunning.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a LongRunning message from the specified reader or buffer.\n * @function decode\n * @memberof google.api.MethodSettings.LongRunning\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.api.MethodSettings.LongRunning} LongRunning\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n LongRunning.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.pollDelayMultiplier = reader.float();\n break;\n }\n case 3: {\n message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32());\n break;\n }\n case 4: {\n message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a LongRunning message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.api.MethodSettings.LongRunning\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.api.MethodSettings.LongRunning} LongRunning\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n LongRunning.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a LongRunning message.\n * @function verify\n * @memberof google.api.MethodSettings.LongRunning\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n LongRunning.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.initialPollDelay != null && message.hasOwnProperty(\"initialPollDelay\")) {\n var error = $root.google.protobuf.Duration.verify(message.initialPollDelay);\n if (error)\n return \"initialPollDelay.\" + error;\n }\n if (message.pollDelayMultiplier != null && message.hasOwnProperty(\"pollDelayMultiplier\"))\n if (typeof message.pollDelayMultiplier !== \"number\")\n return \"pollDelayMultiplier: number expected\";\n if (message.maxPollDelay != null && message.hasOwnProperty(\"maxPollDelay\")) {\n var error = $root.google.protobuf.Duration.verify(message.maxPollDelay);\n if (error)\n return \"maxPollDelay.\" + error;\n }\n if (message.totalPollTimeout != null && message.hasOwnProperty(\"totalPollTimeout\")) {\n var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout);\n if (error)\n return \"totalPollTimeout.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a LongRunning message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.api.MethodSettings.LongRunning\n * @static\n * @param {Object.} object Plain object\n * @returns {google.api.MethodSettings.LongRunning} LongRunning\n */\n LongRunning.fromObject = function fromObject(object) {\n if (object instanceof $root.google.api.MethodSettings.LongRunning)\n return object;\n var message = new $root.google.api.MethodSettings.LongRunning();\n if (object.initialPollDelay != null) {\n if (typeof object.initialPollDelay !== \"object\")\n throw TypeError(\".google.api.MethodSettings.LongRunning.initialPollDelay: object expected\");\n message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay);\n }\n if (object.pollDelayMultiplier != null)\n message.pollDelayMultiplier = Number(object.pollDelayMultiplier);\n if (object.maxPollDelay != null) {\n if (typeof object.maxPollDelay !== \"object\")\n throw TypeError(\".google.api.MethodSettings.LongRunning.maxPollDelay: object expected\");\n message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay);\n }\n if (object.totalPollTimeout != null) {\n if (typeof object.totalPollTimeout !== \"object\")\n throw TypeError(\".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected\");\n message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a LongRunning message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.api.MethodSettings.LongRunning\n * @static\n * @param {google.api.MethodSettings.LongRunning} message LongRunning\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n LongRunning.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.initialPollDelay = null;\n object.pollDelayMultiplier = 0;\n object.maxPollDelay = null;\n object.totalPollTimeout = null;\n }\n if (message.initialPollDelay != null && message.hasOwnProperty(\"initialPollDelay\"))\n object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options);\n if (message.pollDelayMultiplier != null && message.hasOwnProperty(\"pollDelayMultiplier\"))\n object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier;\n if (message.maxPollDelay != null && message.hasOwnProperty(\"maxPollDelay\"))\n object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options);\n if (message.totalPollTimeout != null && message.hasOwnProperty(\"totalPollTimeout\"))\n object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options);\n return object;\n };\n \n /**\n * Converts this LongRunning to JSON.\n * @function toJSON\n * @memberof google.api.MethodSettings.LongRunning\n * @instance\n * @returns {Object.} JSON object\n */\n LongRunning.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for LongRunning\n * @function getTypeUrl\n * @memberof google.api.MethodSettings.LongRunning\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.api.MethodSettings.LongRunning\";\n };\n \n return LongRunning;\n })();\n \n return MethodSettings;\n })();\n \n /**\n * ClientLibraryOrganization enum.\n * @name google.api.ClientLibraryOrganization\n * @enum {number}\n * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value\n * @property {number} CLOUD=1 CLOUD value\n * @property {number} ADS=2 ADS value\n * @property {number} PHOTOS=3 PHOTOS value\n * @property {number} STREET_VIEW=4 STREET_VIEW value\n * @property {number} SHOPPING=5 SHOPPING value\n * @property {number} GEO=6 GEO value\n * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value\n */\n api.ClientLibraryOrganization = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"CLOUD\"] = 1;\n values[valuesById[2] = \"ADS\"] = 2;\n values[valuesById[3] = \"PHOTOS\"] = 3;\n values[valuesById[4] = \"STREET_VIEW\"] = 4;\n values[valuesById[5] = \"SHOPPING\"] = 5;\n values[valuesById[6] = \"GEO\"] = 6;\n values[valuesById[7] = \"GENERATIVE_AI\"] = 7;\n return values;\n })();\n \n /**\n * ClientLibraryDestination enum.\n * @name google.api.ClientLibraryDestination\n * @enum {number}\n * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value\n * @property {number} GITHUB=10 GITHUB value\n * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value\n */\n api.ClientLibraryDestination = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"CLIENT_LIBRARY_DESTINATION_UNSPECIFIED\"] = 0;\n values[valuesById[10] = \"GITHUB\"] = 10;\n values[valuesById[20] = \"PACKAGE_MANAGER\"] = 20;\n return values;\n })();\n \n /**\n * LaunchStage enum.\n * @name google.api.LaunchStage\n * @enum {number}\n * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value\n * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value\n * @property {number} PRELAUNCH=7 PRELAUNCH value\n * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value\n * @property {number} ALPHA=2 ALPHA value\n * @property {number} BETA=3 BETA value\n * @property {number} GA=4 GA value\n * @property {number} DEPRECATED=5 DEPRECATED value\n */\n api.LaunchStage = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"LAUNCH_STAGE_UNSPECIFIED\"] = 0;\n values[valuesById[6] = \"UNIMPLEMENTED\"] = 6;\n values[valuesById[7] = \"PRELAUNCH\"] = 7;\n values[valuesById[1] = \"EARLY_ACCESS\"] = 1;\n values[valuesById[2] = \"ALPHA\"] = 2;\n values[valuesById[3] = \"BETA\"] = 3;\n values[valuesById[4] = \"GA\"] = 4;\n values[valuesById[5] = \"DEPRECATED\"] = 5;\n return values;\n })();\n \n return api;\n })();\n \n google.protobuf = (function() {\n \n /**\n * Namespace protobuf.\n * @memberof google\n * @namespace\n */\n var protobuf = {};\n \n protobuf.FileDescriptorSet = (function() {\n \n /**\n * Properties of a FileDescriptorSet.\n * @memberof google.protobuf\n * @interface IFileDescriptorSet\n * @property {Array.|null} [file] FileDescriptorSet file\n */\n \n /**\n * Constructs a new FileDescriptorSet.\n * @memberof google.protobuf\n * @classdesc Represents a FileDescriptorSet.\n * @implements IFileDescriptorSet\n * @constructor\n * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set\n */\n function FileDescriptorSet(properties) {\n this.file = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * FileDescriptorSet file.\n * @member {Array.} file\n * @memberof google.protobuf.FileDescriptorSet\n * @instance\n */\n FileDescriptorSet.prototype.file = $util.emptyArray;\n \n /**\n * Creates a new FileDescriptorSet instance using the specified properties.\n * @function create\n * @memberof google.protobuf.FileDescriptorSet\n * @static\n * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set\n * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance\n */\n FileDescriptorSet.create = function create(properties) {\n return new FileDescriptorSet(properties);\n };\n \n /**\n * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.FileDescriptorSet\n * @static\n * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FileDescriptorSet.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.file != null && message.file.length)\n for (var i = 0; i < message.file.length; ++i)\n $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.FileDescriptorSet\n * @static\n * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a FileDescriptorSet message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.FileDescriptorSet\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FileDescriptorSet.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.file && message.file.length))\n message.file = [];\n message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.FileDescriptorSet\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a FileDescriptorSet message.\n * @function verify\n * @memberof google.protobuf.FileDescriptorSet\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n FileDescriptorSet.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.file != null && message.hasOwnProperty(\"file\")) {\n if (!Array.isArray(message.file))\n return \"file: array expected\";\n for (var i = 0; i < message.file.length; ++i) {\n var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]);\n if (error)\n return \"file.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.FileDescriptorSet\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet\n */\n FileDescriptorSet.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.FileDescriptorSet)\n return object;\n var message = new $root.google.protobuf.FileDescriptorSet();\n if (object.file) {\n if (!Array.isArray(object.file))\n throw TypeError(\".google.protobuf.FileDescriptorSet.file: array expected\");\n message.file = [];\n for (var i = 0; i < object.file.length; ++i) {\n if (typeof object.file[i] !== \"object\")\n throw TypeError(\".google.protobuf.FileDescriptorSet.file: object expected\");\n message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.FileDescriptorSet\n * @static\n * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n FileDescriptorSet.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.file = [];\n if (message.file && message.file.length) {\n object.file = [];\n for (var j = 0; j < message.file.length; ++j)\n object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options);\n }\n return object;\n };\n \n /**\n * Converts this FileDescriptorSet to JSON.\n * @function toJSON\n * @memberof google.protobuf.FileDescriptorSet\n * @instance\n * @returns {Object.} JSON object\n */\n FileDescriptorSet.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for FileDescriptorSet\n * @function getTypeUrl\n * @memberof google.protobuf.FileDescriptorSet\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.FileDescriptorSet\";\n };\n \n return FileDescriptorSet;\n })();\n \n /**\n * Edition enum.\n * @name google.protobuf.Edition\n * @enum {number}\n * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value\n * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value\n * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value\n * @property {number} EDITION_2023=1000 EDITION_2023 value\n * @property {number} EDITION_2024=1001 EDITION_2024 value\n * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value\n * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value\n * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value\n * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value\n * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value\n * @property {number} EDITION_MAX=2147483647 EDITION_MAX value\n */\n protobuf.Edition = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"EDITION_UNKNOWN\"] = 0;\n values[valuesById[998] = \"EDITION_PROTO2\"] = 998;\n values[valuesById[999] = \"EDITION_PROTO3\"] = 999;\n values[valuesById[1000] = \"EDITION_2023\"] = 1000;\n values[valuesById[1001] = \"EDITION_2024\"] = 1001;\n values[valuesById[1] = \"EDITION_1_TEST_ONLY\"] = 1;\n values[valuesById[2] = \"EDITION_2_TEST_ONLY\"] = 2;\n values[valuesById[99997] = \"EDITION_99997_TEST_ONLY\"] = 99997;\n values[valuesById[99998] = \"EDITION_99998_TEST_ONLY\"] = 99998;\n values[valuesById[99999] = \"EDITION_99999_TEST_ONLY\"] = 99999;\n values[valuesById[2147483647] = \"EDITION_MAX\"] = 2147483647;\n return values;\n })();\n \n protobuf.FileDescriptorProto = (function() {\n \n /**\n * Properties of a FileDescriptorProto.\n * @memberof google.protobuf\n * @interface IFileDescriptorProto\n * @property {string|null} [name] FileDescriptorProto name\n * @property {string|null} [\"package\"] FileDescriptorProto package\n * @property {Array.|null} [dependency] FileDescriptorProto dependency\n * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency\n * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency\n * @property {Array.|null} [messageType] FileDescriptorProto messageType\n * @property {Array.|null} [enumType] FileDescriptorProto enumType\n * @property {Array.|null} [service] FileDescriptorProto service\n * @property {Array.|null} [extension] FileDescriptorProto extension\n * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options\n * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo\n * @property {string|null} [syntax] FileDescriptorProto syntax\n * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition\n */\n \n /**\n * Constructs a new FileDescriptorProto.\n * @memberof google.protobuf\n * @classdesc Represents a FileDescriptorProto.\n * @implements IFileDescriptorProto\n * @constructor\n * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set\n */\n function FileDescriptorProto(properties) {\n this.dependency = [];\n this.publicDependency = [];\n this.weakDependency = [];\n this.messageType = [];\n this.enumType = [];\n this.service = [];\n this.extension = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * FileDescriptorProto name.\n * @member {string} name\n * @memberof google.protobuf.FileDescriptorProto\n * @instance\n */\n FileDescriptorProto.prototype.name = \"\";\n \n /**\n * FileDescriptorProto package.\n * @member {string} package\n * @memberof google.protobuf.FileDescriptorProto\n * @instance\n */\n FileDescriptorProto.prototype[\"package\"] = \"\";\n \n /**\n * FileDescriptorProto dependency.\n * @member {Array.} dependency\n * @memberof google.protobuf.FileDescriptorProto\n * @instance\n */\n FileDescriptorProto.prototype.dependency = $util.emptyArray;\n \n /**\n * FileDescriptorProto publicDependency.\n * @member {Array.} publicDependency\n * @memberof google.protobuf.FileDescriptorProto\n * @instance\n */\n FileDescriptorProto.prototype.publicDependency = $util.emptyArray;\n \n /**\n * FileDescriptorProto weakDependency.\n * @member {Array.} weakDependency\n * @memberof google.protobuf.FileDescriptorProto\n * @instance\n */\n FileDescriptorProto.prototype.weakDependency = $util.emptyArray;\n \n /**\n * FileDescriptorProto messageType.\n * @member {Array.} messageType\n * @memberof google.protobuf.FileDescriptorProto\n * @instance\n */\n FileDescriptorProto.prototype.messageType = $util.emptyArray;\n \n /**\n * FileDescriptorProto enumType.\n * @member {Array.} enumType\n * @memberof google.protobuf.FileDescriptorProto\n * @instance\n */\n FileDescriptorProto.prototype.enumType = $util.emptyArray;\n \n /**\n * FileDescriptorProto service.\n * @member {Array.} service\n * @memberof google.protobuf.FileDescriptorProto\n * @instance\n */\n FileDescriptorProto.prototype.service = $util.emptyArray;\n \n /**\n * FileDescriptorProto extension.\n * @member {Array.} extension\n * @memberof google.protobuf.FileDescriptorProto\n * @instance\n */\n FileDescriptorProto.prototype.extension = $util.emptyArray;\n \n /**\n * FileDescriptorProto options.\n * @member {google.protobuf.IFileOptions|null|undefined} options\n * @memberof google.protobuf.FileDescriptorProto\n * @instance\n */\n FileDescriptorProto.prototype.options = null;\n \n /**\n * FileDescriptorProto sourceCodeInfo.\n * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo\n * @memberof google.protobuf.FileDescriptorProto\n * @instance\n */\n FileDescriptorProto.prototype.sourceCodeInfo = null;\n \n /**\n * FileDescriptorProto syntax.\n * @member {string} syntax\n * @memberof google.protobuf.FileDescriptorProto\n * @instance\n */\n FileDescriptorProto.prototype.syntax = \"\";\n \n /**\n * FileDescriptorProto edition.\n * @member {google.protobuf.Edition} edition\n * @memberof google.protobuf.FileDescriptorProto\n * @instance\n */\n FileDescriptorProto.prototype.edition = 0;\n \n /**\n * Creates a new FileDescriptorProto instance using the specified properties.\n * @function create\n * @memberof google.protobuf.FileDescriptorProto\n * @static\n * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set\n * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance\n */\n FileDescriptorProto.create = function create(properties) {\n return new FileDescriptorProto(properties);\n };\n \n /**\n * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.FileDescriptorProto\n * @static\n * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FileDescriptorProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message[\"package\"] != null && Object.hasOwnProperty.call(message, \"package\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message[\"package\"]);\n if (message.dependency != null && message.dependency.length)\n for (var i = 0; i < message.dependency.length; ++i)\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]);\n if (message.messageType != null && message.messageType.length)\n for (var i = 0; i < message.messageType.length; ++i)\n $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n if (message.enumType != null && message.enumType.length)\n for (var i = 0; i < message.enumType.length; ++i)\n $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.service != null && message.service.length)\n for (var i = 0; i < message.service.length; ++i)\n $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.extension != null && message.extension.length)\n for (var i = 0; i < message.extension.length; ++i)\n $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, \"sourceCodeInfo\"))\n $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();\n if (message.publicDependency != null && message.publicDependency.length)\n for (var i = 0; i < message.publicDependency.length; ++i)\n writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]);\n if (message.weakDependency != null && message.weakDependency.length)\n for (var i = 0; i < message.weakDependency.length; ++i)\n writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]);\n if (message.syntax != null && Object.hasOwnProperty.call(message, \"syntax\"))\n writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax);\n if (message.edition != null && Object.hasOwnProperty.call(message, \"edition\"))\n writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition);\n return writer;\n };\n \n /**\n * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.FileDescriptorProto\n * @static\n * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a FileDescriptorProto message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.FileDescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FileDescriptorProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message[\"package\"] = reader.string();\n break;\n }\n case 3: {\n if (!(message.dependency && message.dependency.length))\n message.dependency = [];\n message.dependency.push(reader.string());\n break;\n }\n case 10: {\n if (!(message.publicDependency && message.publicDependency.length))\n message.publicDependency = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.publicDependency.push(reader.int32());\n } else\n message.publicDependency.push(reader.int32());\n break;\n }\n case 11: {\n if (!(message.weakDependency && message.weakDependency.length))\n message.weakDependency = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.weakDependency.push(reader.int32());\n } else\n message.weakDependency.push(reader.int32());\n break;\n }\n case 4: {\n if (!(message.messageType && message.messageType.length))\n message.messageType = [];\n message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));\n break;\n }\n case 5: {\n if (!(message.enumType && message.enumType.length))\n message.enumType = [];\n message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));\n break;\n }\n case 6: {\n if (!(message.service && message.service.length))\n message.service = [];\n message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32()));\n break;\n }\n case 7: {\n if (!(message.extension && message.extension.length))\n message.extension = [];\n message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));\n break;\n }\n case 8: {\n message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32());\n break;\n }\n case 9: {\n message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32());\n break;\n }\n case 12: {\n message.syntax = reader.string();\n break;\n }\n case 14: {\n message.edition = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.FileDescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a FileDescriptorProto message.\n * @function verify\n * @memberof google.protobuf.FileDescriptorProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n FileDescriptorProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message[\"package\"] != null && message.hasOwnProperty(\"package\"))\n if (!$util.isString(message[\"package\"]))\n return \"package: string expected\";\n if (message.dependency != null && message.hasOwnProperty(\"dependency\")) {\n if (!Array.isArray(message.dependency))\n return \"dependency: array expected\";\n for (var i = 0; i < message.dependency.length; ++i)\n if (!$util.isString(message.dependency[i]))\n return \"dependency: string[] expected\";\n }\n if (message.publicDependency != null && message.hasOwnProperty(\"publicDependency\")) {\n if (!Array.isArray(message.publicDependency))\n return \"publicDependency: array expected\";\n for (var i = 0; i < message.publicDependency.length; ++i)\n if (!$util.isInteger(message.publicDependency[i]))\n return \"publicDependency: integer[] expected\";\n }\n if (message.weakDependency != null && message.hasOwnProperty(\"weakDependency\")) {\n if (!Array.isArray(message.weakDependency))\n return \"weakDependency: array expected\";\n for (var i = 0; i < message.weakDependency.length; ++i)\n if (!$util.isInteger(message.weakDependency[i]))\n return \"weakDependency: integer[] expected\";\n }\n if (message.messageType != null && message.hasOwnProperty(\"messageType\")) {\n if (!Array.isArray(message.messageType))\n return \"messageType: array expected\";\n for (var i = 0; i < message.messageType.length; ++i) {\n var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]);\n if (error)\n return \"messageType.\" + error;\n }\n }\n if (message.enumType != null && message.hasOwnProperty(\"enumType\")) {\n if (!Array.isArray(message.enumType))\n return \"enumType: array expected\";\n for (var i = 0; i < message.enumType.length; ++i) {\n var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]);\n if (error)\n return \"enumType.\" + error;\n }\n }\n if (message.service != null && message.hasOwnProperty(\"service\")) {\n if (!Array.isArray(message.service))\n return \"service: array expected\";\n for (var i = 0; i < message.service.length; ++i) {\n var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]);\n if (error)\n return \"service.\" + error;\n }\n }\n if (message.extension != null && message.hasOwnProperty(\"extension\")) {\n if (!Array.isArray(message.extension))\n return \"extension: array expected\";\n for (var i = 0; i < message.extension.length; ++i) {\n var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);\n if (error)\n return \"extension.\" + error;\n }\n }\n if (message.options != null && message.hasOwnProperty(\"options\")) {\n var error = $root.google.protobuf.FileOptions.verify(message.options);\n if (error)\n return \"options.\" + error;\n }\n if (message.sourceCodeInfo != null && message.hasOwnProperty(\"sourceCodeInfo\")) {\n var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo);\n if (error)\n return \"sourceCodeInfo.\" + error;\n }\n if (message.syntax != null && message.hasOwnProperty(\"syntax\"))\n if (!$util.isString(message.syntax))\n return \"syntax: string expected\";\n if (message.edition != null && message.hasOwnProperty(\"edition\"))\n switch (message.edition) {\n default:\n return \"edition: enum value expected\";\n case 0:\n case 998:\n case 999:\n case 1000:\n case 1001:\n case 1:\n case 2:\n case 99997:\n case 99998:\n case 99999:\n case 2147483647:\n break;\n }\n return null;\n };\n \n /**\n * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.FileDescriptorProto\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto\n */\n FileDescriptorProto.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.FileDescriptorProto)\n return object;\n var message = new $root.google.protobuf.FileDescriptorProto();\n if (object.name != null)\n message.name = String(object.name);\n if (object[\"package\"] != null)\n message[\"package\"] = String(object[\"package\"]);\n if (object.dependency) {\n if (!Array.isArray(object.dependency))\n throw TypeError(\".google.protobuf.FileDescriptorProto.dependency: array expected\");\n message.dependency = [];\n for (var i = 0; i < object.dependency.length; ++i)\n message.dependency[i] = String(object.dependency[i]);\n }\n if (object.publicDependency) {\n if (!Array.isArray(object.publicDependency))\n throw TypeError(\".google.protobuf.FileDescriptorProto.publicDependency: array expected\");\n message.publicDependency = [];\n for (var i = 0; i < object.publicDependency.length; ++i)\n message.publicDependency[i] = object.publicDependency[i] | 0;\n }\n if (object.weakDependency) {\n if (!Array.isArray(object.weakDependency))\n throw TypeError(\".google.protobuf.FileDescriptorProto.weakDependency: array expected\");\n message.weakDependency = [];\n for (var i = 0; i < object.weakDependency.length; ++i)\n message.weakDependency[i] = object.weakDependency[i] | 0;\n }\n if (object.messageType) {\n if (!Array.isArray(object.messageType))\n throw TypeError(\".google.protobuf.FileDescriptorProto.messageType: array expected\");\n message.messageType = [];\n for (var i = 0; i < object.messageType.length; ++i) {\n if (typeof object.messageType[i] !== \"object\")\n throw TypeError(\".google.protobuf.FileDescriptorProto.messageType: object expected\");\n message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]);\n }\n }\n if (object.enumType) {\n if (!Array.isArray(object.enumType))\n throw TypeError(\".google.protobuf.FileDescriptorProto.enumType: array expected\");\n message.enumType = [];\n for (var i = 0; i < object.enumType.length; ++i) {\n if (typeof object.enumType[i] !== \"object\")\n throw TypeError(\".google.protobuf.FileDescriptorProto.enumType: object expected\");\n message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]);\n }\n }\n if (object.service) {\n if (!Array.isArray(object.service))\n throw TypeError(\".google.protobuf.FileDescriptorProto.service: array expected\");\n message.service = [];\n for (var i = 0; i < object.service.length; ++i) {\n if (typeof object.service[i] !== \"object\")\n throw TypeError(\".google.protobuf.FileDescriptorProto.service: object expected\");\n message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]);\n }\n }\n if (object.extension) {\n if (!Array.isArray(object.extension))\n throw TypeError(\".google.protobuf.FileDescriptorProto.extension: array expected\");\n message.extension = [];\n for (var i = 0; i < object.extension.length; ++i) {\n if (typeof object.extension[i] !== \"object\")\n throw TypeError(\".google.protobuf.FileDescriptorProto.extension: object expected\");\n message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);\n }\n }\n if (object.options != null) {\n if (typeof object.options !== \"object\")\n throw TypeError(\".google.protobuf.FileDescriptorProto.options: object expected\");\n message.options = $root.google.protobuf.FileOptions.fromObject(object.options);\n }\n if (object.sourceCodeInfo != null) {\n if (typeof object.sourceCodeInfo !== \"object\")\n throw TypeError(\".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected\");\n message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo);\n }\n if (object.syntax != null)\n message.syntax = String(object.syntax);\n switch (object.edition) {\n default:\n if (typeof object.edition === \"number\") {\n message.edition = object.edition;\n break;\n }\n break;\n case \"EDITION_UNKNOWN\":\n case 0:\n message.edition = 0;\n break;\n case \"EDITION_PROTO2\":\n case 998:\n message.edition = 998;\n break;\n case \"EDITION_PROTO3\":\n case 999:\n message.edition = 999;\n break;\n case \"EDITION_2023\":\n case 1000:\n message.edition = 1000;\n break;\n case \"EDITION_2024\":\n case 1001:\n message.edition = 1001;\n break;\n case \"EDITION_1_TEST_ONLY\":\n case 1:\n message.edition = 1;\n break;\n case \"EDITION_2_TEST_ONLY\":\n case 2:\n message.edition = 2;\n break;\n case \"EDITION_99997_TEST_ONLY\":\n case 99997:\n message.edition = 99997;\n break;\n case \"EDITION_99998_TEST_ONLY\":\n case 99998:\n message.edition = 99998;\n break;\n case \"EDITION_99999_TEST_ONLY\":\n case 99999:\n message.edition = 99999;\n break;\n case \"EDITION_MAX\":\n case 2147483647:\n message.edition = 2147483647;\n break;\n }\n return message;\n };\n \n /**\n * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.FileDescriptorProto\n * @static\n * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n FileDescriptorProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.dependency = [];\n object.messageType = [];\n object.enumType = [];\n object.service = [];\n object.extension = [];\n object.publicDependency = [];\n object.weakDependency = [];\n }\n if (options.defaults) {\n object.name = \"\";\n object[\"package\"] = \"\";\n object.options = null;\n object.sourceCodeInfo = null;\n object.syntax = \"\";\n object.edition = options.enums === String ? \"EDITION_UNKNOWN\" : 0;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message[\"package\"] != null && message.hasOwnProperty(\"package\"))\n object[\"package\"] = message[\"package\"];\n if (message.dependency && message.dependency.length) {\n object.dependency = [];\n for (var j = 0; j < message.dependency.length; ++j)\n object.dependency[j] = message.dependency[j];\n }\n if (message.messageType && message.messageType.length) {\n object.messageType = [];\n for (var j = 0; j < message.messageType.length; ++j)\n object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options);\n }\n if (message.enumType && message.enumType.length) {\n object.enumType = [];\n for (var j = 0; j < message.enumType.length; ++j)\n object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options);\n }\n if (message.service && message.service.length) {\n object.service = [];\n for (var j = 0; j < message.service.length; ++j)\n object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options);\n }\n if (message.extension && message.extension.length) {\n object.extension = [];\n for (var j = 0; j < message.extension.length; ++j)\n object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);\n }\n if (message.options != null && message.hasOwnProperty(\"options\"))\n object.options = $root.google.protobuf.FileOptions.toObject(message.options, options);\n if (message.sourceCodeInfo != null && message.hasOwnProperty(\"sourceCodeInfo\"))\n object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options);\n if (message.publicDependency && message.publicDependency.length) {\n object.publicDependency = [];\n for (var j = 0; j < message.publicDependency.length; ++j)\n object.publicDependency[j] = message.publicDependency[j];\n }\n if (message.weakDependency && message.weakDependency.length) {\n object.weakDependency = [];\n for (var j = 0; j < message.weakDependency.length; ++j)\n object.weakDependency[j] = message.weakDependency[j];\n }\n if (message.syntax != null && message.hasOwnProperty(\"syntax\"))\n object.syntax = message.syntax;\n if (message.edition != null && message.hasOwnProperty(\"edition\"))\n object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition;\n return object;\n };\n \n /**\n * Converts this FileDescriptorProto to JSON.\n * @function toJSON\n * @memberof google.protobuf.FileDescriptorProto\n * @instance\n * @returns {Object.} JSON object\n */\n FileDescriptorProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for FileDescriptorProto\n * @function getTypeUrl\n * @memberof google.protobuf.FileDescriptorProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.FileDescriptorProto\";\n };\n \n return FileDescriptorProto;\n })();\n \n protobuf.DescriptorProto = (function() {\n \n /**\n * Properties of a DescriptorProto.\n * @memberof google.protobuf\n * @interface IDescriptorProto\n * @property {string|null} [name] DescriptorProto name\n * @property {Array.|null} [field] DescriptorProto field\n * @property {Array.|null} [extension] DescriptorProto extension\n * @property {Array.|null} [nestedType] DescriptorProto nestedType\n * @property {Array.|null} [enumType] DescriptorProto enumType\n * @property {Array.|null} [extensionRange] DescriptorProto extensionRange\n * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl\n * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options\n * @property {Array.|null} [reservedRange] DescriptorProto reservedRange\n * @property {Array.|null} [reservedName] DescriptorProto reservedName\n */\n \n /**\n * Constructs a new DescriptorProto.\n * @memberof google.protobuf\n * @classdesc Represents a DescriptorProto.\n * @implements IDescriptorProto\n * @constructor\n * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set\n */\n function DescriptorProto(properties) {\n this.field = [];\n this.extension = [];\n this.nestedType = [];\n this.enumType = [];\n this.extensionRange = [];\n this.oneofDecl = [];\n this.reservedRange = [];\n this.reservedName = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DescriptorProto name.\n * @member {string} name\n * @memberof google.protobuf.DescriptorProto\n * @instance\n */\n DescriptorProto.prototype.name = \"\";\n \n /**\n * DescriptorProto field.\n * @member {Array.} field\n * @memberof google.protobuf.DescriptorProto\n * @instance\n */\n DescriptorProto.prototype.field = $util.emptyArray;\n \n /**\n * DescriptorProto extension.\n * @member {Array.} extension\n * @memberof google.protobuf.DescriptorProto\n * @instance\n */\n DescriptorProto.prototype.extension = $util.emptyArray;\n \n /**\n * DescriptorProto nestedType.\n * @member {Array.} nestedType\n * @memberof google.protobuf.DescriptorProto\n * @instance\n */\n DescriptorProto.prototype.nestedType = $util.emptyArray;\n \n /**\n * DescriptorProto enumType.\n * @member {Array.} enumType\n * @memberof google.protobuf.DescriptorProto\n * @instance\n */\n DescriptorProto.prototype.enumType = $util.emptyArray;\n \n /**\n * DescriptorProto extensionRange.\n * @member {Array.} extensionRange\n * @memberof google.protobuf.DescriptorProto\n * @instance\n */\n DescriptorProto.prototype.extensionRange = $util.emptyArray;\n \n /**\n * DescriptorProto oneofDecl.\n * @member {Array.} oneofDecl\n * @memberof google.protobuf.DescriptorProto\n * @instance\n */\n DescriptorProto.prototype.oneofDecl = $util.emptyArray;\n \n /**\n * DescriptorProto options.\n * @member {google.protobuf.IMessageOptions|null|undefined} options\n * @memberof google.protobuf.DescriptorProto\n * @instance\n */\n DescriptorProto.prototype.options = null;\n \n /**\n * DescriptorProto reservedRange.\n * @member {Array.} reservedRange\n * @memberof google.protobuf.DescriptorProto\n * @instance\n */\n DescriptorProto.prototype.reservedRange = $util.emptyArray;\n \n /**\n * DescriptorProto reservedName.\n * @member {Array.} reservedName\n * @memberof google.protobuf.DescriptorProto\n * @instance\n */\n DescriptorProto.prototype.reservedName = $util.emptyArray;\n \n /**\n * Creates a new DescriptorProto instance using the specified properties.\n * @function create\n * @memberof google.protobuf.DescriptorProto\n * @static\n * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set\n * @returns {google.protobuf.DescriptorProto} DescriptorProto instance\n */\n DescriptorProto.create = function create(properties) {\n return new DescriptorProto(properties);\n };\n \n /**\n * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.DescriptorProto\n * @static\n * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DescriptorProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.field != null && message.field.length)\n for (var i = 0; i < message.field.length; ++i)\n $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.nestedType != null && message.nestedType.length)\n for (var i = 0; i < message.nestedType.length; ++i)\n $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n if (message.enumType != null && message.enumType.length)\n for (var i = 0; i < message.enumType.length; ++i)\n $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n if (message.extensionRange != null && message.extensionRange.length)\n for (var i = 0; i < message.extensionRange.length; ++i)\n $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.extension != null && message.extension.length)\n for (var i = 0; i < message.extension.length; ++i)\n $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n if (message.oneofDecl != null && message.oneofDecl.length)\n for (var i = 0; i < message.oneofDecl.length; ++i)\n $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n if (message.reservedRange != null && message.reservedRange.length)\n for (var i = 0; i < message.reservedRange.length; ++i)\n $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();\n if (message.reservedName != null && message.reservedName.length)\n for (var i = 0; i < message.reservedName.length; ++i)\n writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]);\n return writer;\n };\n \n /**\n * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.DescriptorProto\n * @static\n * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DescriptorProto message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.DescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.DescriptorProto} DescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DescriptorProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n if (!(message.field && message.field.length))\n message.field = [];\n message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));\n break;\n }\n case 6: {\n if (!(message.extension && message.extension.length))\n message.extension = [];\n message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));\n break;\n }\n case 3: {\n if (!(message.nestedType && message.nestedType.length))\n message.nestedType = [];\n message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));\n break;\n }\n case 4: {\n if (!(message.enumType && message.enumType.length))\n message.enumType = [];\n message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));\n break;\n }\n case 5: {\n if (!(message.extensionRange && message.extensionRange.length))\n message.extensionRange = [];\n message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32()));\n break;\n }\n case 8: {\n if (!(message.oneofDecl && message.oneofDecl.length))\n message.oneofDecl = [];\n message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32()));\n break;\n }\n case 7: {\n message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32());\n break;\n }\n case 9: {\n if (!(message.reservedRange && message.reservedRange.length))\n message.reservedRange = [];\n message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32()));\n break;\n }\n case 10: {\n if (!(message.reservedName && message.reservedName.length))\n message.reservedName = [];\n message.reservedName.push(reader.string());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DescriptorProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.DescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.DescriptorProto} DescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DescriptorProto message.\n * @function verify\n * @memberof google.protobuf.DescriptorProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DescriptorProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.field != null && message.hasOwnProperty(\"field\")) {\n if (!Array.isArray(message.field))\n return \"field: array expected\";\n for (var i = 0; i < message.field.length; ++i) {\n var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]);\n if (error)\n return \"field.\" + error;\n }\n }\n if (message.extension != null && message.hasOwnProperty(\"extension\")) {\n if (!Array.isArray(message.extension))\n return \"extension: array expected\";\n for (var i = 0; i < message.extension.length; ++i) {\n var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);\n if (error)\n return \"extension.\" + error;\n }\n }\n if (message.nestedType != null && message.hasOwnProperty(\"nestedType\")) {\n if (!Array.isArray(message.nestedType))\n return \"nestedType: array expected\";\n for (var i = 0; i < message.nestedType.length; ++i) {\n var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]);\n if (error)\n return \"nestedType.\" + error;\n }\n }\n if (message.enumType != null && message.hasOwnProperty(\"enumType\")) {\n if (!Array.isArray(message.enumType))\n return \"enumType: array expected\";\n for (var i = 0; i < message.enumType.length; ++i) {\n var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]);\n if (error)\n return \"enumType.\" + error;\n }\n }\n if (message.extensionRange != null && message.hasOwnProperty(\"extensionRange\")) {\n if (!Array.isArray(message.extensionRange))\n return \"extensionRange: array expected\";\n for (var i = 0; i < message.extensionRange.length; ++i) {\n var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]);\n if (error)\n return \"extensionRange.\" + error;\n }\n }\n if (message.oneofDecl != null && message.hasOwnProperty(\"oneofDecl\")) {\n if (!Array.isArray(message.oneofDecl))\n return \"oneofDecl: array expected\";\n for (var i = 0; i < message.oneofDecl.length; ++i) {\n var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]);\n if (error)\n return \"oneofDecl.\" + error;\n }\n }\n if (message.options != null && message.hasOwnProperty(\"options\")) {\n var error = $root.google.protobuf.MessageOptions.verify(message.options);\n if (error)\n return \"options.\" + error;\n }\n if (message.reservedRange != null && message.hasOwnProperty(\"reservedRange\")) {\n if (!Array.isArray(message.reservedRange))\n return \"reservedRange: array expected\";\n for (var i = 0; i < message.reservedRange.length; ++i) {\n var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]);\n if (error)\n return \"reservedRange.\" + error;\n }\n }\n if (message.reservedName != null && message.hasOwnProperty(\"reservedName\")) {\n if (!Array.isArray(message.reservedName))\n return \"reservedName: array expected\";\n for (var i = 0; i < message.reservedName.length; ++i)\n if (!$util.isString(message.reservedName[i]))\n return \"reservedName: string[] expected\";\n }\n return null;\n };\n \n /**\n * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.DescriptorProto\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.DescriptorProto} DescriptorProto\n */\n DescriptorProto.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.DescriptorProto)\n return object;\n var message = new $root.google.protobuf.DescriptorProto();\n if (object.name != null)\n message.name = String(object.name);\n if (object.field) {\n if (!Array.isArray(object.field))\n throw TypeError(\".google.protobuf.DescriptorProto.field: array expected\");\n message.field = [];\n for (var i = 0; i < object.field.length; ++i) {\n if (typeof object.field[i] !== \"object\")\n throw TypeError(\".google.protobuf.DescriptorProto.field: object expected\");\n message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]);\n }\n }\n if (object.extension) {\n if (!Array.isArray(object.extension))\n throw TypeError(\".google.protobuf.DescriptorProto.extension: array expected\");\n message.extension = [];\n for (var i = 0; i < object.extension.length; ++i) {\n if (typeof object.extension[i] !== \"object\")\n throw TypeError(\".google.protobuf.DescriptorProto.extension: object expected\");\n message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);\n }\n }\n if (object.nestedType) {\n if (!Array.isArray(object.nestedType))\n throw TypeError(\".google.protobuf.DescriptorProto.nestedType: array expected\");\n message.nestedType = [];\n for (var i = 0; i < object.nestedType.length; ++i) {\n if (typeof object.nestedType[i] !== \"object\")\n throw TypeError(\".google.protobuf.DescriptorProto.nestedType: object expected\");\n message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]);\n }\n }\n if (object.enumType) {\n if (!Array.isArray(object.enumType))\n throw TypeError(\".google.protobuf.DescriptorProto.enumType: array expected\");\n message.enumType = [];\n for (var i = 0; i < object.enumType.length; ++i) {\n if (typeof object.enumType[i] !== \"object\")\n throw TypeError(\".google.protobuf.DescriptorProto.enumType: object expected\");\n message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]);\n }\n }\n if (object.extensionRange) {\n if (!Array.isArray(object.extensionRange))\n throw TypeError(\".google.protobuf.DescriptorProto.extensionRange: array expected\");\n message.extensionRange = [];\n for (var i = 0; i < object.extensionRange.length; ++i) {\n if (typeof object.extensionRange[i] !== \"object\")\n throw TypeError(\".google.protobuf.DescriptorProto.extensionRange: object expected\");\n message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]);\n }\n }\n if (object.oneofDecl) {\n if (!Array.isArray(object.oneofDecl))\n throw TypeError(\".google.protobuf.DescriptorProto.oneofDecl: array expected\");\n message.oneofDecl = [];\n for (var i = 0; i < object.oneofDecl.length; ++i) {\n if (typeof object.oneofDecl[i] !== \"object\")\n throw TypeError(\".google.protobuf.DescriptorProto.oneofDecl: object expected\");\n message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]);\n }\n }\n if (object.options != null) {\n if (typeof object.options !== \"object\")\n throw TypeError(\".google.protobuf.DescriptorProto.options: object expected\");\n message.options = $root.google.protobuf.MessageOptions.fromObject(object.options);\n }\n if (object.reservedRange) {\n if (!Array.isArray(object.reservedRange))\n throw TypeError(\".google.protobuf.DescriptorProto.reservedRange: array expected\");\n message.reservedRange = [];\n for (var i = 0; i < object.reservedRange.length; ++i) {\n if (typeof object.reservedRange[i] !== \"object\")\n throw TypeError(\".google.protobuf.DescriptorProto.reservedRange: object expected\");\n message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]);\n }\n }\n if (object.reservedName) {\n if (!Array.isArray(object.reservedName))\n throw TypeError(\".google.protobuf.DescriptorProto.reservedName: array expected\");\n message.reservedName = [];\n for (var i = 0; i < object.reservedName.length; ++i)\n message.reservedName[i] = String(object.reservedName[i]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.DescriptorProto\n * @static\n * @param {google.protobuf.DescriptorProto} message DescriptorProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DescriptorProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.field = [];\n object.nestedType = [];\n object.enumType = [];\n object.extensionRange = [];\n object.extension = [];\n object.oneofDecl = [];\n object.reservedRange = [];\n object.reservedName = [];\n }\n if (options.defaults) {\n object.name = \"\";\n object.options = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.field && message.field.length) {\n object.field = [];\n for (var j = 0; j < message.field.length; ++j)\n object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options);\n }\n if (message.nestedType && message.nestedType.length) {\n object.nestedType = [];\n for (var j = 0; j < message.nestedType.length; ++j)\n object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options);\n }\n if (message.enumType && message.enumType.length) {\n object.enumType = [];\n for (var j = 0; j < message.enumType.length; ++j)\n object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options);\n }\n if (message.extensionRange && message.extensionRange.length) {\n object.extensionRange = [];\n for (var j = 0; j < message.extensionRange.length; ++j)\n object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options);\n }\n if (message.extension && message.extension.length) {\n object.extension = [];\n for (var j = 0; j < message.extension.length; ++j)\n object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);\n }\n if (message.options != null && message.hasOwnProperty(\"options\"))\n object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options);\n if (message.oneofDecl && message.oneofDecl.length) {\n object.oneofDecl = [];\n for (var j = 0; j < message.oneofDecl.length; ++j)\n object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options);\n }\n if (message.reservedRange && message.reservedRange.length) {\n object.reservedRange = [];\n for (var j = 0; j < message.reservedRange.length; ++j)\n object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options);\n }\n if (message.reservedName && message.reservedName.length) {\n object.reservedName = [];\n for (var j = 0; j < message.reservedName.length; ++j)\n object.reservedName[j] = message.reservedName[j];\n }\n return object;\n };\n \n /**\n * Converts this DescriptorProto to JSON.\n * @function toJSON\n * @memberof google.protobuf.DescriptorProto\n * @instance\n * @returns {Object.} JSON object\n */\n DescriptorProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DescriptorProto\n * @function getTypeUrl\n * @memberof google.protobuf.DescriptorProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.DescriptorProto\";\n };\n \n DescriptorProto.ExtensionRange = (function() {\n \n /**\n * Properties of an ExtensionRange.\n * @memberof google.protobuf.DescriptorProto\n * @interface IExtensionRange\n * @property {number|null} [start] ExtensionRange start\n * @property {number|null} [end] ExtensionRange end\n * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options\n */\n \n /**\n * Constructs a new ExtensionRange.\n * @memberof google.protobuf.DescriptorProto\n * @classdesc Represents an ExtensionRange.\n * @implements IExtensionRange\n * @constructor\n * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set\n */\n function ExtensionRange(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ExtensionRange start.\n * @member {number} start\n * @memberof google.protobuf.DescriptorProto.ExtensionRange\n * @instance\n */\n ExtensionRange.prototype.start = 0;\n \n /**\n * ExtensionRange end.\n * @member {number} end\n * @memberof google.protobuf.DescriptorProto.ExtensionRange\n * @instance\n */\n ExtensionRange.prototype.end = 0;\n \n /**\n * ExtensionRange options.\n * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options\n * @memberof google.protobuf.DescriptorProto.ExtensionRange\n * @instance\n */\n ExtensionRange.prototype.options = null;\n \n /**\n * Creates a new ExtensionRange instance using the specified properties.\n * @function create\n * @memberof google.protobuf.DescriptorProto.ExtensionRange\n * @static\n * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set\n * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance\n */\n ExtensionRange.create = function create(properties) {\n return new ExtensionRange(properties);\n };\n \n /**\n * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.DescriptorProto.ExtensionRange\n * @static\n * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ExtensionRange.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.start != null && Object.hasOwnProperty.call(message, \"start\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);\n if (message.end != null && Object.hasOwnProperty.call(message, \"end\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);\n if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.DescriptorProto.ExtensionRange\n * @static\n * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ExtensionRange message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.DescriptorProto.ExtensionRange\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ExtensionRange.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.start = reader.int32();\n break;\n }\n case 2: {\n message.end = reader.int32();\n break;\n }\n case 3: {\n message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ExtensionRange message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.DescriptorProto.ExtensionRange\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ExtensionRange.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ExtensionRange message.\n * @function verify\n * @memberof google.protobuf.DescriptorProto.ExtensionRange\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ExtensionRange.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.start != null && message.hasOwnProperty(\"start\"))\n if (!$util.isInteger(message.start))\n return \"start: integer expected\";\n if (message.end != null && message.hasOwnProperty(\"end\"))\n if (!$util.isInteger(message.end))\n return \"end: integer expected\";\n if (message.options != null && message.hasOwnProperty(\"options\")) {\n var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options);\n if (error)\n return \"options.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.DescriptorProto.ExtensionRange\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange\n */\n ExtensionRange.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange)\n return object;\n var message = new $root.google.protobuf.DescriptorProto.ExtensionRange();\n if (object.start != null)\n message.start = object.start | 0;\n if (object.end != null)\n message.end = object.end | 0;\n if (object.options != null) {\n if (typeof object.options !== \"object\")\n throw TypeError(\".google.protobuf.DescriptorProto.ExtensionRange.options: object expected\");\n message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.DescriptorProto.ExtensionRange\n * @static\n * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ExtensionRange.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.start = 0;\n object.end = 0;\n object.options = null;\n }\n if (message.start != null && message.hasOwnProperty(\"start\"))\n object.start = message.start;\n if (message.end != null && message.hasOwnProperty(\"end\"))\n object.end = message.end;\n if (message.options != null && message.hasOwnProperty(\"options\"))\n object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options);\n return object;\n };\n \n /**\n * Converts this ExtensionRange to JSON.\n * @function toJSON\n * @memberof google.protobuf.DescriptorProto.ExtensionRange\n * @instance\n * @returns {Object.} JSON object\n */\n ExtensionRange.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ExtensionRange\n * @function getTypeUrl\n * @memberof google.protobuf.DescriptorProto.ExtensionRange\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.DescriptorProto.ExtensionRange\";\n };\n \n return ExtensionRange;\n })();\n \n DescriptorProto.ReservedRange = (function() {\n \n /**\n * Properties of a ReservedRange.\n * @memberof google.protobuf.DescriptorProto\n * @interface IReservedRange\n * @property {number|null} [start] ReservedRange start\n * @property {number|null} [end] ReservedRange end\n */\n \n /**\n * Constructs a new ReservedRange.\n * @memberof google.protobuf.DescriptorProto\n * @classdesc Represents a ReservedRange.\n * @implements IReservedRange\n * @constructor\n * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set\n */\n function ReservedRange(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ReservedRange start.\n * @member {number} start\n * @memberof google.protobuf.DescriptorProto.ReservedRange\n * @instance\n */\n ReservedRange.prototype.start = 0;\n \n /**\n * ReservedRange end.\n * @member {number} end\n * @memberof google.protobuf.DescriptorProto.ReservedRange\n * @instance\n */\n ReservedRange.prototype.end = 0;\n \n /**\n * Creates a new ReservedRange instance using the specified properties.\n * @function create\n * @memberof google.protobuf.DescriptorProto.ReservedRange\n * @static\n * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set\n * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance\n */\n ReservedRange.create = function create(properties) {\n return new ReservedRange(properties);\n };\n \n /**\n * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.DescriptorProto.ReservedRange\n * @static\n * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ReservedRange.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.start != null && Object.hasOwnProperty.call(message, \"start\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);\n if (message.end != null && Object.hasOwnProperty.call(message, \"end\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);\n return writer;\n };\n \n /**\n * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.DescriptorProto.ReservedRange\n * @static\n * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ReservedRange.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ReservedRange message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.DescriptorProto.ReservedRange\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ReservedRange.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.start = reader.int32();\n break;\n }\n case 2: {\n message.end = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ReservedRange message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.DescriptorProto.ReservedRange\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ReservedRange.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ReservedRange message.\n * @function verify\n * @memberof google.protobuf.DescriptorProto.ReservedRange\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ReservedRange.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.start != null && message.hasOwnProperty(\"start\"))\n if (!$util.isInteger(message.start))\n return \"start: integer expected\";\n if (message.end != null && message.hasOwnProperty(\"end\"))\n if (!$util.isInteger(message.end))\n return \"end: integer expected\";\n return null;\n };\n \n /**\n * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.DescriptorProto.ReservedRange\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange\n */\n ReservedRange.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange)\n return object;\n var message = new $root.google.protobuf.DescriptorProto.ReservedRange();\n if (object.start != null)\n message.start = object.start | 0;\n if (object.end != null)\n message.end = object.end | 0;\n return message;\n };\n \n /**\n * Creates a plain object from a ReservedRange message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.DescriptorProto.ReservedRange\n * @static\n * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ReservedRange.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.start = 0;\n object.end = 0;\n }\n if (message.start != null && message.hasOwnProperty(\"start\"))\n object.start = message.start;\n if (message.end != null && message.hasOwnProperty(\"end\"))\n object.end = message.end;\n return object;\n };\n \n /**\n * Converts this ReservedRange to JSON.\n * @function toJSON\n * @memberof google.protobuf.DescriptorProto.ReservedRange\n * @instance\n * @returns {Object.} JSON object\n */\n ReservedRange.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ReservedRange\n * @function getTypeUrl\n * @memberof google.protobuf.DescriptorProto.ReservedRange\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.DescriptorProto.ReservedRange\";\n };\n \n return ReservedRange;\n })();\n \n return DescriptorProto;\n })();\n \n protobuf.ExtensionRangeOptions = (function() {\n \n /**\n * Properties of an ExtensionRangeOptions.\n * @memberof google.protobuf\n * @interface IExtensionRangeOptions\n * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption\n * @property {Array.|null} [declaration] ExtensionRangeOptions declaration\n * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features\n * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification\n */\n \n /**\n * Constructs a new ExtensionRangeOptions.\n * @memberof google.protobuf\n * @classdesc Represents an ExtensionRangeOptions.\n * @implements IExtensionRangeOptions\n * @constructor\n * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set\n */\n function ExtensionRangeOptions(properties) {\n this.uninterpretedOption = [];\n this.declaration = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ExtensionRangeOptions uninterpretedOption.\n * @member {Array.} uninterpretedOption\n * @memberof google.protobuf.ExtensionRangeOptions\n * @instance\n */\n ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray;\n \n /**\n * ExtensionRangeOptions declaration.\n * @member {Array.} declaration\n * @memberof google.protobuf.ExtensionRangeOptions\n * @instance\n */\n ExtensionRangeOptions.prototype.declaration = $util.emptyArray;\n \n /**\n * ExtensionRangeOptions features.\n * @member {google.protobuf.IFeatureSet|null|undefined} features\n * @memberof google.protobuf.ExtensionRangeOptions\n * @instance\n */\n ExtensionRangeOptions.prototype.features = null;\n \n /**\n * ExtensionRangeOptions verification.\n * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification\n * @memberof google.protobuf.ExtensionRangeOptions\n * @instance\n */\n ExtensionRangeOptions.prototype.verification = 1;\n \n /**\n * Creates a new ExtensionRangeOptions instance using the specified properties.\n * @function create\n * @memberof google.protobuf.ExtensionRangeOptions\n * @static\n * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set\n * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance\n */\n ExtensionRangeOptions.create = function create(properties) {\n return new ExtensionRangeOptions(properties);\n };\n \n /**\n * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.ExtensionRangeOptions\n * @static\n * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ExtensionRangeOptions.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.declaration != null && message.declaration.length)\n for (var i = 0; i < message.declaration.length; ++i)\n $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.verification != null && Object.hasOwnProperty.call(message, \"verification\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification);\n if (message.features != null && Object.hasOwnProperty.call(message, \"features\"))\n $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim();\n if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n for (var i = 0; i < message.uninterpretedOption.length; ++i)\n $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.ExtensionRangeOptions\n * @static\n * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an ExtensionRangeOptions message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.ExtensionRangeOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ExtensionRangeOptions.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 999: {\n if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n message.uninterpretedOption = [];\n message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n if (!(message.declaration && message.declaration.length))\n message.declaration = [];\n message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32()));\n break;\n }\n case 50: {\n message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());\n break;\n }\n case 3: {\n message.verification = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.ExtensionRangeOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an ExtensionRangeOptions message.\n * @function verify\n * @memberof google.protobuf.ExtensionRangeOptions\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ExtensionRangeOptions.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n if (!Array.isArray(message.uninterpretedOption))\n return \"uninterpretedOption: array expected\";\n for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n if (error)\n return \"uninterpretedOption.\" + error;\n }\n }\n if (message.declaration != null && message.hasOwnProperty(\"declaration\")) {\n if (!Array.isArray(message.declaration))\n return \"declaration: array expected\";\n for (var i = 0; i < message.declaration.length; ++i) {\n var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]);\n if (error)\n return \"declaration.\" + error;\n }\n }\n if (message.features != null && message.hasOwnProperty(\"features\")) {\n var error = $root.google.protobuf.FeatureSet.verify(message.features);\n if (error)\n return \"features.\" + error;\n }\n if (message.verification != null && message.hasOwnProperty(\"verification\"))\n switch (message.verification) {\n default:\n return \"verification: enum value expected\";\n case 0:\n case 1:\n break;\n }\n return null;\n };\n \n /**\n * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.ExtensionRangeOptions\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions\n */\n ExtensionRangeOptions.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.ExtensionRangeOptions)\n return object;\n var message = new $root.google.protobuf.ExtensionRangeOptions();\n if (object.uninterpretedOption) {\n if (!Array.isArray(object.uninterpretedOption))\n throw TypeError(\".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected\");\n message.uninterpretedOption = [];\n for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n if (typeof object.uninterpretedOption[i] !== \"object\")\n throw TypeError(\".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected\");\n message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n }\n }\n if (object.declaration) {\n if (!Array.isArray(object.declaration))\n throw TypeError(\".google.protobuf.ExtensionRangeOptions.declaration: array expected\");\n message.declaration = [];\n for (var i = 0; i < object.declaration.length; ++i) {\n if (typeof object.declaration[i] !== \"object\")\n throw TypeError(\".google.protobuf.ExtensionRangeOptions.declaration: object expected\");\n message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]);\n }\n }\n if (object.features != null) {\n if (typeof object.features !== \"object\")\n throw TypeError(\".google.protobuf.ExtensionRangeOptions.features: object expected\");\n message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);\n }\n switch (object.verification) {\n case \"DECLARATION\":\n case 0:\n message.verification = 0;\n break;\n default:\n if (typeof object.verification === \"number\") {\n message.verification = object.verification;\n break;\n }\n break;\n case \"UNVERIFIED\":\n case 1:\n message.verification = 1;\n break;\n }\n return message;\n };\n \n /**\n * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.ExtensionRangeOptions\n * @static\n * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ExtensionRangeOptions.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.declaration = [];\n object.uninterpretedOption = [];\n }\n if (options.defaults) {\n object.verification = options.enums === String ? \"UNVERIFIED\" : 1;\n object.features = null;\n }\n if (message.declaration && message.declaration.length) {\n object.declaration = [];\n for (var j = 0; j < message.declaration.length; ++j)\n object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options);\n }\n if (message.verification != null && message.hasOwnProperty(\"verification\"))\n object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification;\n if (message.features != null && message.hasOwnProperty(\"features\"))\n object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);\n if (message.uninterpretedOption && message.uninterpretedOption.length) {\n object.uninterpretedOption = [];\n for (var j = 0; j < message.uninterpretedOption.length; ++j)\n object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n }\n return object;\n };\n \n /**\n * Converts this ExtensionRangeOptions to JSON.\n * @function toJSON\n * @memberof google.protobuf.ExtensionRangeOptions\n * @instance\n * @returns {Object.} JSON object\n */\n ExtensionRangeOptions.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ExtensionRangeOptions\n * @function getTypeUrl\n * @memberof google.protobuf.ExtensionRangeOptions\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.ExtensionRangeOptions\";\n };\n \n ExtensionRangeOptions.Declaration = (function() {\n \n /**\n * Properties of a Declaration.\n * @memberof google.protobuf.ExtensionRangeOptions\n * @interface IDeclaration\n * @property {number|null} [number] Declaration number\n * @property {string|null} [fullName] Declaration fullName\n * @property {string|null} [type] Declaration type\n * @property {boolean|null} [reserved] Declaration reserved\n * @property {boolean|null} [repeated] Declaration repeated\n */\n \n /**\n * Constructs a new Declaration.\n * @memberof google.protobuf.ExtensionRangeOptions\n * @classdesc Represents a Declaration.\n * @implements IDeclaration\n * @constructor\n * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set\n */\n function Declaration(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Declaration number.\n * @member {number} number\n * @memberof google.protobuf.ExtensionRangeOptions.Declaration\n * @instance\n */\n Declaration.prototype.number = 0;\n \n /**\n * Declaration fullName.\n * @member {string} fullName\n * @memberof google.protobuf.ExtensionRangeOptions.Declaration\n * @instance\n */\n Declaration.prototype.fullName = \"\";\n \n /**\n * Declaration type.\n * @member {string} type\n * @memberof google.protobuf.ExtensionRangeOptions.Declaration\n * @instance\n */\n Declaration.prototype.type = \"\";\n \n /**\n * Declaration reserved.\n * @member {boolean} reserved\n * @memberof google.protobuf.ExtensionRangeOptions.Declaration\n * @instance\n */\n Declaration.prototype.reserved = false;\n \n /**\n * Declaration repeated.\n * @member {boolean} repeated\n * @memberof google.protobuf.ExtensionRangeOptions.Declaration\n * @instance\n */\n Declaration.prototype.repeated = false;\n \n /**\n * Creates a new Declaration instance using the specified properties.\n * @function create\n * @memberof google.protobuf.ExtensionRangeOptions.Declaration\n * @static\n * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set\n * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance\n */\n Declaration.create = function create(properties) {\n return new Declaration(properties);\n };\n \n /**\n * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.ExtensionRangeOptions.Declaration\n * @static\n * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Declaration.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.number != null && Object.hasOwnProperty.call(message, \"number\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number);\n if (message.fullName != null && Object.hasOwnProperty.call(message, \"fullName\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName);\n if (message.type != null && Object.hasOwnProperty.call(message, \"type\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.type);\n if (message.reserved != null && Object.hasOwnProperty.call(message, \"reserved\"))\n writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved);\n if (message.repeated != null && Object.hasOwnProperty.call(message, \"repeated\"))\n writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated);\n return writer;\n };\n \n /**\n * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.ExtensionRangeOptions.Declaration\n * @static\n * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Declaration.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Declaration message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.ExtensionRangeOptions.Declaration\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Declaration.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.number = reader.int32();\n break;\n }\n case 2: {\n message.fullName = reader.string();\n break;\n }\n case 3: {\n message.type = reader.string();\n break;\n }\n case 5: {\n message.reserved = reader.bool();\n break;\n }\n case 6: {\n message.repeated = reader.bool();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Declaration message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.ExtensionRangeOptions.Declaration\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Declaration.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Declaration message.\n * @function verify\n * @memberof google.protobuf.ExtensionRangeOptions.Declaration\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Declaration.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.number != null && message.hasOwnProperty(\"number\"))\n if (!$util.isInteger(message.number))\n return \"number: integer expected\";\n if (message.fullName != null && message.hasOwnProperty(\"fullName\"))\n if (!$util.isString(message.fullName))\n return \"fullName: string expected\";\n if (message.type != null && message.hasOwnProperty(\"type\"))\n if (!$util.isString(message.type))\n return \"type: string expected\";\n if (message.reserved != null && message.hasOwnProperty(\"reserved\"))\n if (typeof message.reserved !== \"boolean\")\n return \"reserved: boolean expected\";\n if (message.repeated != null && message.hasOwnProperty(\"repeated\"))\n if (typeof message.repeated !== \"boolean\")\n return \"repeated: boolean expected\";\n return null;\n };\n \n /**\n * Creates a Declaration message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.ExtensionRangeOptions.Declaration\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration\n */\n Declaration.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration)\n return object;\n var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration();\n if (object.number != null)\n message.number = object.number | 0;\n if (object.fullName != null)\n message.fullName = String(object.fullName);\n if (object.type != null)\n message.type = String(object.type);\n if (object.reserved != null)\n message.reserved = Boolean(object.reserved);\n if (object.repeated != null)\n message.repeated = Boolean(object.repeated);\n return message;\n };\n \n /**\n * Creates a plain object from a Declaration message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.ExtensionRangeOptions.Declaration\n * @static\n * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Declaration.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.number = 0;\n object.fullName = \"\";\n object.type = \"\";\n object.reserved = false;\n object.repeated = false;\n }\n if (message.number != null && message.hasOwnProperty(\"number\"))\n object.number = message.number;\n if (message.fullName != null && message.hasOwnProperty(\"fullName\"))\n object.fullName = message.fullName;\n if (message.type != null && message.hasOwnProperty(\"type\"))\n object.type = message.type;\n if (message.reserved != null && message.hasOwnProperty(\"reserved\"))\n object.reserved = message.reserved;\n if (message.repeated != null && message.hasOwnProperty(\"repeated\"))\n object.repeated = message.repeated;\n return object;\n };\n \n /**\n * Converts this Declaration to JSON.\n * @function toJSON\n * @memberof google.protobuf.ExtensionRangeOptions.Declaration\n * @instance\n * @returns {Object.} JSON object\n */\n Declaration.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Declaration\n * @function getTypeUrl\n * @memberof google.protobuf.ExtensionRangeOptions.Declaration\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.ExtensionRangeOptions.Declaration\";\n };\n \n return Declaration;\n })();\n \n /**\n * VerificationState enum.\n * @name google.protobuf.ExtensionRangeOptions.VerificationState\n * @enum {number}\n * @property {number} DECLARATION=0 DECLARATION value\n * @property {number} UNVERIFIED=1 UNVERIFIED value\n */\n ExtensionRangeOptions.VerificationState = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"DECLARATION\"] = 0;\n values[valuesById[1] = \"UNVERIFIED\"] = 1;\n return values;\n })();\n \n return ExtensionRangeOptions;\n })();\n \n protobuf.FieldDescriptorProto = (function() {\n \n /**\n * Properties of a FieldDescriptorProto.\n * @memberof google.protobuf\n * @interface IFieldDescriptorProto\n * @property {string|null} [name] FieldDescriptorProto name\n * @property {number|null} [number] FieldDescriptorProto number\n * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label\n * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type\n * @property {string|null} [typeName] FieldDescriptorProto typeName\n * @property {string|null} [extendee] FieldDescriptorProto extendee\n * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue\n * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex\n * @property {string|null} [jsonName] FieldDescriptorProto jsonName\n * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options\n * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional\n */\n \n /**\n * Constructs a new FieldDescriptorProto.\n * @memberof google.protobuf\n * @classdesc Represents a FieldDescriptorProto.\n * @implements IFieldDescriptorProto\n * @constructor\n * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set\n */\n function FieldDescriptorProto(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * FieldDescriptorProto name.\n * @member {string} name\n * @memberof google.protobuf.FieldDescriptorProto\n * @instance\n */\n FieldDescriptorProto.prototype.name = \"\";\n \n /**\n * FieldDescriptorProto number.\n * @member {number} number\n * @memberof google.protobuf.FieldDescriptorProto\n * @instance\n */\n FieldDescriptorProto.prototype.number = 0;\n \n /**\n * FieldDescriptorProto label.\n * @member {google.protobuf.FieldDescriptorProto.Label} label\n * @memberof google.protobuf.FieldDescriptorProto\n * @instance\n */\n FieldDescriptorProto.prototype.label = 1;\n \n /**\n * FieldDescriptorProto type.\n * @member {google.protobuf.FieldDescriptorProto.Type} type\n * @memberof google.protobuf.FieldDescriptorProto\n * @instance\n */\n FieldDescriptorProto.prototype.type = 1;\n \n /**\n * FieldDescriptorProto typeName.\n * @member {string} typeName\n * @memberof google.protobuf.FieldDescriptorProto\n * @instance\n */\n FieldDescriptorProto.prototype.typeName = \"\";\n \n /**\n * FieldDescriptorProto extendee.\n * @member {string} extendee\n * @memberof google.protobuf.FieldDescriptorProto\n * @instance\n */\n FieldDescriptorProto.prototype.extendee = \"\";\n \n /**\n * FieldDescriptorProto defaultValue.\n * @member {string} defaultValue\n * @memberof google.protobuf.FieldDescriptorProto\n * @instance\n */\n FieldDescriptorProto.prototype.defaultValue = \"\";\n \n /**\n * FieldDescriptorProto oneofIndex.\n * @member {number} oneofIndex\n * @memberof google.protobuf.FieldDescriptorProto\n * @instance\n */\n FieldDescriptorProto.prototype.oneofIndex = 0;\n \n /**\n * FieldDescriptorProto jsonName.\n * @member {string} jsonName\n * @memberof google.protobuf.FieldDescriptorProto\n * @instance\n */\n FieldDescriptorProto.prototype.jsonName = \"\";\n \n /**\n * FieldDescriptorProto options.\n * @member {google.protobuf.IFieldOptions|null|undefined} options\n * @memberof google.protobuf.FieldDescriptorProto\n * @instance\n */\n FieldDescriptorProto.prototype.options = null;\n \n /**\n * FieldDescriptorProto proto3Optional.\n * @member {boolean} proto3Optional\n * @memberof google.protobuf.FieldDescriptorProto\n * @instance\n */\n FieldDescriptorProto.prototype.proto3Optional = false;\n \n /**\n * Creates a new FieldDescriptorProto instance using the specified properties.\n * @function create\n * @memberof google.protobuf.FieldDescriptorProto\n * @static\n * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set\n * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance\n */\n FieldDescriptorProto.create = function create(properties) {\n return new FieldDescriptorProto(properties);\n };\n \n /**\n * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.FieldDescriptorProto\n * @static\n * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FieldDescriptorProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.extendee != null && Object.hasOwnProperty.call(message, \"extendee\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee);\n if (message.number != null && Object.hasOwnProperty.call(message, \"number\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number);\n if (message.label != null && Object.hasOwnProperty.call(message, \"label\"))\n writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label);\n if (message.type != null && Object.hasOwnProperty.call(message, \"type\"))\n writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type);\n if (message.typeName != null && Object.hasOwnProperty.call(message, \"typeName\"))\n writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName);\n if (message.defaultValue != null && Object.hasOwnProperty.call(message, \"defaultValue\"))\n writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue);\n if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n if (message.oneofIndex != null && Object.hasOwnProperty.call(message, \"oneofIndex\"))\n writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex);\n if (message.jsonName != null && Object.hasOwnProperty.call(message, \"jsonName\"))\n writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName);\n if (message.proto3Optional != null && Object.hasOwnProperty.call(message, \"proto3Optional\"))\n writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional);\n return writer;\n };\n \n /**\n * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.FieldDescriptorProto\n * @static\n * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a FieldDescriptorProto message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.FieldDescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FieldDescriptorProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 3: {\n message.number = reader.int32();\n break;\n }\n case 4: {\n message.label = reader.int32();\n break;\n }\n case 5: {\n message.type = reader.int32();\n break;\n }\n case 6: {\n message.typeName = reader.string();\n break;\n }\n case 2: {\n message.extendee = reader.string();\n break;\n }\n case 7: {\n message.defaultValue = reader.string();\n break;\n }\n case 9: {\n message.oneofIndex = reader.int32();\n break;\n }\n case 10: {\n message.jsonName = reader.string();\n break;\n }\n case 8: {\n message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32());\n break;\n }\n case 17: {\n message.proto3Optional = reader.bool();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.FieldDescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a FieldDescriptorProto message.\n * @function verify\n * @memberof google.protobuf.FieldDescriptorProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n FieldDescriptorProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.number != null && message.hasOwnProperty(\"number\"))\n if (!$util.isInteger(message.number))\n return \"number: integer expected\";\n if (message.label != null && message.hasOwnProperty(\"label\"))\n switch (message.label) {\n default:\n return \"label: enum value expected\";\n case 1:\n case 3:\n case 2:\n break;\n }\n if (message.type != null && message.hasOwnProperty(\"type\"))\n switch (message.type) {\n default:\n return \"type: enum value expected\";\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n case 7:\n case 8:\n case 9:\n case 10:\n case 11:\n case 12:\n case 13:\n case 14:\n case 15:\n case 16:\n case 17:\n case 18:\n break;\n }\n if (message.typeName != null && message.hasOwnProperty(\"typeName\"))\n if (!$util.isString(message.typeName))\n return \"typeName: string expected\";\n if (message.extendee != null && message.hasOwnProperty(\"extendee\"))\n if (!$util.isString(message.extendee))\n return \"extendee: string expected\";\n if (message.defaultValue != null && message.hasOwnProperty(\"defaultValue\"))\n if (!$util.isString(message.defaultValue))\n return \"defaultValue: string expected\";\n if (message.oneofIndex != null && message.hasOwnProperty(\"oneofIndex\"))\n if (!$util.isInteger(message.oneofIndex))\n return \"oneofIndex: integer expected\";\n if (message.jsonName != null && message.hasOwnProperty(\"jsonName\"))\n if (!$util.isString(message.jsonName))\n return \"jsonName: string expected\";\n if (message.options != null && message.hasOwnProperty(\"options\")) {\n var error = $root.google.protobuf.FieldOptions.verify(message.options);\n if (error)\n return \"options.\" + error;\n }\n if (message.proto3Optional != null && message.hasOwnProperty(\"proto3Optional\"))\n if (typeof message.proto3Optional !== \"boolean\")\n return \"proto3Optional: boolean expected\";\n return null;\n };\n \n /**\n * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.FieldDescriptorProto\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto\n */\n FieldDescriptorProto.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.FieldDescriptorProto)\n return object;\n var message = new $root.google.protobuf.FieldDescriptorProto();\n if (object.name != null)\n message.name = String(object.name);\n if (object.number != null)\n message.number = object.number | 0;\n switch (object.label) {\n default:\n if (typeof object.label === \"number\") {\n message.label = object.label;\n break;\n }\n break;\n case \"LABEL_OPTIONAL\":\n case 1:\n message.label = 1;\n break;\n case \"LABEL_REPEATED\":\n case 3:\n message.label = 3;\n break;\n case \"LABEL_REQUIRED\":\n case 2:\n message.label = 2;\n break;\n }\n switch (object.type) {\n default:\n if (typeof object.type === \"number\") {\n message.type = object.type;\n break;\n }\n break;\n case \"TYPE_DOUBLE\":\n case 1:\n message.type = 1;\n break;\n case \"TYPE_FLOAT\":\n case 2:\n message.type = 2;\n break;\n case \"TYPE_INT64\":\n case 3:\n message.type = 3;\n break;\n case \"TYPE_UINT64\":\n case 4:\n message.type = 4;\n break;\n case \"TYPE_INT32\":\n case 5:\n message.type = 5;\n break;\n case \"TYPE_FIXED64\":\n case 6:\n message.type = 6;\n break;\n case \"TYPE_FIXED32\":\n case 7:\n message.type = 7;\n break;\n case \"TYPE_BOOL\":\n case 8:\n message.type = 8;\n break;\n case \"TYPE_STRING\":\n case 9:\n message.type = 9;\n break;\n case \"TYPE_GROUP\":\n case 10:\n message.type = 10;\n break;\n case \"TYPE_MESSAGE\":\n case 11:\n message.type = 11;\n break;\n case \"TYPE_BYTES\":\n case 12:\n message.type = 12;\n break;\n case \"TYPE_UINT32\":\n case 13:\n message.type = 13;\n break;\n case \"TYPE_ENUM\":\n case 14:\n message.type = 14;\n break;\n case \"TYPE_SFIXED32\":\n case 15:\n message.type = 15;\n break;\n case \"TYPE_SFIXED64\":\n case 16:\n message.type = 16;\n break;\n case \"TYPE_SINT32\":\n case 17:\n message.type = 17;\n break;\n case \"TYPE_SINT64\":\n case 18:\n message.type = 18;\n break;\n }\n if (object.typeName != null)\n message.typeName = String(object.typeName);\n if (object.extendee != null)\n message.extendee = String(object.extendee);\n if (object.defaultValue != null)\n message.defaultValue = String(object.defaultValue);\n if (object.oneofIndex != null)\n message.oneofIndex = object.oneofIndex | 0;\n if (object.jsonName != null)\n message.jsonName = String(object.jsonName);\n if (object.options != null) {\n if (typeof object.options !== \"object\")\n throw TypeError(\".google.protobuf.FieldDescriptorProto.options: object expected\");\n message.options = $root.google.protobuf.FieldOptions.fromObject(object.options);\n }\n if (object.proto3Optional != null)\n message.proto3Optional = Boolean(object.proto3Optional);\n return message;\n };\n \n /**\n * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.FieldDescriptorProto\n * @static\n * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n FieldDescriptorProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.extendee = \"\";\n object.number = 0;\n object.label = options.enums === String ? \"LABEL_OPTIONAL\" : 1;\n object.type = options.enums === String ? \"TYPE_DOUBLE\" : 1;\n object.typeName = \"\";\n object.defaultValue = \"\";\n object.options = null;\n object.oneofIndex = 0;\n object.jsonName = \"\";\n object.proto3Optional = false;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.extendee != null && message.hasOwnProperty(\"extendee\"))\n object.extendee = message.extendee;\n if (message.number != null && message.hasOwnProperty(\"number\"))\n object.number = message.number;\n if (message.label != null && message.hasOwnProperty(\"label\"))\n object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label;\n if (message.type != null && message.hasOwnProperty(\"type\"))\n object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type;\n if (message.typeName != null && message.hasOwnProperty(\"typeName\"))\n object.typeName = message.typeName;\n if (message.defaultValue != null && message.hasOwnProperty(\"defaultValue\"))\n object.defaultValue = message.defaultValue;\n if (message.options != null && message.hasOwnProperty(\"options\"))\n object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options);\n if (message.oneofIndex != null && message.hasOwnProperty(\"oneofIndex\"))\n object.oneofIndex = message.oneofIndex;\n if (message.jsonName != null && message.hasOwnProperty(\"jsonName\"))\n object.jsonName = message.jsonName;\n if (message.proto3Optional != null && message.hasOwnProperty(\"proto3Optional\"))\n object.proto3Optional = message.proto3Optional;\n return object;\n };\n \n /**\n * Converts this FieldDescriptorProto to JSON.\n * @function toJSON\n * @memberof google.protobuf.FieldDescriptorProto\n * @instance\n * @returns {Object.} JSON object\n */\n FieldDescriptorProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for FieldDescriptorProto\n * @function getTypeUrl\n * @memberof google.protobuf.FieldDescriptorProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.FieldDescriptorProto\";\n };\n \n /**\n * Type enum.\n * @name google.protobuf.FieldDescriptorProto.Type\n * @enum {number}\n * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value\n * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value\n * @property {number} TYPE_INT64=3 TYPE_INT64 value\n * @property {number} TYPE_UINT64=4 TYPE_UINT64 value\n * @property {number} TYPE_INT32=5 TYPE_INT32 value\n * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value\n * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value\n * @property {number} TYPE_BOOL=8 TYPE_BOOL value\n * @property {number} TYPE_STRING=9 TYPE_STRING value\n * @property {number} TYPE_GROUP=10 TYPE_GROUP value\n * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value\n * @property {number} TYPE_BYTES=12 TYPE_BYTES value\n * @property {number} TYPE_UINT32=13 TYPE_UINT32 value\n * @property {number} TYPE_ENUM=14 TYPE_ENUM value\n * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value\n * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value\n * @property {number} TYPE_SINT32=17 TYPE_SINT32 value\n * @property {number} TYPE_SINT64=18 TYPE_SINT64 value\n */\n FieldDescriptorProto.Type = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[1] = \"TYPE_DOUBLE\"] = 1;\n values[valuesById[2] = \"TYPE_FLOAT\"] = 2;\n values[valuesById[3] = \"TYPE_INT64\"] = 3;\n values[valuesById[4] = \"TYPE_UINT64\"] = 4;\n values[valuesById[5] = \"TYPE_INT32\"] = 5;\n values[valuesById[6] = \"TYPE_FIXED64\"] = 6;\n values[valuesById[7] = \"TYPE_FIXED32\"] = 7;\n values[valuesById[8] = \"TYPE_BOOL\"] = 8;\n values[valuesById[9] = \"TYPE_STRING\"] = 9;\n values[valuesById[10] = \"TYPE_GROUP\"] = 10;\n values[valuesById[11] = \"TYPE_MESSAGE\"] = 11;\n values[valuesById[12] = \"TYPE_BYTES\"] = 12;\n values[valuesById[13] = \"TYPE_UINT32\"] = 13;\n values[valuesById[14] = \"TYPE_ENUM\"] = 14;\n values[valuesById[15] = \"TYPE_SFIXED32\"] = 15;\n values[valuesById[16] = \"TYPE_SFIXED64\"] = 16;\n values[valuesById[17] = \"TYPE_SINT32\"] = 17;\n values[valuesById[18] = \"TYPE_SINT64\"] = 18;\n return values;\n })();\n \n /**\n * Label enum.\n * @name google.protobuf.FieldDescriptorProto.Label\n * @enum {number}\n * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value\n * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value\n * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value\n */\n FieldDescriptorProto.Label = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[1] = \"LABEL_OPTIONAL\"] = 1;\n values[valuesById[3] = \"LABEL_REPEATED\"] = 3;\n values[valuesById[2] = \"LABEL_REQUIRED\"] = 2;\n return values;\n })();\n \n return FieldDescriptorProto;\n })();\n \n protobuf.OneofDescriptorProto = (function() {\n \n /**\n * Properties of an OneofDescriptorProto.\n * @memberof google.protobuf\n * @interface IOneofDescriptorProto\n * @property {string|null} [name] OneofDescriptorProto name\n * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options\n */\n \n /**\n * Constructs a new OneofDescriptorProto.\n * @memberof google.protobuf\n * @classdesc Represents an OneofDescriptorProto.\n * @implements IOneofDescriptorProto\n * @constructor\n * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set\n */\n function OneofDescriptorProto(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * OneofDescriptorProto name.\n * @member {string} name\n * @memberof google.protobuf.OneofDescriptorProto\n * @instance\n */\n OneofDescriptorProto.prototype.name = \"\";\n \n /**\n * OneofDescriptorProto options.\n * @member {google.protobuf.IOneofOptions|null|undefined} options\n * @memberof google.protobuf.OneofDescriptorProto\n * @instance\n */\n OneofDescriptorProto.prototype.options = null;\n \n /**\n * Creates a new OneofDescriptorProto instance using the specified properties.\n * @function create\n * @memberof google.protobuf.OneofDescriptorProto\n * @static\n * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set\n * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance\n */\n OneofDescriptorProto.create = function create(properties) {\n return new OneofDescriptorProto(properties);\n };\n \n /**\n * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.OneofDescriptorProto\n * @static\n * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OneofDescriptorProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.OneofDescriptorProto\n * @static\n * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an OneofDescriptorProto message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.OneofDescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OneofDescriptorProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.OneofDescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an OneofDescriptorProto message.\n * @function verify\n * @memberof google.protobuf.OneofDescriptorProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n OneofDescriptorProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.options != null && message.hasOwnProperty(\"options\")) {\n var error = $root.google.protobuf.OneofOptions.verify(message.options);\n if (error)\n return \"options.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.OneofDescriptorProto\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto\n */\n OneofDescriptorProto.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.OneofDescriptorProto)\n return object;\n var message = new $root.google.protobuf.OneofDescriptorProto();\n if (object.name != null)\n message.name = String(object.name);\n if (object.options != null) {\n if (typeof object.options !== \"object\")\n throw TypeError(\".google.protobuf.OneofDescriptorProto.options: object expected\");\n message.options = $root.google.protobuf.OneofOptions.fromObject(object.options);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.OneofDescriptorProto\n * @static\n * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n OneofDescriptorProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.options = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.options != null && message.hasOwnProperty(\"options\"))\n object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options);\n return object;\n };\n \n /**\n * Converts this OneofDescriptorProto to JSON.\n * @function toJSON\n * @memberof google.protobuf.OneofDescriptorProto\n * @instance\n * @returns {Object.} JSON object\n */\n OneofDescriptorProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for OneofDescriptorProto\n * @function getTypeUrl\n * @memberof google.protobuf.OneofDescriptorProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.OneofDescriptorProto\";\n };\n \n return OneofDescriptorProto;\n })();\n \n protobuf.EnumDescriptorProto = (function() {\n \n /**\n * Properties of an EnumDescriptorProto.\n * @memberof google.protobuf\n * @interface IEnumDescriptorProto\n * @property {string|null} [name] EnumDescriptorProto name\n * @property {Array.|null} [value] EnumDescriptorProto value\n * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options\n * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange\n * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName\n */\n \n /**\n * Constructs a new EnumDescriptorProto.\n * @memberof google.protobuf\n * @classdesc Represents an EnumDescriptorProto.\n * @implements IEnumDescriptorProto\n * @constructor\n * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set\n */\n function EnumDescriptorProto(properties) {\n this.value = [];\n this.reservedRange = [];\n this.reservedName = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * EnumDescriptorProto name.\n * @member {string} name\n * @memberof google.protobuf.EnumDescriptorProto\n * @instance\n */\n EnumDescriptorProto.prototype.name = \"\";\n \n /**\n * EnumDescriptorProto value.\n * @member {Array.} value\n * @memberof google.protobuf.EnumDescriptorProto\n * @instance\n */\n EnumDescriptorProto.prototype.value = $util.emptyArray;\n \n /**\n * EnumDescriptorProto options.\n * @member {google.protobuf.IEnumOptions|null|undefined} options\n * @memberof google.protobuf.EnumDescriptorProto\n * @instance\n */\n EnumDescriptorProto.prototype.options = null;\n \n /**\n * EnumDescriptorProto reservedRange.\n * @member {Array.} reservedRange\n * @memberof google.protobuf.EnumDescriptorProto\n * @instance\n */\n EnumDescriptorProto.prototype.reservedRange = $util.emptyArray;\n \n /**\n * EnumDescriptorProto reservedName.\n * @member {Array.} reservedName\n * @memberof google.protobuf.EnumDescriptorProto\n * @instance\n */\n EnumDescriptorProto.prototype.reservedName = $util.emptyArray;\n \n /**\n * Creates a new EnumDescriptorProto instance using the specified properties.\n * @function create\n * @memberof google.protobuf.EnumDescriptorProto\n * @static\n * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set\n * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance\n */\n EnumDescriptorProto.create = function create(properties) {\n return new EnumDescriptorProto(properties);\n };\n \n /**\n * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.EnumDescriptorProto\n * @static\n * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n EnumDescriptorProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.value != null && message.value.length)\n for (var i = 0; i < message.value.length; ++i)\n $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n if (message.reservedRange != null && message.reservedRange.length)\n for (var i = 0; i < message.reservedRange.length; ++i)\n $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n if (message.reservedName != null && message.reservedName.length)\n for (var i = 0; i < message.reservedName.length; ++i)\n writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]);\n return writer;\n };\n \n /**\n * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.EnumDescriptorProto\n * @static\n * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an EnumDescriptorProto message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.EnumDescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n EnumDescriptorProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n if (!(message.value && message.value.length))\n message.value = [];\n message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32()));\n break;\n }\n case 3: {\n message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32());\n break;\n }\n case 4: {\n if (!(message.reservedRange && message.reservedRange.length))\n message.reservedRange = [];\n message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32()));\n break;\n }\n case 5: {\n if (!(message.reservedName && message.reservedName.length))\n message.reservedName = [];\n message.reservedName.push(reader.string());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.EnumDescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an EnumDescriptorProto message.\n * @function verify\n * @memberof google.protobuf.EnumDescriptorProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n EnumDescriptorProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.value != null && message.hasOwnProperty(\"value\")) {\n if (!Array.isArray(message.value))\n return \"value: array expected\";\n for (var i = 0; i < message.value.length; ++i) {\n var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]);\n if (error)\n return \"value.\" + error;\n }\n }\n if (message.options != null && message.hasOwnProperty(\"options\")) {\n var error = $root.google.protobuf.EnumOptions.verify(message.options);\n if (error)\n return \"options.\" + error;\n }\n if (message.reservedRange != null && message.hasOwnProperty(\"reservedRange\")) {\n if (!Array.isArray(message.reservedRange))\n return \"reservedRange: array expected\";\n for (var i = 0; i < message.reservedRange.length; ++i) {\n var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]);\n if (error)\n return \"reservedRange.\" + error;\n }\n }\n if (message.reservedName != null && message.hasOwnProperty(\"reservedName\")) {\n if (!Array.isArray(message.reservedName))\n return \"reservedName: array expected\";\n for (var i = 0; i < message.reservedName.length; ++i)\n if (!$util.isString(message.reservedName[i]))\n return \"reservedName: string[] expected\";\n }\n return null;\n };\n \n /**\n * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.EnumDescriptorProto\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto\n */\n EnumDescriptorProto.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.EnumDescriptorProto)\n return object;\n var message = new $root.google.protobuf.EnumDescriptorProto();\n if (object.name != null)\n message.name = String(object.name);\n if (object.value) {\n if (!Array.isArray(object.value))\n throw TypeError(\".google.protobuf.EnumDescriptorProto.value: array expected\");\n message.value = [];\n for (var i = 0; i < object.value.length; ++i) {\n if (typeof object.value[i] !== \"object\")\n throw TypeError(\".google.protobuf.EnumDescriptorProto.value: object expected\");\n message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]);\n }\n }\n if (object.options != null) {\n if (typeof object.options !== \"object\")\n throw TypeError(\".google.protobuf.EnumDescriptorProto.options: object expected\");\n message.options = $root.google.protobuf.EnumOptions.fromObject(object.options);\n }\n if (object.reservedRange) {\n if (!Array.isArray(object.reservedRange))\n throw TypeError(\".google.protobuf.EnumDescriptorProto.reservedRange: array expected\");\n message.reservedRange = [];\n for (var i = 0; i < object.reservedRange.length; ++i) {\n if (typeof object.reservedRange[i] !== \"object\")\n throw TypeError(\".google.protobuf.EnumDescriptorProto.reservedRange: object expected\");\n message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]);\n }\n }\n if (object.reservedName) {\n if (!Array.isArray(object.reservedName))\n throw TypeError(\".google.protobuf.EnumDescriptorProto.reservedName: array expected\");\n message.reservedName = [];\n for (var i = 0; i < object.reservedName.length; ++i)\n message.reservedName[i] = String(object.reservedName[i]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.EnumDescriptorProto\n * @static\n * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n EnumDescriptorProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.value = [];\n object.reservedRange = [];\n object.reservedName = [];\n }\n if (options.defaults) {\n object.name = \"\";\n object.options = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.value && message.value.length) {\n object.value = [];\n for (var j = 0; j < message.value.length; ++j)\n object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options);\n }\n if (message.options != null && message.hasOwnProperty(\"options\"))\n object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options);\n if (message.reservedRange && message.reservedRange.length) {\n object.reservedRange = [];\n for (var j = 0; j < message.reservedRange.length; ++j)\n object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options);\n }\n if (message.reservedName && message.reservedName.length) {\n object.reservedName = [];\n for (var j = 0; j < message.reservedName.length; ++j)\n object.reservedName[j] = message.reservedName[j];\n }\n return object;\n };\n \n /**\n * Converts this EnumDescriptorProto to JSON.\n * @function toJSON\n * @memberof google.protobuf.EnumDescriptorProto\n * @instance\n * @returns {Object.} JSON object\n */\n EnumDescriptorProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for EnumDescriptorProto\n * @function getTypeUrl\n * @memberof google.protobuf.EnumDescriptorProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.EnumDescriptorProto\";\n };\n \n EnumDescriptorProto.EnumReservedRange = (function() {\n \n /**\n * Properties of an EnumReservedRange.\n * @memberof google.protobuf.EnumDescriptorProto\n * @interface IEnumReservedRange\n * @property {number|null} [start] EnumReservedRange start\n * @property {number|null} [end] EnumReservedRange end\n */\n \n /**\n * Constructs a new EnumReservedRange.\n * @memberof google.protobuf.EnumDescriptorProto\n * @classdesc Represents an EnumReservedRange.\n * @implements IEnumReservedRange\n * @constructor\n * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set\n */\n function EnumReservedRange(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * EnumReservedRange start.\n * @member {number} start\n * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange\n * @instance\n */\n EnumReservedRange.prototype.start = 0;\n \n /**\n * EnumReservedRange end.\n * @member {number} end\n * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange\n * @instance\n */\n EnumReservedRange.prototype.end = 0;\n \n /**\n * Creates a new EnumReservedRange instance using the specified properties.\n * @function create\n * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange\n * @static\n * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set\n * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance\n */\n EnumReservedRange.create = function create(properties) {\n return new EnumReservedRange(properties);\n };\n \n /**\n * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange\n * @static\n * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n EnumReservedRange.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.start != null && Object.hasOwnProperty.call(message, \"start\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);\n if (message.end != null && Object.hasOwnProperty.call(message, \"end\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);\n return writer;\n };\n \n /**\n * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange\n * @static\n * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an EnumReservedRange message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n EnumReservedRange.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.start = reader.int32();\n break;\n }\n case 2: {\n message.end = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n EnumReservedRange.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an EnumReservedRange message.\n * @function verify\n * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n EnumReservedRange.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.start != null && message.hasOwnProperty(\"start\"))\n if (!$util.isInteger(message.start))\n return \"start: integer expected\";\n if (message.end != null && message.hasOwnProperty(\"end\"))\n if (!$util.isInteger(message.end))\n return \"end: integer expected\";\n return null;\n };\n \n /**\n * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange\n */\n EnumReservedRange.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange)\n return object;\n var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange();\n if (object.start != null)\n message.start = object.start | 0;\n if (object.end != null)\n message.end = object.end | 0;\n return message;\n };\n \n /**\n * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange\n * @static\n * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n EnumReservedRange.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.start = 0;\n object.end = 0;\n }\n if (message.start != null && message.hasOwnProperty(\"start\"))\n object.start = message.start;\n if (message.end != null && message.hasOwnProperty(\"end\"))\n object.end = message.end;\n return object;\n };\n \n /**\n * Converts this EnumReservedRange to JSON.\n * @function toJSON\n * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange\n * @instance\n * @returns {Object.} JSON object\n */\n EnumReservedRange.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for EnumReservedRange\n * @function getTypeUrl\n * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.EnumDescriptorProto.EnumReservedRange\";\n };\n \n return EnumReservedRange;\n })();\n \n return EnumDescriptorProto;\n })();\n \n protobuf.EnumValueDescriptorProto = (function() {\n \n /**\n * Properties of an EnumValueDescriptorProto.\n * @memberof google.protobuf\n * @interface IEnumValueDescriptorProto\n * @property {string|null} [name] EnumValueDescriptorProto name\n * @property {number|null} [number] EnumValueDescriptorProto number\n * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options\n */\n \n /**\n * Constructs a new EnumValueDescriptorProto.\n * @memberof google.protobuf\n * @classdesc Represents an EnumValueDescriptorProto.\n * @implements IEnumValueDescriptorProto\n * @constructor\n * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set\n */\n function EnumValueDescriptorProto(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * EnumValueDescriptorProto name.\n * @member {string} name\n * @memberof google.protobuf.EnumValueDescriptorProto\n * @instance\n */\n EnumValueDescriptorProto.prototype.name = \"\";\n \n /**\n * EnumValueDescriptorProto number.\n * @member {number} number\n * @memberof google.protobuf.EnumValueDescriptorProto\n * @instance\n */\n EnumValueDescriptorProto.prototype.number = 0;\n \n /**\n * EnumValueDescriptorProto options.\n * @member {google.protobuf.IEnumValueOptions|null|undefined} options\n * @memberof google.protobuf.EnumValueDescriptorProto\n * @instance\n */\n EnumValueDescriptorProto.prototype.options = null;\n \n /**\n * Creates a new EnumValueDescriptorProto instance using the specified properties.\n * @function create\n * @memberof google.protobuf.EnumValueDescriptorProto\n * @static\n * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set\n * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance\n */\n EnumValueDescriptorProto.create = function create(properties) {\n return new EnumValueDescriptorProto(properties);\n };\n \n /**\n * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.EnumValueDescriptorProto\n * @static\n * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n EnumValueDescriptorProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.number != null && Object.hasOwnProperty.call(message, \"number\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number);\n if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.EnumValueDescriptorProto\n * @static\n * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an EnumValueDescriptorProto message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.EnumValueDescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n EnumValueDescriptorProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.number = reader.int32();\n break;\n }\n case 3: {\n message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.EnumValueDescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an EnumValueDescriptorProto message.\n * @function verify\n * @memberof google.protobuf.EnumValueDescriptorProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n EnumValueDescriptorProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.number != null && message.hasOwnProperty(\"number\"))\n if (!$util.isInteger(message.number))\n return \"number: integer expected\";\n if (message.options != null && message.hasOwnProperty(\"options\")) {\n var error = $root.google.protobuf.EnumValueOptions.verify(message.options);\n if (error)\n return \"options.\" + error;\n }\n return null;\n };\n \n /**\n * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.EnumValueDescriptorProto\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto\n */\n EnumValueDescriptorProto.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.EnumValueDescriptorProto)\n return object;\n var message = new $root.google.protobuf.EnumValueDescriptorProto();\n if (object.name != null)\n message.name = String(object.name);\n if (object.number != null)\n message.number = object.number | 0;\n if (object.options != null) {\n if (typeof object.options !== \"object\")\n throw TypeError(\".google.protobuf.EnumValueDescriptorProto.options: object expected\");\n message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.EnumValueDescriptorProto\n * @static\n * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n EnumValueDescriptorProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.number = 0;\n object.options = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.number != null && message.hasOwnProperty(\"number\"))\n object.number = message.number;\n if (message.options != null && message.hasOwnProperty(\"options\"))\n object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options);\n return object;\n };\n \n /**\n * Converts this EnumValueDescriptorProto to JSON.\n * @function toJSON\n * @memberof google.protobuf.EnumValueDescriptorProto\n * @instance\n * @returns {Object.} JSON object\n */\n EnumValueDescriptorProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for EnumValueDescriptorProto\n * @function getTypeUrl\n * @memberof google.protobuf.EnumValueDescriptorProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.EnumValueDescriptorProto\";\n };\n \n return EnumValueDescriptorProto;\n })();\n \n protobuf.ServiceDescriptorProto = (function() {\n \n /**\n * Properties of a ServiceDescriptorProto.\n * @memberof google.protobuf\n * @interface IServiceDescriptorProto\n * @property {string|null} [name] ServiceDescriptorProto name\n * @property {Array.|null} [method] ServiceDescriptorProto method\n * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options\n */\n \n /**\n * Constructs a new ServiceDescriptorProto.\n * @memberof google.protobuf\n * @classdesc Represents a ServiceDescriptorProto.\n * @implements IServiceDescriptorProto\n * @constructor\n * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set\n */\n function ServiceDescriptorProto(properties) {\n this.method = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ServiceDescriptorProto name.\n * @member {string} name\n * @memberof google.protobuf.ServiceDescriptorProto\n * @instance\n */\n ServiceDescriptorProto.prototype.name = \"\";\n \n /**\n * ServiceDescriptorProto method.\n * @member {Array.} method\n * @memberof google.protobuf.ServiceDescriptorProto\n * @instance\n */\n ServiceDescriptorProto.prototype.method = $util.emptyArray;\n \n /**\n * ServiceDescriptorProto options.\n * @member {google.protobuf.IServiceOptions|null|undefined} options\n * @memberof google.protobuf.ServiceDescriptorProto\n * @instance\n */\n ServiceDescriptorProto.prototype.options = null;\n \n /**\n * Creates a new ServiceDescriptorProto instance using the specified properties.\n * @function create\n * @memberof google.protobuf.ServiceDescriptorProto\n * @static\n * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set\n * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance\n */\n ServiceDescriptorProto.create = function create(properties) {\n return new ServiceDescriptorProto(properties);\n };\n \n /**\n * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.ServiceDescriptorProto\n * @static\n * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ServiceDescriptorProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.method != null && message.method.length)\n for (var i = 0; i < message.method.length; ++i)\n $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.ServiceDescriptorProto\n * @static\n * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ServiceDescriptorProto message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.ServiceDescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ServiceDescriptorProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n if (!(message.method && message.method.length))\n message.method = [];\n message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32()));\n break;\n }\n case 3: {\n message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.ServiceDescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ServiceDescriptorProto message.\n * @function verify\n * @memberof google.protobuf.ServiceDescriptorProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ServiceDescriptorProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.method != null && message.hasOwnProperty(\"method\")) {\n if (!Array.isArray(message.method))\n return \"method: array expected\";\n for (var i = 0; i < message.method.length; ++i) {\n var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]);\n if (error)\n return \"method.\" + error;\n }\n }\n if (message.options != null && message.hasOwnProperty(\"options\")) {\n var error = $root.google.protobuf.ServiceOptions.verify(message.options);\n if (error)\n return \"options.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.ServiceDescriptorProto\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto\n */\n ServiceDescriptorProto.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.ServiceDescriptorProto)\n return object;\n var message = new $root.google.protobuf.ServiceDescriptorProto();\n if (object.name != null)\n message.name = String(object.name);\n if (object.method) {\n if (!Array.isArray(object.method))\n throw TypeError(\".google.protobuf.ServiceDescriptorProto.method: array expected\");\n message.method = [];\n for (var i = 0; i < object.method.length; ++i) {\n if (typeof object.method[i] !== \"object\")\n throw TypeError(\".google.protobuf.ServiceDescriptorProto.method: object expected\");\n message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]);\n }\n }\n if (object.options != null) {\n if (typeof object.options !== \"object\")\n throw TypeError(\".google.protobuf.ServiceDescriptorProto.options: object expected\");\n message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.ServiceDescriptorProto\n * @static\n * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ServiceDescriptorProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.method = [];\n if (options.defaults) {\n object.name = \"\";\n object.options = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.method && message.method.length) {\n object.method = [];\n for (var j = 0; j < message.method.length; ++j)\n object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options);\n }\n if (message.options != null && message.hasOwnProperty(\"options\"))\n object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options);\n return object;\n };\n \n /**\n * Converts this ServiceDescriptorProto to JSON.\n * @function toJSON\n * @memberof google.protobuf.ServiceDescriptorProto\n * @instance\n * @returns {Object.} JSON object\n */\n ServiceDescriptorProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ServiceDescriptorProto\n * @function getTypeUrl\n * @memberof google.protobuf.ServiceDescriptorProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.ServiceDescriptorProto\";\n };\n \n return ServiceDescriptorProto;\n })();\n \n protobuf.MethodDescriptorProto = (function() {\n \n /**\n * Properties of a MethodDescriptorProto.\n * @memberof google.protobuf\n * @interface IMethodDescriptorProto\n * @property {string|null} [name] MethodDescriptorProto name\n * @property {string|null} [inputType] MethodDescriptorProto inputType\n * @property {string|null} [outputType] MethodDescriptorProto outputType\n * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options\n * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming\n * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming\n */\n \n /**\n * Constructs a new MethodDescriptorProto.\n * @memberof google.protobuf\n * @classdesc Represents a MethodDescriptorProto.\n * @implements IMethodDescriptorProto\n * @constructor\n * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set\n */\n function MethodDescriptorProto(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * MethodDescriptorProto name.\n * @member {string} name\n * @memberof google.protobuf.MethodDescriptorProto\n * @instance\n */\n MethodDescriptorProto.prototype.name = \"\";\n \n /**\n * MethodDescriptorProto inputType.\n * @member {string} inputType\n * @memberof google.protobuf.MethodDescriptorProto\n * @instance\n */\n MethodDescriptorProto.prototype.inputType = \"\";\n \n /**\n * MethodDescriptorProto outputType.\n * @member {string} outputType\n * @memberof google.protobuf.MethodDescriptorProto\n * @instance\n */\n MethodDescriptorProto.prototype.outputType = \"\";\n \n /**\n * MethodDescriptorProto options.\n * @member {google.protobuf.IMethodOptions|null|undefined} options\n * @memberof google.protobuf.MethodDescriptorProto\n * @instance\n */\n MethodDescriptorProto.prototype.options = null;\n \n /**\n * MethodDescriptorProto clientStreaming.\n * @member {boolean} clientStreaming\n * @memberof google.protobuf.MethodDescriptorProto\n * @instance\n */\n MethodDescriptorProto.prototype.clientStreaming = false;\n \n /**\n * MethodDescriptorProto serverStreaming.\n * @member {boolean} serverStreaming\n * @memberof google.protobuf.MethodDescriptorProto\n * @instance\n */\n MethodDescriptorProto.prototype.serverStreaming = false;\n \n /**\n * Creates a new MethodDescriptorProto instance using the specified properties.\n * @function create\n * @memberof google.protobuf.MethodDescriptorProto\n * @static\n * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set\n * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance\n */\n MethodDescriptorProto.create = function create(properties) {\n return new MethodDescriptorProto(properties);\n };\n \n /**\n * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.MethodDescriptorProto\n * @static\n * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MethodDescriptorProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.inputType != null && Object.hasOwnProperty.call(message, \"inputType\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType);\n if (message.outputType != null && Object.hasOwnProperty.call(message, \"outputType\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType);\n if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n if (message.clientStreaming != null && Object.hasOwnProperty.call(message, \"clientStreaming\"))\n writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming);\n if (message.serverStreaming != null && Object.hasOwnProperty.call(message, \"serverStreaming\"))\n writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming);\n return writer;\n };\n \n /**\n * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.MethodDescriptorProto\n * @static\n * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a MethodDescriptorProto message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.MethodDescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MethodDescriptorProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.inputType = reader.string();\n break;\n }\n case 3: {\n message.outputType = reader.string();\n break;\n }\n case 4: {\n message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32());\n break;\n }\n case 5: {\n message.clientStreaming = reader.bool();\n break;\n }\n case 6: {\n message.serverStreaming = reader.bool();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.MethodDescriptorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a MethodDescriptorProto message.\n * @function verify\n * @memberof google.protobuf.MethodDescriptorProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n MethodDescriptorProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.inputType != null && message.hasOwnProperty(\"inputType\"))\n if (!$util.isString(message.inputType))\n return \"inputType: string expected\";\n if (message.outputType != null && message.hasOwnProperty(\"outputType\"))\n if (!$util.isString(message.outputType))\n return \"outputType: string expected\";\n if (message.options != null && message.hasOwnProperty(\"options\")) {\n var error = $root.google.protobuf.MethodOptions.verify(message.options);\n if (error)\n return \"options.\" + error;\n }\n if (message.clientStreaming != null && message.hasOwnProperty(\"clientStreaming\"))\n if (typeof message.clientStreaming !== \"boolean\")\n return \"clientStreaming: boolean expected\";\n if (message.serverStreaming != null && message.hasOwnProperty(\"serverStreaming\"))\n if (typeof message.serverStreaming !== \"boolean\")\n return \"serverStreaming: boolean expected\";\n return null;\n };\n \n /**\n * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.MethodDescriptorProto\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto\n */\n MethodDescriptorProto.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.MethodDescriptorProto)\n return object;\n var message = new $root.google.protobuf.MethodDescriptorProto();\n if (object.name != null)\n message.name = String(object.name);\n if (object.inputType != null)\n message.inputType = String(object.inputType);\n if (object.outputType != null)\n message.outputType = String(object.outputType);\n if (object.options != null) {\n if (typeof object.options !== \"object\")\n throw TypeError(\".google.protobuf.MethodDescriptorProto.options: object expected\");\n message.options = $root.google.protobuf.MethodOptions.fromObject(object.options);\n }\n if (object.clientStreaming != null)\n message.clientStreaming = Boolean(object.clientStreaming);\n if (object.serverStreaming != null)\n message.serverStreaming = Boolean(object.serverStreaming);\n return message;\n };\n \n /**\n * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.MethodDescriptorProto\n * @static\n * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n MethodDescriptorProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.inputType = \"\";\n object.outputType = \"\";\n object.options = null;\n object.clientStreaming = false;\n object.serverStreaming = false;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.inputType != null && message.hasOwnProperty(\"inputType\"))\n object.inputType = message.inputType;\n if (message.outputType != null && message.hasOwnProperty(\"outputType\"))\n object.outputType = message.outputType;\n if (message.options != null && message.hasOwnProperty(\"options\"))\n object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options);\n if (message.clientStreaming != null && message.hasOwnProperty(\"clientStreaming\"))\n object.clientStreaming = message.clientStreaming;\n if (message.serverStreaming != null && message.hasOwnProperty(\"serverStreaming\"))\n object.serverStreaming = message.serverStreaming;\n return object;\n };\n \n /**\n * Converts this MethodDescriptorProto to JSON.\n * @function toJSON\n * @memberof google.protobuf.MethodDescriptorProto\n * @instance\n * @returns {Object.} JSON object\n */\n MethodDescriptorProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for MethodDescriptorProto\n * @function getTypeUrl\n * @memberof google.protobuf.MethodDescriptorProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.MethodDescriptorProto\";\n };\n \n return MethodDescriptorProto;\n })();\n \n protobuf.FileOptions = (function() {\n \n /**\n * Properties of a FileOptions.\n * @memberof google.protobuf\n * @interface IFileOptions\n * @property {string|null} [javaPackage] FileOptions javaPackage\n * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname\n * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles\n * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash\n * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8\n * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor\n * @property {string|null} [goPackage] FileOptions goPackage\n * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices\n * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices\n * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices\n * @property {boolean|null} [deprecated] FileOptions deprecated\n * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas\n * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix\n * @property {string|null} [csharpNamespace] FileOptions csharpNamespace\n * @property {string|null} [swiftPrefix] FileOptions swiftPrefix\n * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix\n * @property {string|null} [phpNamespace] FileOptions phpNamespace\n * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace\n * @property {string|null} [rubyPackage] FileOptions rubyPackage\n * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features\n * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption\n * @property {Array.|null} [\".google.api.resourceDefinition\"] FileOptions .google.api.resourceDefinition\n */\n \n /**\n * Constructs a new FileOptions.\n * @memberof google.protobuf\n * @classdesc Represents a FileOptions.\n * @implements IFileOptions\n * @constructor\n * @param {google.protobuf.IFileOptions=} [properties] Properties to set\n */\n function FileOptions(properties) {\n this.uninterpretedOption = [];\n this[\".google.api.resourceDefinition\"] = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * FileOptions javaPackage.\n * @member {string} javaPackage\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.javaPackage = \"\";\n \n /**\n * FileOptions javaOuterClassname.\n * @member {string} javaOuterClassname\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.javaOuterClassname = \"\";\n \n /**\n * FileOptions javaMultipleFiles.\n * @member {boolean} javaMultipleFiles\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.javaMultipleFiles = false;\n \n /**\n * FileOptions javaGenerateEqualsAndHash.\n * @member {boolean} javaGenerateEqualsAndHash\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.javaGenerateEqualsAndHash = false;\n \n /**\n * FileOptions javaStringCheckUtf8.\n * @member {boolean} javaStringCheckUtf8\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.javaStringCheckUtf8 = false;\n \n /**\n * FileOptions optimizeFor.\n * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.optimizeFor = 1;\n \n /**\n * FileOptions goPackage.\n * @member {string} goPackage\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.goPackage = \"\";\n \n /**\n * FileOptions ccGenericServices.\n * @member {boolean} ccGenericServices\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.ccGenericServices = false;\n \n /**\n * FileOptions javaGenericServices.\n * @member {boolean} javaGenericServices\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.javaGenericServices = false;\n \n /**\n * FileOptions pyGenericServices.\n * @member {boolean} pyGenericServices\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.pyGenericServices = false;\n \n /**\n * FileOptions deprecated.\n * @member {boolean} deprecated\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.deprecated = false;\n \n /**\n * FileOptions ccEnableArenas.\n * @member {boolean} ccEnableArenas\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.ccEnableArenas = true;\n \n /**\n * FileOptions objcClassPrefix.\n * @member {string} objcClassPrefix\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.objcClassPrefix = \"\";\n \n /**\n * FileOptions csharpNamespace.\n * @member {string} csharpNamespace\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.csharpNamespace = \"\";\n \n /**\n * FileOptions swiftPrefix.\n * @member {string} swiftPrefix\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.swiftPrefix = \"\";\n \n /**\n * FileOptions phpClassPrefix.\n * @member {string} phpClassPrefix\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.phpClassPrefix = \"\";\n \n /**\n * FileOptions phpNamespace.\n * @member {string} phpNamespace\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.phpNamespace = \"\";\n \n /**\n * FileOptions phpMetadataNamespace.\n * @member {string} phpMetadataNamespace\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.phpMetadataNamespace = \"\";\n \n /**\n * FileOptions rubyPackage.\n * @member {string} rubyPackage\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.rubyPackage = \"\";\n \n /**\n * FileOptions features.\n * @member {google.protobuf.IFeatureSet|null|undefined} features\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.features = null;\n \n /**\n * FileOptions uninterpretedOption.\n * @member {Array.} uninterpretedOption\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype.uninterpretedOption = $util.emptyArray;\n \n /**\n * FileOptions .google.api.resourceDefinition.\n * @member {Array.} .google.api.resourceDefinition\n * @memberof google.protobuf.FileOptions\n * @instance\n */\n FileOptions.prototype[\".google.api.resourceDefinition\"] = $util.emptyArray;\n \n /**\n * Creates a new FileOptions instance using the specified properties.\n * @function create\n * @memberof google.protobuf.FileOptions\n * @static\n * @param {google.protobuf.IFileOptions=} [properties] Properties to set\n * @returns {google.protobuf.FileOptions} FileOptions instance\n */\n FileOptions.create = function create(properties) {\n return new FileOptions(properties);\n };\n \n /**\n * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.FileOptions\n * @static\n * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FileOptions.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.javaPackage != null && Object.hasOwnProperty.call(message, \"javaPackage\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage);\n if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, \"javaOuterClassname\"))\n writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname);\n if (message.optimizeFor != null && Object.hasOwnProperty.call(message, \"optimizeFor\"))\n writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor);\n if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, \"javaMultipleFiles\"))\n writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles);\n if (message.goPackage != null && Object.hasOwnProperty.call(message, \"goPackage\"))\n writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage);\n if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, \"ccGenericServices\"))\n writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices);\n if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, \"javaGenericServices\"))\n writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices);\n if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, \"pyGenericServices\"))\n writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices);\n if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, \"javaGenerateEqualsAndHash\"))\n writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash);\n if (message.deprecated != null && Object.hasOwnProperty.call(message, \"deprecated\"))\n writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated);\n if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, \"javaStringCheckUtf8\"))\n writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8);\n if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, \"ccEnableArenas\"))\n writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas);\n if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, \"objcClassPrefix\"))\n writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix);\n if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, \"csharpNamespace\"))\n writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace);\n if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, \"swiftPrefix\"))\n writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix);\n if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, \"phpClassPrefix\"))\n writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix);\n if (message.phpNamespace != null && Object.hasOwnProperty.call(message, \"phpNamespace\"))\n writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace);\n if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, \"phpMetadataNamespace\"))\n writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace);\n if (message.rubyPackage != null && Object.hasOwnProperty.call(message, \"rubyPackage\"))\n writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage);\n if (message.features != null && Object.hasOwnProperty.call(message, \"features\"))\n $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim();\n if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n for (var i = 0; i < message.uninterpretedOption.length; ++i)\n $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n if (message[\".google.api.resourceDefinition\"] != null && message[\".google.api.resourceDefinition\"].length)\n for (var i = 0; i < message[\".google.api.resourceDefinition\"].length; ++i)\n $root.google.api.ResourceDescriptor.encode(message[\".google.api.resourceDefinition\"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.FileOptions\n * @static\n * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FileOptions.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a FileOptions message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.FileOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.FileOptions} FileOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FileOptions.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.javaPackage = reader.string();\n break;\n }\n case 8: {\n message.javaOuterClassname = reader.string();\n break;\n }\n case 10: {\n message.javaMultipleFiles = reader.bool();\n break;\n }\n case 20: {\n message.javaGenerateEqualsAndHash = reader.bool();\n break;\n }\n case 27: {\n message.javaStringCheckUtf8 = reader.bool();\n break;\n }\n case 9: {\n message.optimizeFor = reader.int32();\n break;\n }\n case 11: {\n message.goPackage = reader.string();\n break;\n }\n case 16: {\n message.ccGenericServices = reader.bool();\n break;\n }\n case 17: {\n message.javaGenericServices = reader.bool();\n break;\n }\n case 18: {\n message.pyGenericServices = reader.bool();\n break;\n }\n case 23: {\n message.deprecated = reader.bool();\n break;\n }\n case 31: {\n message.ccEnableArenas = reader.bool();\n break;\n }\n case 36: {\n message.objcClassPrefix = reader.string();\n break;\n }\n case 37: {\n message.csharpNamespace = reader.string();\n break;\n }\n case 39: {\n message.swiftPrefix = reader.string();\n break;\n }\n case 40: {\n message.phpClassPrefix = reader.string();\n break;\n }\n case 41: {\n message.phpNamespace = reader.string();\n break;\n }\n case 44: {\n message.phpMetadataNamespace = reader.string();\n break;\n }\n case 45: {\n message.rubyPackage = reader.string();\n break;\n }\n case 50: {\n message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());\n break;\n }\n case 999: {\n if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n message.uninterpretedOption = [];\n message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n break;\n }\n case 1053: {\n if (!(message[\".google.api.resourceDefinition\"] && message[\".google.api.resourceDefinition\"].length))\n message[\".google.api.resourceDefinition\"] = [];\n message[\".google.api.resourceDefinition\"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a FileOptions message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.FileOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.FileOptions} FileOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FileOptions.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a FileOptions message.\n * @function verify\n * @memberof google.protobuf.FileOptions\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n FileOptions.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.javaPackage != null && message.hasOwnProperty(\"javaPackage\"))\n if (!$util.isString(message.javaPackage))\n return \"javaPackage: string expected\";\n if (message.javaOuterClassname != null && message.hasOwnProperty(\"javaOuterClassname\"))\n if (!$util.isString(message.javaOuterClassname))\n return \"javaOuterClassname: string expected\";\n if (message.javaMultipleFiles != null && message.hasOwnProperty(\"javaMultipleFiles\"))\n if (typeof message.javaMultipleFiles !== \"boolean\")\n return \"javaMultipleFiles: boolean expected\";\n if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty(\"javaGenerateEqualsAndHash\"))\n if (typeof message.javaGenerateEqualsAndHash !== \"boolean\")\n return \"javaGenerateEqualsAndHash: boolean expected\";\n if (message.javaStringCheckUtf8 != null && message.hasOwnProperty(\"javaStringCheckUtf8\"))\n if (typeof message.javaStringCheckUtf8 !== \"boolean\")\n return \"javaStringCheckUtf8: boolean expected\";\n if (message.optimizeFor != null && message.hasOwnProperty(\"optimizeFor\"))\n switch (message.optimizeFor) {\n default:\n return \"optimizeFor: enum value expected\";\n case 1:\n case 2:\n case 3:\n break;\n }\n if (message.goPackage != null && message.hasOwnProperty(\"goPackage\"))\n if (!$util.isString(message.goPackage))\n return \"goPackage: string expected\";\n if (message.ccGenericServices != null && message.hasOwnProperty(\"ccGenericServices\"))\n if (typeof message.ccGenericServices !== \"boolean\")\n return \"ccGenericServices: boolean expected\";\n if (message.javaGenericServices != null && message.hasOwnProperty(\"javaGenericServices\"))\n if (typeof message.javaGenericServices !== \"boolean\")\n return \"javaGenericServices: boolean expected\";\n if (message.pyGenericServices != null && message.hasOwnProperty(\"pyGenericServices\"))\n if (typeof message.pyGenericServices !== \"boolean\")\n return \"pyGenericServices: boolean expected\";\n if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n if (typeof message.deprecated !== \"boolean\")\n return \"deprecated: boolean expected\";\n if (message.ccEnableArenas != null && message.hasOwnProperty(\"ccEnableArenas\"))\n if (typeof message.ccEnableArenas !== \"boolean\")\n return \"ccEnableArenas: boolean expected\";\n if (message.objcClassPrefix != null && message.hasOwnProperty(\"objcClassPrefix\"))\n if (!$util.isString(message.objcClassPrefix))\n return \"objcClassPrefix: string expected\";\n if (message.csharpNamespace != null && message.hasOwnProperty(\"csharpNamespace\"))\n if (!$util.isString(message.csharpNamespace))\n return \"csharpNamespace: string expected\";\n if (message.swiftPrefix != null && message.hasOwnProperty(\"swiftPrefix\"))\n if (!$util.isString(message.swiftPrefix))\n return \"swiftPrefix: string expected\";\n if (message.phpClassPrefix != null && message.hasOwnProperty(\"phpClassPrefix\"))\n if (!$util.isString(message.phpClassPrefix))\n return \"phpClassPrefix: string expected\";\n if (message.phpNamespace != null && message.hasOwnProperty(\"phpNamespace\"))\n if (!$util.isString(message.phpNamespace))\n return \"phpNamespace: string expected\";\n if (message.phpMetadataNamespace != null && message.hasOwnProperty(\"phpMetadataNamespace\"))\n if (!$util.isString(message.phpMetadataNamespace))\n return \"phpMetadataNamespace: string expected\";\n if (message.rubyPackage != null && message.hasOwnProperty(\"rubyPackage\"))\n if (!$util.isString(message.rubyPackage))\n return \"rubyPackage: string expected\";\n if (message.features != null && message.hasOwnProperty(\"features\")) {\n var error = $root.google.protobuf.FeatureSet.verify(message.features);\n if (error)\n return \"features.\" + error;\n }\n if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n if (!Array.isArray(message.uninterpretedOption))\n return \"uninterpretedOption: array expected\";\n for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n if (error)\n return \"uninterpretedOption.\" + error;\n }\n }\n if (message[\".google.api.resourceDefinition\"] != null && message.hasOwnProperty(\".google.api.resourceDefinition\")) {\n if (!Array.isArray(message[\".google.api.resourceDefinition\"]))\n return \".google.api.resourceDefinition: array expected\";\n for (var i = 0; i < message[\".google.api.resourceDefinition\"].length; ++i) {\n var error = $root.google.api.ResourceDescriptor.verify(message[\".google.api.resourceDefinition\"][i]);\n if (error)\n return \".google.api.resourceDefinition.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a FileOptions message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.FileOptions\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.FileOptions} FileOptions\n */\n FileOptions.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.FileOptions)\n return object;\n var message = new $root.google.protobuf.FileOptions();\n if (object.javaPackage != null)\n message.javaPackage = String(object.javaPackage);\n if (object.javaOuterClassname != null)\n message.javaOuterClassname = String(object.javaOuterClassname);\n if (object.javaMultipleFiles != null)\n message.javaMultipleFiles = Boolean(object.javaMultipleFiles);\n if (object.javaGenerateEqualsAndHash != null)\n message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash);\n if (object.javaStringCheckUtf8 != null)\n message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8);\n switch (object.optimizeFor) {\n default:\n if (typeof object.optimizeFor === \"number\") {\n message.optimizeFor = object.optimizeFor;\n break;\n }\n break;\n case \"SPEED\":\n case 1:\n message.optimizeFor = 1;\n break;\n case \"CODE_SIZE\":\n case 2:\n message.optimizeFor = 2;\n break;\n case \"LITE_RUNTIME\":\n case 3:\n message.optimizeFor = 3;\n break;\n }\n if (object.goPackage != null)\n message.goPackage = String(object.goPackage);\n if (object.ccGenericServices != null)\n message.ccGenericServices = Boolean(object.ccGenericServices);\n if (object.javaGenericServices != null)\n message.javaGenericServices = Boolean(object.javaGenericServices);\n if (object.pyGenericServices != null)\n message.pyGenericServices = Boolean(object.pyGenericServices);\n if (object.deprecated != null)\n message.deprecated = Boolean(object.deprecated);\n if (object.ccEnableArenas != null)\n message.ccEnableArenas = Boolean(object.ccEnableArenas);\n if (object.objcClassPrefix != null)\n message.objcClassPrefix = String(object.objcClassPrefix);\n if (object.csharpNamespace != null)\n message.csharpNamespace = String(object.csharpNamespace);\n if (object.swiftPrefix != null)\n message.swiftPrefix = String(object.swiftPrefix);\n if (object.phpClassPrefix != null)\n message.phpClassPrefix = String(object.phpClassPrefix);\n if (object.phpNamespace != null)\n message.phpNamespace = String(object.phpNamespace);\n if (object.phpMetadataNamespace != null)\n message.phpMetadataNamespace = String(object.phpMetadataNamespace);\n if (object.rubyPackage != null)\n message.rubyPackage = String(object.rubyPackage);\n if (object.features != null) {\n if (typeof object.features !== \"object\")\n throw TypeError(\".google.protobuf.FileOptions.features: object expected\");\n message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);\n }\n if (object.uninterpretedOption) {\n if (!Array.isArray(object.uninterpretedOption))\n throw TypeError(\".google.protobuf.FileOptions.uninterpretedOption: array expected\");\n message.uninterpretedOption = [];\n for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n if (typeof object.uninterpretedOption[i] !== \"object\")\n throw TypeError(\".google.protobuf.FileOptions.uninterpretedOption: object expected\");\n message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n }\n }\n if (object[\".google.api.resourceDefinition\"]) {\n if (!Array.isArray(object[\".google.api.resourceDefinition\"]))\n throw TypeError(\".google.protobuf.FileOptions..google.api.resourceDefinition: array expected\");\n message[\".google.api.resourceDefinition\"] = [];\n for (var i = 0; i < object[\".google.api.resourceDefinition\"].length; ++i) {\n if (typeof object[\".google.api.resourceDefinition\"][i] !== \"object\")\n throw TypeError(\".google.protobuf.FileOptions..google.api.resourceDefinition: object expected\");\n message[\".google.api.resourceDefinition\"][i] = $root.google.api.ResourceDescriptor.fromObject(object[\".google.api.resourceDefinition\"][i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from a FileOptions message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.FileOptions\n * @static\n * @param {google.protobuf.FileOptions} message FileOptions\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n FileOptions.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.uninterpretedOption = [];\n object[\".google.api.resourceDefinition\"] = [];\n }\n if (options.defaults) {\n object.javaPackage = \"\";\n object.javaOuterClassname = \"\";\n object.optimizeFor = options.enums === String ? \"SPEED\" : 1;\n object.javaMultipleFiles = false;\n object.goPackage = \"\";\n object.ccGenericServices = false;\n object.javaGenericServices = false;\n object.pyGenericServices = false;\n object.javaGenerateEqualsAndHash = false;\n object.deprecated = false;\n object.javaStringCheckUtf8 = false;\n object.ccEnableArenas = true;\n object.objcClassPrefix = \"\";\n object.csharpNamespace = \"\";\n object.swiftPrefix = \"\";\n object.phpClassPrefix = \"\";\n object.phpNamespace = \"\";\n object.phpMetadataNamespace = \"\";\n object.rubyPackage = \"\";\n object.features = null;\n }\n if (message.javaPackage != null && message.hasOwnProperty(\"javaPackage\"))\n object.javaPackage = message.javaPackage;\n if (message.javaOuterClassname != null && message.hasOwnProperty(\"javaOuterClassname\"))\n object.javaOuterClassname = message.javaOuterClassname;\n if (message.optimizeFor != null && message.hasOwnProperty(\"optimizeFor\"))\n object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor;\n if (message.javaMultipleFiles != null && message.hasOwnProperty(\"javaMultipleFiles\"))\n object.javaMultipleFiles = message.javaMultipleFiles;\n if (message.goPackage != null && message.hasOwnProperty(\"goPackage\"))\n object.goPackage = message.goPackage;\n if (message.ccGenericServices != null && message.hasOwnProperty(\"ccGenericServices\"))\n object.ccGenericServices = message.ccGenericServices;\n if (message.javaGenericServices != null && message.hasOwnProperty(\"javaGenericServices\"))\n object.javaGenericServices = message.javaGenericServices;\n if (message.pyGenericServices != null && message.hasOwnProperty(\"pyGenericServices\"))\n object.pyGenericServices = message.pyGenericServices;\n if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty(\"javaGenerateEqualsAndHash\"))\n object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash;\n if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n object.deprecated = message.deprecated;\n if (message.javaStringCheckUtf8 != null && message.hasOwnProperty(\"javaStringCheckUtf8\"))\n object.javaStringCheckUtf8 = message.javaStringCheckUtf8;\n if (message.ccEnableArenas != null && message.hasOwnProperty(\"ccEnableArenas\"))\n object.ccEnableArenas = message.ccEnableArenas;\n if (message.objcClassPrefix != null && message.hasOwnProperty(\"objcClassPrefix\"))\n object.objcClassPrefix = message.objcClassPrefix;\n if (message.csharpNamespace != null && message.hasOwnProperty(\"csharpNamespace\"))\n object.csharpNamespace = message.csharpNamespace;\n if (message.swiftPrefix != null && message.hasOwnProperty(\"swiftPrefix\"))\n object.swiftPrefix = message.swiftPrefix;\n if (message.phpClassPrefix != null && message.hasOwnProperty(\"phpClassPrefix\"))\n object.phpClassPrefix = message.phpClassPrefix;\n if (message.phpNamespace != null && message.hasOwnProperty(\"phpNamespace\"))\n object.phpNamespace = message.phpNamespace;\n if (message.phpMetadataNamespace != null && message.hasOwnProperty(\"phpMetadataNamespace\"))\n object.phpMetadataNamespace = message.phpMetadataNamespace;\n if (message.rubyPackage != null && message.hasOwnProperty(\"rubyPackage\"))\n object.rubyPackage = message.rubyPackage;\n if (message.features != null && message.hasOwnProperty(\"features\"))\n object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);\n if (message.uninterpretedOption && message.uninterpretedOption.length) {\n object.uninterpretedOption = [];\n for (var j = 0; j < message.uninterpretedOption.length; ++j)\n object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n }\n if (message[\".google.api.resourceDefinition\"] && message[\".google.api.resourceDefinition\"].length) {\n object[\".google.api.resourceDefinition\"] = [];\n for (var j = 0; j < message[\".google.api.resourceDefinition\"].length; ++j)\n object[\".google.api.resourceDefinition\"][j] = $root.google.api.ResourceDescriptor.toObject(message[\".google.api.resourceDefinition\"][j], options);\n }\n return object;\n };\n \n /**\n * Converts this FileOptions to JSON.\n * @function toJSON\n * @memberof google.protobuf.FileOptions\n * @instance\n * @returns {Object.} JSON object\n */\n FileOptions.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for FileOptions\n * @function getTypeUrl\n * @memberof google.protobuf.FileOptions\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.FileOptions\";\n };\n \n /**\n * OptimizeMode enum.\n * @name google.protobuf.FileOptions.OptimizeMode\n * @enum {number}\n * @property {number} SPEED=1 SPEED value\n * @property {number} CODE_SIZE=2 CODE_SIZE value\n * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value\n */\n FileOptions.OptimizeMode = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[1] = \"SPEED\"] = 1;\n values[valuesById[2] = \"CODE_SIZE\"] = 2;\n values[valuesById[3] = \"LITE_RUNTIME\"] = 3;\n return values;\n })();\n \n return FileOptions;\n })();\n \n protobuf.MessageOptions = (function() {\n \n /**\n * Properties of a MessageOptions.\n * @memberof google.protobuf\n * @interface IMessageOptions\n * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat\n * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor\n * @property {boolean|null} [deprecated] MessageOptions deprecated\n * @property {boolean|null} [mapEntry] MessageOptions mapEntry\n * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts\n * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features\n * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption\n * @property {google.api.IResourceDescriptor|null} [\".google.api.resource\"] MessageOptions .google.api.resource\n */\n \n /**\n * Constructs a new MessageOptions.\n * @memberof google.protobuf\n * @classdesc Represents a MessageOptions.\n * @implements IMessageOptions\n * @constructor\n * @param {google.protobuf.IMessageOptions=} [properties] Properties to set\n */\n function MessageOptions(properties) {\n this.uninterpretedOption = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * MessageOptions messageSetWireFormat.\n * @member {boolean} messageSetWireFormat\n * @memberof google.protobuf.MessageOptions\n * @instance\n */\n MessageOptions.prototype.messageSetWireFormat = false;\n \n /**\n * MessageOptions noStandardDescriptorAccessor.\n * @member {boolean} noStandardDescriptorAccessor\n * @memberof google.protobuf.MessageOptions\n * @instance\n */\n MessageOptions.prototype.noStandardDescriptorAccessor = false;\n \n /**\n * MessageOptions deprecated.\n * @member {boolean} deprecated\n * @memberof google.protobuf.MessageOptions\n * @instance\n */\n MessageOptions.prototype.deprecated = false;\n \n /**\n * MessageOptions mapEntry.\n * @member {boolean} mapEntry\n * @memberof google.protobuf.MessageOptions\n * @instance\n */\n MessageOptions.prototype.mapEntry = false;\n \n /**\n * MessageOptions deprecatedLegacyJsonFieldConflicts.\n * @member {boolean} deprecatedLegacyJsonFieldConflicts\n * @memberof google.protobuf.MessageOptions\n * @instance\n */\n MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false;\n \n /**\n * MessageOptions features.\n * @member {google.protobuf.IFeatureSet|null|undefined} features\n * @memberof google.protobuf.MessageOptions\n * @instance\n */\n MessageOptions.prototype.features = null;\n \n /**\n * MessageOptions uninterpretedOption.\n * @member {Array.} uninterpretedOption\n * @memberof google.protobuf.MessageOptions\n * @instance\n */\n MessageOptions.prototype.uninterpretedOption = $util.emptyArray;\n \n /**\n * MessageOptions .google.api.resource.\n * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource\n * @memberof google.protobuf.MessageOptions\n * @instance\n */\n MessageOptions.prototype[\".google.api.resource\"] = null;\n \n /**\n * Creates a new MessageOptions instance using the specified properties.\n * @function create\n * @memberof google.protobuf.MessageOptions\n * @static\n * @param {google.protobuf.IMessageOptions=} [properties] Properties to set\n * @returns {google.protobuf.MessageOptions} MessageOptions instance\n */\n MessageOptions.create = function create(properties) {\n return new MessageOptions(properties);\n };\n \n /**\n * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.MessageOptions\n * @static\n * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MessageOptions.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, \"messageSetWireFormat\"))\n writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat);\n if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, \"noStandardDescriptorAccessor\"))\n writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor);\n if (message.deprecated != null && Object.hasOwnProperty.call(message, \"deprecated\"))\n writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);\n if (message.mapEntry != null && Object.hasOwnProperty.call(message, \"mapEntry\"))\n writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry);\n if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, \"deprecatedLegacyJsonFieldConflicts\"))\n writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts);\n if (message.features != null && Object.hasOwnProperty.call(message, \"features\"))\n $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();\n if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n for (var i = 0; i < message.uninterpretedOption.length; ++i)\n $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n if (message[\".google.api.resource\"] != null && Object.hasOwnProperty.call(message, \".google.api.resource\"))\n $root.google.api.ResourceDescriptor.encode(message[\".google.api.resource\"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.MessageOptions\n * @static\n * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MessageOptions.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a MessageOptions message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.MessageOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.MessageOptions} MessageOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MessageOptions.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.messageSetWireFormat = reader.bool();\n break;\n }\n case 2: {\n message.noStandardDescriptorAccessor = reader.bool();\n break;\n }\n case 3: {\n message.deprecated = reader.bool();\n break;\n }\n case 7: {\n message.mapEntry = reader.bool();\n break;\n }\n case 11: {\n message.deprecatedLegacyJsonFieldConflicts = reader.bool();\n break;\n }\n case 12: {\n message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());\n break;\n }\n case 999: {\n if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n message.uninterpretedOption = [];\n message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n break;\n }\n case 1053: {\n message[\".google.api.resource\"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a MessageOptions message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.MessageOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.MessageOptions} MessageOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MessageOptions.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a MessageOptions message.\n * @function verify\n * @memberof google.protobuf.MessageOptions\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n MessageOptions.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.messageSetWireFormat != null && message.hasOwnProperty(\"messageSetWireFormat\"))\n if (typeof message.messageSetWireFormat !== \"boolean\")\n return \"messageSetWireFormat: boolean expected\";\n if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty(\"noStandardDescriptorAccessor\"))\n if (typeof message.noStandardDescriptorAccessor !== \"boolean\")\n return \"noStandardDescriptorAccessor: boolean expected\";\n if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n if (typeof message.deprecated !== \"boolean\")\n return \"deprecated: boolean expected\";\n if (message.mapEntry != null && message.hasOwnProperty(\"mapEntry\"))\n if (typeof message.mapEntry !== \"boolean\")\n return \"mapEntry: boolean expected\";\n if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty(\"deprecatedLegacyJsonFieldConflicts\"))\n if (typeof message.deprecatedLegacyJsonFieldConflicts !== \"boolean\")\n return \"deprecatedLegacyJsonFieldConflicts: boolean expected\";\n if (message.features != null && message.hasOwnProperty(\"features\")) {\n var error = $root.google.protobuf.FeatureSet.verify(message.features);\n if (error)\n return \"features.\" + error;\n }\n if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n if (!Array.isArray(message.uninterpretedOption))\n return \"uninterpretedOption: array expected\";\n for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n if (error)\n return \"uninterpretedOption.\" + error;\n }\n }\n if (message[\".google.api.resource\"] != null && message.hasOwnProperty(\".google.api.resource\")) {\n var error = $root.google.api.ResourceDescriptor.verify(message[\".google.api.resource\"]);\n if (error)\n return \".google.api.resource.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.MessageOptions\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.MessageOptions} MessageOptions\n */\n MessageOptions.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.MessageOptions)\n return object;\n var message = new $root.google.protobuf.MessageOptions();\n if (object.messageSetWireFormat != null)\n message.messageSetWireFormat = Boolean(object.messageSetWireFormat);\n if (object.noStandardDescriptorAccessor != null)\n message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor);\n if (object.deprecated != null)\n message.deprecated = Boolean(object.deprecated);\n if (object.mapEntry != null)\n message.mapEntry = Boolean(object.mapEntry);\n if (object.deprecatedLegacyJsonFieldConflicts != null)\n message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts);\n if (object.features != null) {\n if (typeof object.features !== \"object\")\n throw TypeError(\".google.protobuf.MessageOptions.features: object expected\");\n message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);\n }\n if (object.uninterpretedOption) {\n if (!Array.isArray(object.uninterpretedOption))\n throw TypeError(\".google.protobuf.MessageOptions.uninterpretedOption: array expected\");\n message.uninterpretedOption = [];\n for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n if (typeof object.uninterpretedOption[i] !== \"object\")\n throw TypeError(\".google.protobuf.MessageOptions.uninterpretedOption: object expected\");\n message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n }\n }\n if (object[\".google.api.resource\"] != null) {\n if (typeof object[\".google.api.resource\"] !== \"object\")\n throw TypeError(\".google.protobuf.MessageOptions..google.api.resource: object expected\");\n message[\".google.api.resource\"] = $root.google.api.ResourceDescriptor.fromObject(object[\".google.api.resource\"]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a MessageOptions message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.MessageOptions\n * @static\n * @param {google.protobuf.MessageOptions} message MessageOptions\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n MessageOptions.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.uninterpretedOption = [];\n if (options.defaults) {\n object.messageSetWireFormat = false;\n object.noStandardDescriptorAccessor = false;\n object.deprecated = false;\n object.mapEntry = false;\n object.deprecatedLegacyJsonFieldConflicts = false;\n object.features = null;\n object[\".google.api.resource\"] = null;\n }\n if (message.messageSetWireFormat != null && message.hasOwnProperty(\"messageSetWireFormat\"))\n object.messageSetWireFormat = message.messageSetWireFormat;\n if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty(\"noStandardDescriptorAccessor\"))\n object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor;\n if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n object.deprecated = message.deprecated;\n if (message.mapEntry != null && message.hasOwnProperty(\"mapEntry\"))\n object.mapEntry = message.mapEntry;\n if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty(\"deprecatedLegacyJsonFieldConflicts\"))\n object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts;\n if (message.features != null && message.hasOwnProperty(\"features\"))\n object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);\n if (message.uninterpretedOption && message.uninterpretedOption.length) {\n object.uninterpretedOption = [];\n for (var j = 0; j < message.uninterpretedOption.length; ++j)\n object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n }\n if (message[\".google.api.resource\"] != null && message.hasOwnProperty(\".google.api.resource\"))\n object[\".google.api.resource\"] = $root.google.api.ResourceDescriptor.toObject(message[\".google.api.resource\"], options);\n return object;\n };\n \n /**\n * Converts this MessageOptions to JSON.\n * @function toJSON\n * @memberof google.protobuf.MessageOptions\n * @instance\n * @returns {Object.} JSON object\n */\n MessageOptions.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for MessageOptions\n * @function getTypeUrl\n * @memberof google.protobuf.MessageOptions\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.MessageOptions\";\n };\n \n return MessageOptions;\n })();\n \n protobuf.FieldOptions = (function() {\n \n /**\n * Properties of a FieldOptions.\n * @memberof google.protobuf\n * @interface IFieldOptions\n * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype\n * @property {boolean|null} [packed] FieldOptions packed\n * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype\n * @property {boolean|null} [lazy] FieldOptions lazy\n * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy\n * @property {boolean|null} [deprecated] FieldOptions deprecated\n * @property {boolean|null} [weak] FieldOptions weak\n * @property {boolean|null} [debugRedact] FieldOptions debugRedact\n * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention\n * @property {Array.|null} [targets] FieldOptions targets\n * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults\n * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features\n * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption\n * @property {Array.|null} [\".google.api.fieldBehavior\"] FieldOptions .google.api.fieldBehavior\n * @property {google.api.IResourceReference|null} [\".google.api.resourceReference\"] FieldOptions .google.api.resourceReference\n */\n \n /**\n * Constructs a new FieldOptions.\n * @memberof google.protobuf\n * @classdesc Represents a FieldOptions.\n * @implements IFieldOptions\n * @constructor\n * @param {google.protobuf.IFieldOptions=} [properties] Properties to set\n */\n function FieldOptions(properties) {\n this.targets = [];\n this.editionDefaults = [];\n this.uninterpretedOption = [];\n this[\".google.api.fieldBehavior\"] = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * FieldOptions ctype.\n * @member {google.protobuf.FieldOptions.CType} ctype\n * @memberof google.protobuf.FieldOptions\n * @instance\n */\n FieldOptions.prototype.ctype = 0;\n \n /**\n * FieldOptions packed.\n * @member {boolean} packed\n * @memberof google.protobuf.FieldOptions\n * @instance\n */\n FieldOptions.prototype.packed = false;\n \n /**\n * FieldOptions jstype.\n * @member {google.protobuf.FieldOptions.JSType} jstype\n * @memberof google.protobuf.FieldOptions\n * @instance\n */\n FieldOptions.prototype.jstype = 0;\n \n /**\n * FieldOptions lazy.\n * @member {boolean} lazy\n * @memberof google.protobuf.FieldOptions\n * @instance\n */\n FieldOptions.prototype.lazy = false;\n \n /**\n * FieldOptions unverifiedLazy.\n * @member {boolean} unverifiedLazy\n * @memberof google.protobuf.FieldOptions\n * @instance\n */\n FieldOptions.prototype.unverifiedLazy = false;\n \n /**\n * FieldOptions deprecated.\n * @member {boolean} deprecated\n * @memberof google.protobuf.FieldOptions\n * @instance\n */\n FieldOptions.prototype.deprecated = false;\n \n /**\n * FieldOptions weak.\n * @member {boolean} weak\n * @memberof google.protobuf.FieldOptions\n * @instance\n */\n FieldOptions.prototype.weak = false;\n \n /**\n * FieldOptions debugRedact.\n * @member {boolean} debugRedact\n * @memberof google.protobuf.FieldOptions\n * @instance\n */\n FieldOptions.prototype.debugRedact = false;\n \n /**\n * FieldOptions retention.\n * @member {google.protobuf.FieldOptions.OptionRetention} retention\n * @memberof google.protobuf.FieldOptions\n * @instance\n */\n FieldOptions.prototype.retention = 0;\n \n /**\n * FieldOptions targets.\n * @member {Array.} targets\n * @memberof google.protobuf.FieldOptions\n * @instance\n */\n FieldOptions.prototype.targets = $util.emptyArray;\n \n /**\n * FieldOptions editionDefaults.\n * @member {Array.} editionDefaults\n * @memberof google.protobuf.FieldOptions\n * @instance\n */\n FieldOptions.prototype.editionDefaults = $util.emptyArray;\n \n /**\n * FieldOptions features.\n * @member {google.protobuf.IFeatureSet|null|undefined} features\n * @memberof google.protobuf.FieldOptions\n * @instance\n */\n FieldOptions.prototype.features = null;\n \n /**\n * FieldOptions uninterpretedOption.\n * @member {Array.} uninterpretedOption\n * @memberof google.protobuf.FieldOptions\n * @instance\n */\n FieldOptions.prototype.uninterpretedOption = $util.emptyArray;\n \n /**\n * FieldOptions .google.api.fieldBehavior.\n * @member {Array.} .google.api.fieldBehavior\n * @memberof google.protobuf.FieldOptions\n * @instance\n */\n FieldOptions.prototype[\".google.api.fieldBehavior\"] = $util.emptyArray;\n \n /**\n * FieldOptions .google.api.resourceReference.\n * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference\n * @memberof google.protobuf.FieldOptions\n * @instance\n */\n FieldOptions.prototype[\".google.api.resourceReference\"] = null;\n \n /**\n * Creates a new FieldOptions instance using the specified properties.\n * @function create\n * @memberof google.protobuf.FieldOptions\n * @static\n * @param {google.protobuf.IFieldOptions=} [properties] Properties to set\n * @returns {google.protobuf.FieldOptions} FieldOptions instance\n */\n FieldOptions.create = function create(properties) {\n return new FieldOptions(properties);\n };\n \n /**\n * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.FieldOptions\n * @static\n * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FieldOptions.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.ctype != null && Object.hasOwnProperty.call(message, \"ctype\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype);\n if (message.packed != null && Object.hasOwnProperty.call(message, \"packed\"))\n writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed);\n if (message.deprecated != null && Object.hasOwnProperty.call(message, \"deprecated\"))\n writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);\n if (message.lazy != null && Object.hasOwnProperty.call(message, \"lazy\"))\n writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy);\n if (message.jstype != null && Object.hasOwnProperty.call(message, \"jstype\"))\n writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype);\n if (message.weak != null && Object.hasOwnProperty.call(message, \"weak\"))\n writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak);\n if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, \"unverifiedLazy\"))\n writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy);\n if (message.debugRedact != null && Object.hasOwnProperty.call(message, \"debugRedact\"))\n writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact);\n if (message.retention != null && Object.hasOwnProperty.call(message, \"retention\"))\n writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention);\n if (message.targets != null && message.targets.length)\n for (var i = 0; i < message.targets.length; ++i)\n writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]);\n if (message.editionDefaults != null && message.editionDefaults.length)\n for (var i = 0; i < message.editionDefaults.length; ++i)\n $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim();\n if (message.features != null && Object.hasOwnProperty.call(message, \"features\"))\n $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim();\n if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n for (var i = 0; i < message.uninterpretedOption.length; ++i)\n $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n if (message[\".google.api.fieldBehavior\"] != null && message[\".google.api.fieldBehavior\"].length) {\n writer.uint32(/* id 1052, wireType 2 =*/8418).fork();\n for (var i = 0; i < message[\".google.api.fieldBehavior\"].length; ++i)\n writer.int32(message[\".google.api.fieldBehavior\"][i]);\n writer.ldelim();\n }\n if (message[\".google.api.resourceReference\"] != null && Object.hasOwnProperty.call(message, \".google.api.resourceReference\"))\n $root.google.api.ResourceReference.encode(message[\".google.api.resourceReference\"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.FieldOptions\n * @static\n * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FieldOptions.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a FieldOptions message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.FieldOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.FieldOptions} FieldOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FieldOptions.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.ctype = reader.int32();\n break;\n }\n case 2: {\n message.packed = reader.bool();\n break;\n }\n case 6: {\n message.jstype = reader.int32();\n break;\n }\n case 5: {\n message.lazy = reader.bool();\n break;\n }\n case 15: {\n message.unverifiedLazy = reader.bool();\n break;\n }\n case 3: {\n message.deprecated = reader.bool();\n break;\n }\n case 10: {\n message.weak = reader.bool();\n break;\n }\n case 16: {\n message.debugRedact = reader.bool();\n break;\n }\n case 17: {\n message.retention = reader.int32();\n break;\n }\n case 19: {\n if (!(message.targets && message.targets.length))\n message.targets = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.targets.push(reader.int32());\n } else\n message.targets.push(reader.int32());\n break;\n }\n case 20: {\n if (!(message.editionDefaults && message.editionDefaults.length))\n message.editionDefaults = [];\n message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32()));\n break;\n }\n case 21: {\n message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());\n break;\n }\n case 999: {\n if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n message.uninterpretedOption = [];\n message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n break;\n }\n case 1052: {\n if (!(message[\".google.api.fieldBehavior\"] && message[\".google.api.fieldBehavior\"].length))\n message[\".google.api.fieldBehavior\"] = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message[\".google.api.fieldBehavior\"].push(reader.int32());\n } else\n message[\".google.api.fieldBehavior\"].push(reader.int32());\n break;\n }\n case 1055: {\n message[\".google.api.resourceReference\"] = $root.google.api.ResourceReference.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a FieldOptions message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.FieldOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.FieldOptions} FieldOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FieldOptions.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a FieldOptions message.\n * @function verify\n * @memberof google.protobuf.FieldOptions\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n FieldOptions.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.ctype != null && message.hasOwnProperty(\"ctype\"))\n switch (message.ctype) {\n default:\n return \"ctype: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.packed != null && message.hasOwnProperty(\"packed\"))\n if (typeof message.packed !== \"boolean\")\n return \"packed: boolean expected\";\n if (message.jstype != null && message.hasOwnProperty(\"jstype\"))\n switch (message.jstype) {\n default:\n return \"jstype: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.lazy != null && message.hasOwnProperty(\"lazy\"))\n if (typeof message.lazy !== \"boolean\")\n return \"lazy: boolean expected\";\n if (message.unverifiedLazy != null && message.hasOwnProperty(\"unverifiedLazy\"))\n if (typeof message.unverifiedLazy !== \"boolean\")\n return \"unverifiedLazy: boolean expected\";\n if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n if (typeof message.deprecated !== \"boolean\")\n return \"deprecated: boolean expected\";\n if (message.weak != null && message.hasOwnProperty(\"weak\"))\n if (typeof message.weak !== \"boolean\")\n return \"weak: boolean expected\";\n if (message.debugRedact != null && message.hasOwnProperty(\"debugRedact\"))\n if (typeof message.debugRedact !== \"boolean\")\n return \"debugRedact: boolean expected\";\n if (message.retention != null && message.hasOwnProperty(\"retention\"))\n switch (message.retention) {\n default:\n return \"retention: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.targets != null && message.hasOwnProperty(\"targets\")) {\n if (!Array.isArray(message.targets))\n return \"targets: array expected\";\n for (var i = 0; i < message.targets.length; ++i)\n switch (message.targets[i]) {\n default:\n return \"targets: enum value[] expected\";\n case 0:\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n case 7:\n case 8:\n case 9:\n break;\n }\n }\n if (message.editionDefaults != null && message.hasOwnProperty(\"editionDefaults\")) {\n if (!Array.isArray(message.editionDefaults))\n return \"editionDefaults: array expected\";\n for (var i = 0; i < message.editionDefaults.length; ++i) {\n var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]);\n if (error)\n return \"editionDefaults.\" + error;\n }\n }\n if (message.features != null && message.hasOwnProperty(\"features\")) {\n var error = $root.google.protobuf.FeatureSet.verify(message.features);\n if (error)\n return \"features.\" + error;\n }\n if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n if (!Array.isArray(message.uninterpretedOption))\n return \"uninterpretedOption: array expected\";\n for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n if (error)\n return \"uninterpretedOption.\" + error;\n }\n }\n if (message[\".google.api.fieldBehavior\"] != null && message.hasOwnProperty(\".google.api.fieldBehavior\")) {\n if (!Array.isArray(message[\".google.api.fieldBehavior\"]))\n return \".google.api.fieldBehavior: array expected\";\n for (var i = 0; i < message[\".google.api.fieldBehavior\"].length; ++i)\n switch (message[\".google.api.fieldBehavior\"][i]) {\n default:\n return \".google.api.fieldBehavior: enum value[] expected\";\n case 0:\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n case 7:\n case 8:\n break;\n }\n }\n if (message[\".google.api.resourceReference\"] != null && message.hasOwnProperty(\".google.api.resourceReference\")) {\n var error = $root.google.api.ResourceReference.verify(message[\".google.api.resourceReference\"]);\n if (error)\n return \".google.api.resourceReference.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.FieldOptions\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.FieldOptions} FieldOptions\n */\n FieldOptions.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.FieldOptions)\n return object;\n var message = new $root.google.protobuf.FieldOptions();\n switch (object.ctype) {\n default:\n if (typeof object.ctype === \"number\") {\n message.ctype = object.ctype;\n break;\n }\n break;\n case \"STRING\":\n case 0:\n message.ctype = 0;\n break;\n case \"CORD\":\n case 1:\n message.ctype = 1;\n break;\n case \"STRING_PIECE\":\n case 2:\n message.ctype = 2;\n break;\n }\n if (object.packed != null)\n message.packed = Boolean(object.packed);\n switch (object.jstype) {\n default:\n if (typeof object.jstype === \"number\") {\n message.jstype = object.jstype;\n break;\n }\n break;\n case \"JS_NORMAL\":\n case 0:\n message.jstype = 0;\n break;\n case \"JS_STRING\":\n case 1:\n message.jstype = 1;\n break;\n case \"JS_NUMBER\":\n case 2:\n message.jstype = 2;\n break;\n }\n if (object.lazy != null)\n message.lazy = Boolean(object.lazy);\n if (object.unverifiedLazy != null)\n message.unverifiedLazy = Boolean(object.unverifiedLazy);\n if (object.deprecated != null)\n message.deprecated = Boolean(object.deprecated);\n if (object.weak != null)\n message.weak = Boolean(object.weak);\n if (object.debugRedact != null)\n message.debugRedact = Boolean(object.debugRedact);\n switch (object.retention) {\n default:\n if (typeof object.retention === \"number\") {\n message.retention = object.retention;\n break;\n }\n break;\n case \"RETENTION_UNKNOWN\":\n case 0:\n message.retention = 0;\n break;\n case \"RETENTION_RUNTIME\":\n case 1:\n message.retention = 1;\n break;\n case \"RETENTION_SOURCE\":\n case 2:\n message.retention = 2;\n break;\n }\n if (object.targets) {\n if (!Array.isArray(object.targets))\n throw TypeError(\".google.protobuf.FieldOptions.targets: array expected\");\n message.targets = [];\n for (var i = 0; i < object.targets.length; ++i)\n switch (object.targets[i]) {\n default:\n if (typeof object.targets[i] === \"number\") {\n message.targets[i] = object.targets[i];\n break;\n }\n case \"TARGET_TYPE_UNKNOWN\":\n case 0:\n message.targets[i] = 0;\n break;\n case \"TARGET_TYPE_FILE\":\n case 1:\n message.targets[i] = 1;\n break;\n case \"TARGET_TYPE_EXTENSION_RANGE\":\n case 2:\n message.targets[i] = 2;\n break;\n case \"TARGET_TYPE_MESSAGE\":\n case 3:\n message.targets[i] = 3;\n break;\n case \"TARGET_TYPE_FIELD\":\n case 4:\n message.targets[i] = 4;\n break;\n case \"TARGET_TYPE_ONEOF\":\n case 5:\n message.targets[i] = 5;\n break;\n case \"TARGET_TYPE_ENUM\":\n case 6:\n message.targets[i] = 6;\n break;\n case \"TARGET_TYPE_ENUM_ENTRY\":\n case 7:\n message.targets[i] = 7;\n break;\n case \"TARGET_TYPE_SERVICE\":\n case 8:\n message.targets[i] = 8;\n break;\n case \"TARGET_TYPE_METHOD\":\n case 9:\n message.targets[i] = 9;\n break;\n }\n }\n if (object.editionDefaults) {\n if (!Array.isArray(object.editionDefaults))\n throw TypeError(\".google.protobuf.FieldOptions.editionDefaults: array expected\");\n message.editionDefaults = [];\n for (var i = 0; i < object.editionDefaults.length; ++i) {\n if (typeof object.editionDefaults[i] !== \"object\")\n throw TypeError(\".google.protobuf.FieldOptions.editionDefaults: object expected\");\n message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]);\n }\n }\n if (object.features != null) {\n if (typeof object.features !== \"object\")\n throw TypeError(\".google.protobuf.FieldOptions.features: object expected\");\n message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);\n }\n if (object.uninterpretedOption) {\n if (!Array.isArray(object.uninterpretedOption))\n throw TypeError(\".google.protobuf.FieldOptions.uninterpretedOption: array expected\");\n message.uninterpretedOption = [];\n for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n if (typeof object.uninterpretedOption[i] !== \"object\")\n throw TypeError(\".google.protobuf.FieldOptions.uninterpretedOption: object expected\");\n message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n }\n }\n if (object[\".google.api.fieldBehavior\"]) {\n if (!Array.isArray(object[\".google.api.fieldBehavior\"]))\n throw TypeError(\".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected\");\n message[\".google.api.fieldBehavior\"] = [];\n for (var i = 0; i < object[\".google.api.fieldBehavior\"].length; ++i)\n switch (object[\".google.api.fieldBehavior\"][i]) {\n default:\n if (typeof object[\".google.api.fieldBehavior\"][i] === \"number\") {\n message[\".google.api.fieldBehavior\"][i] = object[\".google.api.fieldBehavior\"][i];\n break;\n }\n case \"FIELD_BEHAVIOR_UNSPECIFIED\":\n case 0:\n message[\".google.api.fieldBehavior\"][i] = 0;\n break;\n case \"OPTIONAL\":\n case 1:\n message[\".google.api.fieldBehavior\"][i] = 1;\n break;\n case \"REQUIRED\":\n case 2:\n message[\".google.api.fieldBehavior\"][i] = 2;\n break;\n case \"OUTPUT_ONLY\":\n case 3:\n message[\".google.api.fieldBehavior\"][i] = 3;\n break;\n case \"INPUT_ONLY\":\n case 4:\n message[\".google.api.fieldBehavior\"][i] = 4;\n break;\n case \"IMMUTABLE\":\n case 5:\n message[\".google.api.fieldBehavior\"][i] = 5;\n break;\n case \"UNORDERED_LIST\":\n case 6:\n message[\".google.api.fieldBehavior\"][i] = 6;\n break;\n case \"NON_EMPTY_DEFAULT\":\n case 7:\n message[\".google.api.fieldBehavior\"][i] = 7;\n break;\n case \"IDENTIFIER\":\n case 8:\n message[\".google.api.fieldBehavior\"][i] = 8;\n break;\n }\n }\n if (object[\".google.api.resourceReference\"] != null) {\n if (typeof object[\".google.api.resourceReference\"] !== \"object\")\n throw TypeError(\".google.protobuf.FieldOptions..google.api.resourceReference: object expected\");\n message[\".google.api.resourceReference\"] = $root.google.api.ResourceReference.fromObject(object[\".google.api.resourceReference\"]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a FieldOptions message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.FieldOptions\n * @static\n * @param {google.protobuf.FieldOptions} message FieldOptions\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n FieldOptions.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.targets = [];\n object.editionDefaults = [];\n object.uninterpretedOption = [];\n object[\".google.api.fieldBehavior\"] = [];\n }\n if (options.defaults) {\n object.ctype = options.enums === String ? \"STRING\" : 0;\n object.packed = false;\n object.deprecated = false;\n object.lazy = false;\n object.jstype = options.enums === String ? \"JS_NORMAL\" : 0;\n object.weak = false;\n object.unverifiedLazy = false;\n object.debugRedact = false;\n object.retention = options.enums === String ? \"RETENTION_UNKNOWN\" : 0;\n object.features = null;\n object[\".google.api.resourceReference\"] = null;\n }\n if (message.ctype != null && message.hasOwnProperty(\"ctype\"))\n object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype;\n if (message.packed != null && message.hasOwnProperty(\"packed\"))\n object.packed = message.packed;\n if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n object.deprecated = message.deprecated;\n if (message.lazy != null && message.hasOwnProperty(\"lazy\"))\n object.lazy = message.lazy;\n if (message.jstype != null && message.hasOwnProperty(\"jstype\"))\n object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype;\n if (message.weak != null && message.hasOwnProperty(\"weak\"))\n object.weak = message.weak;\n if (message.unverifiedLazy != null && message.hasOwnProperty(\"unverifiedLazy\"))\n object.unverifiedLazy = message.unverifiedLazy;\n if (message.debugRedact != null && message.hasOwnProperty(\"debugRedact\"))\n object.debugRedact = message.debugRedact;\n if (message.retention != null && message.hasOwnProperty(\"retention\"))\n object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention;\n if (message.targets && message.targets.length) {\n object.targets = [];\n for (var j = 0; j < message.targets.length; ++j)\n object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j];\n }\n if (message.editionDefaults && message.editionDefaults.length) {\n object.editionDefaults = [];\n for (var j = 0; j < message.editionDefaults.length; ++j)\n object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options);\n }\n if (message.features != null && message.hasOwnProperty(\"features\"))\n object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);\n if (message.uninterpretedOption && message.uninterpretedOption.length) {\n object.uninterpretedOption = [];\n for (var j = 0; j < message.uninterpretedOption.length; ++j)\n object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n }\n if (message[\".google.api.fieldBehavior\"] && message[\".google.api.fieldBehavior\"].length) {\n object[\".google.api.fieldBehavior\"] = [];\n for (var j = 0; j < message[\".google.api.fieldBehavior\"].length; ++j)\n object[\".google.api.fieldBehavior\"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[\".google.api.fieldBehavior\"][j]] === undefined ? message[\".google.api.fieldBehavior\"][j] : $root.google.api.FieldBehavior[message[\".google.api.fieldBehavior\"][j]] : message[\".google.api.fieldBehavior\"][j];\n }\n if (message[\".google.api.resourceReference\"] != null && message.hasOwnProperty(\".google.api.resourceReference\"))\n object[\".google.api.resourceReference\"] = $root.google.api.ResourceReference.toObject(message[\".google.api.resourceReference\"], options);\n return object;\n };\n \n /**\n * Converts this FieldOptions to JSON.\n * @function toJSON\n * @memberof google.protobuf.FieldOptions\n * @instance\n * @returns {Object.} JSON object\n */\n FieldOptions.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for FieldOptions\n * @function getTypeUrl\n * @memberof google.protobuf.FieldOptions\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.FieldOptions\";\n };\n \n /**\n * CType enum.\n * @name google.protobuf.FieldOptions.CType\n * @enum {number}\n * @property {number} STRING=0 STRING value\n * @property {number} CORD=1 CORD value\n * @property {number} STRING_PIECE=2 STRING_PIECE value\n */\n FieldOptions.CType = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"STRING\"] = 0;\n values[valuesById[1] = \"CORD\"] = 1;\n values[valuesById[2] = \"STRING_PIECE\"] = 2;\n return values;\n })();\n \n /**\n * JSType enum.\n * @name google.protobuf.FieldOptions.JSType\n * @enum {number}\n * @property {number} JS_NORMAL=0 JS_NORMAL value\n * @property {number} JS_STRING=1 JS_STRING value\n * @property {number} JS_NUMBER=2 JS_NUMBER value\n */\n FieldOptions.JSType = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"JS_NORMAL\"] = 0;\n values[valuesById[1] = \"JS_STRING\"] = 1;\n values[valuesById[2] = \"JS_NUMBER\"] = 2;\n return values;\n })();\n \n /**\n * OptionRetention enum.\n * @name google.protobuf.FieldOptions.OptionRetention\n * @enum {number}\n * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value\n * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value\n * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value\n */\n FieldOptions.OptionRetention = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"RETENTION_UNKNOWN\"] = 0;\n values[valuesById[1] = \"RETENTION_RUNTIME\"] = 1;\n values[valuesById[2] = \"RETENTION_SOURCE\"] = 2;\n return values;\n })();\n \n /**\n * OptionTargetType enum.\n * @name google.protobuf.FieldOptions.OptionTargetType\n * @enum {number}\n * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value\n * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value\n * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value\n * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value\n * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value\n * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value\n * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value\n * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value\n * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value\n * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value\n */\n FieldOptions.OptionTargetType = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"TARGET_TYPE_UNKNOWN\"] = 0;\n values[valuesById[1] = \"TARGET_TYPE_FILE\"] = 1;\n values[valuesById[2] = \"TARGET_TYPE_EXTENSION_RANGE\"] = 2;\n values[valuesById[3] = \"TARGET_TYPE_MESSAGE\"] = 3;\n values[valuesById[4] = \"TARGET_TYPE_FIELD\"] = 4;\n values[valuesById[5] = \"TARGET_TYPE_ONEOF\"] = 5;\n values[valuesById[6] = \"TARGET_TYPE_ENUM\"] = 6;\n values[valuesById[7] = \"TARGET_TYPE_ENUM_ENTRY\"] = 7;\n values[valuesById[8] = \"TARGET_TYPE_SERVICE\"] = 8;\n values[valuesById[9] = \"TARGET_TYPE_METHOD\"] = 9;\n return values;\n })();\n \n FieldOptions.EditionDefault = (function() {\n \n /**\n * Properties of an EditionDefault.\n * @memberof google.protobuf.FieldOptions\n * @interface IEditionDefault\n * @property {google.protobuf.Edition|null} [edition] EditionDefault edition\n * @property {string|null} [value] EditionDefault value\n */\n \n /**\n * Constructs a new EditionDefault.\n * @memberof google.protobuf.FieldOptions\n * @classdesc Represents an EditionDefault.\n * @implements IEditionDefault\n * @constructor\n * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set\n */\n function EditionDefault(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * EditionDefault edition.\n * @member {google.protobuf.Edition} edition\n * @memberof google.protobuf.FieldOptions.EditionDefault\n * @instance\n */\n EditionDefault.prototype.edition = 0;\n \n /**\n * EditionDefault value.\n * @member {string} value\n * @memberof google.protobuf.FieldOptions.EditionDefault\n * @instance\n */\n EditionDefault.prototype.value = \"\";\n \n /**\n * Creates a new EditionDefault instance using the specified properties.\n * @function create\n * @memberof google.protobuf.FieldOptions.EditionDefault\n * @static\n * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set\n * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance\n */\n EditionDefault.create = function create(properties) {\n return new EditionDefault(properties);\n };\n \n /**\n * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.FieldOptions.EditionDefault\n * @static\n * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n EditionDefault.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.value != null && Object.hasOwnProperty.call(message, \"value\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.value);\n if (message.edition != null && Object.hasOwnProperty.call(message, \"edition\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition);\n return writer;\n };\n \n /**\n * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.FieldOptions.EditionDefault\n * @static\n * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n EditionDefault.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an EditionDefault message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.FieldOptions.EditionDefault\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n EditionDefault.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 3: {\n message.edition = reader.int32();\n break;\n }\n case 2: {\n message.value = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an EditionDefault message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.FieldOptions.EditionDefault\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n EditionDefault.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an EditionDefault message.\n * @function verify\n * @memberof google.protobuf.FieldOptions.EditionDefault\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n EditionDefault.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.edition != null && message.hasOwnProperty(\"edition\"))\n switch (message.edition) {\n default:\n return \"edition: enum value expected\";\n case 0:\n case 998:\n case 999:\n case 1000:\n case 1001:\n case 1:\n case 2:\n case 99997:\n case 99998:\n case 99999:\n case 2147483647:\n break;\n }\n if (message.value != null && message.hasOwnProperty(\"value\"))\n if (!$util.isString(message.value))\n return \"value: string expected\";\n return null;\n };\n \n /**\n * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.FieldOptions.EditionDefault\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault\n */\n EditionDefault.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault)\n return object;\n var message = new $root.google.protobuf.FieldOptions.EditionDefault();\n switch (object.edition) {\n default:\n if (typeof object.edition === \"number\") {\n message.edition = object.edition;\n break;\n }\n break;\n case \"EDITION_UNKNOWN\":\n case 0:\n message.edition = 0;\n break;\n case \"EDITION_PROTO2\":\n case 998:\n message.edition = 998;\n break;\n case \"EDITION_PROTO3\":\n case 999:\n message.edition = 999;\n break;\n case \"EDITION_2023\":\n case 1000:\n message.edition = 1000;\n break;\n case \"EDITION_2024\":\n case 1001:\n message.edition = 1001;\n break;\n case \"EDITION_1_TEST_ONLY\":\n case 1:\n message.edition = 1;\n break;\n case \"EDITION_2_TEST_ONLY\":\n case 2:\n message.edition = 2;\n break;\n case \"EDITION_99997_TEST_ONLY\":\n case 99997:\n message.edition = 99997;\n break;\n case \"EDITION_99998_TEST_ONLY\":\n case 99998:\n message.edition = 99998;\n break;\n case \"EDITION_99999_TEST_ONLY\":\n case 99999:\n message.edition = 99999;\n break;\n case \"EDITION_MAX\":\n case 2147483647:\n message.edition = 2147483647;\n break;\n }\n if (object.value != null)\n message.value = String(object.value);\n return message;\n };\n \n /**\n * Creates a plain object from an EditionDefault message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.FieldOptions.EditionDefault\n * @static\n * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n EditionDefault.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.value = \"\";\n object.edition = options.enums === String ? \"EDITION_UNKNOWN\" : 0;\n }\n if (message.value != null && message.hasOwnProperty(\"value\"))\n object.value = message.value;\n if (message.edition != null && message.hasOwnProperty(\"edition\"))\n object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition;\n return object;\n };\n \n /**\n * Converts this EditionDefault to JSON.\n * @function toJSON\n * @memberof google.protobuf.FieldOptions.EditionDefault\n * @instance\n * @returns {Object.} JSON object\n */\n EditionDefault.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for EditionDefault\n * @function getTypeUrl\n * @memberof google.protobuf.FieldOptions.EditionDefault\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.FieldOptions.EditionDefault\";\n };\n \n return EditionDefault;\n })();\n \n return FieldOptions;\n })();\n \n protobuf.OneofOptions = (function() {\n \n /**\n * Properties of an OneofOptions.\n * @memberof google.protobuf\n * @interface IOneofOptions\n * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features\n * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption\n */\n \n /**\n * Constructs a new OneofOptions.\n * @memberof google.protobuf\n * @classdesc Represents an OneofOptions.\n * @implements IOneofOptions\n * @constructor\n * @param {google.protobuf.IOneofOptions=} [properties] Properties to set\n */\n function OneofOptions(properties) {\n this.uninterpretedOption = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * OneofOptions features.\n * @member {google.protobuf.IFeatureSet|null|undefined} features\n * @memberof google.protobuf.OneofOptions\n * @instance\n */\n OneofOptions.prototype.features = null;\n \n /**\n * OneofOptions uninterpretedOption.\n * @member {Array.} uninterpretedOption\n * @memberof google.protobuf.OneofOptions\n * @instance\n */\n OneofOptions.prototype.uninterpretedOption = $util.emptyArray;\n \n /**\n * Creates a new OneofOptions instance using the specified properties.\n * @function create\n * @memberof google.protobuf.OneofOptions\n * @static\n * @param {google.protobuf.IOneofOptions=} [properties] Properties to set\n * @returns {google.protobuf.OneofOptions} OneofOptions instance\n */\n OneofOptions.create = function create(properties) {\n return new OneofOptions(properties);\n };\n \n /**\n * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.OneofOptions\n * @static\n * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OneofOptions.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.features != null && Object.hasOwnProperty.call(message, \"features\"))\n $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n for (var i = 0; i < message.uninterpretedOption.length; ++i)\n $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.OneofOptions\n * @static\n * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OneofOptions.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an OneofOptions message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.OneofOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.OneofOptions} OneofOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OneofOptions.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());\n break;\n }\n case 999: {\n if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n message.uninterpretedOption = [];\n message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an OneofOptions message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.OneofOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.OneofOptions} OneofOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OneofOptions.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an OneofOptions message.\n * @function verify\n * @memberof google.protobuf.OneofOptions\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n OneofOptions.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.features != null && message.hasOwnProperty(\"features\")) {\n var error = $root.google.protobuf.FeatureSet.verify(message.features);\n if (error)\n return \"features.\" + error;\n }\n if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n if (!Array.isArray(message.uninterpretedOption))\n return \"uninterpretedOption: array expected\";\n for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n if (error)\n return \"uninterpretedOption.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.OneofOptions\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.OneofOptions} OneofOptions\n */\n OneofOptions.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.OneofOptions)\n return object;\n var message = new $root.google.protobuf.OneofOptions();\n if (object.features != null) {\n if (typeof object.features !== \"object\")\n throw TypeError(\".google.protobuf.OneofOptions.features: object expected\");\n message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);\n }\n if (object.uninterpretedOption) {\n if (!Array.isArray(object.uninterpretedOption))\n throw TypeError(\".google.protobuf.OneofOptions.uninterpretedOption: array expected\");\n message.uninterpretedOption = [];\n for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n if (typeof object.uninterpretedOption[i] !== \"object\")\n throw TypeError(\".google.protobuf.OneofOptions.uninterpretedOption: object expected\");\n message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from an OneofOptions message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.OneofOptions\n * @static\n * @param {google.protobuf.OneofOptions} message OneofOptions\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n OneofOptions.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.uninterpretedOption = [];\n if (options.defaults)\n object.features = null;\n if (message.features != null && message.hasOwnProperty(\"features\"))\n object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);\n if (message.uninterpretedOption && message.uninterpretedOption.length) {\n object.uninterpretedOption = [];\n for (var j = 0; j < message.uninterpretedOption.length; ++j)\n object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n }\n return object;\n };\n \n /**\n * Converts this OneofOptions to JSON.\n * @function toJSON\n * @memberof google.protobuf.OneofOptions\n * @instance\n * @returns {Object.} JSON object\n */\n OneofOptions.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for OneofOptions\n * @function getTypeUrl\n * @memberof google.protobuf.OneofOptions\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.OneofOptions\";\n };\n \n return OneofOptions;\n })();\n \n protobuf.EnumOptions = (function() {\n \n /**\n * Properties of an EnumOptions.\n * @memberof google.protobuf\n * @interface IEnumOptions\n * @property {boolean|null} [allowAlias] EnumOptions allowAlias\n * @property {boolean|null} [deprecated] EnumOptions deprecated\n * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts\n * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features\n * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption\n */\n \n /**\n * Constructs a new EnumOptions.\n * @memberof google.protobuf\n * @classdesc Represents an EnumOptions.\n * @implements IEnumOptions\n * @constructor\n * @param {google.protobuf.IEnumOptions=} [properties] Properties to set\n */\n function EnumOptions(properties) {\n this.uninterpretedOption = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * EnumOptions allowAlias.\n * @member {boolean} allowAlias\n * @memberof google.protobuf.EnumOptions\n * @instance\n */\n EnumOptions.prototype.allowAlias = false;\n \n /**\n * EnumOptions deprecated.\n * @member {boolean} deprecated\n * @memberof google.protobuf.EnumOptions\n * @instance\n */\n EnumOptions.prototype.deprecated = false;\n \n /**\n * EnumOptions deprecatedLegacyJsonFieldConflicts.\n * @member {boolean} deprecatedLegacyJsonFieldConflicts\n * @memberof google.protobuf.EnumOptions\n * @instance\n */\n EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false;\n \n /**\n * EnumOptions features.\n * @member {google.protobuf.IFeatureSet|null|undefined} features\n * @memberof google.protobuf.EnumOptions\n * @instance\n */\n EnumOptions.prototype.features = null;\n \n /**\n * EnumOptions uninterpretedOption.\n * @member {Array.} uninterpretedOption\n * @memberof google.protobuf.EnumOptions\n * @instance\n */\n EnumOptions.prototype.uninterpretedOption = $util.emptyArray;\n \n /**\n * Creates a new EnumOptions instance using the specified properties.\n * @function create\n * @memberof google.protobuf.EnumOptions\n * @static\n * @param {google.protobuf.IEnumOptions=} [properties] Properties to set\n * @returns {google.protobuf.EnumOptions} EnumOptions instance\n */\n EnumOptions.create = function create(properties) {\n return new EnumOptions(properties);\n };\n \n /**\n * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.EnumOptions\n * @static\n * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n EnumOptions.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.allowAlias != null && Object.hasOwnProperty.call(message, \"allowAlias\"))\n writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias);\n if (message.deprecated != null && Object.hasOwnProperty.call(message, \"deprecated\"))\n writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);\n if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, \"deprecatedLegacyJsonFieldConflicts\"))\n writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts);\n if (message.features != null && Object.hasOwnProperty.call(message, \"features\"))\n $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n for (var i = 0; i < message.uninterpretedOption.length; ++i)\n $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.EnumOptions\n * @static\n * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n EnumOptions.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an EnumOptions message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.EnumOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.EnumOptions} EnumOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n EnumOptions.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n message.allowAlias = reader.bool();\n break;\n }\n case 3: {\n message.deprecated = reader.bool();\n break;\n }\n case 6: {\n message.deprecatedLegacyJsonFieldConflicts = reader.bool();\n break;\n }\n case 7: {\n message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());\n break;\n }\n case 999: {\n if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n message.uninterpretedOption = [];\n message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an EnumOptions message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.EnumOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.EnumOptions} EnumOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n EnumOptions.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an EnumOptions message.\n * @function verify\n * @memberof google.protobuf.EnumOptions\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n EnumOptions.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.allowAlias != null && message.hasOwnProperty(\"allowAlias\"))\n if (typeof message.allowAlias !== \"boolean\")\n return \"allowAlias: boolean expected\";\n if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n if (typeof message.deprecated !== \"boolean\")\n return \"deprecated: boolean expected\";\n if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty(\"deprecatedLegacyJsonFieldConflicts\"))\n if (typeof message.deprecatedLegacyJsonFieldConflicts !== \"boolean\")\n return \"deprecatedLegacyJsonFieldConflicts: boolean expected\";\n if (message.features != null && message.hasOwnProperty(\"features\")) {\n var error = $root.google.protobuf.FeatureSet.verify(message.features);\n if (error)\n return \"features.\" + error;\n }\n if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n if (!Array.isArray(message.uninterpretedOption))\n return \"uninterpretedOption: array expected\";\n for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n if (error)\n return \"uninterpretedOption.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.EnumOptions\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.EnumOptions} EnumOptions\n */\n EnumOptions.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.EnumOptions)\n return object;\n var message = new $root.google.protobuf.EnumOptions();\n if (object.allowAlias != null)\n message.allowAlias = Boolean(object.allowAlias);\n if (object.deprecated != null)\n message.deprecated = Boolean(object.deprecated);\n if (object.deprecatedLegacyJsonFieldConflicts != null)\n message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts);\n if (object.features != null) {\n if (typeof object.features !== \"object\")\n throw TypeError(\".google.protobuf.EnumOptions.features: object expected\");\n message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);\n }\n if (object.uninterpretedOption) {\n if (!Array.isArray(object.uninterpretedOption))\n throw TypeError(\".google.protobuf.EnumOptions.uninterpretedOption: array expected\");\n message.uninterpretedOption = [];\n for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n if (typeof object.uninterpretedOption[i] !== \"object\")\n throw TypeError(\".google.protobuf.EnumOptions.uninterpretedOption: object expected\");\n message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from an EnumOptions message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.EnumOptions\n * @static\n * @param {google.protobuf.EnumOptions} message EnumOptions\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n EnumOptions.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.uninterpretedOption = [];\n if (options.defaults) {\n object.allowAlias = false;\n object.deprecated = false;\n object.deprecatedLegacyJsonFieldConflicts = false;\n object.features = null;\n }\n if (message.allowAlias != null && message.hasOwnProperty(\"allowAlias\"))\n object.allowAlias = message.allowAlias;\n if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n object.deprecated = message.deprecated;\n if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty(\"deprecatedLegacyJsonFieldConflicts\"))\n object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts;\n if (message.features != null && message.hasOwnProperty(\"features\"))\n object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);\n if (message.uninterpretedOption && message.uninterpretedOption.length) {\n object.uninterpretedOption = [];\n for (var j = 0; j < message.uninterpretedOption.length; ++j)\n object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n }\n return object;\n };\n \n /**\n * Converts this EnumOptions to JSON.\n * @function toJSON\n * @memberof google.protobuf.EnumOptions\n * @instance\n * @returns {Object.} JSON object\n */\n EnumOptions.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for EnumOptions\n * @function getTypeUrl\n * @memberof google.protobuf.EnumOptions\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.EnumOptions\";\n };\n \n return EnumOptions;\n })();\n \n protobuf.EnumValueOptions = (function() {\n \n /**\n * Properties of an EnumValueOptions.\n * @memberof google.protobuf\n * @interface IEnumValueOptions\n * @property {boolean|null} [deprecated] EnumValueOptions deprecated\n * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features\n * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact\n * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption\n */\n \n /**\n * Constructs a new EnumValueOptions.\n * @memberof google.protobuf\n * @classdesc Represents an EnumValueOptions.\n * @implements IEnumValueOptions\n * @constructor\n * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set\n */\n function EnumValueOptions(properties) {\n this.uninterpretedOption = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * EnumValueOptions deprecated.\n * @member {boolean} deprecated\n * @memberof google.protobuf.EnumValueOptions\n * @instance\n */\n EnumValueOptions.prototype.deprecated = false;\n \n /**\n * EnumValueOptions features.\n * @member {google.protobuf.IFeatureSet|null|undefined} features\n * @memberof google.protobuf.EnumValueOptions\n * @instance\n */\n EnumValueOptions.prototype.features = null;\n \n /**\n * EnumValueOptions debugRedact.\n * @member {boolean} debugRedact\n * @memberof google.protobuf.EnumValueOptions\n * @instance\n */\n EnumValueOptions.prototype.debugRedact = false;\n \n /**\n * EnumValueOptions uninterpretedOption.\n * @member {Array.} uninterpretedOption\n * @memberof google.protobuf.EnumValueOptions\n * @instance\n */\n EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray;\n \n /**\n * Creates a new EnumValueOptions instance using the specified properties.\n * @function create\n * @memberof google.protobuf.EnumValueOptions\n * @static\n * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set\n * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance\n */\n EnumValueOptions.create = function create(properties) {\n return new EnumValueOptions(properties);\n };\n \n /**\n * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.EnumValueOptions\n * @static\n * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n EnumValueOptions.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.deprecated != null && Object.hasOwnProperty.call(message, \"deprecated\"))\n writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated);\n if (message.features != null && Object.hasOwnProperty.call(message, \"features\"))\n $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.debugRedact != null && Object.hasOwnProperty.call(message, \"debugRedact\"))\n writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact);\n if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n for (var i = 0; i < message.uninterpretedOption.length; ++i)\n $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.EnumValueOptions\n * @static\n * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an EnumValueOptions message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.EnumValueOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.EnumValueOptions} EnumValueOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n EnumValueOptions.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.deprecated = reader.bool();\n break;\n }\n case 2: {\n message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());\n break;\n }\n case 3: {\n message.debugRedact = reader.bool();\n break;\n }\n case 999: {\n if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n message.uninterpretedOption = [];\n message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.EnumValueOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.EnumValueOptions} EnumValueOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n EnumValueOptions.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an EnumValueOptions message.\n * @function verify\n * @memberof google.protobuf.EnumValueOptions\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n EnumValueOptions.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n if (typeof message.deprecated !== \"boolean\")\n return \"deprecated: boolean expected\";\n if (message.features != null && message.hasOwnProperty(\"features\")) {\n var error = $root.google.protobuf.FeatureSet.verify(message.features);\n if (error)\n return \"features.\" + error;\n }\n if (message.debugRedact != null && message.hasOwnProperty(\"debugRedact\"))\n if (typeof message.debugRedact !== \"boolean\")\n return \"debugRedact: boolean expected\";\n if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n if (!Array.isArray(message.uninterpretedOption))\n return \"uninterpretedOption: array expected\";\n for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n if (error)\n return \"uninterpretedOption.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.EnumValueOptions\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.EnumValueOptions} EnumValueOptions\n */\n EnumValueOptions.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.EnumValueOptions)\n return object;\n var message = new $root.google.protobuf.EnumValueOptions();\n if (object.deprecated != null)\n message.deprecated = Boolean(object.deprecated);\n if (object.features != null) {\n if (typeof object.features !== \"object\")\n throw TypeError(\".google.protobuf.EnumValueOptions.features: object expected\");\n message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);\n }\n if (object.debugRedact != null)\n message.debugRedact = Boolean(object.debugRedact);\n if (object.uninterpretedOption) {\n if (!Array.isArray(object.uninterpretedOption))\n throw TypeError(\".google.protobuf.EnumValueOptions.uninterpretedOption: array expected\");\n message.uninterpretedOption = [];\n for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n if (typeof object.uninterpretedOption[i] !== \"object\")\n throw TypeError(\".google.protobuf.EnumValueOptions.uninterpretedOption: object expected\");\n message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.EnumValueOptions\n * @static\n * @param {google.protobuf.EnumValueOptions} message EnumValueOptions\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n EnumValueOptions.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.uninterpretedOption = [];\n if (options.defaults) {\n object.deprecated = false;\n object.features = null;\n object.debugRedact = false;\n }\n if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n object.deprecated = message.deprecated;\n if (message.features != null && message.hasOwnProperty(\"features\"))\n object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);\n if (message.debugRedact != null && message.hasOwnProperty(\"debugRedact\"))\n object.debugRedact = message.debugRedact;\n if (message.uninterpretedOption && message.uninterpretedOption.length) {\n object.uninterpretedOption = [];\n for (var j = 0; j < message.uninterpretedOption.length; ++j)\n object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n }\n return object;\n };\n \n /**\n * Converts this EnumValueOptions to JSON.\n * @function toJSON\n * @memberof google.protobuf.EnumValueOptions\n * @instance\n * @returns {Object.} JSON object\n */\n EnumValueOptions.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for EnumValueOptions\n * @function getTypeUrl\n * @memberof google.protobuf.EnumValueOptions\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.EnumValueOptions\";\n };\n \n return EnumValueOptions;\n })();\n \n protobuf.ServiceOptions = (function() {\n \n /**\n * Properties of a ServiceOptions.\n * @memberof google.protobuf\n * @interface IServiceOptions\n * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features\n * @property {boolean|null} [deprecated] ServiceOptions deprecated\n * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption\n * @property {string|null} [\".google.api.defaultHost\"] ServiceOptions .google.api.defaultHost\n * @property {string|null} [\".google.api.oauthScopes\"] ServiceOptions .google.api.oauthScopes\n */\n \n /**\n * Constructs a new ServiceOptions.\n * @memberof google.protobuf\n * @classdesc Represents a ServiceOptions.\n * @implements IServiceOptions\n * @constructor\n * @param {google.protobuf.IServiceOptions=} [properties] Properties to set\n */\n function ServiceOptions(properties) {\n this.uninterpretedOption = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ServiceOptions features.\n * @member {google.protobuf.IFeatureSet|null|undefined} features\n * @memberof google.protobuf.ServiceOptions\n * @instance\n */\n ServiceOptions.prototype.features = null;\n \n /**\n * ServiceOptions deprecated.\n * @member {boolean} deprecated\n * @memberof google.protobuf.ServiceOptions\n * @instance\n */\n ServiceOptions.prototype.deprecated = false;\n \n /**\n * ServiceOptions uninterpretedOption.\n * @member {Array.} uninterpretedOption\n * @memberof google.protobuf.ServiceOptions\n * @instance\n */\n ServiceOptions.prototype.uninterpretedOption = $util.emptyArray;\n \n /**\n * ServiceOptions .google.api.defaultHost.\n * @member {string} .google.api.defaultHost\n * @memberof google.protobuf.ServiceOptions\n * @instance\n */\n ServiceOptions.prototype[\".google.api.defaultHost\"] = \"\";\n \n /**\n * ServiceOptions .google.api.oauthScopes.\n * @member {string} .google.api.oauthScopes\n * @memberof google.protobuf.ServiceOptions\n * @instance\n */\n ServiceOptions.prototype[\".google.api.oauthScopes\"] = \"\";\n \n /**\n * Creates a new ServiceOptions instance using the specified properties.\n * @function create\n * @memberof google.protobuf.ServiceOptions\n * @static\n * @param {google.protobuf.IServiceOptions=} [properties] Properties to set\n * @returns {google.protobuf.ServiceOptions} ServiceOptions instance\n */\n ServiceOptions.create = function create(properties) {\n return new ServiceOptions(properties);\n };\n \n /**\n * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.ServiceOptions\n * @static\n * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ServiceOptions.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.deprecated != null && Object.hasOwnProperty.call(message, \"deprecated\"))\n writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated);\n if (message.features != null && Object.hasOwnProperty.call(message, \"features\"))\n $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim();\n if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n for (var i = 0; i < message.uninterpretedOption.length; ++i)\n $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n if (message[\".google.api.defaultHost\"] != null && Object.hasOwnProperty.call(message, \".google.api.defaultHost\"))\n writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[\".google.api.defaultHost\"]);\n if (message[\".google.api.oauthScopes\"] != null && Object.hasOwnProperty.call(message, \".google.api.oauthScopes\"))\n writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[\".google.api.oauthScopes\"]);\n return writer;\n };\n \n /**\n * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.ServiceOptions\n * @static\n * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ServiceOptions message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.ServiceOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.ServiceOptions} ServiceOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ServiceOptions.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 34: {\n message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());\n break;\n }\n case 33: {\n message.deprecated = reader.bool();\n break;\n }\n case 999: {\n if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n message.uninterpretedOption = [];\n message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n break;\n }\n case 1049: {\n message[\".google.api.defaultHost\"] = reader.string();\n break;\n }\n case 1050: {\n message[\".google.api.oauthScopes\"] = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ServiceOptions message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.ServiceOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.ServiceOptions} ServiceOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ServiceOptions.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ServiceOptions message.\n * @function verify\n * @memberof google.protobuf.ServiceOptions\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ServiceOptions.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.features != null && message.hasOwnProperty(\"features\")) {\n var error = $root.google.protobuf.FeatureSet.verify(message.features);\n if (error)\n return \"features.\" + error;\n }\n if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n if (typeof message.deprecated !== \"boolean\")\n return \"deprecated: boolean expected\";\n if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n if (!Array.isArray(message.uninterpretedOption))\n return \"uninterpretedOption: array expected\";\n for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n if (error)\n return \"uninterpretedOption.\" + error;\n }\n }\n if (message[\".google.api.defaultHost\"] != null && message.hasOwnProperty(\".google.api.defaultHost\"))\n if (!$util.isString(message[\".google.api.defaultHost\"]))\n return \".google.api.defaultHost: string expected\";\n if (message[\".google.api.oauthScopes\"] != null && message.hasOwnProperty(\".google.api.oauthScopes\"))\n if (!$util.isString(message[\".google.api.oauthScopes\"]))\n return \".google.api.oauthScopes: string expected\";\n return null;\n };\n \n /**\n * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.ServiceOptions\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.ServiceOptions} ServiceOptions\n */\n ServiceOptions.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.ServiceOptions)\n return object;\n var message = new $root.google.protobuf.ServiceOptions();\n if (object.features != null) {\n if (typeof object.features !== \"object\")\n throw TypeError(\".google.protobuf.ServiceOptions.features: object expected\");\n message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);\n }\n if (object.deprecated != null)\n message.deprecated = Boolean(object.deprecated);\n if (object.uninterpretedOption) {\n if (!Array.isArray(object.uninterpretedOption))\n throw TypeError(\".google.protobuf.ServiceOptions.uninterpretedOption: array expected\");\n message.uninterpretedOption = [];\n for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n if (typeof object.uninterpretedOption[i] !== \"object\")\n throw TypeError(\".google.protobuf.ServiceOptions.uninterpretedOption: object expected\");\n message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n }\n }\n if (object[\".google.api.defaultHost\"] != null)\n message[\".google.api.defaultHost\"] = String(object[\".google.api.defaultHost\"]);\n if (object[\".google.api.oauthScopes\"] != null)\n message[\".google.api.oauthScopes\"] = String(object[\".google.api.oauthScopes\"]);\n return message;\n };\n \n /**\n * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.ServiceOptions\n * @static\n * @param {google.protobuf.ServiceOptions} message ServiceOptions\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ServiceOptions.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.uninterpretedOption = [];\n if (options.defaults) {\n object.deprecated = false;\n object.features = null;\n object[\".google.api.defaultHost\"] = \"\";\n object[\".google.api.oauthScopes\"] = \"\";\n }\n if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n object.deprecated = message.deprecated;\n if (message.features != null && message.hasOwnProperty(\"features\"))\n object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);\n if (message.uninterpretedOption && message.uninterpretedOption.length) {\n object.uninterpretedOption = [];\n for (var j = 0; j < message.uninterpretedOption.length; ++j)\n object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n }\n if (message[\".google.api.defaultHost\"] != null && message.hasOwnProperty(\".google.api.defaultHost\"))\n object[\".google.api.defaultHost\"] = message[\".google.api.defaultHost\"];\n if (message[\".google.api.oauthScopes\"] != null && message.hasOwnProperty(\".google.api.oauthScopes\"))\n object[\".google.api.oauthScopes\"] = message[\".google.api.oauthScopes\"];\n return object;\n };\n \n /**\n * Converts this ServiceOptions to JSON.\n * @function toJSON\n * @memberof google.protobuf.ServiceOptions\n * @instance\n * @returns {Object.} JSON object\n */\n ServiceOptions.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ServiceOptions\n * @function getTypeUrl\n * @memberof google.protobuf.ServiceOptions\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.ServiceOptions\";\n };\n \n return ServiceOptions;\n })();\n \n protobuf.MethodOptions = (function() {\n \n /**\n * Properties of a MethodOptions.\n * @memberof google.protobuf\n * @interface IMethodOptions\n * @property {boolean|null} [deprecated] MethodOptions deprecated\n * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel\n * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features\n * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption\n * @property {google.api.IHttpRule|null} [\".google.api.http\"] MethodOptions .google.api.http\n * @property {Array.|null} [\".google.api.methodSignature\"] MethodOptions .google.api.methodSignature\n * @property {google.longrunning.IOperationInfo|null} [\".google.longrunning.operationInfo\"] MethodOptions .google.longrunning.operationInfo\n */\n \n /**\n * Constructs a new MethodOptions.\n * @memberof google.protobuf\n * @classdesc Represents a MethodOptions.\n * @implements IMethodOptions\n * @constructor\n * @param {google.protobuf.IMethodOptions=} [properties] Properties to set\n */\n function MethodOptions(properties) {\n this.uninterpretedOption = [];\n this[\".google.api.methodSignature\"] = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * MethodOptions deprecated.\n * @member {boolean} deprecated\n * @memberof google.protobuf.MethodOptions\n * @instance\n */\n MethodOptions.prototype.deprecated = false;\n \n /**\n * MethodOptions idempotencyLevel.\n * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel\n * @memberof google.protobuf.MethodOptions\n * @instance\n */\n MethodOptions.prototype.idempotencyLevel = 0;\n \n /**\n * MethodOptions features.\n * @member {google.protobuf.IFeatureSet|null|undefined} features\n * @memberof google.protobuf.MethodOptions\n * @instance\n */\n MethodOptions.prototype.features = null;\n \n /**\n * MethodOptions uninterpretedOption.\n * @member {Array.} uninterpretedOption\n * @memberof google.protobuf.MethodOptions\n * @instance\n */\n MethodOptions.prototype.uninterpretedOption = $util.emptyArray;\n \n /**\n * MethodOptions .google.api.http.\n * @member {google.api.IHttpRule|null|undefined} .google.api.http\n * @memberof google.protobuf.MethodOptions\n * @instance\n */\n MethodOptions.prototype[\".google.api.http\"] = null;\n \n /**\n * MethodOptions .google.api.methodSignature.\n * @member {Array.} .google.api.methodSignature\n * @memberof google.protobuf.MethodOptions\n * @instance\n */\n MethodOptions.prototype[\".google.api.methodSignature\"] = $util.emptyArray;\n \n /**\n * MethodOptions .google.longrunning.operationInfo.\n * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo\n * @memberof google.protobuf.MethodOptions\n * @instance\n */\n MethodOptions.prototype[\".google.longrunning.operationInfo\"] = null;\n \n /**\n * Creates a new MethodOptions instance using the specified properties.\n * @function create\n * @memberof google.protobuf.MethodOptions\n * @static\n * @param {google.protobuf.IMethodOptions=} [properties] Properties to set\n * @returns {google.protobuf.MethodOptions} MethodOptions instance\n */\n MethodOptions.create = function create(properties) {\n return new MethodOptions(properties);\n };\n \n /**\n * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.MethodOptions\n * @static\n * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MethodOptions.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.deprecated != null && Object.hasOwnProperty.call(message, \"deprecated\"))\n writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated);\n if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, \"idempotencyLevel\"))\n writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel);\n if (message.features != null && Object.hasOwnProperty.call(message, \"features\"))\n $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim();\n if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n for (var i = 0; i < message.uninterpretedOption.length; ++i)\n $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n if (message[\".google.longrunning.operationInfo\"] != null && Object.hasOwnProperty.call(message, \".google.longrunning.operationInfo\"))\n $root.google.longrunning.OperationInfo.encode(message[\".google.longrunning.operationInfo\"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim();\n if (message[\".google.api.methodSignature\"] != null && message[\".google.api.methodSignature\"].length)\n for (var i = 0; i < message[\".google.api.methodSignature\"].length; ++i)\n writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[\".google.api.methodSignature\"][i]);\n if (message[\".google.api.http\"] != null && Object.hasOwnProperty.call(message, \".google.api.http\"))\n $root.google.api.HttpRule.encode(message[\".google.api.http\"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.MethodOptions\n * @static\n * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n MethodOptions.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a MethodOptions message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.MethodOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.MethodOptions} MethodOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MethodOptions.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 33: {\n message.deprecated = reader.bool();\n break;\n }\n case 34: {\n message.idempotencyLevel = reader.int32();\n break;\n }\n case 35: {\n message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());\n break;\n }\n case 999: {\n if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n message.uninterpretedOption = [];\n message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n break;\n }\n case 72295728: {\n message[\".google.api.http\"] = $root.google.api.HttpRule.decode(reader, reader.uint32());\n break;\n }\n case 1051: {\n if (!(message[\".google.api.methodSignature\"] && message[\".google.api.methodSignature\"].length))\n message[\".google.api.methodSignature\"] = [];\n message[\".google.api.methodSignature\"].push(reader.string());\n break;\n }\n case 1049: {\n message[\".google.longrunning.operationInfo\"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a MethodOptions message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.MethodOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.MethodOptions} MethodOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n MethodOptions.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a MethodOptions message.\n * @function verify\n * @memberof google.protobuf.MethodOptions\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n MethodOptions.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n if (typeof message.deprecated !== \"boolean\")\n return \"deprecated: boolean expected\";\n if (message.idempotencyLevel != null && message.hasOwnProperty(\"idempotencyLevel\"))\n switch (message.idempotencyLevel) {\n default:\n return \"idempotencyLevel: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.features != null && message.hasOwnProperty(\"features\")) {\n var error = $root.google.protobuf.FeatureSet.verify(message.features);\n if (error)\n return \"features.\" + error;\n }\n if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n if (!Array.isArray(message.uninterpretedOption))\n return \"uninterpretedOption: array expected\";\n for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n if (error)\n return \"uninterpretedOption.\" + error;\n }\n }\n if (message[\".google.api.http\"] != null && message.hasOwnProperty(\".google.api.http\")) {\n var error = $root.google.api.HttpRule.verify(message[\".google.api.http\"]);\n if (error)\n return \".google.api.http.\" + error;\n }\n if (message[\".google.api.methodSignature\"] != null && message.hasOwnProperty(\".google.api.methodSignature\")) {\n if (!Array.isArray(message[\".google.api.methodSignature\"]))\n return \".google.api.methodSignature: array expected\";\n for (var i = 0; i < message[\".google.api.methodSignature\"].length; ++i)\n if (!$util.isString(message[\".google.api.methodSignature\"][i]))\n return \".google.api.methodSignature: string[] expected\";\n }\n if (message[\".google.longrunning.operationInfo\"] != null && message.hasOwnProperty(\".google.longrunning.operationInfo\")) {\n var error = $root.google.longrunning.OperationInfo.verify(message[\".google.longrunning.operationInfo\"]);\n if (error)\n return \".google.longrunning.operationInfo.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.MethodOptions\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.MethodOptions} MethodOptions\n */\n MethodOptions.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.MethodOptions)\n return object;\n var message = new $root.google.protobuf.MethodOptions();\n if (object.deprecated != null)\n message.deprecated = Boolean(object.deprecated);\n switch (object.idempotencyLevel) {\n default:\n if (typeof object.idempotencyLevel === \"number\") {\n message.idempotencyLevel = object.idempotencyLevel;\n break;\n }\n break;\n case \"IDEMPOTENCY_UNKNOWN\":\n case 0:\n message.idempotencyLevel = 0;\n break;\n case \"NO_SIDE_EFFECTS\":\n case 1:\n message.idempotencyLevel = 1;\n break;\n case \"IDEMPOTENT\":\n case 2:\n message.idempotencyLevel = 2;\n break;\n }\n if (object.features != null) {\n if (typeof object.features !== \"object\")\n throw TypeError(\".google.protobuf.MethodOptions.features: object expected\");\n message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);\n }\n if (object.uninterpretedOption) {\n if (!Array.isArray(object.uninterpretedOption))\n throw TypeError(\".google.protobuf.MethodOptions.uninterpretedOption: array expected\");\n message.uninterpretedOption = [];\n for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n if (typeof object.uninterpretedOption[i] !== \"object\")\n throw TypeError(\".google.protobuf.MethodOptions.uninterpretedOption: object expected\");\n message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n }\n }\n if (object[\".google.api.http\"] != null) {\n if (typeof object[\".google.api.http\"] !== \"object\")\n throw TypeError(\".google.protobuf.MethodOptions..google.api.http: object expected\");\n message[\".google.api.http\"] = $root.google.api.HttpRule.fromObject(object[\".google.api.http\"]);\n }\n if (object[\".google.api.methodSignature\"]) {\n if (!Array.isArray(object[\".google.api.methodSignature\"]))\n throw TypeError(\".google.protobuf.MethodOptions..google.api.methodSignature: array expected\");\n message[\".google.api.methodSignature\"] = [];\n for (var i = 0; i < object[\".google.api.methodSignature\"].length; ++i)\n message[\".google.api.methodSignature\"][i] = String(object[\".google.api.methodSignature\"][i]);\n }\n if (object[\".google.longrunning.operationInfo\"] != null) {\n if (typeof object[\".google.longrunning.operationInfo\"] !== \"object\")\n throw TypeError(\".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected\");\n message[\".google.longrunning.operationInfo\"] = $root.google.longrunning.OperationInfo.fromObject(object[\".google.longrunning.operationInfo\"]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a MethodOptions message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.MethodOptions\n * @static\n * @param {google.protobuf.MethodOptions} message MethodOptions\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n MethodOptions.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.uninterpretedOption = [];\n object[\".google.api.methodSignature\"] = [];\n }\n if (options.defaults) {\n object.deprecated = false;\n object.idempotencyLevel = options.enums === String ? \"IDEMPOTENCY_UNKNOWN\" : 0;\n object.features = null;\n object[\".google.longrunning.operationInfo\"] = null;\n object[\".google.api.http\"] = null;\n }\n if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n object.deprecated = message.deprecated;\n if (message.idempotencyLevel != null && message.hasOwnProperty(\"idempotencyLevel\"))\n object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel;\n if (message.features != null && message.hasOwnProperty(\"features\"))\n object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);\n if (message.uninterpretedOption && message.uninterpretedOption.length) {\n object.uninterpretedOption = [];\n for (var j = 0; j < message.uninterpretedOption.length; ++j)\n object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n }\n if (message[\".google.longrunning.operationInfo\"] != null && message.hasOwnProperty(\".google.longrunning.operationInfo\"))\n object[\".google.longrunning.operationInfo\"] = $root.google.longrunning.OperationInfo.toObject(message[\".google.longrunning.operationInfo\"], options);\n if (message[\".google.api.methodSignature\"] && message[\".google.api.methodSignature\"].length) {\n object[\".google.api.methodSignature\"] = [];\n for (var j = 0; j < message[\".google.api.methodSignature\"].length; ++j)\n object[\".google.api.methodSignature\"][j] = message[\".google.api.methodSignature\"][j];\n }\n if (message[\".google.api.http\"] != null && message.hasOwnProperty(\".google.api.http\"))\n object[\".google.api.http\"] = $root.google.api.HttpRule.toObject(message[\".google.api.http\"], options);\n return object;\n };\n \n /**\n * Converts this MethodOptions to JSON.\n * @function toJSON\n * @memberof google.protobuf.MethodOptions\n * @instance\n * @returns {Object.} JSON object\n */\n MethodOptions.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for MethodOptions\n * @function getTypeUrl\n * @memberof google.protobuf.MethodOptions\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.MethodOptions\";\n };\n \n /**\n * IdempotencyLevel enum.\n * @name google.protobuf.MethodOptions.IdempotencyLevel\n * @enum {number}\n * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value\n * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value\n * @property {number} IDEMPOTENT=2 IDEMPOTENT value\n */\n MethodOptions.IdempotencyLevel = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"IDEMPOTENCY_UNKNOWN\"] = 0;\n values[valuesById[1] = \"NO_SIDE_EFFECTS\"] = 1;\n values[valuesById[2] = \"IDEMPOTENT\"] = 2;\n return values;\n })();\n \n return MethodOptions;\n })();\n \n protobuf.UninterpretedOption = (function() {\n \n /**\n * Properties of an UninterpretedOption.\n * @memberof google.protobuf\n * @interface IUninterpretedOption\n * @property {Array.|null} [name] UninterpretedOption name\n * @property {string|null} [identifierValue] UninterpretedOption identifierValue\n * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue\n * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue\n * @property {number|null} [doubleValue] UninterpretedOption doubleValue\n * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue\n * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue\n */\n \n /**\n * Constructs a new UninterpretedOption.\n * @memberof google.protobuf\n * @classdesc Represents an UninterpretedOption.\n * @implements IUninterpretedOption\n * @constructor\n * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set\n */\n function UninterpretedOption(properties) {\n this.name = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * UninterpretedOption name.\n * @member {Array.} name\n * @memberof google.protobuf.UninterpretedOption\n * @instance\n */\n UninterpretedOption.prototype.name = $util.emptyArray;\n \n /**\n * UninterpretedOption identifierValue.\n * @member {string} identifierValue\n * @memberof google.protobuf.UninterpretedOption\n * @instance\n */\n UninterpretedOption.prototype.identifierValue = \"\";\n \n /**\n * UninterpretedOption positiveIntValue.\n * @member {number|Long} positiveIntValue\n * @memberof google.protobuf.UninterpretedOption\n * @instance\n */\n UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0;\n \n /**\n * UninterpretedOption negativeIntValue.\n * @member {number|Long} negativeIntValue\n * @memberof google.protobuf.UninterpretedOption\n * @instance\n */\n UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n \n /**\n * UninterpretedOption doubleValue.\n * @member {number} doubleValue\n * @memberof google.protobuf.UninterpretedOption\n * @instance\n */\n UninterpretedOption.prototype.doubleValue = 0;\n \n /**\n * UninterpretedOption stringValue.\n * @member {Uint8Array} stringValue\n * @memberof google.protobuf.UninterpretedOption\n * @instance\n */\n UninterpretedOption.prototype.stringValue = $util.newBuffer([]);\n \n /**\n * UninterpretedOption aggregateValue.\n * @member {string} aggregateValue\n * @memberof google.protobuf.UninterpretedOption\n * @instance\n */\n UninterpretedOption.prototype.aggregateValue = \"\";\n \n /**\n * Creates a new UninterpretedOption instance using the specified properties.\n * @function create\n * @memberof google.protobuf.UninterpretedOption\n * @static\n * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set\n * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance\n */\n UninterpretedOption.create = function create(properties) {\n return new UninterpretedOption(properties);\n };\n \n /**\n * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.UninterpretedOption\n * @static\n * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UninterpretedOption.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && message.name.length)\n for (var i = 0; i < message.name.length; ++i)\n $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.identifierValue != null && Object.hasOwnProperty.call(message, \"identifierValue\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue);\n if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, \"positiveIntValue\"))\n writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue);\n if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, \"negativeIntValue\"))\n writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue);\n if (message.doubleValue != null && Object.hasOwnProperty.call(message, \"doubleValue\"))\n writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue);\n if (message.stringValue != null && Object.hasOwnProperty.call(message, \"stringValue\"))\n writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue);\n if (message.aggregateValue != null && Object.hasOwnProperty.call(message, \"aggregateValue\"))\n writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue);\n return writer;\n };\n \n /**\n * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.UninterpretedOption\n * @static\n * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an UninterpretedOption message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.UninterpretedOption\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.UninterpretedOption} UninterpretedOption\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UninterpretedOption.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n if (!(message.name && message.name.length))\n message.name = [];\n message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32()));\n break;\n }\n case 3: {\n message.identifierValue = reader.string();\n break;\n }\n case 4: {\n message.positiveIntValue = reader.uint64();\n break;\n }\n case 5: {\n message.negativeIntValue = reader.int64();\n break;\n }\n case 6: {\n message.doubleValue = reader.double();\n break;\n }\n case 7: {\n message.stringValue = reader.bytes();\n break;\n }\n case 8: {\n message.aggregateValue = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.UninterpretedOption\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.UninterpretedOption} UninterpretedOption\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n UninterpretedOption.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an UninterpretedOption message.\n * @function verify\n * @memberof google.protobuf.UninterpretedOption\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n UninterpretedOption.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\")) {\n if (!Array.isArray(message.name))\n return \"name: array expected\";\n for (var i = 0; i < message.name.length; ++i) {\n var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]);\n if (error)\n return \"name.\" + error;\n }\n }\n if (message.identifierValue != null && message.hasOwnProperty(\"identifierValue\"))\n if (!$util.isString(message.identifierValue))\n return \"identifierValue: string expected\";\n if (message.positiveIntValue != null && message.hasOwnProperty(\"positiveIntValue\"))\n if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high)))\n return \"positiveIntValue: integer|Long expected\";\n if (message.negativeIntValue != null && message.hasOwnProperty(\"negativeIntValue\"))\n if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high)))\n return \"negativeIntValue: integer|Long expected\";\n if (message.doubleValue != null && message.hasOwnProperty(\"doubleValue\"))\n if (typeof message.doubleValue !== \"number\")\n return \"doubleValue: number expected\";\n if (message.stringValue != null && message.hasOwnProperty(\"stringValue\"))\n if (!(message.stringValue && typeof message.stringValue.length === \"number\" || $util.isString(message.stringValue)))\n return \"stringValue: buffer expected\";\n if (message.aggregateValue != null && message.hasOwnProperty(\"aggregateValue\"))\n if (!$util.isString(message.aggregateValue))\n return \"aggregateValue: string expected\";\n return null;\n };\n \n /**\n * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.UninterpretedOption\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.UninterpretedOption} UninterpretedOption\n */\n UninterpretedOption.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.UninterpretedOption)\n return object;\n var message = new $root.google.protobuf.UninterpretedOption();\n if (object.name) {\n if (!Array.isArray(object.name))\n throw TypeError(\".google.protobuf.UninterpretedOption.name: array expected\");\n message.name = [];\n for (var i = 0; i < object.name.length; ++i) {\n if (typeof object.name[i] !== \"object\")\n throw TypeError(\".google.protobuf.UninterpretedOption.name: object expected\");\n message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]);\n }\n }\n if (object.identifierValue != null)\n message.identifierValue = String(object.identifierValue);\n if (object.positiveIntValue != null)\n if ($util.Long)\n (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true;\n else if (typeof object.positiveIntValue === \"string\")\n message.positiveIntValue = parseInt(object.positiveIntValue, 10);\n else if (typeof object.positiveIntValue === \"number\")\n message.positiveIntValue = object.positiveIntValue;\n else if (typeof object.positiveIntValue === \"object\")\n message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true);\n if (object.negativeIntValue != null)\n if ($util.Long)\n (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false;\n else if (typeof object.negativeIntValue === \"string\")\n message.negativeIntValue = parseInt(object.negativeIntValue, 10);\n else if (typeof object.negativeIntValue === \"number\")\n message.negativeIntValue = object.negativeIntValue;\n else if (typeof object.negativeIntValue === \"object\")\n message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber();\n if (object.doubleValue != null)\n message.doubleValue = Number(object.doubleValue);\n if (object.stringValue != null)\n if (typeof object.stringValue === \"string\")\n $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0);\n else if (object.stringValue.length >= 0)\n message.stringValue = object.stringValue;\n if (object.aggregateValue != null)\n message.aggregateValue = String(object.aggregateValue);\n return message;\n };\n \n /**\n * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.UninterpretedOption\n * @static\n * @param {google.protobuf.UninterpretedOption} message UninterpretedOption\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n UninterpretedOption.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.name = [];\n if (options.defaults) {\n object.identifierValue = \"\";\n if ($util.Long) {\n var long = new $util.Long(0, 0, true);\n object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.positiveIntValue = options.longs === String ? \"0\" : 0;\n if ($util.Long) {\n var long = new $util.Long(0, 0, false);\n object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.negativeIntValue = options.longs === String ? \"0\" : 0;\n object.doubleValue = 0;\n if (options.bytes === String)\n object.stringValue = \"\";\n else {\n object.stringValue = [];\n if (options.bytes !== Array)\n object.stringValue = $util.newBuffer(object.stringValue);\n }\n object.aggregateValue = \"\";\n }\n if (message.name && message.name.length) {\n object.name = [];\n for (var j = 0; j < message.name.length; ++j)\n object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options);\n }\n if (message.identifierValue != null && message.hasOwnProperty(\"identifierValue\"))\n object.identifierValue = message.identifierValue;\n if (message.positiveIntValue != null && message.hasOwnProperty(\"positiveIntValue\"))\n if (typeof message.positiveIntValue === \"number\")\n object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue;\n else\n object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue;\n if (message.negativeIntValue != null && message.hasOwnProperty(\"negativeIntValue\"))\n if (typeof message.negativeIntValue === \"number\")\n object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue;\n else\n object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue;\n if (message.doubleValue != null && message.hasOwnProperty(\"doubleValue\"))\n object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue;\n if (message.stringValue != null && message.hasOwnProperty(\"stringValue\"))\n object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue;\n if (message.aggregateValue != null && message.hasOwnProperty(\"aggregateValue\"))\n object.aggregateValue = message.aggregateValue;\n return object;\n };\n \n /**\n * Converts this UninterpretedOption to JSON.\n * @function toJSON\n * @memberof google.protobuf.UninterpretedOption\n * @instance\n * @returns {Object.} JSON object\n */\n UninterpretedOption.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for UninterpretedOption\n * @function getTypeUrl\n * @memberof google.protobuf.UninterpretedOption\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.UninterpretedOption\";\n };\n \n UninterpretedOption.NamePart = (function() {\n \n /**\n * Properties of a NamePart.\n * @memberof google.protobuf.UninterpretedOption\n * @interface INamePart\n * @property {string} namePart NamePart namePart\n * @property {boolean} isExtension NamePart isExtension\n */\n \n /**\n * Constructs a new NamePart.\n * @memberof google.protobuf.UninterpretedOption\n * @classdesc Represents a NamePart.\n * @implements INamePart\n * @constructor\n * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set\n */\n function NamePart(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * NamePart namePart.\n * @member {string} namePart\n * @memberof google.protobuf.UninterpretedOption.NamePart\n * @instance\n */\n NamePart.prototype.namePart = \"\";\n \n /**\n * NamePart isExtension.\n * @member {boolean} isExtension\n * @memberof google.protobuf.UninterpretedOption.NamePart\n * @instance\n */\n NamePart.prototype.isExtension = false;\n \n /**\n * Creates a new NamePart instance using the specified properties.\n * @function create\n * @memberof google.protobuf.UninterpretedOption.NamePart\n * @static\n * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set\n * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance\n */\n NamePart.create = function create(properties) {\n return new NamePart(properties);\n };\n \n /**\n * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.UninterpretedOption.NamePart\n * @static\n * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n NamePart.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart);\n writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension);\n return writer;\n };\n \n /**\n * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.UninterpretedOption.NamePart\n * @static\n * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n NamePart.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a NamePart message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.UninterpretedOption.NamePart\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n NamePart.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.namePart = reader.string();\n break;\n }\n case 2: {\n message.isExtension = reader.bool();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n if (!message.hasOwnProperty(\"namePart\"))\n throw $util.ProtocolError(\"missing required 'namePart'\", { instance: message });\n if (!message.hasOwnProperty(\"isExtension\"))\n throw $util.ProtocolError(\"missing required 'isExtension'\", { instance: message });\n return message;\n };\n \n /**\n * Decodes a NamePart message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.UninterpretedOption.NamePart\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n NamePart.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a NamePart message.\n * @function verify\n * @memberof google.protobuf.UninterpretedOption.NamePart\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n NamePart.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (!$util.isString(message.namePart))\n return \"namePart: string expected\";\n if (typeof message.isExtension !== \"boolean\")\n return \"isExtension: boolean expected\";\n return null;\n };\n \n /**\n * Creates a NamePart message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.UninterpretedOption.NamePart\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart\n */\n NamePart.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart)\n return object;\n var message = new $root.google.protobuf.UninterpretedOption.NamePart();\n if (object.namePart != null)\n message.namePart = String(object.namePart);\n if (object.isExtension != null)\n message.isExtension = Boolean(object.isExtension);\n return message;\n };\n \n /**\n * Creates a plain object from a NamePart message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.UninterpretedOption.NamePart\n * @static\n * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n NamePart.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.namePart = \"\";\n object.isExtension = false;\n }\n if (message.namePart != null && message.hasOwnProperty(\"namePart\"))\n object.namePart = message.namePart;\n if (message.isExtension != null && message.hasOwnProperty(\"isExtension\"))\n object.isExtension = message.isExtension;\n return object;\n };\n \n /**\n * Converts this NamePart to JSON.\n * @function toJSON\n * @memberof google.protobuf.UninterpretedOption.NamePart\n * @instance\n * @returns {Object.} JSON object\n */\n NamePart.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for NamePart\n * @function getTypeUrl\n * @memberof google.protobuf.UninterpretedOption.NamePart\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.UninterpretedOption.NamePart\";\n };\n \n return NamePart;\n })();\n \n return UninterpretedOption;\n })();\n \n protobuf.FeatureSet = (function() {\n \n /**\n * Properties of a FeatureSet.\n * @memberof google.protobuf\n * @interface IFeatureSet\n * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence\n * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType\n * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding\n * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation\n * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding\n * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat\n */\n \n /**\n * Constructs a new FeatureSet.\n * @memberof google.protobuf\n * @classdesc Represents a FeatureSet.\n * @implements IFeatureSet\n * @constructor\n * @param {google.protobuf.IFeatureSet=} [properties] Properties to set\n */\n function FeatureSet(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * FeatureSet fieldPresence.\n * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence\n * @memberof google.protobuf.FeatureSet\n * @instance\n */\n FeatureSet.prototype.fieldPresence = 0;\n \n /**\n * FeatureSet enumType.\n * @member {google.protobuf.FeatureSet.EnumType} enumType\n * @memberof google.protobuf.FeatureSet\n * @instance\n */\n FeatureSet.prototype.enumType = 0;\n \n /**\n * FeatureSet repeatedFieldEncoding.\n * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding\n * @memberof google.protobuf.FeatureSet\n * @instance\n */\n FeatureSet.prototype.repeatedFieldEncoding = 0;\n \n /**\n * FeatureSet utf8Validation.\n * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation\n * @memberof google.protobuf.FeatureSet\n * @instance\n */\n FeatureSet.prototype.utf8Validation = 0;\n \n /**\n * FeatureSet messageEncoding.\n * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding\n * @memberof google.protobuf.FeatureSet\n * @instance\n */\n FeatureSet.prototype.messageEncoding = 0;\n \n /**\n * FeatureSet jsonFormat.\n * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat\n * @memberof google.protobuf.FeatureSet\n * @instance\n */\n FeatureSet.prototype.jsonFormat = 0;\n \n /**\n * Creates a new FeatureSet instance using the specified properties.\n * @function create\n * @memberof google.protobuf.FeatureSet\n * @static\n * @param {google.protobuf.IFeatureSet=} [properties] Properties to set\n * @returns {google.protobuf.FeatureSet} FeatureSet instance\n */\n FeatureSet.create = function create(properties) {\n return new FeatureSet(properties);\n };\n \n /**\n * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.FeatureSet\n * @static\n * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FeatureSet.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.fieldPresence != null && Object.hasOwnProperty.call(message, \"fieldPresence\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence);\n if (message.enumType != null && Object.hasOwnProperty.call(message, \"enumType\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType);\n if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, \"repeatedFieldEncoding\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding);\n if (message.utf8Validation != null && Object.hasOwnProperty.call(message, \"utf8Validation\"))\n writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation);\n if (message.messageEncoding != null && Object.hasOwnProperty.call(message, \"messageEncoding\"))\n writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding);\n if (message.jsonFormat != null && Object.hasOwnProperty.call(message, \"jsonFormat\"))\n writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat);\n return writer;\n };\n \n /**\n * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.FeatureSet\n * @static\n * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FeatureSet.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a FeatureSet message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.FeatureSet\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.FeatureSet} FeatureSet\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FeatureSet.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.fieldPresence = reader.int32();\n break;\n }\n case 2: {\n message.enumType = reader.int32();\n break;\n }\n case 3: {\n message.repeatedFieldEncoding = reader.int32();\n break;\n }\n case 4: {\n message.utf8Validation = reader.int32();\n break;\n }\n case 5: {\n message.messageEncoding = reader.int32();\n break;\n }\n case 6: {\n message.jsonFormat = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a FeatureSet message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.FeatureSet\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.FeatureSet} FeatureSet\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FeatureSet.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a FeatureSet message.\n * @function verify\n * @memberof google.protobuf.FeatureSet\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n FeatureSet.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.fieldPresence != null && message.hasOwnProperty(\"fieldPresence\"))\n switch (message.fieldPresence) {\n default:\n return \"fieldPresence: enum value expected\";\n case 0:\n case 1:\n case 2:\n case 3:\n break;\n }\n if (message.enumType != null && message.hasOwnProperty(\"enumType\"))\n switch (message.enumType) {\n default:\n return \"enumType: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.repeatedFieldEncoding != null && message.hasOwnProperty(\"repeatedFieldEncoding\"))\n switch (message.repeatedFieldEncoding) {\n default:\n return \"repeatedFieldEncoding: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.utf8Validation != null && message.hasOwnProperty(\"utf8Validation\"))\n switch (message.utf8Validation) {\n default:\n return \"utf8Validation: enum value expected\";\n case 0:\n case 2:\n case 3:\n break;\n }\n if (message.messageEncoding != null && message.hasOwnProperty(\"messageEncoding\"))\n switch (message.messageEncoding) {\n default:\n return \"messageEncoding: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.jsonFormat != null && message.hasOwnProperty(\"jsonFormat\"))\n switch (message.jsonFormat) {\n default:\n return \"jsonFormat: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n return null;\n };\n \n /**\n * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.FeatureSet\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.FeatureSet} FeatureSet\n */\n FeatureSet.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.FeatureSet)\n return object;\n var message = new $root.google.protobuf.FeatureSet();\n switch (object.fieldPresence) {\n default:\n if (typeof object.fieldPresence === \"number\") {\n message.fieldPresence = object.fieldPresence;\n break;\n }\n break;\n case \"FIELD_PRESENCE_UNKNOWN\":\n case 0:\n message.fieldPresence = 0;\n break;\n case \"EXPLICIT\":\n case 1:\n message.fieldPresence = 1;\n break;\n case \"IMPLICIT\":\n case 2:\n message.fieldPresence = 2;\n break;\n case \"LEGACY_REQUIRED\":\n case 3:\n message.fieldPresence = 3;\n break;\n }\n switch (object.enumType) {\n default:\n if (typeof object.enumType === \"number\") {\n message.enumType = object.enumType;\n break;\n }\n break;\n case \"ENUM_TYPE_UNKNOWN\":\n case 0:\n message.enumType = 0;\n break;\n case \"OPEN\":\n case 1:\n message.enumType = 1;\n break;\n case \"CLOSED\":\n case 2:\n message.enumType = 2;\n break;\n }\n switch (object.repeatedFieldEncoding) {\n default:\n if (typeof object.repeatedFieldEncoding === \"number\") {\n message.repeatedFieldEncoding = object.repeatedFieldEncoding;\n break;\n }\n break;\n case \"REPEATED_FIELD_ENCODING_UNKNOWN\":\n case 0:\n message.repeatedFieldEncoding = 0;\n break;\n case \"PACKED\":\n case 1:\n message.repeatedFieldEncoding = 1;\n break;\n case \"EXPANDED\":\n case 2:\n message.repeatedFieldEncoding = 2;\n break;\n }\n switch (object.utf8Validation) {\n default:\n if (typeof object.utf8Validation === \"number\") {\n message.utf8Validation = object.utf8Validation;\n break;\n }\n break;\n case \"UTF8_VALIDATION_UNKNOWN\":\n case 0:\n message.utf8Validation = 0;\n break;\n case \"VERIFY\":\n case 2:\n message.utf8Validation = 2;\n break;\n case \"NONE\":\n case 3:\n message.utf8Validation = 3;\n break;\n }\n switch (object.messageEncoding) {\n default:\n if (typeof object.messageEncoding === \"number\") {\n message.messageEncoding = object.messageEncoding;\n break;\n }\n break;\n case \"MESSAGE_ENCODING_UNKNOWN\":\n case 0:\n message.messageEncoding = 0;\n break;\n case \"LENGTH_PREFIXED\":\n case 1:\n message.messageEncoding = 1;\n break;\n case \"DELIMITED\":\n case 2:\n message.messageEncoding = 2;\n break;\n }\n switch (object.jsonFormat) {\n default:\n if (typeof object.jsonFormat === \"number\") {\n message.jsonFormat = object.jsonFormat;\n break;\n }\n break;\n case \"JSON_FORMAT_UNKNOWN\":\n case 0:\n message.jsonFormat = 0;\n break;\n case \"ALLOW\":\n case 1:\n message.jsonFormat = 1;\n break;\n case \"LEGACY_BEST_EFFORT\":\n case 2:\n message.jsonFormat = 2;\n break;\n }\n return message;\n };\n \n /**\n * Creates a plain object from a FeatureSet message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.FeatureSet\n * @static\n * @param {google.protobuf.FeatureSet} message FeatureSet\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n FeatureSet.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.fieldPresence = options.enums === String ? \"FIELD_PRESENCE_UNKNOWN\" : 0;\n object.enumType = options.enums === String ? \"ENUM_TYPE_UNKNOWN\" : 0;\n object.repeatedFieldEncoding = options.enums === String ? \"REPEATED_FIELD_ENCODING_UNKNOWN\" : 0;\n object.utf8Validation = options.enums === String ? \"UTF8_VALIDATION_UNKNOWN\" : 0;\n object.messageEncoding = options.enums === String ? \"MESSAGE_ENCODING_UNKNOWN\" : 0;\n object.jsonFormat = options.enums === String ? \"JSON_FORMAT_UNKNOWN\" : 0;\n }\n if (message.fieldPresence != null && message.hasOwnProperty(\"fieldPresence\"))\n object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence;\n if (message.enumType != null && message.hasOwnProperty(\"enumType\"))\n object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType;\n if (message.repeatedFieldEncoding != null && message.hasOwnProperty(\"repeatedFieldEncoding\"))\n object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding;\n if (message.utf8Validation != null && message.hasOwnProperty(\"utf8Validation\"))\n object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation;\n if (message.messageEncoding != null && message.hasOwnProperty(\"messageEncoding\"))\n object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding;\n if (message.jsonFormat != null && message.hasOwnProperty(\"jsonFormat\"))\n object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat;\n return object;\n };\n \n /**\n * Converts this FeatureSet to JSON.\n * @function toJSON\n * @memberof google.protobuf.FeatureSet\n * @instance\n * @returns {Object.} JSON object\n */\n FeatureSet.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for FeatureSet\n * @function getTypeUrl\n * @memberof google.protobuf.FeatureSet\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.FeatureSet\";\n };\n \n /**\n * FieldPresence enum.\n * @name google.protobuf.FeatureSet.FieldPresence\n * @enum {number}\n * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value\n * @property {number} EXPLICIT=1 EXPLICIT value\n * @property {number} IMPLICIT=2 IMPLICIT value\n * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value\n */\n FeatureSet.FieldPresence = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"FIELD_PRESENCE_UNKNOWN\"] = 0;\n values[valuesById[1] = \"EXPLICIT\"] = 1;\n values[valuesById[2] = \"IMPLICIT\"] = 2;\n values[valuesById[3] = \"LEGACY_REQUIRED\"] = 3;\n return values;\n })();\n \n /**\n * EnumType enum.\n * @name google.protobuf.FeatureSet.EnumType\n * @enum {number}\n * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value\n * @property {number} OPEN=1 OPEN value\n * @property {number} CLOSED=2 CLOSED value\n */\n FeatureSet.EnumType = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"ENUM_TYPE_UNKNOWN\"] = 0;\n values[valuesById[1] = \"OPEN\"] = 1;\n values[valuesById[2] = \"CLOSED\"] = 2;\n return values;\n })();\n \n /**\n * RepeatedFieldEncoding enum.\n * @name google.protobuf.FeatureSet.RepeatedFieldEncoding\n * @enum {number}\n * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value\n * @property {number} PACKED=1 PACKED value\n * @property {number} EXPANDED=2 EXPANDED value\n */\n FeatureSet.RepeatedFieldEncoding = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"REPEATED_FIELD_ENCODING_UNKNOWN\"] = 0;\n values[valuesById[1] = \"PACKED\"] = 1;\n values[valuesById[2] = \"EXPANDED\"] = 2;\n return values;\n })();\n \n /**\n * Utf8Validation enum.\n * @name google.protobuf.FeatureSet.Utf8Validation\n * @enum {number}\n * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value\n * @property {number} VERIFY=2 VERIFY value\n * @property {number} NONE=3 NONE value\n */\n FeatureSet.Utf8Validation = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"UTF8_VALIDATION_UNKNOWN\"] = 0;\n values[valuesById[2] = \"VERIFY\"] = 2;\n values[valuesById[3] = \"NONE\"] = 3;\n return values;\n })();\n \n /**\n * MessageEncoding enum.\n * @name google.protobuf.FeatureSet.MessageEncoding\n * @enum {number}\n * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value\n * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value\n * @property {number} DELIMITED=2 DELIMITED value\n */\n FeatureSet.MessageEncoding = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"MESSAGE_ENCODING_UNKNOWN\"] = 0;\n values[valuesById[1] = \"LENGTH_PREFIXED\"] = 1;\n values[valuesById[2] = \"DELIMITED\"] = 2;\n return values;\n })();\n \n /**\n * JsonFormat enum.\n * @name google.protobuf.FeatureSet.JsonFormat\n * @enum {number}\n * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value\n * @property {number} ALLOW=1 ALLOW value\n * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value\n */\n FeatureSet.JsonFormat = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"JSON_FORMAT_UNKNOWN\"] = 0;\n values[valuesById[1] = \"ALLOW\"] = 1;\n values[valuesById[2] = \"LEGACY_BEST_EFFORT\"] = 2;\n return values;\n })();\n \n return FeatureSet;\n })();\n \n protobuf.FeatureSetDefaults = (function() {\n \n /**\n * Properties of a FeatureSetDefaults.\n * @memberof google.protobuf\n * @interface IFeatureSetDefaults\n * @property {Array.|null} [defaults] FeatureSetDefaults defaults\n * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition\n * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition\n */\n \n /**\n * Constructs a new FeatureSetDefaults.\n * @memberof google.protobuf\n * @classdesc Represents a FeatureSetDefaults.\n * @implements IFeatureSetDefaults\n * @constructor\n * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set\n */\n function FeatureSetDefaults(properties) {\n this.defaults = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * FeatureSetDefaults defaults.\n * @member {Array.} defaults\n * @memberof google.protobuf.FeatureSetDefaults\n * @instance\n */\n FeatureSetDefaults.prototype.defaults = $util.emptyArray;\n \n /**\n * FeatureSetDefaults minimumEdition.\n * @member {google.protobuf.Edition} minimumEdition\n * @memberof google.protobuf.FeatureSetDefaults\n * @instance\n */\n FeatureSetDefaults.prototype.minimumEdition = 0;\n \n /**\n * FeatureSetDefaults maximumEdition.\n * @member {google.protobuf.Edition} maximumEdition\n * @memberof google.protobuf.FeatureSetDefaults\n * @instance\n */\n FeatureSetDefaults.prototype.maximumEdition = 0;\n \n /**\n * Creates a new FeatureSetDefaults instance using the specified properties.\n * @function create\n * @memberof google.protobuf.FeatureSetDefaults\n * @static\n * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set\n * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance\n */\n FeatureSetDefaults.create = function create(properties) {\n return new FeatureSetDefaults(properties);\n };\n \n /**\n * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.FeatureSetDefaults\n * @static\n * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FeatureSetDefaults.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.defaults != null && message.defaults.length)\n for (var i = 0; i < message.defaults.length; ++i)\n $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.minimumEdition != null && Object.hasOwnProperty.call(message, \"minimumEdition\"))\n writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition);\n if (message.maximumEdition != null && Object.hasOwnProperty.call(message, \"maximumEdition\"))\n writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition);\n return writer;\n };\n \n /**\n * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.FeatureSetDefaults\n * @static\n * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a FeatureSetDefaults message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.FeatureSetDefaults\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FeatureSetDefaults.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.defaults && message.defaults.length))\n message.defaults = [];\n message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32()));\n break;\n }\n case 4: {\n message.minimumEdition = reader.int32();\n break;\n }\n case 5: {\n message.maximumEdition = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.FeatureSetDefaults\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a FeatureSetDefaults message.\n * @function verify\n * @memberof google.protobuf.FeatureSetDefaults\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n FeatureSetDefaults.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.defaults != null && message.hasOwnProperty(\"defaults\")) {\n if (!Array.isArray(message.defaults))\n return \"defaults: array expected\";\n for (var i = 0; i < message.defaults.length; ++i) {\n var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]);\n if (error)\n return \"defaults.\" + error;\n }\n }\n if (message.minimumEdition != null && message.hasOwnProperty(\"minimumEdition\"))\n switch (message.minimumEdition) {\n default:\n return \"minimumEdition: enum value expected\";\n case 0:\n case 998:\n case 999:\n case 1000:\n case 1001:\n case 1:\n case 2:\n case 99997:\n case 99998:\n case 99999:\n case 2147483647:\n break;\n }\n if (message.maximumEdition != null && message.hasOwnProperty(\"maximumEdition\"))\n switch (message.maximumEdition) {\n default:\n return \"maximumEdition: enum value expected\";\n case 0:\n case 998:\n case 999:\n case 1000:\n case 1001:\n case 1:\n case 2:\n case 99997:\n case 99998:\n case 99999:\n case 2147483647:\n break;\n }\n return null;\n };\n \n /**\n * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.FeatureSetDefaults\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults\n */\n FeatureSetDefaults.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.FeatureSetDefaults)\n return object;\n var message = new $root.google.protobuf.FeatureSetDefaults();\n if (object.defaults) {\n if (!Array.isArray(object.defaults))\n throw TypeError(\".google.protobuf.FeatureSetDefaults.defaults: array expected\");\n message.defaults = [];\n for (var i = 0; i < object.defaults.length; ++i) {\n if (typeof object.defaults[i] !== \"object\")\n throw TypeError(\".google.protobuf.FeatureSetDefaults.defaults: object expected\");\n message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]);\n }\n }\n switch (object.minimumEdition) {\n default:\n if (typeof object.minimumEdition === \"number\") {\n message.minimumEdition = object.minimumEdition;\n break;\n }\n break;\n case \"EDITION_UNKNOWN\":\n case 0:\n message.minimumEdition = 0;\n break;\n case \"EDITION_PROTO2\":\n case 998:\n message.minimumEdition = 998;\n break;\n case \"EDITION_PROTO3\":\n case 999:\n message.minimumEdition = 999;\n break;\n case \"EDITION_2023\":\n case 1000:\n message.minimumEdition = 1000;\n break;\n case \"EDITION_2024\":\n case 1001:\n message.minimumEdition = 1001;\n break;\n case \"EDITION_1_TEST_ONLY\":\n case 1:\n message.minimumEdition = 1;\n break;\n case \"EDITION_2_TEST_ONLY\":\n case 2:\n message.minimumEdition = 2;\n break;\n case \"EDITION_99997_TEST_ONLY\":\n case 99997:\n message.minimumEdition = 99997;\n break;\n case \"EDITION_99998_TEST_ONLY\":\n case 99998:\n message.minimumEdition = 99998;\n break;\n case \"EDITION_99999_TEST_ONLY\":\n case 99999:\n message.minimumEdition = 99999;\n break;\n case \"EDITION_MAX\":\n case 2147483647:\n message.minimumEdition = 2147483647;\n break;\n }\n switch (object.maximumEdition) {\n default:\n if (typeof object.maximumEdition === \"number\") {\n message.maximumEdition = object.maximumEdition;\n break;\n }\n break;\n case \"EDITION_UNKNOWN\":\n case 0:\n message.maximumEdition = 0;\n break;\n case \"EDITION_PROTO2\":\n case 998:\n message.maximumEdition = 998;\n break;\n case \"EDITION_PROTO3\":\n case 999:\n message.maximumEdition = 999;\n break;\n case \"EDITION_2023\":\n case 1000:\n message.maximumEdition = 1000;\n break;\n case \"EDITION_2024\":\n case 1001:\n message.maximumEdition = 1001;\n break;\n case \"EDITION_1_TEST_ONLY\":\n case 1:\n message.maximumEdition = 1;\n break;\n case \"EDITION_2_TEST_ONLY\":\n case 2:\n message.maximumEdition = 2;\n break;\n case \"EDITION_99997_TEST_ONLY\":\n case 99997:\n message.maximumEdition = 99997;\n break;\n case \"EDITION_99998_TEST_ONLY\":\n case 99998:\n message.maximumEdition = 99998;\n break;\n case \"EDITION_99999_TEST_ONLY\":\n case 99999:\n message.maximumEdition = 99999;\n break;\n case \"EDITION_MAX\":\n case 2147483647:\n message.maximumEdition = 2147483647;\n break;\n }\n return message;\n };\n \n /**\n * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.FeatureSetDefaults\n * @static\n * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n FeatureSetDefaults.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.defaults = [];\n if (options.defaults) {\n object.minimumEdition = options.enums === String ? \"EDITION_UNKNOWN\" : 0;\n object.maximumEdition = options.enums === String ? \"EDITION_UNKNOWN\" : 0;\n }\n if (message.defaults && message.defaults.length) {\n object.defaults = [];\n for (var j = 0; j < message.defaults.length; ++j)\n object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options);\n }\n if (message.minimumEdition != null && message.hasOwnProperty(\"minimumEdition\"))\n object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition;\n if (message.maximumEdition != null && message.hasOwnProperty(\"maximumEdition\"))\n object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition;\n return object;\n };\n \n /**\n * Converts this FeatureSetDefaults to JSON.\n * @function toJSON\n * @memberof google.protobuf.FeatureSetDefaults\n * @instance\n * @returns {Object.} JSON object\n */\n FeatureSetDefaults.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for FeatureSetDefaults\n * @function getTypeUrl\n * @memberof google.protobuf.FeatureSetDefaults\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.FeatureSetDefaults\";\n };\n \n FeatureSetDefaults.FeatureSetEditionDefault = (function() {\n \n /**\n * Properties of a FeatureSetEditionDefault.\n * @memberof google.protobuf.FeatureSetDefaults\n * @interface IFeatureSetEditionDefault\n * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition\n * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features\n */\n \n /**\n * Constructs a new FeatureSetEditionDefault.\n * @memberof google.protobuf.FeatureSetDefaults\n * @classdesc Represents a FeatureSetEditionDefault.\n * @implements IFeatureSetEditionDefault\n * @constructor\n * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set\n */\n function FeatureSetEditionDefault(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * FeatureSetEditionDefault edition.\n * @member {google.protobuf.Edition} edition\n * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault\n * @instance\n */\n FeatureSetEditionDefault.prototype.edition = 0;\n \n /**\n * FeatureSetEditionDefault features.\n * @member {google.protobuf.IFeatureSet|null|undefined} features\n * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault\n * @instance\n */\n FeatureSetEditionDefault.prototype.features = null;\n \n /**\n * Creates a new FeatureSetEditionDefault instance using the specified properties.\n * @function create\n * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault\n * @static\n * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set\n * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance\n */\n FeatureSetEditionDefault.create = function create(properties) {\n return new FeatureSetEditionDefault(properties);\n };\n \n /**\n * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault\n * @static\n * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FeatureSetEditionDefault.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.features != null && Object.hasOwnProperty.call(message, \"features\"))\n $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.edition != null && Object.hasOwnProperty.call(message, \"edition\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition);\n return writer;\n };\n \n /**\n * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault\n * @static\n * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a FeatureSetEditionDefault message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FeatureSetEditionDefault.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 3: {\n message.edition = reader.int32();\n break;\n }\n case 2: {\n message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a FeatureSetEditionDefault message.\n * @function verify\n * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n FeatureSetEditionDefault.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.edition != null && message.hasOwnProperty(\"edition\"))\n switch (message.edition) {\n default:\n return \"edition: enum value expected\";\n case 0:\n case 998:\n case 999:\n case 1000:\n case 1001:\n case 1:\n case 2:\n case 99997:\n case 99998:\n case 99999:\n case 2147483647:\n break;\n }\n if (message.features != null && message.hasOwnProperty(\"features\")) {\n var error = $root.google.protobuf.FeatureSet.verify(message.features);\n if (error)\n return \"features.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault\n */\n FeatureSetEditionDefault.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault)\n return object;\n var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault();\n switch (object.edition) {\n default:\n if (typeof object.edition === \"number\") {\n message.edition = object.edition;\n break;\n }\n break;\n case \"EDITION_UNKNOWN\":\n case 0:\n message.edition = 0;\n break;\n case \"EDITION_PROTO2\":\n case 998:\n message.edition = 998;\n break;\n case \"EDITION_PROTO3\":\n case 999:\n message.edition = 999;\n break;\n case \"EDITION_2023\":\n case 1000:\n message.edition = 1000;\n break;\n case \"EDITION_2024\":\n case 1001:\n message.edition = 1001;\n break;\n case \"EDITION_1_TEST_ONLY\":\n case 1:\n message.edition = 1;\n break;\n case \"EDITION_2_TEST_ONLY\":\n case 2:\n message.edition = 2;\n break;\n case \"EDITION_99997_TEST_ONLY\":\n case 99997:\n message.edition = 99997;\n break;\n case \"EDITION_99998_TEST_ONLY\":\n case 99998:\n message.edition = 99998;\n break;\n case \"EDITION_99999_TEST_ONLY\":\n case 99999:\n message.edition = 99999;\n break;\n case \"EDITION_MAX\":\n case 2147483647:\n message.edition = 2147483647;\n break;\n }\n if (object.features != null) {\n if (typeof object.features !== \"object\")\n throw TypeError(\".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected\");\n message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault\n * @static\n * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n FeatureSetEditionDefault.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.features = null;\n object.edition = options.enums === String ? \"EDITION_UNKNOWN\" : 0;\n }\n if (message.features != null && message.hasOwnProperty(\"features\"))\n object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);\n if (message.edition != null && message.hasOwnProperty(\"edition\"))\n object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition;\n return object;\n };\n \n /**\n * Converts this FeatureSetEditionDefault to JSON.\n * @function toJSON\n * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault\n * @instance\n * @returns {Object.} JSON object\n */\n FeatureSetEditionDefault.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for FeatureSetEditionDefault\n * @function getTypeUrl\n * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault\";\n };\n \n return FeatureSetEditionDefault;\n })();\n \n return FeatureSetDefaults;\n })();\n \n protobuf.SourceCodeInfo = (function() {\n \n /**\n * Properties of a SourceCodeInfo.\n * @memberof google.protobuf\n * @interface ISourceCodeInfo\n * @property {Array.|null} [location] SourceCodeInfo location\n */\n \n /**\n * Constructs a new SourceCodeInfo.\n * @memberof google.protobuf\n * @classdesc Represents a SourceCodeInfo.\n * @implements ISourceCodeInfo\n * @constructor\n * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set\n */\n function SourceCodeInfo(properties) {\n this.location = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * SourceCodeInfo location.\n * @member {Array.} location\n * @memberof google.protobuf.SourceCodeInfo\n * @instance\n */\n SourceCodeInfo.prototype.location = $util.emptyArray;\n \n /**\n * Creates a new SourceCodeInfo instance using the specified properties.\n * @function create\n * @memberof google.protobuf.SourceCodeInfo\n * @static\n * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set\n * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance\n */\n SourceCodeInfo.create = function create(properties) {\n return new SourceCodeInfo(properties);\n };\n \n /**\n * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.SourceCodeInfo\n * @static\n * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n SourceCodeInfo.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.location != null && message.location.length)\n for (var i = 0; i < message.location.length; ++i)\n $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.SourceCodeInfo\n * @static\n * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a SourceCodeInfo message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.SourceCodeInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n SourceCodeInfo.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.location && message.location.length))\n message.location = [];\n message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.SourceCodeInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a SourceCodeInfo message.\n * @function verify\n * @memberof google.protobuf.SourceCodeInfo\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n SourceCodeInfo.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.location != null && message.hasOwnProperty(\"location\")) {\n if (!Array.isArray(message.location))\n return \"location: array expected\";\n for (var i = 0; i < message.location.length; ++i) {\n var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]);\n if (error)\n return \"location.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.SourceCodeInfo\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo\n */\n SourceCodeInfo.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.SourceCodeInfo)\n return object;\n var message = new $root.google.protobuf.SourceCodeInfo();\n if (object.location) {\n if (!Array.isArray(object.location))\n throw TypeError(\".google.protobuf.SourceCodeInfo.location: array expected\");\n message.location = [];\n for (var i = 0; i < object.location.length; ++i) {\n if (typeof object.location[i] !== \"object\")\n throw TypeError(\".google.protobuf.SourceCodeInfo.location: object expected\");\n message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.SourceCodeInfo\n * @static\n * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n SourceCodeInfo.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.location = [];\n if (message.location && message.location.length) {\n object.location = [];\n for (var j = 0; j < message.location.length; ++j)\n object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options);\n }\n return object;\n };\n \n /**\n * Converts this SourceCodeInfo to JSON.\n * @function toJSON\n * @memberof google.protobuf.SourceCodeInfo\n * @instance\n * @returns {Object.} JSON object\n */\n SourceCodeInfo.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for SourceCodeInfo\n * @function getTypeUrl\n * @memberof google.protobuf.SourceCodeInfo\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.SourceCodeInfo\";\n };\n \n SourceCodeInfo.Location = (function() {\n \n /**\n * Properties of a Location.\n * @memberof google.protobuf.SourceCodeInfo\n * @interface ILocation\n * @property {Array.|null} [path] Location path\n * @property {Array.|null} [span] Location span\n * @property {string|null} [leadingComments] Location leadingComments\n * @property {string|null} [trailingComments] Location trailingComments\n * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments\n */\n \n /**\n * Constructs a new Location.\n * @memberof google.protobuf.SourceCodeInfo\n * @classdesc Represents a Location.\n * @implements ILocation\n * @constructor\n * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set\n */\n function Location(properties) {\n this.path = [];\n this.span = [];\n this.leadingDetachedComments = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Location path.\n * @member {Array.} path\n * @memberof google.protobuf.SourceCodeInfo.Location\n * @instance\n */\n Location.prototype.path = $util.emptyArray;\n \n /**\n * Location span.\n * @member {Array.} span\n * @memberof google.protobuf.SourceCodeInfo.Location\n * @instance\n */\n Location.prototype.span = $util.emptyArray;\n \n /**\n * Location leadingComments.\n * @member {string} leadingComments\n * @memberof google.protobuf.SourceCodeInfo.Location\n * @instance\n */\n Location.prototype.leadingComments = \"\";\n \n /**\n * Location trailingComments.\n * @member {string} trailingComments\n * @memberof google.protobuf.SourceCodeInfo.Location\n * @instance\n */\n Location.prototype.trailingComments = \"\";\n \n /**\n * Location leadingDetachedComments.\n * @member {Array.} leadingDetachedComments\n * @memberof google.protobuf.SourceCodeInfo.Location\n * @instance\n */\n Location.prototype.leadingDetachedComments = $util.emptyArray;\n \n /**\n * Creates a new Location instance using the specified properties.\n * @function create\n * @memberof google.protobuf.SourceCodeInfo.Location\n * @static\n * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set\n * @returns {google.protobuf.SourceCodeInfo.Location} Location instance\n */\n Location.create = function create(properties) {\n return new Location(properties);\n };\n \n /**\n * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.SourceCodeInfo.Location\n * @static\n * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Location.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.path != null && message.path.length) {\n writer.uint32(/* id 1, wireType 2 =*/10).fork();\n for (var i = 0; i < message.path.length; ++i)\n writer.int32(message.path[i]);\n writer.ldelim();\n }\n if (message.span != null && message.span.length) {\n writer.uint32(/* id 2, wireType 2 =*/18).fork();\n for (var i = 0; i < message.span.length; ++i)\n writer.int32(message.span[i]);\n writer.ldelim();\n }\n if (message.leadingComments != null && Object.hasOwnProperty.call(message, \"leadingComments\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments);\n if (message.trailingComments != null && Object.hasOwnProperty.call(message, \"trailingComments\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments);\n if (message.leadingDetachedComments != null && message.leadingDetachedComments.length)\n for (var i = 0; i < message.leadingDetachedComments.length; ++i)\n writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]);\n return writer;\n };\n \n /**\n * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.SourceCodeInfo.Location\n * @static\n * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Location.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Location message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.SourceCodeInfo.Location\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.SourceCodeInfo.Location} Location\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Location.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.path && message.path.length))\n message.path = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.path.push(reader.int32());\n } else\n message.path.push(reader.int32());\n break;\n }\n case 2: {\n if (!(message.span && message.span.length))\n message.span = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.span.push(reader.int32());\n } else\n message.span.push(reader.int32());\n break;\n }\n case 3: {\n message.leadingComments = reader.string();\n break;\n }\n case 4: {\n message.trailingComments = reader.string();\n break;\n }\n case 6: {\n if (!(message.leadingDetachedComments && message.leadingDetachedComments.length))\n message.leadingDetachedComments = [];\n message.leadingDetachedComments.push(reader.string());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Location message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.SourceCodeInfo.Location\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.SourceCodeInfo.Location} Location\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Location.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Location message.\n * @function verify\n * @memberof google.protobuf.SourceCodeInfo.Location\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Location.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.path != null && message.hasOwnProperty(\"path\")) {\n if (!Array.isArray(message.path))\n return \"path: array expected\";\n for (var i = 0; i < message.path.length; ++i)\n if (!$util.isInteger(message.path[i]))\n return \"path: integer[] expected\";\n }\n if (message.span != null && message.hasOwnProperty(\"span\")) {\n if (!Array.isArray(message.span))\n return \"span: array expected\";\n for (var i = 0; i < message.span.length; ++i)\n if (!$util.isInteger(message.span[i]))\n return \"span: integer[] expected\";\n }\n if (message.leadingComments != null && message.hasOwnProperty(\"leadingComments\"))\n if (!$util.isString(message.leadingComments))\n return \"leadingComments: string expected\";\n if (message.trailingComments != null && message.hasOwnProperty(\"trailingComments\"))\n if (!$util.isString(message.trailingComments))\n return \"trailingComments: string expected\";\n if (message.leadingDetachedComments != null && message.hasOwnProperty(\"leadingDetachedComments\")) {\n if (!Array.isArray(message.leadingDetachedComments))\n return \"leadingDetachedComments: array expected\";\n for (var i = 0; i < message.leadingDetachedComments.length; ++i)\n if (!$util.isString(message.leadingDetachedComments[i]))\n return \"leadingDetachedComments: string[] expected\";\n }\n return null;\n };\n \n /**\n * Creates a Location message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.SourceCodeInfo.Location\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.SourceCodeInfo.Location} Location\n */\n Location.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.SourceCodeInfo.Location)\n return object;\n var message = new $root.google.protobuf.SourceCodeInfo.Location();\n if (object.path) {\n if (!Array.isArray(object.path))\n throw TypeError(\".google.protobuf.SourceCodeInfo.Location.path: array expected\");\n message.path = [];\n for (var i = 0; i < object.path.length; ++i)\n message.path[i] = object.path[i] | 0;\n }\n if (object.span) {\n if (!Array.isArray(object.span))\n throw TypeError(\".google.protobuf.SourceCodeInfo.Location.span: array expected\");\n message.span = [];\n for (var i = 0; i < object.span.length; ++i)\n message.span[i] = object.span[i] | 0;\n }\n if (object.leadingComments != null)\n message.leadingComments = String(object.leadingComments);\n if (object.trailingComments != null)\n message.trailingComments = String(object.trailingComments);\n if (object.leadingDetachedComments) {\n if (!Array.isArray(object.leadingDetachedComments))\n throw TypeError(\".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected\");\n message.leadingDetachedComments = [];\n for (var i = 0; i < object.leadingDetachedComments.length; ++i)\n message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a Location message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.SourceCodeInfo.Location\n * @static\n * @param {google.protobuf.SourceCodeInfo.Location} message Location\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Location.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.path = [];\n object.span = [];\n object.leadingDetachedComments = [];\n }\n if (options.defaults) {\n object.leadingComments = \"\";\n object.trailingComments = \"\";\n }\n if (message.path && message.path.length) {\n object.path = [];\n for (var j = 0; j < message.path.length; ++j)\n object.path[j] = message.path[j];\n }\n if (message.span && message.span.length) {\n object.span = [];\n for (var j = 0; j < message.span.length; ++j)\n object.span[j] = message.span[j];\n }\n if (message.leadingComments != null && message.hasOwnProperty(\"leadingComments\"))\n object.leadingComments = message.leadingComments;\n if (message.trailingComments != null && message.hasOwnProperty(\"trailingComments\"))\n object.trailingComments = message.trailingComments;\n if (message.leadingDetachedComments && message.leadingDetachedComments.length) {\n object.leadingDetachedComments = [];\n for (var j = 0; j < message.leadingDetachedComments.length; ++j)\n object.leadingDetachedComments[j] = message.leadingDetachedComments[j];\n }\n return object;\n };\n \n /**\n * Converts this Location to JSON.\n * @function toJSON\n * @memberof google.protobuf.SourceCodeInfo.Location\n * @instance\n * @returns {Object.} JSON object\n */\n Location.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Location\n * @function getTypeUrl\n * @memberof google.protobuf.SourceCodeInfo.Location\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.SourceCodeInfo.Location\";\n };\n \n return Location;\n })();\n \n return SourceCodeInfo;\n })();\n \n protobuf.GeneratedCodeInfo = (function() {\n \n /**\n * Properties of a GeneratedCodeInfo.\n * @memberof google.protobuf\n * @interface IGeneratedCodeInfo\n * @property {Array.|null} [annotation] GeneratedCodeInfo annotation\n */\n \n /**\n * Constructs a new GeneratedCodeInfo.\n * @memberof google.protobuf\n * @classdesc Represents a GeneratedCodeInfo.\n * @implements IGeneratedCodeInfo\n * @constructor\n * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set\n */\n function GeneratedCodeInfo(properties) {\n this.annotation = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GeneratedCodeInfo annotation.\n * @member {Array.} annotation\n * @memberof google.protobuf.GeneratedCodeInfo\n * @instance\n */\n GeneratedCodeInfo.prototype.annotation = $util.emptyArray;\n \n /**\n * Creates a new GeneratedCodeInfo instance using the specified properties.\n * @function create\n * @memberof google.protobuf.GeneratedCodeInfo\n * @static\n * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set\n * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance\n */\n GeneratedCodeInfo.create = function create(properties) {\n return new GeneratedCodeInfo(properties);\n };\n \n /**\n * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.GeneratedCodeInfo\n * @static\n * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GeneratedCodeInfo.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.annotation != null && message.annotation.length)\n for (var i = 0; i < message.annotation.length; ++i)\n $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.GeneratedCodeInfo\n * @static\n * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GeneratedCodeInfo message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.GeneratedCodeInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GeneratedCodeInfo.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.annotation && message.annotation.length))\n message.annotation = [];\n message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.GeneratedCodeInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GeneratedCodeInfo message.\n * @function verify\n * @memberof google.protobuf.GeneratedCodeInfo\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GeneratedCodeInfo.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.annotation != null && message.hasOwnProperty(\"annotation\")) {\n if (!Array.isArray(message.annotation))\n return \"annotation: array expected\";\n for (var i = 0; i < message.annotation.length; ++i) {\n var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]);\n if (error)\n return \"annotation.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.GeneratedCodeInfo\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo\n */\n GeneratedCodeInfo.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.GeneratedCodeInfo)\n return object;\n var message = new $root.google.protobuf.GeneratedCodeInfo();\n if (object.annotation) {\n if (!Array.isArray(object.annotation))\n throw TypeError(\".google.protobuf.GeneratedCodeInfo.annotation: array expected\");\n message.annotation = [];\n for (var i = 0; i < object.annotation.length; ++i) {\n if (typeof object.annotation[i] !== \"object\")\n throw TypeError(\".google.protobuf.GeneratedCodeInfo.annotation: object expected\");\n message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.GeneratedCodeInfo\n * @static\n * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GeneratedCodeInfo.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.annotation = [];\n if (message.annotation && message.annotation.length) {\n object.annotation = [];\n for (var j = 0; j < message.annotation.length; ++j)\n object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options);\n }\n return object;\n };\n \n /**\n * Converts this GeneratedCodeInfo to JSON.\n * @function toJSON\n * @memberof google.protobuf.GeneratedCodeInfo\n * @instance\n * @returns {Object.} JSON object\n */\n GeneratedCodeInfo.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GeneratedCodeInfo\n * @function getTypeUrl\n * @memberof google.protobuf.GeneratedCodeInfo\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.GeneratedCodeInfo\";\n };\n \n GeneratedCodeInfo.Annotation = (function() {\n \n /**\n * Properties of an Annotation.\n * @memberof google.protobuf.GeneratedCodeInfo\n * @interface IAnnotation\n * @property {Array.|null} [path] Annotation path\n * @property {string|null} [sourceFile] Annotation sourceFile\n * @property {number|null} [begin] Annotation begin\n * @property {number|null} [end] Annotation end\n * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic\n */\n \n /**\n * Constructs a new Annotation.\n * @memberof google.protobuf.GeneratedCodeInfo\n * @classdesc Represents an Annotation.\n * @implements IAnnotation\n * @constructor\n * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set\n */\n function Annotation(properties) {\n this.path = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Annotation path.\n * @member {Array.} path\n * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n * @instance\n */\n Annotation.prototype.path = $util.emptyArray;\n \n /**\n * Annotation sourceFile.\n * @member {string} sourceFile\n * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n * @instance\n */\n Annotation.prototype.sourceFile = \"\";\n \n /**\n * Annotation begin.\n * @member {number} begin\n * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n * @instance\n */\n Annotation.prototype.begin = 0;\n \n /**\n * Annotation end.\n * @member {number} end\n * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n * @instance\n */\n Annotation.prototype.end = 0;\n \n /**\n * Annotation semantic.\n * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic\n * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n * @instance\n */\n Annotation.prototype.semantic = 0;\n \n /**\n * Creates a new Annotation instance using the specified properties.\n * @function create\n * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n * @static\n * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set\n * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance\n */\n Annotation.create = function create(properties) {\n return new Annotation(properties);\n };\n \n /**\n * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n * @static\n * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Annotation.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.path != null && message.path.length) {\n writer.uint32(/* id 1, wireType 2 =*/10).fork();\n for (var i = 0; i < message.path.length; ++i)\n writer.int32(message.path[i]);\n writer.ldelim();\n }\n if (message.sourceFile != null && Object.hasOwnProperty.call(message, \"sourceFile\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile);\n if (message.begin != null && Object.hasOwnProperty.call(message, \"begin\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin);\n if (message.end != null && Object.hasOwnProperty.call(message, \"end\"))\n writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end);\n if (message.semantic != null && Object.hasOwnProperty.call(message, \"semantic\"))\n writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic);\n return writer;\n };\n \n /**\n * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n * @static\n * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Annotation.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an Annotation message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Annotation.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.path && message.path.length))\n message.path = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.path.push(reader.int32());\n } else\n message.path.push(reader.int32());\n break;\n }\n case 2: {\n message.sourceFile = reader.string();\n break;\n }\n case 3: {\n message.begin = reader.int32();\n break;\n }\n case 4: {\n message.end = reader.int32();\n break;\n }\n case 5: {\n message.semantic = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an Annotation message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Annotation.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an Annotation message.\n * @function verify\n * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Annotation.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.path != null && message.hasOwnProperty(\"path\")) {\n if (!Array.isArray(message.path))\n return \"path: array expected\";\n for (var i = 0; i < message.path.length; ++i)\n if (!$util.isInteger(message.path[i]))\n return \"path: integer[] expected\";\n }\n if (message.sourceFile != null && message.hasOwnProperty(\"sourceFile\"))\n if (!$util.isString(message.sourceFile))\n return \"sourceFile: string expected\";\n if (message.begin != null && message.hasOwnProperty(\"begin\"))\n if (!$util.isInteger(message.begin))\n return \"begin: integer expected\";\n if (message.end != null && message.hasOwnProperty(\"end\"))\n if (!$util.isInteger(message.end))\n return \"end: integer expected\";\n if (message.semantic != null && message.hasOwnProperty(\"semantic\"))\n switch (message.semantic) {\n default:\n return \"semantic: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n return null;\n };\n \n /**\n * Creates an Annotation message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation\n */\n Annotation.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation)\n return object;\n var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation();\n if (object.path) {\n if (!Array.isArray(object.path))\n throw TypeError(\".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected\");\n message.path = [];\n for (var i = 0; i < object.path.length; ++i)\n message.path[i] = object.path[i] | 0;\n }\n if (object.sourceFile != null)\n message.sourceFile = String(object.sourceFile);\n if (object.begin != null)\n message.begin = object.begin | 0;\n if (object.end != null)\n message.end = object.end | 0;\n switch (object.semantic) {\n default:\n if (typeof object.semantic === \"number\") {\n message.semantic = object.semantic;\n break;\n }\n break;\n case \"NONE\":\n case 0:\n message.semantic = 0;\n break;\n case \"SET\":\n case 1:\n message.semantic = 1;\n break;\n case \"ALIAS\":\n case 2:\n message.semantic = 2;\n break;\n }\n return message;\n };\n \n /**\n * Creates a plain object from an Annotation message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n * @static\n * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Annotation.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.path = [];\n if (options.defaults) {\n object.sourceFile = \"\";\n object.begin = 0;\n object.end = 0;\n object.semantic = options.enums === String ? \"NONE\" : 0;\n }\n if (message.path && message.path.length) {\n object.path = [];\n for (var j = 0; j < message.path.length; ++j)\n object.path[j] = message.path[j];\n }\n if (message.sourceFile != null && message.hasOwnProperty(\"sourceFile\"))\n object.sourceFile = message.sourceFile;\n if (message.begin != null && message.hasOwnProperty(\"begin\"))\n object.begin = message.begin;\n if (message.end != null && message.hasOwnProperty(\"end\"))\n object.end = message.end;\n if (message.semantic != null && message.hasOwnProperty(\"semantic\"))\n object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic;\n return object;\n };\n \n /**\n * Converts this Annotation to JSON.\n * @function toJSON\n * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n * @instance\n * @returns {Object.} JSON object\n */\n Annotation.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Annotation\n * @function getTypeUrl\n * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.GeneratedCodeInfo.Annotation\";\n };\n \n /**\n * Semantic enum.\n * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic\n * @enum {number}\n * @property {number} NONE=0 NONE value\n * @property {number} SET=1 SET value\n * @property {number} ALIAS=2 ALIAS value\n */\n Annotation.Semantic = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"NONE\"] = 0;\n values[valuesById[1] = \"SET\"] = 1;\n values[valuesById[2] = \"ALIAS\"] = 2;\n return values;\n })();\n \n return Annotation;\n })();\n \n return GeneratedCodeInfo;\n })();\n \n protobuf.Any = (function() {\n \n /**\n * Properties of an Any.\n * @memberof google.protobuf\n * @interface IAny\n * @property {string|null} [type_url] Any type_url\n * @property {Uint8Array|null} [value] Any value\n */\n \n /**\n * Constructs a new Any.\n * @memberof google.protobuf\n * @classdesc Represents an Any.\n * @implements IAny\n * @constructor\n * @param {google.protobuf.IAny=} [properties] Properties to set\n */\n function Any(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Any type_url.\n * @member {string} type_url\n * @memberof google.protobuf.Any\n * @instance\n */\n Any.prototype.type_url = \"\";\n \n /**\n * Any value.\n * @member {Uint8Array} value\n * @memberof google.protobuf.Any\n * @instance\n */\n Any.prototype.value = $util.newBuffer([]);\n \n /**\n * Creates a new Any instance using the specified properties.\n * @function create\n * @memberof google.protobuf.Any\n * @static\n * @param {google.protobuf.IAny=} [properties] Properties to set\n * @returns {google.protobuf.Any} Any instance\n */\n Any.create = function create(properties) {\n return new Any(properties);\n };\n \n /**\n * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.Any\n * @static\n * @param {google.protobuf.IAny} message Any message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Any.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.type_url != null && Object.hasOwnProperty.call(message, \"type_url\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url);\n if (message.value != null && Object.hasOwnProperty.call(message, \"value\"))\n writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value);\n return writer;\n };\n \n /**\n * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.Any\n * @static\n * @param {google.protobuf.IAny} message Any message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Any.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an Any message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.Any\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.Any} Any\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Any.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.type_url = reader.string();\n break;\n }\n case 2: {\n message.value = reader.bytes();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an Any message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.Any\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.Any} Any\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Any.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an Any message.\n * @function verify\n * @memberof google.protobuf.Any\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Any.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.type_url != null && message.hasOwnProperty(\"type_url\"))\n if (!$util.isString(message.type_url))\n return \"type_url: string expected\";\n if (message.value != null && message.hasOwnProperty(\"value\"))\n if (!(message.value && typeof message.value.length === \"number\" || $util.isString(message.value)))\n return \"value: buffer expected\";\n return null;\n };\n \n /**\n * Creates an Any message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.Any\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.Any} Any\n */\n Any.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.Any)\n return object;\n var message = new $root.google.protobuf.Any();\n if (object.type_url != null)\n message.type_url = String(object.type_url);\n if (object.value != null)\n if (typeof object.value === \"string\")\n $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0);\n else if (object.value.length >= 0)\n message.value = object.value;\n return message;\n };\n \n /**\n * Creates a plain object from an Any message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.Any\n * @static\n * @param {google.protobuf.Any} message Any\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Any.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.type_url = \"\";\n if (options.bytes === String)\n object.value = \"\";\n else {\n object.value = [];\n if (options.bytes !== Array)\n object.value = $util.newBuffer(object.value);\n }\n }\n if (message.type_url != null && message.hasOwnProperty(\"type_url\"))\n object.type_url = message.type_url;\n if (message.value != null && message.hasOwnProperty(\"value\"))\n object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value;\n return object;\n };\n \n /**\n * Converts this Any to JSON.\n * @function toJSON\n * @memberof google.protobuf.Any\n * @instance\n * @returns {Object.} JSON object\n */\n Any.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Any\n * @function getTypeUrl\n * @memberof google.protobuf.Any\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.Any\";\n };\n \n return Any;\n })();\n \n protobuf.Timestamp = (function() {\n \n /**\n * Properties of a Timestamp.\n * @memberof google.protobuf\n * @interface ITimestamp\n * @property {number|Long|null} [seconds] Timestamp seconds\n * @property {number|null} [nanos] Timestamp nanos\n */\n \n /**\n * Constructs a new Timestamp.\n * @memberof google.protobuf\n * @classdesc Represents a Timestamp.\n * @implements ITimestamp\n * @constructor\n * @param {google.protobuf.ITimestamp=} [properties] Properties to set\n */\n function Timestamp(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Timestamp seconds.\n * @member {number|Long} seconds\n * @memberof google.protobuf.Timestamp\n * @instance\n */\n Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n \n /**\n * Timestamp nanos.\n * @member {number} nanos\n * @memberof google.protobuf.Timestamp\n * @instance\n */\n Timestamp.prototype.nanos = 0;\n \n /**\n * Creates a new Timestamp instance using the specified properties.\n * @function create\n * @memberof google.protobuf.Timestamp\n * @static\n * @param {google.protobuf.ITimestamp=} [properties] Properties to set\n * @returns {google.protobuf.Timestamp} Timestamp instance\n */\n Timestamp.create = function create(properties) {\n return new Timestamp(properties);\n };\n \n /**\n * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.Timestamp\n * @static\n * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Timestamp.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.seconds != null && Object.hasOwnProperty.call(message, \"seconds\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds);\n if (message.nanos != null && Object.hasOwnProperty.call(message, \"nanos\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos);\n return writer;\n };\n \n /**\n * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.Timestamp\n * @static\n * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Timestamp.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Timestamp message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.Timestamp\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.Timestamp} Timestamp\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Timestamp.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.seconds = reader.int64();\n break;\n }\n case 2: {\n message.nanos = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Timestamp message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.Timestamp\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.Timestamp} Timestamp\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Timestamp.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Timestamp message.\n * @function verify\n * @memberof google.protobuf.Timestamp\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Timestamp.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.seconds != null && message.hasOwnProperty(\"seconds\"))\n if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high)))\n return \"seconds: integer|Long expected\";\n if (message.nanos != null && message.hasOwnProperty(\"nanos\"))\n if (!$util.isInteger(message.nanos))\n return \"nanos: integer expected\";\n return null;\n };\n \n /**\n * Creates a Timestamp message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.Timestamp\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.Timestamp} Timestamp\n */\n Timestamp.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.Timestamp)\n return object;\n var message = new $root.google.protobuf.Timestamp();\n if (object.seconds != null)\n if ($util.Long)\n (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;\n else if (typeof object.seconds === \"string\")\n message.seconds = parseInt(object.seconds, 10);\n else if (typeof object.seconds === \"number\")\n message.seconds = object.seconds;\n else if (typeof object.seconds === \"object\")\n message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber();\n if (object.nanos != null)\n message.nanos = object.nanos | 0;\n return message;\n };\n \n /**\n * Creates a plain object from a Timestamp message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.Timestamp\n * @static\n * @param {google.protobuf.Timestamp} message Timestamp\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Timestamp.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n if ($util.Long) {\n var long = new $util.Long(0, 0, false);\n object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.seconds = options.longs === String ? \"0\" : 0;\n object.nanos = 0;\n }\n if (message.seconds != null && message.hasOwnProperty(\"seconds\"))\n if (typeof message.seconds === \"number\")\n object.seconds = options.longs === String ? String(message.seconds) : message.seconds;\n else\n object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds;\n if (message.nanos != null && message.hasOwnProperty(\"nanos\"))\n object.nanos = message.nanos;\n return object;\n };\n \n /**\n * Converts this Timestamp to JSON.\n * @function toJSON\n * @memberof google.protobuf.Timestamp\n * @instance\n * @returns {Object.} JSON object\n */\n Timestamp.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Timestamp\n * @function getTypeUrl\n * @memberof google.protobuf.Timestamp\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.Timestamp\";\n };\n \n return Timestamp;\n })();\n \n protobuf.FieldMask = (function() {\n \n /**\n * Properties of a FieldMask.\n * @memberof google.protobuf\n * @interface IFieldMask\n * @property {Array.|null} [paths] FieldMask paths\n */\n \n /**\n * Constructs a new FieldMask.\n * @memberof google.protobuf\n * @classdesc Represents a FieldMask.\n * @implements IFieldMask\n * @constructor\n * @param {google.protobuf.IFieldMask=} [properties] Properties to set\n */\n function FieldMask(properties) {\n this.paths = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * FieldMask paths.\n * @member {Array.} paths\n * @memberof google.protobuf.FieldMask\n * @instance\n */\n FieldMask.prototype.paths = $util.emptyArray;\n \n /**\n * Creates a new FieldMask instance using the specified properties.\n * @function create\n * @memberof google.protobuf.FieldMask\n * @static\n * @param {google.protobuf.IFieldMask=} [properties] Properties to set\n * @returns {google.protobuf.FieldMask} FieldMask instance\n */\n FieldMask.create = function create(properties) {\n return new FieldMask(properties);\n };\n \n /**\n * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.FieldMask\n * @static\n * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FieldMask.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.paths != null && message.paths.length)\n for (var i = 0; i < message.paths.length; ++i)\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]);\n return writer;\n };\n \n /**\n * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.FieldMask\n * @static\n * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FieldMask.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a FieldMask message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.FieldMask\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.FieldMask} FieldMask\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FieldMask.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.paths && message.paths.length))\n message.paths = [];\n message.paths.push(reader.string());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a FieldMask message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.FieldMask\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.FieldMask} FieldMask\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FieldMask.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a FieldMask message.\n * @function verify\n * @memberof google.protobuf.FieldMask\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n FieldMask.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.paths != null && message.hasOwnProperty(\"paths\")) {\n if (!Array.isArray(message.paths))\n return \"paths: array expected\";\n for (var i = 0; i < message.paths.length; ++i)\n if (!$util.isString(message.paths[i]))\n return \"paths: string[] expected\";\n }\n return null;\n };\n \n /**\n * Creates a FieldMask message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.FieldMask\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.FieldMask} FieldMask\n */\n FieldMask.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.FieldMask)\n return object;\n var message = new $root.google.protobuf.FieldMask();\n if (object.paths) {\n if (!Array.isArray(object.paths))\n throw TypeError(\".google.protobuf.FieldMask.paths: array expected\");\n message.paths = [];\n for (var i = 0; i < object.paths.length; ++i)\n message.paths[i] = String(object.paths[i]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a FieldMask message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.FieldMask\n * @static\n * @param {google.protobuf.FieldMask} message FieldMask\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n FieldMask.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.paths = [];\n if (message.paths && message.paths.length) {\n object.paths = [];\n for (var j = 0; j < message.paths.length; ++j)\n object.paths[j] = message.paths[j];\n }\n return object;\n };\n \n /**\n * Converts this FieldMask to JSON.\n * @function toJSON\n * @memberof google.protobuf.FieldMask\n * @instance\n * @returns {Object.} JSON object\n */\n FieldMask.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for FieldMask\n * @function getTypeUrl\n * @memberof google.protobuf.FieldMask\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.FieldMask\";\n };\n \n return FieldMask;\n })();\n \n protobuf.Duration = (function() {\n \n /**\n * Properties of a Duration.\n * @memberof google.protobuf\n * @interface IDuration\n * @property {number|Long|null} [seconds] Duration seconds\n * @property {number|null} [nanos] Duration nanos\n */\n \n /**\n * Constructs a new Duration.\n * @memberof google.protobuf\n * @classdesc Represents a Duration.\n * @implements IDuration\n * @constructor\n * @param {google.protobuf.IDuration=} [properties] Properties to set\n */\n function Duration(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Duration seconds.\n * @member {number|Long} seconds\n * @memberof google.protobuf.Duration\n * @instance\n */\n Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n \n /**\n * Duration nanos.\n * @member {number} nanos\n * @memberof google.protobuf.Duration\n * @instance\n */\n Duration.prototype.nanos = 0;\n \n /**\n * Creates a new Duration instance using the specified properties.\n * @function create\n * @memberof google.protobuf.Duration\n * @static\n * @param {google.protobuf.IDuration=} [properties] Properties to set\n * @returns {google.protobuf.Duration} Duration instance\n */\n Duration.create = function create(properties) {\n return new Duration(properties);\n };\n \n /**\n * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.Duration\n * @static\n * @param {google.protobuf.IDuration} message Duration message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Duration.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.seconds != null && Object.hasOwnProperty.call(message, \"seconds\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds);\n if (message.nanos != null && Object.hasOwnProperty.call(message, \"nanos\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos);\n return writer;\n };\n \n /**\n * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.Duration\n * @static\n * @param {google.protobuf.IDuration} message Duration message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Duration.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Duration message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.Duration\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.Duration} Duration\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Duration.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.seconds = reader.int64();\n break;\n }\n case 2: {\n message.nanos = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Duration message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.Duration\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.Duration} Duration\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Duration.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Duration message.\n * @function verify\n * @memberof google.protobuf.Duration\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Duration.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.seconds != null && message.hasOwnProperty(\"seconds\"))\n if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high)))\n return \"seconds: integer|Long expected\";\n if (message.nanos != null && message.hasOwnProperty(\"nanos\"))\n if (!$util.isInteger(message.nanos))\n return \"nanos: integer expected\";\n return null;\n };\n \n /**\n * Creates a Duration message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.Duration\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.Duration} Duration\n */\n Duration.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.Duration)\n return object;\n var message = new $root.google.protobuf.Duration();\n if (object.seconds != null)\n if ($util.Long)\n (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;\n else if (typeof object.seconds === \"string\")\n message.seconds = parseInt(object.seconds, 10);\n else if (typeof object.seconds === \"number\")\n message.seconds = object.seconds;\n else if (typeof object.seconds === \"object\")\n message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber();\n if (object.nanos != null)\n message.nanos = object.nanos | 0;\n return message;\n };\n \n /**\n * Creates a plain object from a Duration message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.Duration\n * @static\n * @param {google.protobuf.Duration} message Duration\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Duration.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n if ($util.Long) {\n var long = new $util.Long(0, 0, false);\n object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.seconds = options.longs === String ? \"0\" : 0;\n object.nanos = 0;\n }\n if (message.seconds != null && message.hasOwnProperty(\"seconds\"))\n if (typeof message.seconds === \"number\")\n object.seconds = options.longs === String ? String(message.seconds) : message.seconds;\n else\n object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds;\n if (message.nanos != null && message.hasOwnProperty(\"nanos\"))\n object.nanos = message.nanos;\n return object;\n };\n \n /**\n * Converts this Duration to JSON.\n * @function toJSON\n * @memberof google.protobuf.Duration\n * @instance\n * @returns {Object.} JSON object\n */\n Duration.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Duration\n * @function getTypeUrl\n * @memberof google.protobuf.Duration\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.Duration\";\n };\n \n return Duration;\n })();\n \n protobuf.Struct = (function() {\n \n /**\n * Properties of a Struct.\n * @memberof google.protobuf\n * @interface IStruct\n * @property {Object.|null} [fields] Struct fields\n */\n \n /**\n * Constructs a new Struct.\n * @memberof google.protobuf\n * @classdesc Represents a Struct.\n * @implements IStruct\n * @constructor\n * @param {google.protobuf.IStruct=} [properties] Properties to set\n */\n function Struct(properties) {\n this.fields = {};\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Struct fields.\n * @member {Object.} fields\n * @memberof google.protobuf.Struct\n * @instance\n */\n Struct.prototype.fields = $util.emptyObject;\n \n /**\n * Creates a new Struct instance using the specified properties.\n * @function create\n * @memberof google.protobuf.Struct\n * @static\n * @param {google.protobuf.IStruct=} [properties] Properties to set\n * @returns {google.protobuf.Struct} Struct instance\n */\n Struct.create = function create(properties) {\n return new Struct(properties);\n };\n \n /**\n * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.Struct\n * @static\n * @param {google.protobuf.IStruct} message Struct message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Struct.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.fields != null && Object.hasOwnProperty.call(message, \"fields\"))\n for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) {\n writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);\n $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();\n }\n return writer;\n };\n \n /**\n * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.Struct\n * @static\n * @param {google.protobuf.IStruct} message Struct message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Struct.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Struct message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.Struct\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.Struct} Struct\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Struct.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value;\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (message.fields === $util.emptyObject)\n message.fields = {};\n var end2 = reader.uint32() + reader.pos;\n key = \"\";\n value = null;\n while (reader.pos < end2) {\n var tag2 = reader.uint32();\n switch (tag2 >>> 3) {\n case 1:\n key = reader.string();\n break;\n case 2:\n value = $root.google.protobuf.Value.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag2 & 7);\n break;\n }\n }\n message.fields[key] = value;\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Struct message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.Struct\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.Struct} Struct\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Struct.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Struct message.\n * @function verify\n * @memberof google.protobuf.Struct\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Struct.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.fields != null && message.hasOwnProperty(\"fields\")) {\n if (!$util.isObject(message.fields))\n return \"fields: object expected\";\n var key = Object.keys(message.fields);\n for (var i = 0; i < key.length; ++i) {\n var error = $root.google.protobuf.Value.verify(message.fields[key[i]]);\n if (error)\n return \"fields.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a Struct message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.Struct\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.Struct} Struct\n */\n Struct.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.Struct)\n return object;\n var message = new $root.google.protobuf.Struct();\n if (object.fields) {\n if (typeof object.fields !== \"object\")\n throw TypeError(\".google.protobuf.Struct.fields: object expected\");\n message.fields = {};\n for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) {\n if (typeof object.fields[keys[i]] !== \"object\")\n throw TypeError(\".google.protobuf.Struct.fields: object expected\");\n message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from a Struct message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.Struct\n * @static\n * @param {google.protobuf.Struct} message Struct\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Struct.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.objects || options.defaults)\n object.fields = {};\n var keys2;\n if (message.fields && (keys2 = Object.keys(message.fields)).length) {\n object.fields = {};\n for (var j = 0; j < keys2.length; ++j)\n object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options);\n }\n return object;\n };\n \n /**\n * Converts this Struct to JSON.\n * @function toJSON\n * @memberof google.protobuf.Struct\n * @instance\n * @returns {Object.} JSON object\n */\n Struct.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Struct\n * @function getTypeUrl\n * @memberof google.protobuf.Struct\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.Struct\";\n };\n \n return Struct;\n })();\n \n protobuf.Value = (function() {\n \n /**\n * Properties of a Value.\n * @memberof google.protobuf\n * @interface IValue\n * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue\n * @property {number|null} [numberValue] Value numberValue\n * @property {string|null} [stringValue] Value stringValue\n * @property {boolean|null} [boolValue] Value boolValue\n * @property {google.protobuf.IStruct|null} [structValue] Value structValue\n * @property {google.protobuf.IListValue|null} [listValue] Value listValue\n */\n \n /**\n * Constructs a new Value.\n * @memberof google.protobuf\n * @classdesc Represents a Value.\n * @implements IValue\n * @constructor\n * @param {google.protobuf.IValue=} [properties] Properties to set\n */\n function Value(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Value nullValue.\n * @member {google.protobuf.NullValue|null|undefined} nullValue\n * @memberof google.protobuf.Value\n * @instance\n */\n Value.prototype.nullValue = null;\n \n /**\n * Value numberValue.\n * @member {number|null|undefined} numberValue\n * @memberof google.protobuf.Value\n * @instance\n */\n Value.prototype.numberValue = null;\n \n /**\n * Value stringValue.\n * @member {string|null|undefined} stringValue\n * @memberof google.protobuf.Value\n * @instance\n */\n Value.prototype.stringValue = null;\n \n /**\n * Value boolValue.\n * @member {boolean|null|undefined} boolValue\n * @memberof google.protobuf.Value\n * @instance\n */\n Value.prototype.boolValue = null;\n \n /**\n * Value structValue.\n * @member {google.protobuf.IStruct|null|undefined} structValue\n * @memberof google.protobuf.Value\n * @instance\n */\n Value.prototype.structValue = null;\n \n /**\n * Value listValue.\n * @member {google.protobuf.IListValue|null|undefined} listValue\n * @memberof google.protobuf.Value\n * @instance\n */\n Value.prototype.listValue = null;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * Value kind.\n * @member {\"nullValue\"|\"numberValue\"|\"stringValue\"|\"boolValue\"|\"structValue\"|\"listValue\"|undefined} kind\n * @memberof google.protobuf.Value\n * @instance\n */\n Object.defineProperty(Value.prototype, \"kind\", {\n get: $util.oneOfGetter($oneOfFields = [\"nullValue\", \"numberValue\", \"stringValue\", \"boolValue\", \"structValue\", \"listValue\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new Value instance using the specified properties.\n * @function create\n * @memberof google.protobuf.Value\n * @static\n * @param {google.protobuf.IValue=} [properties] Properties to set\n * @returns {google.protobuf.Value} Value instance\n */\n Value.create = function create(properties) {\n return new Value(properties);\n };\n \n /**\n * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.Value\n * @static\n * @param {google.protobuf.IValue} message Value message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Value.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.nullValue != null && Object.hasOwnProperty.call(message, \"nullValue\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue);\n if (message.numberValue != null && Object.hasOwnProperty.call(message, \"numberValue\"))\n writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue);\n if (message.stringValue != null && Object.hasOwnProperty.call(message, \"stringValue\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue);\n if (message.boolValue != null && Object.hasOwnProperty.call(message, \"boolValue\"))\n writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue);\n if (message.structValue != null && Object.hasOwnProperty.call(message, \"structValue\"))\n $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.listValue != null && Object.hasOwnProperty.call(message, \"listValue\"))\n $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.Value\n * @static\n * @param {google.protobuf.IValue} message Value message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Value.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Value message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.Value\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.Value} Value\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Value.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.nullValue = reader.int32();\n break;\n }\n case 2: {\n message.numberValue = reader.double();\n break;\n }\n case 3: {\n message.stringValue = reader.string();\n break;\n }\n case 4: {\n message.boolValue = reader.bool();\n break;\n }\n case 5: {\n message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32());\n break;\n }\n case 6: {\n message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Value message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.Value\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.Value} Value\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Value.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Value message.\n * @function verify\n * @memberof google.protobuf.Value\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Value.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.nullValue != null && message.hasOwnProperty(\"nullValue\")) {\n properties.kind = 1;\n switch (message.nullValue) {\n default:\n return \"nullValue: enum value expected\";\n case 0:\n break;\n }\n }\n if (message.numberValue != null && message.hasOwnProperty(\"numberValue\")) {\n if (properties.kind === 1)\n return \"kind: multiple values\";\n properties.kind = 1;\n if (typeof message.numberValue !== \"number\")\n return \"numberValue: number expected\";\n }\n if (message.stringValue != null && message.hasOwnProperty(\"stringValue\")) {\n if (properties.kind === 1)\n return \"kind: multiple values\";\n properties.kind = 1;\n if (!$util.isString(message.stringValue))\n return \"stringValue: string expected\";\n }\n if (message.boolValue != null && message.hasOwnProperty(\"boolValue\")) {\n if (properties.kind === 1)\n return \"kind: multiple values\";\n properties.kind = 1;\n if (typeof message.boolValue !== \"boolean\")\n return \"boolValue: boolean expected\";\n }\n if (message.structValue != null && message.hasOwnProperty(\"structValue\")) {\n if (properties.kind === 1)\n return \"kind: multiple values\";\n properties.kind = 1;\n {\n var error = $root.google.protobuf.Struct.verify(message.structValue);\n if (error)\n return \"structValue.\" + error;\n }\n }\n if (message.listValue != null && message.hasOwnProperty(\"listValue\")) {\n if (properties.kind === 1)\n return \"kind: multiple values\";\n properties.kind = 1;\n {\n var error = $root.google.protobuf.ListValue.verify(message.listValue);\n if (error)\n return \"listValue.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a Value message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.Value\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.Value} Value\n */\n Value.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.Value)\n return object;\n var message = new $root.google.protobuf.Value();\n switch (object.nullValue) {\n default:\n if (typeof object.nullValue === \"number\") {\n message.nullValue = object.nullValue;\n break;\n }\n break;\n case \"NULL_VALUE\":\n case 0:\n message.nullValue = 0;\n break;\n }\n if (object.numberValue != null)\n message.numberValue = Number(object.numberValue);\n if (object.stringValue != null)\n message.stringValue = String(object.stringValue);\n if (object.boolValue != null)\n message.boolValue = Boolean(object.boolValue);\n if (object.structValue != null) {\n if (typeof object.structValue !== \"object\")\n throw TypeError(\".google.protobuf.Value.structValue: object expected\");\n message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue);\n }\n if (object.listValue != null) {\n if (typeof object.listValue !== \"object\")\n throw TypeError(\".google.protobuf.Value.listValue: object expected\");\n message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a Value message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.Value\n * @static\n * @param {google.protobuf.Value} message Value\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Value.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (message.nullValue != null && message.hasOwnProperty(\"nullValue\")) {\n object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue;\n if (options.oneofs)\n object.kind = \"nullValue\";\n }\n if (message.numberValue != null && message.hasOwnProperty(\"numberValue\")) {\n object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue;\n if (options.oneofs)\n object.kind = \"numberValue\";\n }\n if (message.stringValue != null && message.hasOwnProperty(\"stringValue\")) {\n object.stringValue = message.stringValue;\n if (options.oneofs)\n object.kind = \"stringValue\";\n }\n if (message.boolValue != null && message.hasOwnProperty(\"boolValue\")) {\n object.boolValue = message.boolValue;\n if (options.oneofs)\n object.kind = \"boolValue\";\n }\n if (message.structValue != null && message.hasOwnProperty(\"structValue\")) {\n object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options);\n if (options.oneofs)\n object.kind = \"structValue\";\n }\n if (message.listValue != null && message.hasOwnProperty(\"listValue\")) {\n object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options);\n if (options.oneofs)\n object.kind = \"listValue\";\n }\n return object;\n };\n \n /**\n * Converts this Value to JSON.\n * @function toJSON\n * @memberof google.protobuf.Value\n * @instance\n * @returns {Object.} JSON object\n */\n Value.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Value\n * @function getTypeUrl\n * @memberof google.protobuf.Value\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.Value\";\n };\n \n return Value;\n })();\n \n /**\n * NullValue enum.\n * @name google.protobuf.NullValue\n * @enum {number}\n * @property {number} NULL_VALUE=0 NULL_VALUE value\n */\n protobuf.NullValue = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"NULL_VALUE\"] = 0;\n return values;\n })();\n \n protobuf.ListValue = (function() {\n \n /**\n * Properties of a ListValue.\n * @memberof google.protobuf\n * @interface IListValue\n * @property {Array.|null} [values] ListValue values\n */\n \n /**\n * Constructs a new ListValue.\n * @memberof google.protobuf\n * @classdesc Represents a ListValue.\n * @implements IListValue\n * @constructor\n * @param {google.protobuf.IListValue=} [properties] Properties to set\n */\n function ListValue(properties) {\n this.values = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListValue values.\n * @member {Array.} values\n * @memberof google.protobuf.ListValue\n * @instance\n */\n ListValue.prototype.values = $util.emptyArray;\n \n /**\n * Creates a new ListValue instance using the specified properties.\n * @function create\n * @memberof google.protobuf.ListValue\n * @static\n * @param {google.protobuf.IListValue=} [properties] Properties to set\n * @returns {google.protobuf.ListValue} ListValue instance\n */\n ListValue.create = function create(properties) {\n return new ListValue(properties);\n };\n \n /**\n * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.ListValue\n * @static\n * @param {google.protobuf.IListValue} message ListValue message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListValue.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.values != null && message.values.length)\n for (var i = 0; i < message.values.length; ++i)\n $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.ListValue\n * @static\n * @param {google.protobuf.IListValue} message ListValue message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListValue.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListValue message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.ListValue\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.ListValue} ListValue\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListValue.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.values && message.values.length))\n message.values = [];\n message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListValue message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.ListValue\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.ListValue} ListValue\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListValue.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListValue message.\n * @function verify\n * @memberof google.protobuf.ListValue\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListValue.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.values != null && message.hasOwnProperty(\"values\")) {\n if (!Array.isArray(message.values))\n return \"values: array expected\";\n for (var i = 0; i < message.values.length; ++i) {\n var error = $root.google.protobuf.Value.verify(message.values[i]);\n if (error)\n return \"values.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a ListValue message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.ListValue\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.ListValue} ListValue\n */\n ListValue.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.ListValue)\n return object;\n var message = new $root.google.protobuf.ListValue();\n if (object.values) {\n if (!Array.isArray(object.values))\n throw TypeError(\".google.protobuf.ListValue.values: array expected\");\n message.values = [];\n for (var i = 0; i < object.values.length; ++i) {\n if (typeof object.values[i] !== \"object\")\n throw TypeError(\".google.protobuf.ListValue.values: object expected\");\n message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from a ListValue message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.ListValue\n * @static\n * @param {google.protobuf.ListValue} message ListValue\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListValue.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.values = [];\n if (message.values && message.values.length) {\n object.values = [];\n for (var j = 0; j < message.values.length; ++j)\n object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options);\n }\n return object;\n };\n \n /**\n * Converts this ListValue to JSON.\n * @function toJSON\n * @memberof google.protobuf.ListValue\n * @instance\n * @returns {Object.} JSON object\n */\n ListValue.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListValue\n * @function getTypeUrl\n * @memberof google.protobuf.ListValue\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.ListValue\";\n };\n \n return ListValue;\n })();\n \n protobuf.Empty = (function() {\n \n /**\n * Properties of an Empty.\n * @memberof google.protobuf\n * @interface IEmpty\n */\n \n /**\n * Constructs a new Empty.\n * @memberof google.protobuf\n * @classdesc Represents an Empty.\n * @implements IEmpty\n * @constructor\n * @param {google.protobuf.IEmpty=} [properties] Properties to set\n */\n function Empty(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Creates a new Empty instance using the specified properties.\n * @function create\n * @memberof google.protobuf.Empty\n * @static\n * @param {google.protobuf.IEmpty=} [properties] Properties to set\n * @returns {google.protobuf.Empty} Empty instance\n */\n Empty.create = function create(properties) {\n return new Empty(properties);\n };\n \n /**\n * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages.\n * @function encode\n * @memberof google.protobuf.Empty\n * @static\n * @param {google.protobuf.IEmpty} message Empty message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Empty.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n return writer;\n };\n \n /**\n * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.protobuf.Empty\n * @static\n * @param {google.protobuf.IEmpty} message Empty message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Empty.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an Empty message from the specified reader or buffer.\n * @function decode\n * @memberof google.protobuf.Empty\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.protobuf.Empty} Empty\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Empty.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an Empty message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.protobuf.Empty\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.protobuf.Empty} Empty\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Empty.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an Empty message.\n * @function verify\n * @memberof google.protobuf.Empty\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Empty.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n return null;\n };\n \n /**\n * Creates an Empty message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.protobuf.Empty\n * @static\n * @param {Object.} object Plain object\n * @returns {google.protobuf.Empty} Empty\n */\n Empty.fromObject = function fromObject(object) {\n if (object instanceof $root.google.protobuf.Empty)\n return object;\n return new $root.google.protobuf.Empty();\n };\n \n /**\n * Creates a plain object from an Empty message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.protobuf.Empty\n * @static\n * @param {google.protobuf.Empty} message Empty\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Empty.toObject = function toObject() {\n return {};\n };\n \n /**\n * Converts this Empty to JSON.\n * @function toJSON\n * @memberof google.protobuf.Empty\n * @instance\n * @returns {Object.} JSON object\n */\n Empty.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Empty\n * @function getTypeUrl\n * @memberof google.protobuf.Empty\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.protobuf.Empty\";\n };\n \n return Empty;\n })();\n \n return protobuf;\n })();\n \n google.rpc = (function() {\n \n /**\n * Namespace rpc.\n * @memberof google\n * @namespace\n */\n var rpc = {};\n \n rpc.Status = (function() {\n \n /**\n * Properties of a Status.\n * @memberof google.rpc\n * @interface IStatus\n * @property {number|null} [code] Status code\n * @property {string|null} [message] Status message\n * @property {Array.|null} [details] Status details\n */\n \n /**\n * Constructs a new Status.\n * @memberof google.rpc\n * @classdesc Represents a Status.\n * @implements IStatus\n * @constructor\n * @param {google.rpc.IStatus=} [properties] Properties to set\n */\n function Status(properties) {\n this.details = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Status code.\n * @member {number} code\n * @memberof google.rpc.Status\n * @instance\n */\n Status.prototype.code = 0;\n \n /**\n * Status message.\n * @member {string} message\n * @memberof google.rpc.Status\n * @instance\n */\n Status.prototype.message = \"\";\n \n /**\n * Status details.\n * @member {Array.} details\n * @memberof google.rpc.Status\n * @instance\n */\n Status.prototype.details = $util.emptyArray;\n \n /**\n * Creates a new Status instance using the specified properties.\n * @function create\n * @memberof google.rpc.Status\n * @static\n * @param {google.rpc.IStatus=} [properties] Properties to set\n * @returns {google.rpc.Status} Status instance\n */\n Status.create = function create(properties) {\n return new Status(properties);\n };\n \n /**\n * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages.\n * @function encode\n * @memberof google.rpc.Status\n * @static\n * @param {google.rpc.IStatus} message Status message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Status.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.code != null && Object.hasOwnProperty.call(message, \"code\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);\n if (message.message != null && Object.hasOwnProperty.call(message, \"message\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.message);\n if (message.details != null && message.details.length)\n for (var i = 0; i < message.details.length; ++i)\n $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.rpc.Status\n * @static\n * @param {google.rpc.IStatus} message Status message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Status.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Status message from the specified reader or buffer.\n * @function decode\n * @memberof google.rpc.Status\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.rpc.Status} Status\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Status.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.code = reader.int32();\n break;\n }\n case 2: {\n message.message = reader.string();\n break;\n }\n case 3: {\n if (!(message.details && message.details.length))\n message.details = [];\n message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Status message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.rpc.Status\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.rpc.Status} Status\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Status.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Status message.\n * @function verify\n * @memberof google.rpc.Status\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Status.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.code != null && message.hasOwnProperty(\"code\"))\n if (!$util.isInteger(message.code))\n return \"code: integer expected\";\n if (message.message != null && message.hasOwnProperty(\"message\"))\n if (!$util.isString(message.message))\n return \"message: string expected\";\n if (message.details != null && message.hasOwnProperty(\"details\")) {\n if (!Array.isArray(message.details))\n return \"details: array expected\";\n for (var i = 0; i < message.details.length; ++i) {\n var error = $root.google.protobuf.Any.verify(message.details[i]);\n if (error)\n return \"details.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a Status message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.rpc.Status\n * @static\n * @param {Object.} object Plain object\n * @returns {google.rpc.Status} Status\n */\n Status.fromObject = function fromObject(object) {\n if (object instanceof $root.google.rpc.Status)\n return object;\n var message = new $root.google.rpc.Status();\n if (object.code != null)\n message.code = object.code | 0;\n if (object.message != null)\n message.message = String(object.message);\n if (object.details) {\n if (!Array.isArray(object.details))\n throw TypeError(\".google.rpc.Status.details: array expected\");\n message.details = [];\n for (var i = 0; i < object.details.length; ++i) {\n if (typeof object.details[i] !== \"object\")\n throw TypeError(\".google.rpc.Status.details: object expected\");\n message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from a Status message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.rpc.Status\n * @static\n * @param {google.rpc.Status} message Status\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Status.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.details = [];\n if (options.defaults) {\n object.code = 0;\n object.message = \"\";\n }\n if (message.code != null && message.hasOwnProperty(\"code\"))\n object.code = message.code;\n if (message.message != null && message.hasOwnProperty(\"message\"))\n object.message = message.message;\n if (message.details && message.details.length) {\n object.details = [];\n for (var j = 0; j < message.details.length; ++j)\n object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options);\n }\n return object;\n };\n \n /**\n * Converts this Status to JSON.\n * @function toJSON\n * @memberof google.rpc.Status\n * @instance\n * @returns {Object.} JSON object\n */\n Status.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Status\n * @function getTypeUrl\n * @memberof google.rpc.Status\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.rpc.Status\";\n };\n \n return Status;\n })();\n \n return rpc;\n })();\n \n google.type = (function() {\n \n /**\n * Namespace type.\n * @memberof google\n * @namespace\n */\n var type = {};\n \n type.Expr = (function() {\n \n /**\n * Properties of an Expr.\n * @memberof google.type\n * @interface IExpr\n * @property {string|null} [expression] Expr expression\n * @property {string|null} [title] Expr title\n * @property {string|null} [description] Expr description\n * @property {string|null} [location] Expr location\n */\n \n /**\n * Constructs a new Expr.\n * @memberof google.type\n * @classdesc Represents an Expr.\n * @implements IExpr\n * @constructor\n * @param {google.type.IExpr=} [properties] Properties to set\n */\n function Expr(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Expr expression.\n * @member {string} expression\n * @memberof google.type.Expr\n * @instance\n */\n Expr.prototype.expression = \"\";\n \n /**\n * Expr title.\n * @member {string} title\n * @memberof google.type.Expr\n * @instance\n */\n Expr.prototype.title = \"\";\n \n /**\n * Expr description.\n * @member {string} description\n * @memberof google.type.Expr\n * @instance\n */\n Expr.prototype.description = \"\";\n \n /**\n * Expr location.\n * @member {string} location\n * @memberof google.type.Expr\n * @instance\n */\n Expr.prototype.location = \"\";\n \n /**\n * Creates a new Expr instance using the specified properties.\n * @function create\n * @memberof google.type.Expr\n * @static\n * @param {google.type.IExpr=} [properties] Properties to set\n * @returns {google.type.Expr} Expr instance\n */\n Expr.create = function create(properties) {\n return new Expr(properties);\n };\n \n /**\n * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages.\n * @function encode\n * @memberof google.type.Expr\n * @static\n * @param {google.type.IExpr} message Expr message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Expr.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.expression != null && Object.hasOwnProperty.call(message, \"expression\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression);\n if (message.title != null && Object.hasOwnProperty.call(message, \"title\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.title);\n if (message.description != null && Object.hasOwnProperty.call(message, \"description\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.description);\n if (message.location != null && Object.hasOwnProperty.call(message, \"location\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.location);\n return writer;\n };\n \n /**\n * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.type.Expr\n * @static\n * @param {google.type.IExpr} message Expr message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Expr.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an Expr message from the specified reader or buffer.\n * @function decode\n * @memberof google.type.Expr\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.type.Expr} Expr\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Expr.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.expression = reader.string();\n break;\n }\n case 2: {\n message.title = reader.string();\n break;\n }\n case 3: {\n message.description = reader.string();\n break;\n }\n case 4: {\n message.location = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an Expr message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.type.Expr\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.type.Expr} Expr\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Expr.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an Expr message.\n * @function verify\n * @memberof google.type.Expr\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Expr.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.expression != null && message.hasOwnProperty(\"expression\"))\n if (!$util.isString(message.expression))\n return \"expression: string expected\";\n if (message.title != null && message.hasOwnProperty(\"title\"))\n if (!$util.isString(message.title))\n return \"title: string expected\";\n if (message.description != null && message.hasOwnProperty(\"description\"))\n if (!$util.isString(message.description))\n return \"description: string expected\";\n if (message.location != null && message.hasOwnProperty(\"location\"))\n if (!$util.isString(message.location))\n return \"location: string expected\";\n return null;\n };\n \n /**\n * Creates an Expr message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.type.Expr\n * @static\n * @param {Object.} object Plain object\n * @returns {google.type.Expr} Expr\n */\n Expr.fromObject = function fromObject(object) {\n if (object instanceof $root.google.type.Expr)\n return object;\n var message = new $root.google.type.Expr();\n if (object.expression != null)\n message.expression = String(object.expression);\n if (object.title != null)\n message.title = String(object.title);\n if (object.description != null)\n message.description = String(object.description);\n if (object.location != null)\n message.location = String(object.location);\n return message;\n };\n \n /**\n * Creates a plain object from an Expr message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.type.Expr\n * @static\n * @param {google.type.Expr} message Expr\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Expr.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.expression = \"\";\n object.title = \"\";\n object.description = \"\";\n object.location = \"\";\n }\n if (message.expression != null && message.hasOwnProperty(\"expression\"))\n object.expression = message.expression;\n if (message.title != null && message.hasOwnProperty(\"title\"))\n object.title = message.title;\n if (message.description != null && message.hasOwnProperty(\"description\"))\n object.description = message.description;\n if (message.location != null && message.hasOwnProperty(\"location\"))\n object.location = message.location;\n return object;\n };\n \n /**\n * Converts this Expr to JSON.\n * @function toJSON\n * @memberof google.type.Expr\n * @instance\n * @returns {Object.} JSON object\n */\n Expr.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Expr\n * @function getTypeUrl\n * @memberof google.type.Expr\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.type.Expr\";\n };\n \n return Expr;\n })();\n \n return type;\n })();\n \n google.iam = (function() {\n \n /**\n * Namespace iam.\n * @memberof google\n * @namespace\n */\n var iam = {};\n \n iam.v1 = (function() {\n \n /**\n * Namespace v1.\n * @memberof google.iam\n * @namespace\n */\n var v1 = {};\n \n v1.IAMPolicy = (function() {\n \n /**\n * Constructs a new IAMPolicy service.\n * @memberof google.iam.v1\n * @classdesc Represents a IAMPolicy\n * @extends $protobuf.rpc.Service\n * @constructor\n * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\n function IAMPolicy(rpcImpl, requestDelimited, responseDelimited) {\n $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\n }\n \n (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy;\n \n /**\n * Creates new IAMPolicy service using the specified rpc implementation.\n * @function create\n * @memberof google.iam.v1.IAMPolicy\n * @static\n * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n * @returns {IAMPolicy} RPC service. Useful where requests and/or responses are streamed.\n */\n IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n return new this(rpcImpl, requestDelimited, responseDelimited);\n };\n \n /**\n * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}.\n * @memberof google.iam.v1.IAMPolicy\n * @typedef SetIamPolicyCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.iam.v1.Policy} [response] Policy\n */\n \n /**\n * Calls SetIamPolicy.\n * @function setIamPolicy\n * @memberof google.iam.v1.IAMPolicy\n * @instance\n * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object\n * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) {\n return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback);\n }, \"name\", { value: \"SetIamPolicy\" });\n \n /**\n * Calls SetIamPolicy.\n * @function setIamPolicy\n * @memberof google.iam.v1.IAMPolicy\n * @instance\n * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}.\n * @memberof google.iam.v1.IAMPolicy\n * @typedef GetIamPolicyCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.iam.v1.Policy} [response] Policy\n */\n \n /**\n * Calls GetIamPolicy.\n * @function getIamPolicy\n * @memberof google.iam.v1.IAMPolicy\n * @instance\n * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object\n * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) {\n return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback);\n }, \"name\", { value: \"GetIamPolicy\" });\n \n /**\n * Calls GetIamPolicy.\n * @function getIamPolicy\n * @memberof google.iam.v1.IAMPolicy\n * @instance\n * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}.\n * @memberof google.iam.v1.IAMPolicy\n * @typedef TestIamPermissionsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse\n */\n \n /**\n * Calls TestIamPermissions.\n * @function testIamPermissions\n * @memberof google.iam.v1.IAMPolicy\n * @instance\n * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object\n * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) {\n return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback);\n }, \"name\", { value: \"TestIamPermissions\" });\n \n /**\n * Calls TestIamPermissions.\n * @function testIamPermissions\n * @memberof google.iam.v1.IAMPolicy\n * @instance\n * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n return IAMPolicy;\n })();\n \n v1.SetIamPolicyRequest = (function() {\n \n /**\n * Properties of a SetIamPolicyRequest.\n * @memberof google.iam.v1\n * @interface ISetIamPolicyRequest\n * @property {string|null} [resource] SetIamPolicyRequest resource\n * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy\n * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask\n */\n \n /**\n * Constructs a new SetIamPolicyRequest.\n * @memberof google.iam.v1\n * @classdesc Represents a SetIamPolicyRequest.\n * @implements ISetIamPolicyRequest\n * @constructor\n * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set\n */\n function SetIamPolicyRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * SetIamPolicyRequest resource.\n * @member {string} resource\n * @memberof google.iam.v1.SetIamPolicyRequest\n * @instance\n */\n SetIamPolicyRequest.prototype.resource = \"\";\n \n /**\n * SetIamPolicyRequest policy.\n * @member {google.iam.v1.IPolicy|null|undefined} policy\n * @memberof google.iam.v1.SetIamPolicyRequest\n * @instance\n */\n SetIamPolicyRequest.prototype.policy = null;\n \n /**\n * SetIamPolicyRequest updateMask.\n * @member {google.protobuf.IFieldMask|null|undefined} updateMask\n * @memberof google.iam.v1.SetIamPolicyRequest\n * @instance\n */\n SetIamPolicyRequest.prototype.updateMask = null;\n \n /**\n * Creates a new SetIamPolicyRequest instance using the specified properties.\n * @function create\n * @memberof google.iam.v1.SetIamPolicyRequest\n * @static\n * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set\n * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance\n */\n SetIamPolicyRequest.create = function create(properties) {\n return new SetIamPolicyRequest(properties);\n };\n \n /**\n * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages.\n * @function encode\n * @memberof google.iam.v1.SetIamPolicyRequest\n * @static\n * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n SetIamPolicyRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.resource != null && Object.hasOwnProperty.call(message, \"resource\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource);\n if (message.policy != null && Object.hasOwnProperty.call(message, \"policy\"))\n $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.updateMask != null && Object.hasOwnProperty.call(message, \"updateMask\"))\n $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.iam.v1.SetIamPolicyRequest\n * @static\n * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a SetIamPolicyRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.iam.v1.SetIamPolicyRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n SetIamPolicyRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.resource = reader.string();\n break;\n }\n case 2: {\n message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32());\n break;\n }\n case 3: {\n message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.iam.v1.SetIamPolicyRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a SetIamPolicyRequest message.\n * @function verify\n * @memberof google.iam.v1.SetIamPolicyRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n SetIamPolicyRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.resource != null && message.hasOwnProperty(\"resource\"))\n if (!$util.isString(message.resource))\n return \"resource: string expected\";\n if (message.policy != null && message.hasOwnProperty(\"policy\")) {\n var error = $root.google.iam.v1.Policy.verify(message.policy);\n if (error)\n return \"policy.\" + error;\n }\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\")) {\n var error = $root.google.protobuf.FieldMask.verify(message.updateMask);\n if (error)\n return \"updateMask.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.iam.v1.SetIamPolicyRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest\n */\n SetIamPolicyRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.iam.v1.SetIamPolicyRequest)\n return object;\n var message = new $root.google.iam.v1.SetIamPolicyRequest();\n if (object.resource != null)\n message.resource = String(object.resource);\n if (object.policy != null) {\n if (typeof object.policy !== \"object\")\n throw TypeError(\".google.iam.v1.SetIamPolicyRequest.policy: object expected\");\n message.policy = $root.google.iam.v1.Policy.fromObject(object.policy);\n }\n if (object.updateMask != null) {\n if (typeof object.updateMask !== \"object\")\n throw TypeError(\".google.iam.v1.SetIamPolicyRequest.updateMask: object expected\");\n message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.iam.v1.SetIamPolicyRequest\n * @static\n * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n SetIamPolicyRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.resource = \"\";\n object.policy = null;\n object.updateMask = null;\n }\n if (message.resource != null && message.hasOwnProperty(\"resource\"))\n object.resource = message.resource;\n if (message.policy != null && message.hasOwnProperty(\"policy\"))\n object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options);\n if (message.updateMask != null && message.hasOwnProperty(\"updateMask\"))\n object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);\n return object;\n };\n \n /**\n * Converts this SetIamPolicyRequest to JSON.\n * @function toJSON\n * @memberof google.iam.v1.SetIamPolicyRequest\n * @instance\n * @returns {Object.} JSON object\n */\n SetIamPolicyRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for SetIamPolicyRequest\n * @function getTypeUrl\n * @memberof google.iam.v1.SetIamPolicyRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.iam.v1.SetIamPolicyRequest\";\n };\n \n return SetIamPolicyRequest;\n })();\n \n v1.GetIamPolicyRequest = (function() {\n \n /**\n * Properties of a GetIamPolicyRequest.\n * @memberof google.iam.v1\n * @interface IGetIamPolicyRequest\n * @property {string|null} [resource] GetIamPolicyRequest resource\n * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options\n */\n \n /**\n * Constructs a new GetIamPolicyRequest.\n * @memberof google.iam.v1\n * @classdesc Represents a GetIamPolicyRequest.\n * @implements IGetIamPolicyRequest\n * @constructor\n * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set\n */\n function GetIamPolicyRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetIamPolicyRequest resource.\n * @member {string} resource\n * @memberof google.iam.v1.GetIamPolicyRequest\n * @instance\n */\n GetIamPolicyRequest.prototype.resource = \"\";\n \n /**\n * GetIamPolicyRequest options.\n * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options\n * @memberof google.iam.v1.GetIamPolicyRequest\n * @instance\n */\n GetIamPolicyRequest.prototype.options = null;\n \n /**\n * Creates a new GetIamPolicyRequest instance using the specified properties.\n * @function create\n * @memberof google.iam.v1.GetIamPolicyRequest\n * @static\n * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set\n * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance\n */\n GetIamPolicyRequest.create = function create(properties) {\n return new GetIamPolicyRequest(properties);\n };\n \n /**\n * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages.\n * @function encode\n * @memberof google.iam.v1.GetIamPolicyRequest\n * @static\n * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetIamPolicyRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.resource != null && Object.hasOwnProperty.call(message, \"resource\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource);\n if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.iam.v1.GetIamPolicyRequest\n * @static\n * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetIamPolicyRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.iam.v1.GetIamPolicyRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetIamPolicyRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.resource = reader.string();\n break;\n }\n case 2: {\n message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.iam.v1.GetIamPolicyRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetIamPolicyRequest message.\n * @function verify\n * @memberof google.iam.v1.GetIamPolicyRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetIamPolicyRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.resource != null && message.hasOwnProperty(\"resource\"))\n if (!$util.isString(message.resource))\n return \"resource: string expected\";\n if (message.options != null && message.hasOwnProperty(\"options\")) {\n var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options);\n if (error)\n return \"options.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.iam.v1.GetIamPolicyRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest\n */\n GetIamPolicyRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.iam.v1.GetIamPolicyRequest)\n return object;\n var message = new $root.google.iam.v1.GetIamPolicyRequest();\n if (object.resource != null)\n message.resource = String(object.resource);\n if (object.options != null) {\n if (typeof object.options !== \"object\")\n throw TypeError(\".google.iam.v1.GetIamPolicyRequest.options: object expected\");\n message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.iam.v1.GetIamPolicyRequest\n * @static\n * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetIamPolicyRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.resource = \"\";\n object.options = null;\n }\n if (message.resource != null && message.hasOwnProperty(\"resource\"))\n object.resource = message.resource;\n if (message.options != null && message.hasOwnProperty(\"options\"))\n object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options);\n return object;\n };\n \n /**\n * Converts this GetIamPolicyRequest to JSON.\n * @function toJSON\n * @memberof google.iam.v1.GetIamPolicyRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetIamPolicyRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetIamPolicyRequest\n * @function getTypeUrl\n * @memberof google.iam.v1.GetIamPolicyRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.iam.v1.GetIamPolicyRequest\";\n };\n \n return GetIamPolicyRequest;\n })();\n \n v1.TestIamPermissionsRequest = (function() {\n \n /**\n * Properties of a TestIamPermissionsRequest.\n * @memberof google.iam.v1\n * @interface ITestIamPermissionsRequest\n * @property {string|null} [resource] TestIamPermissionsRequest resource\n * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions\n */\n \n /**\n * Constructs a new TestIamPermissionsRequest.\n * @memberof google.iam.v1\n * @classdesc Represents a TestIamPermissionsRequest.\n * @implements ITestIamPermissionsRequest\n * @constructor\n * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set\n */\n function TestIamPermissionsRequest(properties) {\n this.permissions = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * TestIamPermissionsRequest resource.\n * @member {string} resource\n * @memberof google.iam.v1.TestIamPermissionsRequest\n * @instance\n */\n TestIamPermissionsRequest.prototype.resource = \"\";\n \n /**\n * TestIamPermissionsRequest permissions.\n * @member {Array.} permissions\n * @memberof google.iam.v1.TestIamPermissionsRequest\n * @instance\n */\n TestIamPermissionsRequest.prototype.permissions = $util.emptyArray;\n \n /**\n * Creates a new TestIamPermissionsRequest instance using the specified properties.\n * @function create\n * @memberof google.iam.v1.TestIamPermissionsRequest\n * @static\n * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set\n * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance\n */\n TestIamPermissionsRequest.create = function create(properties) {\n return new TestIamPermissionsRequest(properties);\n };\n \n /**\n * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.iam.v1.TestIamPermissionsRequest\n * @static\n * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n TestIamPermissionsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.resource != null && Object.hasOwnProperty.call(message, \"resource\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource);\n if (message.permissions != null && message.permissions.length)\n for (var i = 0; i < message.permissions.length; ++i)\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]);\n return writer;\n };\n \n /**\n * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.iam.v1.TestIamPermissionsRequest\n * @static\n * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a TestIamPermissionsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.iam.v1.TestIamPermissionsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n TestIamPermissionsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.resource = reader.string();\n break;\n }\n case 2: {\n if (!(message.permissions && message.permissions.length))\n message.permissions = [];\n message.permissions.push(reader.string());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.iam.v1.TestIamPermissionsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a TestIamPermissionsRequest message.\n * @function verify\n * @memberof google.iam.v1.TestIamPermissionsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n TestIamPermissionsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.resource != null && message.hasOwnProperty(\"resource\"))\n if (!$util.isString(message.resource))\n return \"resource: string expected\";\n if (message.permissions != null && message.hasOwnProperty(\"permissions\")) {\n if (!Array.isArray(message.permissions))\n return \"permissions: array expected\";\n for (var i = 0; i < message.permissions.length; ++i)\n if (!$util.isString(message.permissions[i]))\n return \"permissions: string[] expected\";\n }\n return null;\n };\n \n /**\n * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.iam.v1.TestIamPermissionsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest\n */\n TestIamPermissionsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest)\n return object;\n var message = new $root.google.iam.v1.TestIamPermissionsRequest();\n if (object.resource != null)\n message.resource = String(object.resource);\n if (object.permissions) {\n if (!Array.isArray(object.permissions))\n throw TypeError(\".google.iam.v1.TestIamPermissionsRequest.permissions: array expected\");\n message.permissions = [];\n for (var i = 0; i < object.permissions.length; ++i)\n message.permissions[i] = String(object.permissions[i]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.iam.v1.TestIamPermissionsRequest\n * @static\n * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n TestIamPermissionsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.permissions = [];\n if (options.defaults)\n object.resource = \"\";\n if (message.resource != null && message.hasOwnProperty(\"resource\"))\n object.resource = message.resource;\n if (message.permissions && message.permissions.length) {\n object.permissions = [];\n for (var j = 0; j < message.permissions.length; ++j)\n object.permissions[j] = message.permissions[j];\n }\n return object;\n };\n \n /**\n * Converts this TestIamPermissionsRequest to JSON.\n * @function toJSON\n * @memberof google.iam.v1.TestIamPermissionsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n TestIamPermissionsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for TestIamPermissionsRequest\n * @function getTypeUrl\n * @memberof google.iam.v1.TestIamPermissionsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.iam.v1.TestIamPermissionsRequest\";\n };\n \n return TestIamPermissionsRequest;\n })();\n \n v1.TestIamPermissionsResponse = (function() {\n \n /**\n * Properties of a TestIamPermissionsResponse.\n * @memberof google.iam.v1\n * @interface ITestIamPermissionsResponse\n * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions\n */\n \n /**\n * Constructs a new TestIamPermissionsResponse.\n * @memberof google.iam.v1\n * @classdesc Represents a TestIamPermissionsResponse.\n * @implements ITestIamPermissionsResponse\n * @constructor\n * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set\n */\n function TestIamPermissionsResponse(properties) {\n this.permissions = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * TestIamPermissionsResponse permissions.\n * @member {Array.} permissions\n * @memberof google.iam.v1.TestIamPermissionsResponse\n * @instance\n */\n TestIamPermissionsResponse.prototype.permissions = $util.emptyArray;\n \n /**\n * Creates a new TestIamPermissionsResponse instance using the specified properties.\n * @function create\n * @memberof google.iam.v1.TestIamPermissionsResponse\n * @static\n * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set\n * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance\n */\n TestIamPermissionsResponse.create = function create(properties) {\n return new TestIamPermissionsResponse(properties);\n };\n \n /**\n * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages.\n * @function encode\n * @memberof google.iam.v1.TestIamPermissionsResponse\n * @static\n * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n TestIamPermissionsResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.permissions != null && message.permissions.length)\n for (var i = 0; i < message.permissions.length; ++i)\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]);\n return writer;\n };\n \n /**\n * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.iam.v1.TestIamPermissionsResponse\n * @static\n * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a TestIamPermissionsResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.iam.v1.TestIamPermissionsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n TestIamPermissionsResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.permissions && message.permissions.length))\n message.permissions = [];\n message.permissions.push(reader.string());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.iam.v1.TestIamPermissionsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a TestIamPermissionsResponse message.\n * @function verify\n * @memberof google.iam.v1.TestIamPermissionsResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n TestIamPermissionsResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.permissions != null && message.hasOwnProperty(\"permissions\")) {\n if (!Array.isArray(message.permissions))\n return \"permissions: array expected\";\n for (var i = 0; i < message.permissions.length; ++i)\n if (!$util.isString(message.permissions[i]))\n return \"permissions: string[] expected\";\n }\n return null;\n };\n \n /**\n * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.iam.v1.TestIamPermissionsResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse\n */\n TestIamPermissionsResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse)\n return object;\n var message = new $root.google.iam.v1.TestIamPermissionsResponse();\n if (object.permissions) {\n if (!Array.isArray(object.permissions))\n throw TypeError(\".google.iam.v1.TestIamPermissionsResponse.permissions: array expected\");\n message.permissions = [];\n for (var i = 0; i < object.permissions.length; ++i)\n message.permissions[i] = String(object.permissions[i]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.iam.v1.TestIamPermissionsResponse\n * @static\n * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n TestIamPermissionsResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.permissions = [];\n if (message.permissions && message.permissions.length) {\n object.permissions = [];\n for (var j = 0; j < message.permissions.length; ++j)\n object.permissions[j] = message.permissions[j];\n }\n return object;\n };\n \n /**\n * Converts this TestIamPermissionsResponse to JSON.\n * @function toJSON\n * @memberof google.iam.v1.TestIamPermissionsResponse\n * @instance\n * @returns {Object.} JSON object\n */\n TestIamPermissionsResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for TestIamPermissionsResponse\n * @function getTypeUrl\n * @memberof google.iam.v1.TestIamPermissionsResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.iam.v1.TestIamPermissionsResponse\";\n };\n \n return TestIamPermissionsResponse;\n })();\n \n v1.GetPolicyOptions = (function() {\n \n /**\n * Properties of a GetPolicyOptions.\n * @memberof google.iam.v1\n * @interface IGetPolicyOptions\n * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion\n */\n \n /**\n * Constructs a new GetPolicyOptions.\n * @memberof google.iam.v1\n * @classdesc Represents a GetPolicyOptions.\n * @implements IGetPolicyOptions\n * @constructor\n * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set\n */\n function GetPolicyOptions(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetPolicyOptions requestedPolicyVersion.\n * @member {number} requestedPolicyVersion\n * @memberof google.iam.v1.GetPolicyOptions\n * @instance\n */\n GetPolicyOptions.prototype.requestedPolicyVersion = 0;\n \n /**\n * Creates a new GetPolicyOptions instance using the specified properties.\n * @function create\n * @memberof google.iam.v1.GetPolicyOptions\n * @static\n * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set\n * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance\n */\n GetPolicyOptions.create = function create(properties) {\n return new GetPolicyOptions(properties);\n };\n \n /**\n * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages.\n * @function encode\n * @memberof google.iam.v1.GetPolicyOptions\n * @static\n * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetPolicyOptions.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, \"requestedPolicyVersion\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion);\n return writer;\n };\n \n /**\n * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.iam.v1.GetPolicyOptions\n * @static\n * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetPolicyOptions message from the specified reader or buffer.\n * @function decode\n * @memberof google.iam.v1.GetPolicyOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetPolicyOptions.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.requestedPolicyVersion = reader.int32();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.iam.v1.GetPolicyOptions\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetPolicyOptions message.\n * @function verify\n * @memberof google.iam.v1.GetPolicyOptions\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetPolicyOptions.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.requestedPolicyVersion != null && message.hasOwnProperty(\"requestedPolicyVersion\"))\n if (!$util.isInteger(message.requestedPolicyVersion))\n return \"requestedPolicyVersion: integer expected\";\n return null;\n };\n \n /**\n * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.iam.v1.GetPolicyOptions\n * @static\n * @param {Object.} object Plain object\n * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions\n */\n GetPolicyOptions.fromObject = function fromObject(object) {\n if (object instanceof $root.google.iam.v1.GetPolicyOptions)\n return object;\n var message = new $root.google.iam.v1.GetPolicyOptions();\n if (object.requestedPolicyVersion != null)\n message.requestedPolicyVersion = object.requestedPolicyVersion | 0;\n return message;\n };\n \n /**\n * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.iam.v1.GetPolicyOptions\n * @static\n * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetPolicyOptions.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.requestedPolicyVersion = 0;\n if (message.requestedPolicyVersion != null && message.hasOwnProperty(\"requestedPolicyVersion\"))\n object.requestedPolicyVersion = message.requestedPolicyVersion;\n return object;\n };\n \n /**\n * Converts this GetPolicyOptions to JSON.\n * @function toJSON\n * @memberof google.iam.v1.GetPolicyOptions\n * @instance\n * @returns {Object.} JSON object\n */\n GetPolicyOptions.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetPolicyOptions\n * @function getTypeUrl\n * @memberof google.iam.v1.GetPolicyOptions\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.iam.v1.GetPolicyOptions\";\n };\n \n return GetPolicyOptions;\n })();\n \n v1.Policy = (function() {\n \n /**\n * Properties of a Policy.\n * @memberof google.iam.v1\n * @interface IPolicy\n * @property {number|null} [version] Policy version\n * @property {Array.|null} [bindings] Policy bindings\n * @property {Array.|null} [auditConfigs] Policy auditConfigs\n * @property {Uint8Array|null} [etag] Policy etag\n */\n \n /**\n * Constructs a new Policy.\n * @memberof google.iam.v1\n * @classdesc Represents a Policy.\n * @implements IPolicy\n * @constructor\n * @param {google.iam.v1.IPolicy=} [properties] Properties to set\n */\n function Policy(properties) {\n this.bindings = [];\n this.auditConfigs = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Policy version.\n * @member {number} version\n * @memberof google.iam.v1.Policy\n * @instance\n */\n Policy.prototype.version = 0;\n \n /**\n * Policy bindings.\n * @member {Array.} bindings\n * @memberof google.iam.v1.Policy\n * @instance\n */\n Policy.prototype.bindings = $util.emptyArray;\n \n /**\n * Policy auditConfigs.\n * @member {Array.} auditConfigs\n * @memberof google.iam.v1.Policy\n * @instance\n */\n Policy.prototype.auditConfigs = $util.emptyArray;\n \n /**\n * Policy etag.\n * @member {Uint8Array} etag\n * @memberof google.iam.v1.Policy\n * @instance\n */\n Policy.prototype.etag = $util.newBuffer([]);\n \n /**\n * Creates a new Policy instance using the specified properties.\n * @function create\n * @memberof google.iam.v1.Policy\n * @static\n * @param {google.iam.v1.IPolicy=} [properties] Properties to set\n * @returns {google.iam.v1.Policy} Policy instance\n */\n Policy.create = function create(properties) {\n return new Policy(properties);\n };\n \n /**\n * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages.\n * @function encode\n * @memberof google.iam.v1.Policy\n * @static\n * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Policy.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.version != null && Object.hasOwnProperty.call(message, \"version\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version);\n if (message.etag != null && Object.hasOwnProperty.call(message, \"etag\"))\n writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag);\n if (message.bindings != null && message.bindings.length)\n for (var i = 0; i < message.bindings.length; ++i)\n $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n if (message.auditConfigs != null && message.auditConfigs.length)\n for (var i = 0; i < message.auditConfigs.length; ++i)\n $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.iam.v1.Policy\n * @static\n * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Policy.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Policy message from the specified reader or buffer.\n * @function decode\n * @memberof google.iam.v1.Policy\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.iam.v1.Policy} Policy\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Policy.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.version = reader.int32();\n break;\n }\n case 4: {\n if (!(message.bindings && message.bindings.length))\n message.bindings = [];\n message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32()));\n break;\n }\n case 6: {\n if (!(message.auditConfigs && message.auditConfigs.length))\n message.auditConfigs = [];\n message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32()));\n break;\n }\n case 3: {\n message.etag = reader.bytes();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Policy message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.iam.v1.Policy\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.iam.v1.Policy} Policy\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Policy.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Policy message.\n * @function verify\n * @memberof google.iam.v1.Policy\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Policy.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.version != null && message.hasOwnProperty(\"version\"))\n if (!$util.isInteger(message.version))\n return \"version: integer expected\";\n if (message.bindings != null && message.hasOwnProperty(\"bindings\")) {\n if (!Array.isArray(message.bindings))\n return \"bindings: array expected\";\n for (var i = 0; i < message.bindings.length; ++i) {\n var error = $root.google.iam.v1.Binding.verify(message.bindings[i]);\n if (error)\n return \"bindings.\" + error;\n }\n }\n if (message.auditConfigs != null && message.hasOwnProperty(\"auditConfigs\")) {\n if (!Array.isArray(message.auditConfigs))\n return \"auditConfigs: array expected\";\n for (var i = 0; i < message.auditConfigs.length; ++i) {\n var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]);\n if (error)\n return \"auditConfigs.\" + error;\n }\n }\n if (message.etag != null && message.hasOwnProperty(\"etag\"))\n if (!(message.etag && typeof message.etag.length === \"number\" || $util.isString(message.etag)))\n return \"etag: buffer expected\";\n return null;\n };\n \n /**\n * Creates a Policy message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.iam.v1.Policy\n * @static\n * @param {Object.} object Plain object\n * @returns {google.iam.v1.Policy} Policy\n */\n Policy.fromObject = function fromObject(object) {\n if (object instanceof $root.google.iam.v1.Policy)\n return object;\n var message = new $root.google.iam.v1.Policy();\n if (object.version != null)\n message.version = object.version | 0;\n if (object.bindings) {\n if (!Array.isArray(object.bindings))\n throw TypeError(\".google.iam.v1.Policy.bindings: array expected\");\n message.bindings = [];\n for (var i = 0; i < object.bindings.length; ++i) {\n if (typeof object.bindings[i] !== \"object\")\n throw TypeError(\".google.iam.v1.Policy.bindings: object expected\");\n message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]);\n }\n }\n if (object.auditConfigs) {\n if (!Array.isArray(object.auditConfigs))\n throw TypeError(\".google.iam.v1.Policy.auditConfigs: array expected\");\n message.auditConfigs = [];\n for (var i = 0; i < object.auditConfigs.length; ++i) {\n if (typeof object.auditConfigs[i] !== \"object\")\n throw TypeError(\".google.iam.v1.Policy.auditConfigs: object expected\");\n message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]);\n }\n }\n if (object.etag != null)\n if (typeof object.etag === \"string\")\n $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0);\n else if (object.etag.length >= 0)\n message.etag = object.etag;\n return message;\n };\n \n /**\n * Creates a plain object from a Policy message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.iam.v1.Policy\n * @static\n * @param {google.iam.v1.Policy} message Policy\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Policy.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.bindings = [];\n object.auditConfigs = [];\n }\n if (options.defaults) {\n object.version = 0;\n if (options.bytes === String)\n object.etag = \"\";\n else {\n object.etag = [];\n if (options.bytes !== Array)\n object.etag = $util.newBuffer(object.etag);\n }\n }\n if (message.version != null && message.hasOwnProperty(\"version\"))\n object.version = message.version;\n if (message.etag != null && message.hasOwnProperty(\"etag\"))\n object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag;\n if (message.bindings && message.bindings.length) {\n object.bindings = [];\n for (var j = 0; j < message.bindings.length; ++j)\n object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options);\n }\n if (message.auditConfigs && message.auditConfigs.length) {\n object.auditConfigs = [];\n for (var j = 0; j < message.auditConfigs.length; ++j)\n object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options);\n }\n return object;\n };\n \n /**\n * Converts this Policy to JSON.\n * @function toJSON\n * @memberof google.iam.v1.Policy\n * @instance\n * @returns {Object.} JSON object\n */\n Policy.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Policy\n * @function getTypeUrl\n * @memberof google.iam.v1.Policy\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.iam.v1.Policy\";\n };\n \n return Policy;\n })();\n \n v1.Binding = (function() {\n \n /**\n * Properties of a Binding.\n * @memberof google.iam.v1\n * @interface IBinding\n * @property {string|null} [role] Binding role\n * @property {Array.|null} [members] Binding members\n * @property {google.type.IExpr|null} [condition] Binding condition\n */\n \n /**\n * Constructs a new Binding.\n * @memberof google.iam.v1\n * @classdesc Represents a Binding.\n * @implements IBinding\n * @constructor\n * @param {google.iam.v1.IBinding=} [properties] Properties to set\n */\n function Binding(properties) {\n this.members = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Binding role.\n * @member {string} role\n * @memberof google.iam.v1.Binding\n * @instance\n */\n Binding.prototype.role = \"\";\n \n /**\n * Binding members.\n * @member {Array.} members\n * @memberof google.iam.v1.Binding\n * @instance\n */\n Binding.prototype.members = $util.emptyArray;\n \n /**\n * Binding condition.\n * @member {google.type.IExpr|null|undefined} condition\n * @memberof google.iam.v1.Binding\n * @instance\n */\n Binding.prototype.condition = null;\n \n /**\n * Creates a new Binding instance using the specified properties.\n * @function create\n * @memberof google.iam.v1.Binding\n * @static\n * @param {google.iam.v1.IBinding=} [properties] Properties to set\n * @returns {google.iam.v1.Binding} Binding instance\n */\n Binding.create = function create(properties) {\n return new Binding(properties);\n };\n \n /**\n * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages.\n * @function encode\n * @memberof google.iam.v1.Binding\n * @static\n * @param {google.iam.v1.IBinding} message Binding message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Binding.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.role != null && Object.hasOwnProperty.call(message, \"role\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.role);\n if (message.members != null && message.members.length)\n for (var i = 0; i < message.members.length; ++i)\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]);\n if (message.condition != null && Object.hasOwnProperty.call(message, \"condition\"))\n $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.iam.v1.Binding\n * @static\n * @param {google.iam.v1.IBinding} message Binding message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Binding.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a Binding message from the specified reader or buffer.\n * @function decode\n * @memberof google.iam.v1.Binding\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.iam.v1.Binding} Binding\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Binding.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.role = reader.string();\n break;\n }\n case 2: {\n if (!(message.members && message.members.length))\n message.members = [];\n message.members.push(reader.string());\n break;\n }\n case 3: {\n message.condition = $root.google.type.Expr.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a Binding message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.iam.v1.Binding\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.iam.v1.Binding} Binding\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Binding.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a Binding message.\n * @function verify\n * @memberof google.iam.v1.Binding\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Binding.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.role != null && message.hasOwnProperty(\"role\"))\n if (!$util.isString(message.role))\n return \"role: string expected\";\n if (message.members != null && message.hasOwnProperty(\"members\")) {\n if (!Array.isArray(message.members))\n return \"members: array expected\";\n for (var i = 0; i < message.members.length; ++i)\n if (!$util.isString(message.members[i]))\n return \"members: string[] expected\";\n }\n if (message.condition != null && message.hasOwnProperty(\"condition\")) {\n var error = $root.google.type.Expr.verify(message.condition);\n if (error)\n return \"condition.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a Binding message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.iam.v1.Binding\n * @static\n * @param {Object.} object Plain object\n * @returns {google.iam.v1.Binding} Binding\n */\n Binding.fromObject = function fromObject(object) {\n if (object instanceof $root.google.iam.v1.Binding)\n return object;\n var message = new $root.google.iam.v1.Binding();\n if (object.role != null)\n message.role = String(object.role);\n if (object.members) {\n if (!Array.isArray(object.members))\n throw TypeError(\".google.iam.v1.Binding.members: array expected\");\n message.members = [];\n for (var i = 0; i < object.members.length; ++i)\n message.members[i] = String(object.members[i]);\n }\n if (object.condition != null) {\n if (typeof object.condition !== \"object\")\n throw TypeError(\".google.iam.v1.Binding.condition: object expected\");\n message.condition = $root.google.type.Expr.fromObject(object.condition);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a Binding message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.iam.v1.Binding\n * @static\n * @param {google.iam.v1.Binding} message Binding\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Binding.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.members = [];\n if (options.defaults) {\n object.role = \"\";\n object.condition = null;\n }\n if (message.role != null && message.hasOwnProperty(\"role\"))\n object.role = message.role;\n if (message.members && message.members.length) {\n object.members = [];\n for (var j = 0; j < message.members.length; ++j)\n object.members[j] = message.members[j];\n }\n if (message.condition != null && message.hasOwnProperty(\"condition\"))\n object.condition = $root.google.type.Expr.toObject(message.condition, options);\n return object;\n };\n \n /**\n * Converts this Binding to JSON.\n * @function toJSON\n * @memberof google.iam.v1.Binding\n * @instance\n * @returns {Object.} JSON object\n */\n Binding.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Binding\n * @function getTypeUrl\n * @memberof google.iam.v1.Binding\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.iam.v1.Binding\";\n };\n \n return Binding;\n })();\n \n v1.AuditConfig = (function() {\n \n /**\n * Properties of an AuditConfig.\n * @memberof google.iam.v1\n * @interface IAuditConfig\n * @property {string|null} [service] AuditConfig service\n * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs\n */\n \n /**\n * Constructs a new AuditConfig.\n * @memberof google.iam.v1\n * @classdesc Represents an AuditConfig.\n * @implements IAuditConfig\n * @constructor\n * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set\n */\n function AuditConfig(properties) {\n this.auditLogConfigs = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * AuditConfig service.\n * @member {string} service\n * @memberof google.iam.v1.AuditConfig\n * @instance\n */\n AuditConfig.prototype.service = \"\";\n \n /**\n * AuditConfig auditLogConfigs.\n * @member {Array.} auditLogConfigs\n * @memberof google.iam.v1.AuditConfig\n * @instance\n */\n AuditConfig.prototype.auditLogConfigs = $util.emptyArray;\n \n /**\n * Creates a new AuditConfig instance using the specified properties.\n * @function create\n * @memberof google.iam.v1.AuditConfig\n * @static\n * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set\n * @returns {google.iam.v1.AuditConfig} AuditConfig instance\n */\n AuditConfig.create = function create(properties) {\n return new AuditConfig(properties);\n };\n \n /**\n * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages.\n * @function encode\n * @memberof google.iam.v1.AuditConfig\n * @static\n * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n AuditConfig.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.service != null && Object.hasOwnProperty.call(message, \"service\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.service);\n if (message.auditLogConfigs != null && message.auditLogConfigs.length)\n for (var i = 0; i < message.auditLogConfigs.length; ++i)\n $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.iam.v1.AuditConfig\n * @static\n * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n AuditConfig.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an AuditConfig message from the specified reader or buffer.\n * @function decode\n * @memberof google.iam.v1.AuditConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.iam.v1.AuditConfig} AuditConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n AuditConfig.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.service = reader.string();\n break;\n }\n case 3: {\n if (!(message.auditLogConfigs && message.auditLogConfigs.length))\n message.auditLogConfigs = [];\n message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an AuditConfig message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.iam.v1.AuditConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.iam.v1.AuditConfig} AuditConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n AuditConfig.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an AuditConfig message.\n * @function verify\n * @memberof google.iam.v1.AuditConfig\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n AuditConfig.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.service != null && message.hasOwnProperty(\"service\"))\n if (!$util.isString(message.service))\n return \"service: string expected\";\n if (message.auditLogConfigs != null && message.hasOwnProperty(\"auditLogConfigs\")) {\n if (!Array.isArray(message.auditLogConfigs))\n return \"auditLogConfigs: array expected\";\n for (var i = 0; i < message.auditLogConfigs.length; ++i) {\n var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]);\n if (error)\n return \"auditLogConfigs.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.iam.v1.AuditConfig\n * @static\n * @param {Object.} object Plain object\n * @returns {google.iam.v1.AuditConfig} AuditConfig\n */\n AuditConfig.fromObject = function fromObject(object) {\n if (object instanceof $root.google.iam.v1.AuditConfig)\n return object;\n var message = new $root.google.iam.v1.AuditConfig();\n if (object.service != null)\n message.service = String(object.service);\n if (object.auditLogConfigs) {\n if (!Array.isArray(object.auditLogConfigs))\n throw TypeError(\".google.iam.v1.AuditConfig.auditLogConfigs: array expected\");\n message.auditLogConfigs = [];\n for (var i = 0; i < object.auditLogConfigs.length; ++i) {\n if (typeof object.auditLogConfigs[i] !== \"object\")\n throw TypeError(\".google.iam.v1.AuditConfig.auditLogConfigs: object expected\");\n message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from an AuditConfig message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.iam.v1.AuditConfig\n * @static\n * @param {google.iam.v1.AuditConfig} message AuditConfig\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n AuditConfig.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.auditLogConfigs = [];\n if (options.defaults)\n object.service = \"\";\n if (message.service != null && message.hasOwnProperty(\"service\"))\n object.service = message.service;\n if (message.auditLogConfigs && message.auditLogConfigs.length) {\n object.auditLogConfigs = [];\n for (var j = 0; j < message.auditLogConfigs.length; ++j)\n object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options);\n }\n return object;\n };\n \n /**\n * Converts this AuditConfig to JSON.\n * @function toJSON\n * @memberof google.iam.v1.AuditConfig\n * @instance\n * @returns {Object.} JSON object\n */\n AuditConfig.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for AuditConfig\n * @function getTypeUrl\n * @memberof google.iam.v1.AuditConfig\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.iam.v1.AuditConfig\";\n };\n \n return AuditConfig;\n })();\n \n v1.AuditLogConfig = (function() {\n \n /**\n * Properties of an AuditLogConfig.\n * @memberof google.iam.v1\n * @interface IAuditLogConfig\n * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType\n * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers\n */\n \n /**\n * Constructs a new AuditLogConfig.\n * @memberof google.iam.v1\n * @classdesc Represents an AuditLogConfig.\n * @implements IAuditLogConfig\n * @constructor\n * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set\n */\n function AuditLogConfig(properties) {\n this.exemptedMembers = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * AuditLogConfig logType.\n * @member {google.iam.v1.AuditLogConfig.LogType} logType\n * @memberof google.iam.v1.AuditLogConfig\n * @instance\n */\n AuditLogConfig.prototype.logType = 0;\n \n /**\n * AuditLogConfig exemptedMembers.\n * @member {Array.} exemptedMembers\n * @memberof google.iam.v1.AuditLogConfig\n * @instance\n */\n AuditLogConfig.prototype.exemptedMembers = $util.emptyArray;\n \n /**\n * Creates a new AuditLogConfig instance using the specified properties.\n * @function create\n * @memberof google.iam.v1.AuditLogConfig\n * @static\n * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set\n * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance\n */\n AuditLogConfig.create = function create(properties) {\n return new AuditLogConfig(properties);\n };\n \n /**\n * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages.\n * @function encode\n * @memberof google.iam.v1.AuditLogConfig\n * @static\n * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n AuditLogConfig.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.logType != null && Object.hasOwnProperty.call(message, \"logType\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType);\n if (message.exemptedMembers != null && message.exemptedMembers.length)\n for (var i = 0; i < message.exemptedMembers.length; ++i)\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]);\n return writer;\n };\n \n /**\n * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.iam.v1.AuditLogConfig\n * @static\n * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an AuditLogConfig message from the specified reader or buffer.\n * @function decode\n * @memberof google.iam.v1.AuditLogConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n AuditLogConfig.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.logType = reader.int32();\n break;\n }\n case 2: {\n if (!(message.exemptedMembers && message.exemptedMembers.length))\n message.exemptedMembers = [];\n message.exemptedMembers.push(reader.string());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.iam.v1.AuditLogConfig\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n AuditLogConfig.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an AuditLogConfig message.\n * @function verify\n * @memberof google.iam.v1.AuditLogConfig\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n AuditLogConfig.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.logType != null && message.hasOwnProperty(\"logType\"))\n switch (message.logType) {\n default:\n return \"logType: enum value expected\";\n case 0:\n case 1:\n case 2:\n case 3:\n break;\n }\n if (message.exemptedMembers != null && message.hasOwnProperty(\"exemptedMembers\")) {\n if (!Array.isArray(message.exemptedMembers))\n return \"exemptedMembers: array expected\";\n for (var i = 0; i < message.exemptedMembers.length; ++i)\n if (!$util.isString(message.exemptedMembers[i]))\n return \"exemptedMembers: string[] expected\";\n }\n return null;\n };\n \n /**\n * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.iam.v1.AuditLogConfig\n * @static\n * @param {Object.} object Plain object\n * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig\n */\n AuditLogConfig.fromObject = function fromObject(object) {\n if (object instanceof $root.google.iam.v1.AuditLogConfig)\n return object;\n var message = new $root.google.iam.v1.AuditLogConfig();\n switch (object.logType) {\n default:\n if (typeof object.logType === \"number\") {\n message.logType = object.logType;\n break;\n }\n break;\n case \"LOG_TYPE_UNSPECIFIED\":\n case 0:\n message.logType = 0;\n break;\n case \"ADMIN_READ\":\n case 1:\n message.logType = 1;\n break;\n case \"DATA_WRITE\":\n case 2:\n message.logType = 2;\n break;\n case \"DATA_READ\":\n case 3:\n message.logType = 3;\n break;\n }\n if (object.exemptedMembers) {\n if (!Array.isArray(object.exemptedMembers))\n throw TypeError(\".google.iam.v1.AuditLogConfig.exemptedMembers: array expected\");\n message.exemptedMembers = [];\n for (var i = 0; i < object.exemptedMembers.length; ++i)\n message.exemptedMembers[i] = String(object.exemptedMembers[i]);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.iam.v1.AuditLogConfig\n * @static\n * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n AuditLogConfig.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.exemptedMembers = [];\n if (options.defaults)\n object.logType = options.enums === String ? \"LOG_TYPE_UNSPECIFIED\" : 0;\n if (message.logType != null && message.hasOwnProperty(\"logType\"))\n object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType;\n if (message.exemptedMembers && message.exemptedMembers.length) {\n object.exemptedMembers = [];\n for (var j = 0; j < message.exemptedMembers.length; ++j)\n object.exemptedMembers[j] = message.exemptedMembers[j];\n }\n return object;\n };\n \n /**\n * Converts this AuditLogConfig to JSON.\n * @function toJSON\n * @memberof google.iam.v1.AuditLogConfig\n * @instance\n * @returns {Object.} JSON object\n */\n AuditLogConfig.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for AuditLogConfig\n * @function getTypeUrl\n * @memberof google.iam.v1.AuditLogConfig\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.iam.v1.AuditLogConfig\";\n };\n \n /**\n * LogType enum.\n * @name google.iam.v1.AuditLogConfig.LogType\n * @enum {number}\n * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value\n * @property {number} ADMIN_READ=1 ADMIN_READ value\n * @property {number} DATA_WRITE=2 DATA_WRITE value\n * @property {number} DATA_READ=3 DATA_READ value\n */\n AuditLogConfig.LogType = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"LOG_TYPE_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"ADMIN_READ\"] = 1;\n values[valuesById[2] = \"DATA_WRITE\"] = 2;\n values[valuesById[3] = \"DATA_READ\"] = 3;\n return values;\n })();\n \n return AuditLogConfig;\n })();\n \n v1.PolicyDelta = (function() {\n \n /**\n * Properties of a PolicyDelta.\n * @memberof google.iam.v1\n * @interface IPolicyDelta\n * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas\n * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas\n */\n \n /**\n * Constructs a new PolicyDelta.\n * @memberof google.iam.v1\n * @classdesc Represents a PolicyDelta.\n * @implements IPolicyDelta\n * @constructor\n * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set\n */\n function PolicyDelta(properties) {\n this.bindingDeltas = [];\n this.auditConfigDeltas = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * PolicyDelta bindingDeltas.\n * @member {Array.} bindingDeltas\n * @memberof google.iam.v1.PolicyDelta\n * @instance\n */\n PolicyDelta.prototype.bindingDeltas = $util.emptyArray;\n \n /**\n * PolicyDelta auditConfigDeltas.\n * @member {Array.} auditConfigDeltas\n * @memberof google.iam.v1.PolicyDelta\n * @instance\n */\n PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray;\n \n /**\n * Creates a new PolicyDelta instance using the specified properties.\n * @function create\n * @memberof google.iam.v1.PolicyDelta\n * @static\n * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set\n * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance\n */\n PolicyDelta.create = function create(properties) {\n return new PolicyDelta(properties);\n };\n \n /**\n * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages.\n * @function encode\n * @memberof google.iam.v1.PolicyDelta\n * @static\n * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PolicyDelta.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.bindingDeltas != null && message.bindingDeltas.length)\n for (var i = 0; i < message.bindingDeltas.length; ++i)\n $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.auditConfigDeltas != null && message.auditConfigDeltas.length)\n for (var i = 0; i < message.auditConfigDeltas.length; ++i)\n $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.iam.v1.PolicyDelta\n * @static\n * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a PolicyDelta message from the specified reader or buffer.\n * @function decode\n * @memberof google.iam.v1.PolicyDelta\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.iam.v1.PolicyDelta} PolicyDelta\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PolicyDelta.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.bindingDeltas && message.bindingDeltas.length))\n message.bindingDeltas = [];\n message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n if (!(message.auditConfigDeltas && message.auditConfigDeltas.length))\n message.auditConfigDeltas = [];\n message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a PolicyDelta message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.iam.v1.PolicyDelta\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.iam.v1.PolicyDelta} PolicyDelta\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PolicyDelta.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a PolicyDelta message.\n * @function verify\n * @memberof google.iam.v1.PolicyDelta\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n PolicyDelta.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.bindingDeltas != null && message.hasOwnProperty(\"bindingDeltas\")) {\n if (!Array.isArray(message.bindingDeltas))\n return \"bindingDeltas: array expected\";\n for (var i = 0; i < message.bindingDeltas.length; ++i) {\n var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]);\n if (error)\n return \"bindingDeltas.\" + error;\n }\n }\n if (message.auditConfigDeltas != null && message.hasOwnProperty(\"auditConfigDeltas\")) {\n if (!Array.isArray(message.auditConfigDeltas))\n return \"auditConfigDeltas: array expected\";\n for (var i = 0; i < message.auditConfigDeltas.length; ++i) {\n var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]);\n if (error)\n return \"auditConfigDeltas.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.iam.v1.PolicyDelta\n * @static\n * @param {Object.} object Plain object\n * @returns {google.iam.v1.PolicyDelta} PolicyDelta\n */\n PolicyDelta.fromObject = function fromObject(object) {\n if (object instanceof $root.google.iam.v1.PolicyDelta)\n return object;\n var message = new $root.google.iam.v1.PolicyDelta();\n if (object.bindingDeltas) {\n if (!Array.isArray(object.bindingDeltas))\n throw TypeError(\".google.iam.v1.PolicyDelta.bindingDeltas: array expected\");\n message.bindingDeltas = [];\n for (var i = 0; i < object.bindingDeltas.length; ++i) {\n if (typeof object.bindingDeltas[i] !== \"object\")\n throw TypeError(\".google.iam.v1.PolicyDelta.bindingDeltas: object expected\");\n message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]);\n }\n }\n if (object.auditConfigDeltas) {\n if (!Array.isArray(object.auditConfigDeltas))\n throw TypeError(\".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected\");\n message.auditConfigDeltas = [];\n for (var i = 0; i < object.auditConfigDeltas.length; ++i) {\n if (typeof object.auditConfigDeltas[i] !== \"object\")\n throw TypeError(\".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected\");\n message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]);\n }\n }\n return message;\n };\n \n /**\n * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.iam.v1.PolicyDelta\n * @static\n * @param {google.iam.v1.PolicyDelta} message PolicyDelta\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n PolicyDelta.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.bindingDeltas = [];\n object.auditConfigDeltas = [];\n }\n if (message.bindingDeltas && message.bindingDeltas.length) {\n object.bindingDeltas = [];\n for (var j = 0; j < message.bindingDeltas.length; ++j)\n object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options);\n }\n if (message.auditConfigDeltas && message.auditConfigDeltas.length) {\n object.auditConfigDeltas = [];\n for (var j = 0; j < message.auditConfigDeltas.length; ++j)\n object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options);\n }\n return object;\n };\n \n /**\n * Converts this PolicyDelta to JSON.\n * @function toJSON\n * @memberof google.iam.v1.PolicyDelta\n * @instance\n * @returns {Object.} JSON object\n */\n PolicyDelta.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for PolicyDelta\n * @function getTypeUrl\n * @memberof google.iam.v1.PolicyDelta\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.iam.v1.PolicyDelta\";\n };\n \n return PolicyDelta;\n })();\n \n v1.BindingDelta = (function() {\n \n /**\n * Properties of a BindingDelta.\n * @memberof google.iam.v1\n * @interface IBindingDelta\n * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action\n * @property {string|null} [role] BindingDelta role\n * @property {string|null} [member] BindingDelta member\n * @property {google.type.IExpr|null} [condition] BindingDelta condition\n */\n \n /**\n * Constructs a new BindingDelta.\n * @memberof google.iam.v1\n * @classdesc Represents a BindingDelta.\n * @implements IBindingDelta\n * @constructor\n * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set\n */\n function BindingDelta(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * BindingDelta action.\n * @member {google.iam.v1.BindingDelta.Action} action\n * @memberof google.iam.v1.BindingDelta\n * @instance\n */\n BindingDelta.prototype.action = 0;\n \n /**\n * BindingDelta role.\n * @member {string} role\n * @memberof google.iam.v1.BindingDelta\n * @instance\n */\n BindingDelta.prototype.role = \"\";\n \n /**\n * BindingDelta member.\n * @member {string} member\n * @memberof google.iam.v1.BindingDelta\n * @instance\n */\n BindingDelta.prototype.member = \"\";\n \n /**\n * BindingDelta condition.\n * @member {google.type.IExpr|null|undefined} condition\n * @memberof google.iam.v1.BindingDelta\n * @instance\n */\n BindingDelta.prototype.condition = null;\n \n /**\n * Creates a new BindingDelta instance using the specified properties.\n * @function create\n * @memberof google.iam.v1.BindingDelta\n * @static\n * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set\n * @returns {google.iam.v1.BindingDelta} BindingDelta instance\n */\n BindingDelta.create = function create(properties) {\n return new BindingDelta(properties);\n };\n \n /**\n * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages.\n * @function encode\n * @memberof google.iam.v1.BindingDelta\n * @static\n * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n BindingDelta.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.action != null && Object.hasOwnProperty.call(message, \"action\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action);\n if (message.role != null && Object.hasOwnProperty.call(message, \"role\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.role);\n if (message.member != null && Object.hasOwnProperty.call(message, \"member\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.member);\n if (message.condition != null && Object.hasOwnProperty.call(message, \"condition\"))\n $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.iam.v1.BindingDelta\n * @static\n * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n BindingDelta.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a BindingDelta message from the specified reader or buffer.\n * @function decode\n * @memberof google.iam.v1.BindingDelta\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.iam.v1.BindingDelta} BindingDelta\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n BindingDelta.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.action = reader.int32();\n break;\n }\n case 2: {\n message.role = reader.string();\n break;\n }\n case 3: {\n message.member = reader.string();\n break;\n }\n case 4: {\n message.condition = $root.google.type.Expr.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a BindingDelta message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.iam.v1.BindingDelta\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.iam.v1.BindingDelta} BindingDelta\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n BindingDelta.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a BindingDelta message.\n * @function verify\n * @memberof google.iam.v1.BindingDelta\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n BindingDelta.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.action != null && message.hasOwnProperty(\"action\"))\n switch (message.action) {\n default:\n return \"action: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.role != null && message.hasOwnProperty(\"role\"))\n if (!$util.isString(message.role))\n return \"role: string expected\";\n if (message.member != null && message.hasOwnProperty(\"member\"))\n if (!$util.isString(message.member))\n return \"member: string expected\";\n if (message.condition != null && message.hasOwnProperty(\"condition\")) {\n var error = $root.google.type.Expr.verify(message.condition);\n if (error)\n return \"condition.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.iam.v1.BindingDelta\n * @static\n * @param {Object.} object Plain object\n * @returns {google.iam.v1.BindingDelta} BindingDelta\n */\n BindingDelta.fromObject = function fromObject(object) {\n if (object instanceof $root.google.iam.v1.BindingDelta)\n return object;\n var message = new $root.google.iam.v1.BindingDelta();\n switch (object.action) {\n default:\n if (typeof object.action === \"number\") {\n message.action = object.action;\n break;\n }\n break;\n case \"ACTION_UNSPECIFIED\":\n case 0:\n message.action = 0;\n break;\n case \"ADD\":\n case 1:\n message.action = 1;\n break;\n case \"REMOVE\":\n case 2:\n message.action = 2;\n break;\n }\n if (object.role != null)\n message.role = String(object.role);\n if (object.member != null)\n message.member = String(object.member);\n if (object.condition != null) {\n if (typeof object.condition !== \"object\")\n throw TypeError(\".google.iam.v1.BindingDelta.condition: object expected\");\n message.condition = $root.google.type.Expr.fromObject(object.condition);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a BindingDelta message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.iam.v1.BindingDelta\n * @static\n * @param {google.iam.v1.BindingDelta} message BindingDelta\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n BindingDelta.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.action = options.enums === String ? \"ACTION_UNSPECIFIED\" : 0;\n object.role = \"\";\n object.member = \"\";\n object.condition = null;\n }\n if (message.action != null && message.hasOwnProperty(\"action\"))\n object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action;\n if (message.role != null && message.hasOwnProperty(\"role\"))\n object.role = message.role;\n if (message.member != null && message.hasOwnProperty(\"member\"))\n object.member = message.member;\n if (message.condition != null && message.hasOwnProperty(\"condition\"))\n object.condition = $root.google.type.Expr.toObject(message.condition, options);\n return object;\n };\n \n /**\n * Converts this BindingDelta to JSON.\n * @function toJSON\n * @memberof google.iam.v1.BindingDelta\n * @instance\n * @returns {Object.} JSON object\n */\n BindingDelta.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for BindingDelta\n * @function getTypeUrl\n * @memberof google.iam.v1.BindingDelta\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.iam.v1.BindingDelta\";\n };\n \n /**\n * Action enum.\n * @name google.iam.v1.BindingDelta.Action\n * @enum {number}\n * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value\n * @property {number} ADD=1 ADD value\n * @property {number} REMOVE=2 REMOVE value\n */\n BindingDelta.Action = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"ACTION_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"ADD\"] = 1;\n values[valuesById[2] = \"REMOVE\"] = 2;\n return values;\n })();\n \n return BindingDelta;\n })();\n \n v1.AuditConfigDelta = (function() {\n \n /**\n * Properties of an AuditConfigDelta.\n * @memberof google.iam.v1\n * @interface IAuditConfigDelta\n * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action\n * @property {string|null} [service] AuditConfigDelta service\n * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember\n * @property {string|null} [logType] AuditConfigDelta logType\n */\n \n /**\n * Constructs a new AuditConfigDelta.\n * @memberof google.iam.v1\n * @classdesc Represents an AuditConfigDelta.\n * @implements IAuditConfigDelta\n * @constructor\n * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set\n */\n function AuditConfigDelta(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * AuditConfigDelta action.\n * @member {google.iam.v1.AuditConfigDelta.Action} action\n * @memberof google.iam.v1.AuditConfigDelta\n * @instance\n */\n AuditConfigDelta.prototype.action = 0;\n \n /**\n * AuditConfigDelta service.\n * @member {string} service\n * @memberof google.iam.v1.AuditConfigDelta\n * @instance\n */\n AuditConfigDelta.prototype.service = \"\";\n \n /**\n * AuditConfigDelta exemptedMember.\n * @member {string} exemptedMember\n * @memberof google.iam.v1.AuditConfigDelta\n * @instance\n */\n AuditConfigDelta.prototype.exemptedMember = \"\";\n \n /**\n * AuditConfigDelta logType.\n * @member {string} logType\n * @memberof google.iam.v1.AuditConfigDelta\n * @instance\n */\n AuditConfigDelta.prototype.logType = \"\";\n \n /**\n * Creates a new AuditConfigDelta instance using the specified properties.\n * @function create\n * @memberof google.iam.v1.AuditConfigDelta\n * @static\n * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set\n * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance\n */\n AuditConfigDelta.create = function create(properties) {\n return new AuditConfigDelta(properties);\n };\n \n /**\n * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages.\n * @function encode\n * @memberof google.iam.v1.AuditConfigDelta\n * @static\n * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n AuditConfigDelta.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.action != null && Object.hasOwnProperty.call(message, \"action\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action);\n if (message.service != null && Object.hasOwnProperty.call(message, \"service\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.service);\n if (message.exemptedMember != null && Object.hasOwnProperty.call(message, \"exemptedMember\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember);\n if (message.logType != null && Object.hasOwnProperty.call(message, \"logType\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType);\n return writer;\n };\n \n /**\n * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.iam.v1.AuditConfigDelta\n * @static\n * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an AuditConfigDelta message from the specified reader or buffer.\n * @function decode\n * @memberof google.iam.v1.AuditConfigDelta\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n AuditConfigDelta.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.action = reader.int32();\n break;\n }\n case 2: {\n message.service = reader.string();\n break;\n }\n case 3: {\n message.exemptedMember = reader.string();\n break;\n }\n case 4: {\n message.logType = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.iam.v1.AuditConfigDelta\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an AuditConfigDelta message.\n * @function verify\n * @memberof google.iam.v1.AuditConfigDelta\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n AuditConfigDelta.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.action != null && message.hasOwnProperty(\"action\"))\n switch (message.action) {\n default:\n return \"action: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.service != null && message.hasOwnProperty(\"service\"))\n if (!$util.isString(message.service))\n return \"service: string expected\";\n if (message.exemptedMember != null && message.hasOwnProperty(\"exemptedMember\"))\n if (!$util.isString(message.exemptedMember))\n return \"exemptedMember: string expected\";\n if (message.logType != null && message.hasOwnProperty(\"logType\"))\n if (!$util.isString(message.logType))\n return \"logType: string expected\";\n return null;\n };\n \n /**\n * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.iam.v1.AuditConfigDelta\n * @static\n * @param {Object.} object Plain object\n * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta\n */\n AuditConfigDelta.fromObject = function fromObject(object) {\n if (object instanceof $root.google.iam.v1.AuditConfigDelta)\n return object;\n var message = new $root.google.iam.v1.AuditConfigDelta();\n switch (object.action) {\n default:\n if (typeof object.action === \"number\") {\n message.action = object.action;\n break;\n }\n break;\n case \"ACTION_UNSPECIFIED\":\n case 0:\n message.action = 0;\n break;\n case \"ADD\":\n case 1:\n message.action = 1;\n break;\n case \"REMOVE\":\n case 2:\n message.action = 2;\n break;\n }\n if (object.service != null)\n message.service = String(object.service);\n if (object.exemptedMember != null)\n message.exemptedMember = String(object.exemptedMember);\n if (object.logType != null)\n message.logType = String(object.logType);\n return message;\n };\n \n /**\n * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.iam.v1.AuditConfigDelta\n * @static\n * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n AuditConfigDelta.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.action = options.enums === String ? \"ACTION_UNSPECIFIED\" : 0;\n object.service = \"\";\n object.exemptedMember = \"\";\n object.logType = \"\";\n }\n if (message.action != null && message.hasOwnProperty(\"action\"))\n object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action;\n if (message.service != null && message.hasOwnProperty(\"service\"))\n object.service = message.service;\n if (message.exemptedMember != null && message.hasOwnProperty(\"exemptedMember\"))\n object.exemptedMember = message.exemptedMember;\n if (message.logType != null && message.hasOwnProperty(\"logType\"))\n object.logType = message.logType;\n return object;\n };\n \n /**\n * Converts this AuditConfigDelta to JSON.\n * @function toJSON\n * @memberof google.iam.v1.AuditConfigDelta\n * @instance\n * @returns {Object.} JSON object\n */\n AuditConfigDelta.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for AuditConfigDelta\n * @function getTypeUrl\n * @memberof google.iam.v1.AuditConfigDelta\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.iam.v1.AuditConfigDelta\";\n };\n \n /**\n * Action enum.\n * @name google.iam.v1.AuditConfigDelta.Action\n * @enum {number}\n * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value\n * @property {number} ADD=1 ADD value\n * @property {number} REMOVE=2 REMOVE value\n */\n AuditConfigDelta.Action = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"ACTION_UNSPECIFIED\"] = 0;\n values[valuesById[1] = \"ADD\"] = 1;\n values[valuesById[2] = \"REMOVE\"] = 2;\n return values;\n })();\n \n return AuditConfigDelta;\n })();\n \n return v1;\n })();\n \n return iam;\n })();\n \n google.longrunning = (function() {\n \n /**\n * Namespace longrunning.\n * @memberof google\n * @namespace\n */\n var longrunning = {};\n \n longrunning.Operations = (function() {\n \n /**\n * Constructs a new Operations service.\n * @memberof google.longrunning\n * @classdesc Represents an Operations\n * @extends $protobuf.rpc.Service\n * @constructor\n * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\n function Operations(rpcImpl, requestDelimited, responseDelimited) {\n $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\n }\n \n (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations;\n \n /**\n * Creates new Operations service using the specified rpc implementation.\n * @function create\n * @memberof google.longrunning.Operations\n * @static\n * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n * @returns {Operations} RPC service. Useful where requests and/or responses are streamed.\n */\n Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n return new this(rpcImpl, requestDelimited, responseDelimited);\n };\n \n /**\n * Callback as used by {@link google.longrunning.Operations|listOperations}.\n * @memberof google.longrunning.Operations\n * @typedef ListOperationsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse\n */\n \n /**\n * Calls ListOperations.\n * @function listOperations\n * @memberof google.longrunning.Operations\n * @instance\n * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object\n * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) {\n return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback);\n }, \"name\", { value: \"ListOperations\" });\n \n /**\n * Calls ListOperations.\n * @function listOperations\n * @memberof google.longrunning.Operations\n * @instance\n * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.longrunning.Operations|getOperation}.\n * @memberof google.longrunning.Operations\n * @typedef GetOperationCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls GetOperation.\n * @function getOperation\n * @memberof google.longrunning.Operations\n * @instance\n * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object\n * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) {\n return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"GetOperation\" });\n \n /**\n * Calls GetOperation.\n * @function getOperation\n * @memberof google.longrunning.Operations\n * @instance\n * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.longrunning.Operations|deleteOperation}.\n * @memberof google.longrunning.Operations\n * @typedef DeleteOperationCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.protobuf.Empty} [response] Empty\n */\n \n /**\n * Calls DeleteOperation.\n * @function deleteOperation\n * @memberof google.longrunning.Operations\n * @instance\n * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object\n * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) {\n return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback);\n }, \"name\", { value: \"DeleteOperation\" });\n \n /**\n * Calls DeleteOperation.\n * @function deleteOperation\n * @memberof google.longrunning.Operations\n * @instance\n * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.longrunning.Operations|cancelOperation}.\n * @memberof google.longrunning.Operations\n * @typedef CancelOperationCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.protobuf.Empty} [response] Empty\n */\n \n /**\n * Calls CancelOperation.\n * @function cancelOperation\n * @memberof google.longrunning.Operations\n * @instance\n * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object\n * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) {\n return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback);\n }, \"name\", { value: \"CancelOperation\" });\n \n /**\n * Calls CancelOperation.\n * @function cancelOperation\n * @memberof google.longrunning.Operations\n * @instance\n * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n /**\n * Callback as used by {@link google.longrunning.Operations|waitOperation}.\n * @memberof google.longrunning.Operations\n * @typedef WaitOperationCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {google.longrunning.Operation} [response] Operation\n */\n \n /**\n * Calls WaitOperation.\n * @function waitOperation\n * @memberof google.longrunning.Operations\n * @instance\n * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object\n * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) {\n return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback);\n }, \"name\", { value: \"WaitOperation\" });\n \n /**\n * Calls WaitOperation.\n * @function waitOperation\n * @memberof google.longrunning.Operations\n * @instance\n * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object\n * @returns {Promise} Promise\n * @variation 2\n */\n \n return Operations;\n })();\n \n longrunning.Operation = (function() {\n \n /**\n * Properties of an Operation.\n * @memberof google.longrunning\n * @interface IOperation\n * @property {string|null} [name] Operation name\n * @property {google.protobuf.IAny|null} [metadata] Operation metadata\n * @property {boolean|null} [done] Operation done\n * @property {google.rpc.IStatus|null} [error] Operation error\n * @property {google.protobuf.IAny|null} [response] Operation response\n */\n \n /**\n * Constructs a new Operation.\n * @memberof google.longrunning\n * @classdesc Represents an Operation.\n * @implements IOperation\n * @constructor\n * @param {google.longrunning.IOperation=} [properties] Properties to set\n */\n function Operation(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * Operation name.\n * @member {string} name\n * @memberof google.longrunning.Operation\n * @instance\n */\n Operation.prototype.name = \"\";\n \n /**\n * Operation metadata.\n * @member {google.protobuf.IAny|null|undefined} metadata\n * @memberof google.longrunning.Operation\n * @instance\n */\n Operation.prototype.metadata = null;\n \n /**\n * Operation done.\n * @member {boolean} done\n * @memberof google.longrunning.Operation\n * @instance\n */\n Operation.prototype.done = false;\n \n /**\n * Operation error.\n * @member {google.rpc.IStatus|null|undefined} error\n * @memberof google.longrunning.Operation\n * @instance\n */\n Operation.prototype.error = null;\n \n /**\n * Operation response.\n * @member {google.protobuf.IAny|null|undefined} response\n * @memberof google.longrunning.Operation\n * @instance\n */\n Operation.prototype.response = null;\n \n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n \n /**\n * Operation result.\n * @member {\"error\"|\"response\"|undefined} result\n * @memberof google.longrunning.Operation\n * @instance\n */\n Object.defineProperty(Operation.prototype, \"result\", {\n get: $util.oneOfGetter($oneOfFields = [\"error\", \"response\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n \n /**\n * Creates a new Operation instance using the specified properties.\n * @function create\n * @memberof google.longrunning.Operation\n * @static\n * @param {google.longrunning.IOperation=} [properties] Properties to set\n * @returns {google.longrunning.Operation} Operation instance\n */\n Operation.create = function create(properties) {\n return new Operation(properties);\n };\n \n /**\n * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages.\n * @function encode\n * @memberof google.longrunning.Operation\n * @static\n * @param {google.longrunning.IOperation} message Operation message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Operation.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.metadata != null && Object.hasOwnProperty.call(message, \"metadata\"))\n $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.done != null && Object.hasOwnProperty.call(message, \"done\"))\n writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done);\n if (message.error != null && Object.hasOwnProperty.call(message, \"error\"))\n $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n if (message.response != null && Object.hasOwnProperty.call(message, \"response\"))\n $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.longrunning.Operation\n * @static\n * @param {google.longrunning.IOperation} message Operation message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Operation.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an Operation message from the specified reader or buffer.\n * @function decode\n * @memberof google.longrunning.Operation\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.longrunning.Operation} Operation\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Operation.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32());\n break;\n }\n case 3: {\n message.done = reader.bool();\n break;\n }\n case 4: {\n message.error = $root.google.rpc.Status.decode(reader, reader.uint32());\n break;\n }\n case 5: {\n message.response = $root.google.protobuf.Any.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an Operation message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.longrunning.Operation\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.longrunning.Operation} Operation\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Operation.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an Operation message.\n * @function verify\n * @memberof google.longrunning.Operation\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Operation.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.metadata != null && message.hasOwnProperty(\"metadata\")) {\n var error = $root.google.protobuf.Any.verify(message.metadata);\n if (error)\n return \"metadata.\" + error;\n }\n if (message.done != null && message.hasOwnProperty(\"done\"))\n if (typeof message.done !== \"boolean\")\n return \"done: boolean expected\";\n if (message.error != null && message.hasOwnProperty(\"error\")) {\n properties.result = 1;\n {\n var error = $root.google.rpc.Status.verify(message.error);\n if (error)\n return \"error.\" + error;\n }\n }\n if (message.response != null && message.hasOwnProperty(\"response\")) {\n if (properties.result === 1)\n return \"result: multiple values\";\n properties.result = 1;\n {\n var error = $root.google.protobuf.Any.verify(message.response);\n if (error)\n return \"response.\" + error;\n }\n }\n return null;\n };\n \n /**\n * Creates an Operation message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.longrunning.Operation\n * @static\n * @param {Object.} object Plain object\n * @returns {google.longrunning.Operation} Operation\n */\n Operation.fromObject = function fromObject(object) {\n if (object instanceof $root.google.longrunning.Operation)\n return object;\n var message = new $root.google.longrunning.Operation();\n if (object.name != null)\n message.name = String(object.name);\n if (object.metadata != null) {\n if (typeof object.metadata !== \"object\")\n throw TypeError(\".google.longrunning.Operation.metadata: object expected\");\n message.metadata = $root.google.protobuf.Any.fromObject(object.metadata);\n }\n if (object.done != null)\n message.done = Boolean(object.done);\n if (object.error != null) {\n if (typeof object.error !== \"object\")\n throw TypeError(\".google.longrunning.Operation.error: object expected\");\n message.error = $root.google.rpc.Status.fromObject(object.error);\n }\n if (object.response != null) {\n if (typeof object.response !== \"object\")\n throw TypeError(\".google.longrunning.Operation.response: object expected\");\n message.response = $root.google.protobuf.Any.fromObject(object.response);\n }\n return message;\n };\n \n /**\n * Creates a plain object from an Operation message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.longrunning.Operation\n * @static\n * @param {google.longrunning.Operation} message Operation\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Operation.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.metadata = null;\n object.done = false;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.metadata != null && message.hasOwnProperty(\"metadata\"))\n object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options);\n if (message.done != null && message.hasOwnProperty(\"done\"))\n object.done = message.done;\n if (message.error != null && message.hasOwnProperty(\"error\")) {\n object.error = $root.google.rpc.Status.toObject(message.error, options);\n if (options.oneofs)\n object.result = \"error\";\n }\n if (message.response != null && message.hasOwnProperty(\"response\")) {\n object.response = $root.google.protobuf.Any.toObject(message.response, options);\n if (options.oneofs)\n object.result = \"response\";\n }\n return object;\n };\n \n /**\n * Converts this Operation to JSON.\n * @function toJSON\n * @memberof google.longrunning.Operation\n * @instance\n * @returns {Object.} JSON object\n */\n Operation.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for Operation\n * @function getTypeUrl\n * @memberof google.longrunning.Operation\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.longrunning.Operation\";\n };\n \n return Operation;\n })();\n \n longrunning.GetOperationRequest = (function() {\n \n /**\n * Properties of a GetOperationRequest.\n * @memberof google.longrunning\n * @interface IGetOperationRequest\n * @property {string|null} [name] GetOperationRequest name\n */\n \n /**\n * Constructs a new GetOperationRequest.\n * @memberof google.longrunning\n * @classdesc Represents a GetOperationRequest.\n * @implements IGetOperationRequest\n * @constructor\n * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set\n */\n function GetOperationRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * GetOperationRequest name.\n * @member {string} name\n * @memberof google.longrunning.GetOperationRequest\n * @instance\n */\n GetOperationRequest.prototype.name = \"\";\n \n /**\n * Creates a new GetOperationRequest instance using the specified properties.\n * @function create\n * @memberof google.longrunning.GetOperationRequest\n * @static\n * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set\n * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance\n */\n GetOperationRequest.create = function create(properties) {\n return new GetOperationRequest(properties);\n };\n \n /**\n * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages.\n * @function encode\n * @memberof google.longrunning.GetOperationRequest\n * @static\n * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetOperationRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.longrunning.GetOperationRequest\n * @static\n * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a GetOperationRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.longrunning.GetOperationRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.longrunning.GetOperationRequest} GetOperationRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetOperationRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.longrunning.GetOperationRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.longrunning.GetOperationRequest} GetOperationRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GetOperationRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a GetOperationRequest message.\n * @function verify\n * @memberof google.longrunning.GetOperationRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GetOperationRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.longrunning.GetOperationRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.longrunning.GetOperationRequest} GetOperationRequest\n */\n GetOperationRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.longrunning.GetOperationRequest)\n return object;\n var message = new $root.google.longrunning.GetOperationRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.longrunning.GetOperationRequest\n * @static\n * @param {google.longrunning.GetOperationRequest} message GetOperationRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GetOperationRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this GetOperationRequest to JSON.\n * @function toJSON\n * @memberof google.longrunning.GetOperationRequest\n * @instance\n * @returns {Object.} JSON object\n */\n GetOperationRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for GetOperationRequest\n * @function getTypeUrl\n * @memberof google.longrunning.GetOperationRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.longrunning.GetOperationRequest\";\n };\n \n return GetOperationRequest;\n })();\n \n longrunning.ListOperationsRequest = (function() {\n \n /**\n * Properties of a ListOperationsRequest.\n * @memberof google.longrunning\n * @interface IListOperationsRequest\n * @property {string|null} [name] ListOperationsRequest name\n * @property {string|null} [filter] ListOperationsRequest filter\n * @property {number|null} [pageSize] ListOperationsRequest pageSize\n * @property {string|null} [pageToken] ListOperationsRequest pageToken\n */\n \n /**\n * Constructs a new ListOperationsRequest.\n * @memberof google.longrunning\n * @classdesc Represents a ListOperationsRequest.\n * @implements IListOperationsRequest\n * @constructor\n * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set\n */\n function ListOperationsRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListOperationsRequest name.\n * @member {string} name\n * @memberof google.longrunning.ListOperationsRequest\n * @instance\n */\n ListOperationsRequest.prototype.name = \"\";\n \n /**\n * ListOperationsRequest filter.\n * @member {string} filter\n * @memberof google.longrunning.ListOperationsRequest\n * @instance\n */\n ListOperationsRequest.prototype.filter = \"\";\n \n /**\n * ListOperationsRequest pageSize.\n * @member {number} pageSize\n * @memberof google.longrunning.ListOperationsRequest\n * @instance\n */\n ListOperationsRequest.prototype.pageSize = 0;\n \n /**\n * ListOperationsRequest pageToken.\n * @member {string} pageToken\n * @memberof google.longrunning.ListOperationsRequest\n * @instance\n */\n ListOperationsRequest.prototype.pageToken = \"\";\n \n /**\n * Creates a new ListOperationsRequest instance using the specified properties.\n * @function create\n * @memberof google.longrunning.ListOperationsRequest\n * @static\n * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set\n * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance\n */\n ListOperationsRequest.create = function create(properties) {\n return new ListOperationsRequest(properties);\n };\n \n /**\n * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages.\n * @function encode\n * @memberof google.longrunning.ListOperationsRequest\n * @static\n * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListOperationsRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.filter != null && Object.hasOwnProperty.call(message, \"filter\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter);\n if (message.pageSize != null && Object.hasOwnProperty.call(message, \"pageSize\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);\n if (message.pageToken != null && Object.hasOwnProperty.call(message, \"pageToken\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.longrunning.ListOperationsRequest\n * @static\n * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListOperationsRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.longrunning.ListOperationsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListOperationsRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 4: {\n message.name = reader.string();\n break;\n }\n case 1: {\n message.filter = reader.string();\n break;\n }\n case 2: {\n message.pageSize = reader.int32();\n break;\n }\n case 3: {\n message.pageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.longrunning.ListOperationsRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListOperationsRequest message.\n * @function verify\n * @memberof google.longrunning.ListOperationsRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListOperationsRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n if (!$util.isString(message.filter))\n return \"filter: string expected\";\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n if (!$util.isInteger(message.pageSize))\n return \"pageSize: integer expected\";\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n if (!$util.isString(message.pageToken))\n return \"pageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.longrunning.ListOperationsRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest\n */\n ListOperationsRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.longrunning.ListOperationsRequest)\n return object;\n var message = new $root.google.longrunning.ListOperationsRequest();\n if (object.name != null)\n message.name = String(object.name);\n if (object.filter != null)\n message.filter = String(object.filter);\n if (object.pageSize != null)\n message.pageSize = object.pageSize | 0;\n if (object.pageToken != null)\n message.pageToken = String(object.pageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.longrunning.ListOperationsRequest\n * @static\n * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListOperationsRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.filter = \"\";\n object.pageSize = 0;\n object.pageToken = \"\";\n object.name = \"\";\n }\n if (message.filter != null && message.hasOwnProperty(\"filter\"))\n object.filter = message.filter;\n if (message.pageSize != null && message.hasOwnProperty(\"pageSize\"))\n object.pageSize = message.pageSize;\n if (message.pageToken != null && message.hasOwnProperty(\"pageToken\"))\n object.pageToken = message.pageToken;\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this ListOperationsRequest to JSON.\n * @function toJSON\n * @memberof google.longrunning.ListOperationsRequest\n * @instance\n * @returns {Object.} JSON object\n */\n ListOperationsRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListOperationsRequest\n * @function getTypeUrl\n * @memberof google.longrunning.ListOperationsRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.longrunning.ListOperationsRequest\";\n };\n \n return ListOperationsRequest;\n })();\n \n longrunning.ListOperationsResponse = (function() {\n \n /**\n * Properties of a ListOperationsResponse.\n * @memberof google.longrunning\n * @interface IListOperationsResponse\n * @property {Array.|null} [operations] ListOperationsResponse operations\n * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken\n */\n \n /**\n * Constructs a new ListOperationsResponse.\n * @memberof google.longrunning\n * @classdesc Represents a ListOperationsResponse.\n * @implements IListOperationsResponse\n * @constructor\n * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set\n */\n function ListOperationsResponse(properties) {\n this.operations = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * ListOperationsResponse operations.\n * @member {Array.} operations\n * @memberof google.longrunning.ListOperationsResponse\n * @instance\n */\n ListOperationsResponse.prototype.operations = $util.emptyArray;\n \n /**\n * ListOperationsResponse nextPageToken.\n * @member {string} nextPageToken\n * @memberof google.longrunning.ListOperationsResponse\n * @instance\n */\n ListOperationsResponse.prototype.nextPageToken = \"\";\n \n /**\n * Creates a new ListOperationsResponse instance using the specified properties.\n * @function create\n * @memberof google.longrunning.ListOperationsResponse\n * @static\n * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set\n * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance\n */\n ListOperationsResponse.create = function create(properties) {\n return new ListOperationsResponse(properties);\n };\n \n /**\n * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages.\n * @function encode\n * @memberof google.longrunning.ListOperationsResponse\n * @static\n * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListOperationsResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.operations != null && message.operations.length)\n for (var i = 0; i < message.operations.length; ++i)\n $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.nextPageToken != null && Object.hasOwnProperty.call(message, \"nextPageToken\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);\n return writer;\n };\n \n /**\n * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.longrunning.ListOperationsResponse\n * @static\n * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a ListOperationsResponse message from the specified reader or buffer.\n * @function decode\n * @memberof google.longrunning.ListOperationsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListOperationsResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.operations && message.operations.length))\n message.operations = [];\n message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.nextPageToken = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.longrunning.ListOperationsResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a ListOperationsResponse message.\n * @function verify\n * @memberof google.longrunning.ListOperationsResponse\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ListOperationsResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.operations != null && message.hasOwnProperty(\"operations\")) {\n if (!Array.isArray(message.operations))\n return \"operations: array expected\";\n for (var i = 0; i < message.operations.length; ++i) {\n var error = $root.google.longrunning.Operation.verify(message.operations[i]);\n if (error)\n return \"operations.\" + error;\n }\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n if (!$util.isString(message.nextPageToken))\n return \"nextPageToken: string expected\";\n return null;\n };\n \n /**\n * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.longrunning.ListOperationsResponse\n * @static\n * @param {Object.} object Plain object\n * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse\n */\n ListOperationsResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.google.longrunning.ListOperationsResponse)\n return object;\n var message = new $root.google.longrunning.ListOperationsResponse();\n if (object.operations) {\n if (!Array.isArray(object.operations))\n throw TypeError(\".google.longrunning.ListOperationsResponse.operations: array expected\");\n message.operations = [];\n for (var i = 0; i < object.operations.length; ++i) {\n if (typeof object.operations[i] !== \"object\")\n throw TypeError(\".google.longrunning.ListOperationsResponse.operations: object expected\");\n message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]);\n }\n }\n if (object.nextPageToken != null)\n message.nextPageToken = String(object.nextPageToken);\n return message;\n };\n \n /**\n * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.longrunning.ListOperationsResponse\n * @static\n * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ListOperationsResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.operations = [];\n if (options.defaults)\n object.nextPageToken = \"\";\n if (message.operations && message.operations.length) {\n object.operations = [];\n for (var j = 0; j < message.operations.length; ++j)\n object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options);\n }\n if (message.nextPageToken != null && message.hasOwnProperty(\"nextPageToken\"))\n object.nextPageToken = message.nextPageToken;\n return object;\n };\n \n /**\n * Converts this ListOperationsResponse to JSON.\n * @function toJSON\n * @memberof google.longrunning.ListOperationsResponse\n * @instance\n * @returns {Object.} JSON object\n */\n ListOperationsResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for ListOperationsResponse\n * @function getTypeUrl\n * @memberof google.longrunning.ListOperationsResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.longrunning.ListOperationsResponse\";\n };\n \n return ListOperationsResponse;\n })();\n \n longrunning.CancelOperationRequest = (function() {\n \n /**\n * Properties of a CancelOperationRequest.\n * @memberof google.longrunning\n * @interface ICancelOperationRequest\n * @property {string|null} [name] CancelOperationRequest name\n */\n \n /**\n * Constructs a new CancelOperationRequest.\n * @memberof google.longrunning\n * @classdesc Represents a CancelOperationRequest.\n * @implements ICancelOperationRequest\n * @constructor\n * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set\n */\n function CancelOperationRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * CancelOperationRequest name.\n * @member {string} name\n * @memberof google.longrunning.CancelOperationRequest\n * @instance\n */\n CancelOperationRequest.prototype.name = \"\";\n \n /**\n * Creates a new CancelOperationRequest instance using the specified properties.\n * @function create\n * @memberof google.longrunning.CancelOperationRequest\n * @static\n * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set\n * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance\n */\n CancelOperationRequest.create = function create(properties) {\n return new CancelOperationRequest(properties);\n };\n \n /**\n * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages.\n * @function encode\n * @memberof google.longrunning.CancelOperationRequest\n * @static\n * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CancelOperationRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.longrunning.CancelOperationRequest\n * @static\n * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a CancelOperationRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.longrunning.CancelOperationRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CancelOperationRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.longrunning.CancelOperationRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a CancelOperationRequest message.\n * @function verify\n * @memberof google.longrunning.CancelOperationRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CancelOperationRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.longrunning.CancelOperationRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest\n */\n CancelOperationRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.longrunning.CancelOperationRequest)\n return object;\n var message = new $root.google.longrunning.CancelOperationRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.longrunning.CancelOperationRequest\n * @static\n * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CancelOperationRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this CancelOperationRequest to JSON.\n * @function toJSON\n * @memberof google.longrunning.CancelOperationRequest\n * @instance\n * @returns {Object.} JSON object\n */\n CancelOperationRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for CancelOperationRequest\n * @function getTypeUrl\n * @memberof google.longrunning.CancelOperationRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.longrunning.CancelOperationRequest\";\n };\n \n return CancelOperationRequest;\n })();\n \n longrunning.DeleteOperationRequest = (function() {\n \n /**\n * Properties of a DeleteOperationRequest.\n * @memberof google.longrunning\n * @interface IDeleteOperationRequest\n * @property {string|null} [name] DeleteOperationRequest name\n */\n \n /**\n * Constructs a new DeleteOperationRequest.\n * @memberof google.longrunning\n * @classdesc Represents a DeleteOperationRequest.\n * @implements IDeleteOperationRequest\n * @constructor\n * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set\n */\n function DeleteOperationRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * DeleteOperationRequest name.\n * @member {string} name\n * @memberof google.longrunning.DeleteOperationRequest\n * @instance\n */\n DeleteOperationRequest.prototype.name = \"\";\n \n /**\n * Creates a new DeleteOperationRequest instance using the specified properties.\n * @function create\n * @memberof google.longrunning.DeleteOperationRequest\n * @static\n * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set\n * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance\n */\n DeleteOperationRequest.create = function create(properties) {\n return new DeleteOperationRequest(properties);\n };\n \n /**\n * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages.\n * @function encode\n * @memberof google.longrunning.DeleteOperationRequest\n * @static\n * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteOperationRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n return writer;\n };\n \n /**\n * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.longrunning.DeleteOperationRequest\n * @static\n * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a DeleteOperationRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.longrunning.DeleteOperationRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteOperationRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.longrunning.DeleteOperationRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a DeleteOperationRequest message.\n * @function verify\n * @memberof google.longrunning.DeleteOperationRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n DeleteOperationRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n return null;\n };\n \n /**\n * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.longrunning.DeleteOperationRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest\n */\n DeleteOperationRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.longrunning.DeleteOperationRequest)\n return object;\n var message = new $root.google.longrunning.DeleteOperationRequest();\n if (object.name != null)\n message.name = String(object.name);\n return message;\n };\n \n /**\n * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.longrunning.DeleteOperationRequest\n * @static\n * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n DeleteOperationRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.name = \"\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n return object;\n };\n \n /**\n * Converts this DeleteOperationRequest to JSON.\n * @function toJSON\n * @memberof google.longrunning.DeleteOperationRequest\n * @instance\n * @returns {Object.} JSON object\n */\n DeleteOperationRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for DeleteOperationRequest\n * @function getTypeUrl\n * @memberof google.longrunning.DeleteOperationRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.longrunning.DeleteOperationRequest\";\n };\n \n return DeleteOperationRequest;\n })();\n \n longrunning.WaitOperationRequest = (function() {\n \n /**\n * Properties of a WaitOperationRequest.\n * @memberof google.longrunning\n * @interface IWaitOperationRequest\n * @property {string|null} [name] WaitOperationRequest name\n * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout\n */\n \n /**\n * Constructs a new WaitOperationRequest.\n * @memberof google.longrunning\n * @classdesc Represents a WaitOperationRequest.\n * @implements IWaitOperationRequest\n * @constructor\n * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set\n */\n function WaitOperationRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * WaitOperationRequest name.\n * @member {string} name\n * @memberof google.longrunning.WaitOperationRequest\n * @instance\n */\n WaitOperationRequest.prototype.name = \"\";\n \n /**\n * WaitOperationRequest timeout.\n * @member {google.protobuf.IDuration|null|undefined} timeout\n * @memberof google.longrunning.WaitOperationRequest\n * @instance\n */\n WaitOperationRequest.prototype.timeout = null;\n \n /**\n * Creates a new WaitOperationRequest instance using the specified properties.\n * @function create\n * @memberof google.longrunning.WaitOperationRequest\n * @static\n * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set\n * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance\n */\n WaitOperationRequest.create = function create(properties) {\n return new WaitOperationRequest(properties);\n };\n \n /**\n * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages.\n * @function encode\n * @memberof google.longrunning.WaitOperationRequest\n * @static\n * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n WaitOperationRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.timeout != null && Object.hasOwnProperty.call(message, \"timeout\"))\n $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n \n /**\n * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.longrunning.WaitOperationRequest\n * @static\n * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes a WaitOperationRequest message from the specified reader or buffer.\n * @function decode\n * @memberof google.longrunning.WaitOperationRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n WaitOperationRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.longrunning.WaitOperationRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies a WaitOperationRequest message.\n * @function verify\n * @memberof google.longrunning.WaitOperationRequest\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n WaitOperationRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.timeout != null && message.hasOwnProperty(\"timeout\")) {\n var error = $root.google.protobuf.Duration.verify(message.timeout);\n if (error)\n return \"timeout.\" + error;\n }\n return null;\n };\n \n /**\n * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.longrunning.WaitOperationRequest\n * @static\n * @param {Object.} object Plain object\n * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest\n */\n WaitOperationRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.google.longrunning.WaitOperationRequest)\n return object;\n var message = new $root.google.longrunning.WaitOperationRequest();\n if (object.name != null)\n message.name = String(object.name);\n if (object.timeout != null) {\n if (typeof object.timeout !== \"object\")\n throw TypeError(\".google.longrunning.WaitOperationRequest.timeout: object expected\");\n message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout);\n }\n return message;\n };\n \n /**\n * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.longrunning.WaitOperationRequest\n * @static\n * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n WaitOperationRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.timeout = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.timeout != null && message.hasOwnProperty(\"timeout\"))\n object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options);\n return object;\n };\n \n /**\n * Converts this WaitOperationRequest to JSON.\n * @function toJSON\n * @memberof google.longrunning.WaitOperationRequest\n * @instance\n * @returns {Object.} JSON object\n */\n WaitOperationRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for WaitOperationRequest\n * @function getTypeUrl\n * @memberof google.longrunning.WaitOperationRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.longrunning.WaitOperationRequest\";\n };\n \n return WaitOperationRequest;\n })();\n \n longrunning.OperationInfo = (function() {\n \n /**\n * Properties of an OperationInfo.\n * @memberof google.longrunning\n * @interface IOperationInfo\n * @property {string|null} [responseType] OperationInfo responseType\n * @property {string|null} [metadataType] OperationInfo metadataType\n */\n \n /**\n * Constructs a new OperationInfo.\n * @memberof google.longrunning\n * @classdesc Represents an OperationInfo.\n * @implements IOperationInfo\n * @constructor\n * @param {google.longrunning.IOperationInfo=} [properties] Properties to set\n */\n function OperationInfo(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n \n /**\n * OperationInfo responseType.\n * @member {string} responseType\n * @memberof google.longrunning.OperationInfo\n * @instance\n */\n OperationInfo.prototype.responseType = \"\";\n \n /**\n * OperationInfo metadataType.\n * @member {string} metadataType\n * @memberof google.longrunning.OperationInfo\n * @instance\n */\n OperationInfo.prototype.metadataType = \"\";\n \n /**\n * Creates a new OperationInfo instance using the specified properties.\n * @function create\n * @memberof google.longrunning.OperationInfo\n * @static\n * @param {google.longrunning.IOperationInfo=} [properties] Properties to set\n * @returns {google.longrunning.OperationInfo} OperationInfo instance\n */\n OperationInfo.create = function create(properties) {\n return new OperationInfo(properties);\n };\n \n /**\n * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages.\n * @function encode\n * @memberof google.longrunning.OperationInfo\n * @static\n * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OperationInfo.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.responseType != null && Object.hasOwnProperty.call(message, \"responseType\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType);\n if (message.metadataType != null && Object.hasOwnProperty.call(message, \"metadataType\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType);\n return writer;\n };\n \n /**\n * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages.\n * @function encodeDelimited\n * @memberof google.longrunning.OperationInfo\n * @static\n * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OperationInfo.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n \n /**\n * Decodes an OperationInfo message from the specified reader or buffer.\n * @function decode\n * @memberof google.longrunning.OperationInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {google.longrunning.OperationInfo} OperationInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OperationInfo.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.responseType = reader.string();\n break;\n }\n case 2: {\n message.metadataType = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n \n /**\n * Decodes an OperationInfo message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof google.longrunning.OperationInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {google.longrunning.OperationInfo} OperationInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OperationInfo.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n \n /**\n * Verifies an OperationInfo message.\n * @function verify\n * @memberof google.longrunning.OperationInfo\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n OperationInfo.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.responseType != null && message.hasOwnProperty(\"responseType\"))\n if (!$util.isString(message.responseType))\n return \"responseType: string expected\";\n if (message.metadataType != null && message.hasOwnProperty(\"metadataType\"))\n if (!$util.isString(message.metadataType))\n return \"metadataType: string expected\";\n return null;\n };\n \n /**\n * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof google.longrunning.OperationInfo\n * @static\n * @param {Object.} object Plain object\n * @returns {google.longrunning.OperationInfo} OperationInfo\n */\n OperationInfo.fromObject = function fromObject(object) {\n if (object instanceof $root.google.longrunning.OperationInfo)\n return object;\n var message = new $root.google.longrunning.OperationInfo();\n if (object.responseType != null)\n message.responseType = String(object.responseType);\n if (object.metadataType != null)\n message.metadataType = String(object.metadataType);\n return message;\n };\n \n /**\n * Creates a plain object from an OperationInfo message. Also converts values to other types if specified.\n * @function toObject\n * @memberof google.longrunning.OperationInfo\n * @static\n * @param {google.longrunning.OperationInfo} message OperationInfo\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n OperationInfo.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.responseType = \"\";\n object.metadataType = \"\";\n }\n if (message.responseType != null && message.hasOwnProperty(\"responseType\"))\n object.responseType = message.responseType;\n if (message.metadataType != null && message.hasOwnProperty(\"metadataType\"))\n object.metadataType = message.metadataType;\n return object;\n };\n \n /**\n * Converts this OperationInfo to JSON.\n * @function toJSON\n * @memberof google.longrunning.OperationInfo\n * @instance\n * @returns {Object.} JSON object\n */\n OperationInfo.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n \n /**\n * Gets the default type url for OperationInfo\n * @function getTypeUrl\n * @memberof google.longrunning.OperationInfo\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/google.longrunning.OperationInfo\";\n };\n \n return OperationInfo;\n })();\n \n return longrunning;\n })();\n \n return google;\n })();\n\n return $root;\n});\n","\"use strict\";\n// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// ** This file is automatically generated by synthtool. **\n// ** https://github.com/googleapis/synthtool **\n// ** All changes to this file may be overwritten. **\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.protos = exports.ArtifactRegistryClient = exports.v1beta2 = exports.v1 = void 0;\nconst v1 = require(\"./v1\");\nexports.v1 = v1;\nconst v1beta2 = require(\"./v1beta2\");\nexports.v1beta2 = v1beta2;\nconst ArtifactRegistryClient = v1.ArtifactRegistryClient;\nexports.ArtifactRegistryClient = ArtifactRegistryClient;\nexports.default = { v1, v1beta2, ArtifactRegistryClient };\nconst protos = require(\"../protos/protos\");\nexports.protos = protos;\n//# sourceMappingURL=index.js.map","/**\n * @module LRUCache\n */\nconst perf = typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ? performance\n : Date;\nconst warned = new Set();\n/* c8 ignore start */\nconst PROCESS = (typeof process === 'object' && !!process ? process : {});\n/* c8 ignore start */\nconst emitWarning = (msg, type, code, fn) => {\n typeof PROCESS.emitWarning === 'function'\n ? PROCESS.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`);\n};\nlet AC = globalThis.AbortController;\nlet AS = globalThis.AbortSignal;\n/* c8 ignore start */\nif (typeof AC === 'undefined') {\n //@ts-ignore\n AS = class AbortSignal {\n onabort;\n _onabort = [];\n reason;\n aborted = false;\n addEventListener(_, fn) {\n this._onabort.push(fn);\n }\n };\n //@ts-ignore\n AC = class AbortController {\n constructor() {\n warnACPolyfill();\n }\n signal = new AS();\n abort(reason) {\n if (this.signal.aborted)\n return;\n //@ts-ignore\n this.signal.reason = reason;\n //@ts-ignore\n this.signal.aborted = true;\n //@ts-ignore\n for (const fn of this.signal._onabort) {\n fn(reason);\n }\n this.signal.onabort?.(reason);\n }\n };\n let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1';\n const warnACPolyfill = () => {\n if (!printACPolyfillWarning)\n return;\n printACPolyfillWarning = false;\n emitWarning('AbortController is not defined. If using lru-cache in ' +\n 'node 14, load an AbortController polyfill from the ' +\n '`node-abort-controller` package. A minimal polyfill is ' +\n 'provided for use by LRUCache.fetch(), but it should not be ' +\n 'relied upon in other contexts (eg, passing it to other APIs that ' +\n 'use AbortController/AbortSignal might have undesirable effects). ' +\n 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.', 'NO_ABORT_CONTROLLER', 'ENOTSUP', warnACPolyfill);\n };\n}\n/* c8 ignore stop */\nconst shouldWarn = (code) => !warned.has(code);\nconst TYPE = Symbol('type');\nconst isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max) => !isPosInt(max)\n ? null\n : max <= Math.pow(2, 8)\n ? Uint8Array\n : max <= Math.pow(2, 16)\n ? Uint16Array\n : max <= Math.pow(2, 32)\n ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER\n ? ZeroArray\n : null;\n/* c8 ignore stop */\nclass ZeroArray extends Array {\n constructor(size) {\n super(size);\n this.fill(0);\n }\n}\nclass Stack {\n heap;\n length;\n // private constructor\n static #constructing = false;\n static create(max) {\n const HeapCls = getUintArray(max);\n if (!HeapCls)\n return [];\n Stack.#constructing = true;\n const s = new Stack(max, HeapCls);\n Stack.#constructing = false;\n return s;\n }\n constructor(max, HeapCls) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)');\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max);\n this.length = 0;\n }\n push(n) {\n this.heap[this.length++] = n;\n }\n pop() {\n return this.heap[--this.length];\n }\n}\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n #max;\n #maxSize;\n #dispose;\n #disposeAfter;\n #fetchMethod;\n #memoMethod;\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl;\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution;\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge;\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet;\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas;\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale;\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet;\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL;\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize;\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation;\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection;\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet;\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort;\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection;\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort;\n // computed properties\n #size;\n #calculatedSize;\n #keyMap;\n #keyList;\n #valList;\n #next;\n #prev;\n #head;\n #tail;\n #free;\n #disposed;\n #sizes;\n #starts;\n #ttls;\n #hasDispose;\n #hasFetchMethod;\n #hasDisposeAfter;\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals(c) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n sizes: c.#sizes,\n keyMap: c.#keyMap,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head;\n },\n get tail() {\n return c.#tail;\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p) => c.#isBackgroundFetch(p),\n backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context),\n moveToTail: (index) => c.#moveToTail(index),\n indexes: (options) => c.#indexes(options),\n rindexes: (options) => c.#rindexes(options),\n isStale: (index) => c.#isStale(index),\n };\n }\n // Protected read-only members\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max() {\n return this.#max;\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize() {\n return this.#maxSize;\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize() {\n return this.#calculatedSize;\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size() {\n return this.#size;\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod() {\n return this.#fetchMethod;\n }\n get memoMethod() {\n return this.#memoMethod;\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose;\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter;\n }\n constructor(options) {\n const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options;\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer');\n }\n const UintArray = max ? getUintArray(max) : Array;\n if (!UintArray) {\n throw new Error('invalid max value: ' + max);\n }\n this.#max = max;\n this.#maxSize = maxSize;\n this.maxEntrySize = maxEntrySize || this.#maxSize;\n this.sizeCalculation = sizeCalculation;\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize');\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function');\n }\n }\n if (memoMethod !== undefined &&\n typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined');\n }\n this.#memoMethod = memoMethod;\n if (fetchMethod !== undefined &&\n typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified');\n }\n this.#fetchMethod = fetchMethod;\n this.#hasFetchMethod = !!fetchMethod;\n this.#keyMap = new Map();\n this.#keyList = new Array(max).fill(undefined);\n this.#valList = new Array(max).fill(undefined);\n this.#next = new UintArray(max);\n this.#prev = new UintArray(max);\n this.#head = 0;\n this.#tail = 0;\n this.#free = Stack.create(max);\n this.#size = 0;\n this.#calculatedSize = 0;\n if (typeof dispose === 'function') {\n this.#dispose = dispose;\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter;\n this.#disposed = [];\n }\n else {\n this.#disposeAfter = undefined;\n this.#disposed = undefined;\n }\n this.#hasDispose = !!this.#dispose;\n this.#hasDisposeAfter = !!this.#disposeAfter;\n this.noDisposeOnSet = !!noDisposeOnSet;\n this.noUpdateTTL = !!noUpdateTTL;\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;\n this.ignoreFetchAbort = !!ignoreFetchAbort;\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError('maxSize must be a positive integer if specified');\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError('maxEntrySize must be a positive integer if specified');\n }\n this.#initializeSizeTracking();\n }\n this.allowStale = !!allowStale;\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;\n this.updateAgeOnGet = !!updateAgeOnGet;\n this.updateAgeOnHas = !!updateAgeOnHas;\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0\n ? ttlResolution\n : 1;\n this.ttlAutopurge = !!ttlAutopurge;\n this.ttl = ttl || 0;\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified');\n }\n this.#initializeTTLTracking();\n }\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError('At least one of max, maxSize, or ttl is required');\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED';\n if (shouldWarn(code)) {\n warned.add(code);\n const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.';\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache);\n }\n }\n }\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key) {\n return this.#keyMap.has(key) ? Infinity : 0;\n }\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max);\n const starts = new ZeroArray(this.#max);\n this.#ttls = ttls;\n this.#starts = starts;\n this.#setItemTTL = (index, ttl, start = perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0;\n ttls[index] = ttl;\n if (ttl !== 0 && this.ttlAutopurge) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index], 'expire');\n }\n }, ttl + 1);\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref();\n }\n /* c8 ignore stop */\n }\n };\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? perf.now() : 0;\n };\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index];\n const start = starts[index];\n /* c8 ignore next */\n if (!ttl || !start)\n return;\n status.ttl = ttl;\n status.start = start;\n status.now = cachedNow || getNow();\n const age = status.now - start;\n status.remainingTTL = ttl - age;\n }\n };\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0;\n const getNow = () => {\n const n = perf.now();\n if (this.ttlResolution > 0) {\n cachedNow = n;\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution);\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref();\n }\n /* c8 ignore stop */\n }\n return n;\n };\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key);\n if (index === undefined) {\n return 0;\n }\n const ttl = ttls[index];\n const start = starts[index];\n if (!ttl || !start) {\n return Infinity;\n }\n const age = (cachedNow || getNow()) - start;\n return ttl - age;\n };\n this.#isStale = index => {\n const s = starts[index];\n const t = ttls[index];\n return !!t && !!s && (cachedNow || getNow()) - s > t;\n };\n }\n // conditionally set private methods related to TTL\n #updateItemAge = () => { };\n #statusTTL = () => { };\n #setItemTTL = () => { };\n /* c8 ignore stop */\n #isStale = () => false;\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max);\n this.#calculatedSize = 0;\n this.#sizes = sizes;\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index];\n sizes[index] = 0;\n };\n this.#requireSize = (k, v, size, sizeCalculation) => {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n return 0;\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function');\n }\n size = sizeCalculation(v, k);\n if (!isPosInt(size)) {\n throw new TypeError('sizeCalculation return invalid (expect positive integer)');\n }\n }\n else {\n throw new TypeError('invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.');\n }\n }\n return size;\n };\n this.#addItemSize = (index, size, status) => {\n sizes[index] = size;\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index];\n while (this.#calculatedSize > maxSize) {\n this.#evict(true);\n }\n }\n this.#calculatedSize += sizes[index];\n if (status) {\n status.entrySize = size;\n status.totalCalculatedSize = this.#calculatedSize;\n }\n };\n }\n #removeItemSize = _i => { };\n #addItemSize = (_i, _s, _st) => { };\n #requireSize = (_k, _v, size, sizeCalculation) => {\n if (size || sizeCalculation) {\n throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache');\n }\n return 0;\n };\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; true;) {\n if (!this.#isValidIndex(i)) {\n break;\n }\n if (allowStale || !this.#isStale(i)) {\n yield i;\n }\n if (i === this.#head) {\n break;\n }\n else {\n i = this.#prev[i];\n }\n }\n }\n }\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; true;) {\n if (!this.#isValidIndex(i)) {\n break;\n }\n if (allowStale || !this.#isStale(i)) {\n yield i;\n }\n if (i === this.#tail) {\n break;\n }\n else {\n i = this.#next[i];\n }\n }\n }\n }\n #isValidIndex(index) {\n return (index !== undefined &&\n this.#keyMap.get(this.#keyList[index]) === index);\n }\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield [this.#keyList[i], this.#valList[i]];\n }\n }\n }\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield [this.#keyList[i], this.#valList[i]];\n }\n }\n }\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i];\n if (k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield k;\n }\n }\n }\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i];\n if (k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield k;\n }\n }\n }\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i];\n if (v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i];\n }\n }\n }\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i];\n if (v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i];\n }\n }\n }\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries();\n }\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache';\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(fn, getOptions = {}) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i];\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v;\n if (value === undefined)\n continue;\n if (fn(value, this.#keyList[i], this)) {\n return this.get(this.#keyList[i], getOptions);\n }\n }\n }\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(fn, thisp = this) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i];\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v;\n if (value === undefined)\n continue;\n fn.call(thisp, value, this.#keyList[i], this);\n }\n }\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(fn, thisp = this) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i];\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v;\n if (value === undefined)\n continue;\n fn.call(thisp, value, this.#keyList[i], this);\n }\n }\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false;\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i], 'expire');\n deleted = true;\n }\n }\n return deleted;\n }\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key) {\n const i = this.#keyMap.get(key);\n if (i === undefined)\n return undefined;\n const v = this.#valList[i];\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v;\n if (value === undefined)\n return undefined;\n const entry = { value };\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i];\n const start = this.#starts[i];\n if (ttl && start) {\n const remain = ttl - (perf.now() - start);\n entry.ttl = remain;\n entry.start = Date.now();\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i];\n }\n return entry;\n }\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr = [];\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i];\n const v = this.#valList[i];\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v;\n if (value === undefined || key === undefined)\n continue;\n const entry = { value };\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i];\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = perf.now() - this.#starts[i];\n entry.start = Math.floor(Date.now() - age);\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i];\n }\n arr.unshift([key, entry]);\n }\n return arr;\n }\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr) {\n this.clear();\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start;\n entry.start = perf.now() - age;\n }\n this.set(key, entry.value, entry);\n }\n }\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(k, v, setOptions = {}) {\n if (v === undefined) {\n this.delete(k);\n return this;\n }\n const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions;\n let { noUpdateTTL = this.noUpdateTTL } = setOptions;\n const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = 'miss';\n status.maxEntrySizeExceeded = true;\n }\n // have to delete, in case something is there already.\n this.#delete(k, 'set');\n return this;\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k);\n if (index === undefined) {\n // addition\n index = (this.#size === 0\n ? this.#tail\n : this.#free.length !== 0\n ? this.#free.pop()\n : this.#size === this.#max\n ? this.#evict(false)\n : this.#size);\n this.#keyList[index] = k;\n this.#valList[index] = v;\n this.#keyMap.set(k, index);\n this.#next[this.#tail] = index;\n this.#prev[index] = this.#tail;\n this.#tail = index;\n this.#size++;\n this.#addItemSize(index, size, status);\n if (status)\n status.set = 'add';\n noUpdateTTL = false;\n }\n else {\n // update\n this.#moveToTail(index);\n const oldVal = this.#valList[index];\n if (v !== oldVal) {\n if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n oldVal.__abortController.abort(new Error('replaced'));\n const { __staleWhileFetching: s } = oldVal;\n if (s !== undefined && !noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set');\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set']);\n }\n }\n }\n else if (!noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set');\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set']);\n }\n }\n this.#removeItemSize(index);\n this.#addItemSize(index, size, status);\n this.#valList[index] = v;\n if (status) {\n status.set = 'replace';\n const oldValue = oldVal && this.#isBackgroundFetch(oldVal)\n ? oldVal.__staleWhileFetching\n : oldVal;\n if (oldValue !== undefined)\n status.oldValue = oldValue;\n }\n }\n else if (status) {\n status.set = 'update';\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking();\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start);\n }\n if (status)\n this.#statusTTL(status, index);\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed;\n let task;\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task);\n }\n }\n return this;\n }\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop() {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head];\n this.#evict(true);\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching;\n }\n }\n else if (val !== undefined) {\n return val;\n }\n }\n }\n finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed;\n let task;\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task);\n }\n }\n }\n }\n #evict(free) {\n const head = this.#head;\n const k = this.#keyList[head];\n const v = this.#valList[head];\n if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('evicted'));\n }\n else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'evict');\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'evict']);\n }\n }\n this.#removeItemSize(head);\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined;\n this.#valList[head] = undefined;\n this.#free.push(head);\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0;\n this.#free.length = 0;\n }\n else {\n this.#head = this.#next[head];\n }\n this.#keyMap.delete(k);\n this.#size--;\n return head;\n }\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k, hasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;\n const index = this.#keyMap.get(k);\n if (index !== undefined) {\n const v = this.#valList[index];\n if (this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined) {\n return false;\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index);\n }\n if (status) {\n status.has = 'hit';\n this.#statusTTL(status, index);\n }\n return true;\n }\n else if (status) {\n status.has = 'stale';\n this.#statusTTL(status, index);\n }\n }\n else if (status) {\n status.has = 'miss';\n }\n return false;\n }\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k, peekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions;\n const index = this.#keyMap.get(k);\n if (index === undefined ||\n (!allowStale && this.#isStale(index))) {\n return;\n }\n const v = this.#valList[index];\n // either stale and allowed, or forcing a refresh of non-stale value\n return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n }\n #backgroundFetch(k, index, options, context) {\n const v = index === undefined ? undefined : this.#valList[index];\n if (this.#isBackgroundFetch(v)) {\n return v;\n }\n const ac = new AC();\n const { signal } = options;\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n });\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n };\n const cb = (v, updateCache = false) => {\n const { aborted } = ac.signal;\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined;\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true;\n options.status.fetchError = ac.signal.reason;\n if (ignoreAbort)\n options.status.fetchAbortIgnored = true;\n }\n else {\n options.status.fetchResolved = true;\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason);\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p;\n if (this.#valList[index] === p) {\n if (v === undefined) {\n if (bf.__staleWhileFetching) {\n this.#valList[index] = bf.__staleWhileFetching;\n }\n else {\n this.#delete(k, 'fetch');\n }\n }\n else {\n if (options.status)\n options.status.fetchUpdated = true;\n this.set(k, v, fetchOpts.options);\n }\n }\n return v;\n };\n const eb = (er) => {\n if (options.status) {\n options.status.fetchRejected = true;\n options.status.fetchError = er;\n }\n return fetchFail(er);\n };\n const fetchFail = (er) => {\n const { aborted } = ac.signal;\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;\n const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;\n const noDelete = allowStale || options.noDeleteOnFetchRejection;\n const bf = p;\n if (this.#valList[index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del = !noDelete || bf.__staleWhileFetching === undefined;\n if (del) {\n this.#delete(k, 'fetch');\n }\n else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index] = bf.__staleWhileFetching;\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true;\n }\n return bf.__staleWhileFetching;\n }\n else if (bf.__returned === bf) {\n throw er;\n }\n };\n const pcall = (res, rej) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts);\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej);\n }\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort ||\n options.allowStaleOnFetchAbort) {\n res(undefined);\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true);\n }\n }\n });\n };\n if (options.status)\n options.status.fetchDispatched = true;\n const p = new Promise(pcall).then(cb, eb);\n const bf = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n });\n if (index === undefined) {\n // internal, don't expose status.\n this.set(k, bf, { ...fetchOpts.options, status: undefined });\n index = this.#keyMap.get(k);\n }\n else {\n this.#valList[index] = bf;\n }\n return bf;\n }\n #isBackgroundFetch(p) {\n if (!this.#hasFetchMethod)\n return false;\n const b = p;\n return (!!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AC);\n }\n async fetch(k, fetchOptions = {}) {\n const { \n // get options\n allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, \n // set options\n ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, \n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions;\n if (!this.#hasFetchMethod) {\n if (status)\n status.fetch = 'get';\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n });\n }\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n };\n let index = this.#keyMap.get(k);\n if (index === undefined) {\n if (status)\n status.fetch = 'miss';\n const p = this.#backgroundFetch(k, index, options, context);\n return (p.__returned = p);\n }\n else {\n // in cache, maybe already fetching\n const v = this.#valList[index];\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined;\n if (status) {\n status.fetch = 'inflight';\n if (stale)\n status.returnedStale = true;\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v);\n }\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index);\n if (!forceRefresh && !isStale) {\n if (status)\n status.fetch = 'hit';\n this.#moveToTail(index);\n if (updateAgeOnGet) {\n this.#updateItemAge(index);\n }\n if (status)\n this.#statusTTL(status, index);\n return v;\n }\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context);\n const hasStale = p.__staleWhileFetching !== undefined;\n const staleVal = hasStale && allowStale;\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh';\n if (staleVal && isStale)\n status.returnedStale = true;\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p);\n }\n }\n async forceFetch(k, fetchOptions = {}) {\n const v = await this.fetch(k, fetchOptions);\n if (v === undefined)\n throw new Error('fetch() returned undefined');\n return v;\n }\n memo(k, memoOptions = {}) {\n const memoMethod = this.#memoMethod;\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor');\n }\n const { context, forceRefresh, ...options } = memoOptions;\n const v = this.get(k, options);\n if (!forceRefresh && v !== undefined)\n return v;\n const vv = memoMethod(k, v, {\n options,\n context,\n });\n this.set(k, vv, options);\n return vv;\n }\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k, getOptions = {}) {\n const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions;\n const index = this.#keyMap.get(k);\n if (index !== undefined) {\n const value = this.#valList[index];\n const fetching = this.#isBackgroundFetch(value);\n if (status)\n this.#statusTTL(status, index);\n if (this.#isStale(index)) {\n if (status)\n status.get = 'stale';\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire');\n }\n if (status && allowStale)\n status.returnedStale = true;\n return allowStale ? value : undefined;\n }\n else {\n if (status &&\n allowStale &&\n value.__staleWhileFetching !== undefined) {\n status.returnedStale = true;\n }\n return allowStale ? value.__staleWhileFetching : undefined;\n }\n }\n else {\n if (status)\n status.get = 'hit';\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n if (fetching) {\n return value.__staleWhileFetching;\n }\n this.#moveToTail(index);\n if (updateAgeOnGet) {\n this.#updateItemAge(index);\n }\n return value;\n }\n }\n else if (status) {\n status.get = 'miss';\n }\n }\n #connect(p, n) {\n this.#prev[n] = p;\n this.#next[p] = n;\n }\n #moveToTail(index) {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index];\n }\n else {\n this.#connect(this.#prev[index], this.#next[index]);\n }\n this.#connect(this.#tail, index);\n this.#tail = index;\n }\n }\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k) {\n return this.#delete(k, 'delete');\n }\n #delete(k, reason) {\n let deleted = false;\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k);\n if (index !== undefined) {\n deleted = true;\n if (this.#size === 1) {\n this.#clear(reason);\n }\n else {\n this.#removeItemSize(index);\n const v = this.#valList[index];\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'));\n }\n else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, reason);\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, reason]);\n }\n }\n this.#keyMap.delete(k);\n this.#keyList[index] = undefined;\n this.#valList[index] = undefined;\n if (index === this.#tail) {\n this.#tail = this.#prev[index];\n }\n else if (index === this.#head) {\n this.#head = this.#next[index];\n }\n else {\n const pi = this.#prev[index];\n this.#next[pi] = this.#next[index];\n const ni = this.#next[index];\n this.#prev[ni] = this.#prev[index];\n }\n this.#size--;\n this.#free.push(index);\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed;\n let task;\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task);\n }\n }\n return deleted;\n }\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete');\n }\n #clear(reason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index];\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'));\n }\n else {\n const k = this.#keyList[index];\n if (this.#hasDispose) {\n this.#dispose?.(v, k, reason);\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, reason]);\n }\n }\n }\n this.#keyMap.clear();\n this.#valList.fill(undefined);\n this.#keyList.fill(undefined);\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0);\n this.#starts.fill(0);\n }\n if (this.#sizes) {\n this.#sizes.fill(0);\n }\n this.#head = 0;\n this.#tail = 0;\n this.#free.length = 0;\n this.#calculatedSize = 0;\n this.#size = 0;\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed;\n let task;\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task);\n }\n }\n }\n}\n//# sourceMappingURL=index.js.map","import { Link } from \"./templates.js\";\n\nexport interface PromotionInfoCommits {\n type: \"commits\";\n commitSHAs: string[]; // non-empty\n}\n\nexport function promotionInfoCommits(\n commitSHAs: string[],\n): PromotionInfoCommits {\n return { type: \"commits\", commitSHAs };\n}\n\n/** Used when the value is being changed but there are no commits between the two\n * values (ie, no-op change). */\nexport interface PromotionInfoNoCommits {\n type: \"no-commits\";\n}\n\n/** Used when the tag/ref value isn't changed at all. */\nexport interface PromotionInfoNoChange {\n type: \"no-change\";\n}\n\n// If we're unable to tell what happened with a promotion, the message will\n// explain that.\nexport interface PromotionInfoUnknown {\n type: \"unknown\";\n message: string;\n}\n\nexport function promotionInfoUnknown(message: string): PromotionInfoUnknown {\n return { type: \"unknown\", message };\n}\n\nexport type PromotionInfo =\n | PromotionInfoCommits\n | PromotionInfoNoCommits\n | PromotionInfoNoChange\n | PromotionInfoUnknown;\n\n// This is the set of data about a promotion that, if two apps have the same\n// values for it, will make them be treated as having identical promotions (ie,\n// we'll only have one section about it in the PR description). Notably, it does\n// not include the Docker image (or app name) because we often (due to\n// monorepos) have the same set of commits contributing to multiple Docker\n// images.\nexport interface PromotionSet {\n trimmedRepoURL: string;\n gitConfigPromotionInfo: PromotionInfo;\n // null if there's no Docker image being tracked\n dockerImagePromotionInfo: PromotionInfo | null;\n links: Link[];\n}\nexport interface PromotionSetWithDockerImage {\n promotionSet: PromotionSet;\n dockerImageRepository: string | null; // null if there's no Docker image being tracked\n}\n\n// Map from environment (eg `staging`) to EnvironmentPromotions.\nexport type PromotionsByTargetEnvironment = Map<\n string,\n PromotionSetWithDockerImage\n>;\n","import {\n ArtifactRegistryClient,\n protos,\n} from \"@google-cloud/artifact-registry\";\nimport { LRUCache } from \"lru-cache\";\nimport { PromotionInfo, promotionInfoUnknown } from \"./promotionInfo.js\";\nimport { PrefixingLogger } from \"./log.js\";\n\nexport interface GetAllEquivalentTagsOptions {\n /** The name of the specific Docker image in question (ie, a Docker\n * \"repository\", not an Artifact Registry \"repository\" that contains them.) */\n dockerImageRepository: string;\n tag: string;\n}\n\nexport interface GitCommitsBetweenTagsOptions {\n prevTag: string;\n nextTag: string;\n /** The name of the specific Docker image in question (ie, a Docker\n * \"repository\", not an Artifact Registry \"repository\" that contains them.) */\n dockerImageRepository: string;\n}\n\nexport interface GetDigestForTagOptions {\n packageName: string;\n tagName: string;\n}\n\nexport interface DockerRegistryClient {\n getAllEquivalentTags(options: GetAllEquivalentTagsOptions): Promise;\n getGitCommitsBetweenTags(\n options: GitCommitsBetweenTagsOptions,\n ): Promise;\n getDigestForTag(options: GetDigestForTagOptions): Promise;\n}\n\nexport class ArtifactRegistryDockerRegistryClient {\n private client: ArtifactRegistryClient;\n private repositoryFields: {\n project: string;\n location: string;\n repository: string;\n };\n private logger: PrefixingLogger;\n constructor(\n /** A string of the form\n * `projects/PROJECT/locations/LOCATION/repositories/REPOSITORY`; this is an\n * Artifact Registry repository, which is a set of Docker repositories. */\n artifactRegistryRepository: string,\n logger: PrefixingLogger,\n ) {\n this.logger = logger;\n this.client = new ArtifactRegistryClient();\n const { project, location, repository } =\n this.client.pathTemplates.repositoryPathTemplate.match(\n artifactRegistryRepository,\n );\n\n if (typeof project !== \"string\") {\n throw Error(`String expected for 'project'`);\n }\n if (typeof location !== \"string\") {\n throw Error(`String expected for 'location'`);\n }\n if (typeof repository !== \"string\") {\n throw Error(`String expected for 'repository'`);\n }\n\n this.repositoryFields = { project, location, repository };\n }\n\n async getDigestForTag({\n packageName,\n tagName,\n }: {\n packageName: string;\n tagName: string;\n }): Promise {\n const tagPath = this.client.pathTemplates.tagPathTemplate.render({\n ...this.repositoryFields,\n package: encodeURIComponent(packageName),\n tag: tagName,\n });\n\n // Fetch the tag object\n const [tag] = await this.client.getTag({ name: tagPath });\n\n if (!tag || !tag.version) {\n throw new Error(\n `The tag '${tagName}' on the image '${packageName}' does not exist. Check that both the image and tag are spelled correctly.`,\n );\n }\n // version.name is like projects/.../versions/{versionId}, but digest is in version metadata field\n return tag.version;\n }\n\n /**\n * getGitCommitsBetweenTags\n *\n * @param {string} prevTag The previous docker tag: of the following format:\n * main---0013567-2024.04-g\n * @param {string} nextTag The next docker tag:\n * main---0013567-2024.04-g\n *\n * @param {object} dockerImageRepository\n *\n * @returns {Promise} - The promise which resolves to an array of relevant\n * commit SHAs, or null if there's a promotion but we aren't able to map\n * that to commits (eg, it's not between two `main---` tags).\n */\n async getGitCommitsBetweenTags({\n prevTag,\n nextTag,\n dockerImageRepository,\n }: {\n prevTag: string;\n nextTag: string;\n dockerImageRepository: string;\n }): Promise {\n this.logger.info(\n `running diff docker tags ${prevTag} ${nextTag} ${dockerImageRepository}`,\n );\n // Note: we don't need `listTagsAsync` (which is recommended) because we\n // only care about the first element in the result array, which is the list of tags.\n // https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination\n // These tags look like the following:\n // {\n // \"name\":\"projects/platform-cross-environment/locations/us-central1/repositories/platform-docker/packages/identity/tags/2022.02-278-g123456789\",\n // \"version\":\"projects/platform-cross-environment/locations/us-central1/repositories/platform-docker/packages/identity/versions/sha256:123abc456defg\"\n // }\n const dockerTags = (\n await this.client.listTags({\n parent: this.client.pathTemplates.packagePathTemplate.render({\n ...this.repositoryFields,\n package: encodeURIComponent(dockerImageRepository),\n }),\n })\n )[0].map((iTag) => {\n const tag = new protos.google.devtools.artifactregistry.v1.Tag(iTag);\n return {\n // Trim off the path here, going from absolute path to the base name\n // \"projects/platform-cross-environment/locations/us-central1/repositories/platform-docker/packages/identity/tags/2022.02-278-g123456789\"\n // Becomes: \"2022.02-278-g123456789\"\n tag: this.client.pathTemplates.tagPathTemplate.match(tag.name)\n .tag as string,\n version: tag.version,\n };\n });\n\n return getRelevantCommits(prevTag, nextTag, dockerTags);\n }\n\n async getAllEquivalentTags({\n dockerImageRepository,\n tag,\n }: GetAllEquivalentTagsOptions): Promise {\n if (tag.includes(\"/\")) {\n throw Error(\"tag cannot contain a slash\");\n }\n\n const tagPath = this.client.pathTemplates.tagPathTemplate.render({\n ...this.repositoryFields,\n package: encodeURIComponent(dockerImageRepository),\n tag,\n });\n\n this.logger.info(`[AR API] Fetching tag ${tagPath}`);\n // Note: this throws if the repository or tag are not found.\n const { version } = (await this.client.getTag({ name: tagPath }))[0];\n if (!version) {\n throw Error(`No version found for ${tagPath}`);\n }\n\n // It may seem like you can just use `this.client.getVersion({name: version,\n // view: 'FULL'})` here and look in the \"relatedTags\" field, but that field\n // only shows at most 100 tags. Instead, use the Docker Image-specific API\n // which returns all tags.\n\n const parsedVersion =\n this.client.pathTemplates.versionPathTemplate.match(version);\n\n const dockerImagePath =\n this.client.pathTemplates.dockerImagePathTemplate.render({\n ...this.repositoryFields,\n docker_image: `${parsedVersion.package}@${parsedVersion.version}`,\n });\n\n this.logger.info(`[AR API] Fetching Docker image ${dockerImagePath}`);\n const { tags } = (\n await this.client.getDockerImage({ name: dockerImagePath })\n )[0];\n if (!tags) {\n throw Error(`No tags returned for ${dockerImagePath}`);\n }\n return tags;\n }\n}\n\nexport class CachingDockerRegistryClient {\n constructor(\n private wrapped: DockerRegistryClient,\n dump?: CachingDockerRegistryClientDump | null,\n ) {\n if (dump) {\n this.getGitCommitsBetweenTagsCache.load(dump.promotionsBetweenTags);\n }\n }\n private getAllEquivalentTagsCache = new LRUCache<\n string,\n string[],\n GetAllEquivalentTagsOptions\n >({\n max: 1024,\n fetchMethod: async (_key, _staleValue, { context }) => {\n return this.wrapped.getAllEquivalentTags(context);\n },\n });\n\n async getDigestForTag(): Promise {\n throw Error(\n \"getDigestForTag is not implemented for CachingDockerRegistryClient\",\n );\n }\n\n async getAllEquivalentTags(\n options: GetAllEquivalentTagsOptions,\n ): Promise {\n const tags = await this.getAllEquivalentTagsCache.fetch(\n JSON.stringify(options),\n { context: options },\n );\n if (!tags) {\n throw Error(\n \"getAllEquivalentTagsCache.fetch should never resolve without a list of tags\",\n );\n }\n return tags;\n }\n\n private getGitCommitsBetweenTagsCache = new LRUCache<\n string,\n PromotionInfo,\n GitCommitsBetweenTagsOptions\n >({\n max: 1024,\n fetchMethod: async (_key, _staleValue, { context }) => {\n return await this.wrapped.getGitCommitsBetweenTags(context);\n },\n });\n\n async getGitCommitsBetweenTags(\n options: GitCommitsBetweenTagsOptions,\n ): Promise {\n const cached = await this.getGitCommitsBetweenTagsCache.fetch(\n JSON.stringify(options),\n { context: options },\n );\n if (!cached) {\n throw Error(\n \"getGitCommitsBetweenTagsCache.fetch should never resolve without a return value\",\n );\n }\n return cached;\n }\n\n dump(): CachingDockerRegistryClientDump {\n // We cache the git commit list across executions, because assuming there's no\n // thrown error, both tags are main--- numbers that currently exist, so if\n // there aren't any force pushes to main then the set of relevant commits in\n // that range of history shouldn't change. (But don't dump\n // getAllEquivalentTagsCache since that changes over time!)\n return { promotionsBetweenTags: this.getGitCommitsBetweenTagsCache.dump() };\n }\n}\n\nexport interface CachingDockerRegistryClientDump {\n promotionsBetweenTags: [string, LRUCache.Entry][];\n}\n\nexport function isCachingDockerRegistryClientDump(\n dump: unknown,\n): dump is CachingDockerRegistryClientDump {\n if (!dump || typeof dump !== \"object\") {\n return false;\n }\n if (!(\"promotionsBetweenTags\" in dump)) {\n return false;\n }\n const { promotionsBetweenTags } = dump;\n if (!Array.isArray(promotionsBetweenTags)) {\n return false;\n }\n\n // XXX we could check the values further if we want to be more anal\n return true;\n}\n\n/**\n * An example format of a docker tag:\n * {\n * \"name\":\"projects/platform-cross-environment/locations/us-central1/repositories/platform-docker/packages/identity/tags/2022.02-278-g123456789\",\n * \"version\":\"projects/platform-cross-environment/locations/us-central1/repositories/platform-docker/packages/identity/versions/sha256:123abc456defg\"\n * }\n *\n * All of the information up to the final bits of information will be the same for all of these, though for version, we really only care about differences so we dont bother parsing anything out\n *\n * so we actually want to store these as:\n *\n * {\n * \"tag\":\"2022.02-278-g123456789\",\n * \"version\":\"projects/platform-cross-environment/locations/us-central1/repositories/platform-docker/packages/identity/versions/sha256:123abc456defg\"\n * }\n *\n */\nexport type DockerTag = {\n tag: string;\n version: string;\n};\n\n/**\n * getRelevantCommits\n *\n * @param {string} prevTag\n * The previous docker tag: of the following format: main---0013567-2024.04-g\n *\n * @param {string} nextTag\n * The next docker tag: main---0013567-2024.04-g\n *\n * @param {DockerTag[]} dockerTags\n * The docker tags as we need to parse and filter into relevant commits. Provided by a previous call to the artifact registry.\n *\n * @returns {string[] | null} - The relevant commits as strings, or null if we can't calculate the list\n */\nexport function getRelevantCommits(\n prevTag: string,\n nextTag: string,\n dockerTags: DockerTag[],\n): PromotionInfo {\n // We only want to speak authoratively about what is being promoted if both the\n // old and new tags are part of the linear `main---1234` order, and we know\n // their versions directly.\n if (!isMainTag(prevTag)) {\n return promotionInfoUnknown(\n `Old Docker tag \\`${prevTag}\\` does not start with \\`main---\\`.`,\n );\n }\n if (!isMainTag(nextTag)) {\n return promotionInfoUnknown(\n `New Docker tag \\`${nextTag}\\` does not start with \\`main---\\`.`,\n );\n }\n if (!dockerTags.some(({ tag }) => tag === nextTag)) {\n return promotionInfoUnknown(`New Docker tag \\`${nextTag}\\` unknown.`);\n }\n const prevTagVersion = dockerTags.find(({ tag }) => tag === prevTag)?.version;\n if (prevTagVersion === undefined) {\n return promotionInfoUnknown(`Old Docker tag \\`${prevTag}\\` unknown.`);\n }\n\n dockerTags = [...dockerTags]; // Don't mutate the argument\n dockerTags.sort((a, b) => a.tag.localeCompare(b.tag));\n\n // Put a \"dummy\" entry at the beginning of this list with the version\n // associated with the old tag. This means the logic below won't have to\n // special-case not including this version or special-case deduped being\n // empty; we slice it off before we return it.\n const deduped: { commit: string; version: string }[] = [\n { commit: \"\", version: prevTagVersion },\n ];\n for (const { tag, version } of dockerTags) {\n if (!isMainTag(tag)) continue;\n if (tag <= prevTag) continue;\n if (tag > nextTag) break;\n\n // We only care about the tags between prev and next that have a git commit\n const commit = tag.match(/-g([0-9a-fA-F]+)$/)?.[1];\n if (commit === undefined) {\n continue;\n }\n\n if (deduped[deduped.length - 1].version === version) {\n continue;\n }\n deduped.push({ commit, version });\n }\n // Slice off the version that is prevTagVersion.\n const commitSHAs = deduped.map(({ commit }) => commit).slice(1);\n\n return commitSHAs.length\n ? {\n type: \"commits\",\n commitSHAs,\n }\n : { type: \"no-commits\" };\n}\n\nfunction isMainTag(tag: string): boolean {\n return tag.startsWith(\"main---\");\n}\n","import { getOctokit } from \"@actions/github\";\nimport { LRUCache } from \"lru-cache\";\nimport { posix as posixPath } from \"path\";\nimport {\n PromotionInfo,\n promotionInfoCommits,\n promotionInfoUnknown,\n} from \"./promotionInfo.js\";\nimport { PrefixingLogger } from \"./log.js\";\n\nexport interface ResolveRefToSHAOptions {\n repoURL: string;\n ref: string;\n}\n\nexport interface GetTreeSHAForPathOptions {\n repoURL: string;\n commitSHA: string;\n path: string;\n}\n\nexport interface GetCommitSHAsForPathOptions {\n repoURL: string;\n ref: string;\n path: string;\n}\n\nexport interface GetPullRequestForNumberOptions {\n repoURL: string;\n prNumber: number;\n}\n\nexport type PullRequestState = \"open\" | \"closed\";\n\nexport interface PullRequest {\n state: PullRequestState;\n title: string;\n closedAt: string | null;\n}\n\nexport interface GitHubClient {\n resolveRefToSHA(options: ResolveRefToSHAOptions): Promise;\n getTreeSHAForPath(options: GetTreeSHAForPathOptions): Promise;\n // Returns the symlink target if the path is a symlink, or null if it's not.\n getSymlinkTarget(options: GetTreeSHAForPathOptions): Promise;\n getCommitSHAsForPath(options: GetCommitSHAsForPathOptions): Promise;\n getPullRequest(options: GetPullRequestForNumberOptions): Promise;\n}\n\ninterface OwnerAndRepo {\n owner: string;\n repo: string;\n}\n\nfunction parseRepoURL(repoURL: string): OwnerAndRepo {\n const m = repoURL.match(/\\bgithub\\.com\\/([\\w.-]+)\\/([\\w.-]+?)(?:\\.git|\\/)?$/);\n if (!m) {\n throw Error(`Can only track GitHub repoURLs, not ${repoURL}`);\n }\n return { owner: m[1], repo: m[2] };\n}\n\n/**\n * @param repoURL Git repository URL (e.g., \"https://github.com/owner/repo.git\")\n * @returns GitHub web URL (e.g., \"https://github.com/owner/repo\")\n */\nexport function getWebURL(repoURL: string): string {\n const { owner, repo } = parseRepoURL(repoURL);\n return `https://github.com/${owner}/${repo}`;\n}\n\ninterface AllTreesForCommit {\n pathToTreeSHA: Map;\n // Maps symlink paths to their target paths (the content of the symlink blob).\n pathToSymlinkTarget: Map;\n // If true, GitHub's response to the recursive tree fetch was truncated, so on\n // cache miss we fall back to the getContent API.\n truncated: boolean;\n}\n\nfunction isSHA(s: string): boolean {\n return !!s.match(/^[0-9a-f]{40}$/);\n}\n\n// Resolves a symlink target relative to the symlink's path.\n// For example, if the symlink is at \"apps/linter/chart\" and points to\n// \"../../shared/chart\", this returns \"shared/chart\".\n// Throws if the target escapes the repository root or is absolute.\nexport function resolveSymlinkTarget(\n symlinkPath: string,\n target: string,\n): string {\n if (target.startsWith(\"/\")) {\n throw new Error(\n `Symlink at ${symlinkPath} has absolute target ${target}, which is not supported`,\n );\n }\n // Get the parent directory of the symlink and join with the target.\n const parentDir = posixPath.dirname(symlinkPath);\n const resolved = posixPath.join(parentDir, target);\n // If the resolved path escapes the repo root, posixPath.join will return\n // a path starting with \"..\"\n if (resolved.startsWith(\"..\")) {\n throw new Error(\n `Symlink at ${symlinkPath} points to ${target}, which escapes the repository root`,\n );\n }\n return resolved;\n}\n\nexport class OctokitGitHubClient {\n apiCalls = new Map();\n constructor(\n private octokit: ReturnType,\n private logger: PrefixingLogger,\n ) {}\n\n private logAPICall(name: string, description: string): void {\n this.logger.info(`[GH API] ${name} ${description}`);\n this.apiCalls.set(name, (this.apiCalls.get(name) ?? 0) + 1);\n }\n\n // The cache key is JSON-ification of `{ repoURL, commitSHA }`.\n private allTreesForCommitCache = new LRUCache<\n string,\n AllTreesForCommit,\n { repoURL: string; commitSHA: string }\n >({\n max: 1024,\n // We ignore the key itself and treat the context as the key\n // (the key is just the JSON-ification of context).\n fetchMethod: async (_key, _staleValue, { context }) => {\n const { repoURL, commitSHA } = context;\n const { owner, repo } = parseRepoURL(repoURL);\n this.logAPICall(\"git.getCommit\", `${owner} / ${repo} ${commitSHA}`);\n const rootTreeSHA = (\n await this.octokit.rest.git.getCommit({\n owner,\n repo,\n commit_sha: commitSHA,\n })\n ).data.tree.sha;\n this.logAPICall(\"git.getTree\", `${owner} / ${repo} ${rootTreeSHA}`);\n const { tree, truncated } = (\n await this.octokit.rest.git.getTree({\n owner,\n repo,\n tree_sha: rootTreeSHA,\n recursive: \"true\",\n })\n ).data;\n const allTreesForCommit: AllTreesForCommit = {\n pathToTreeSHA: new Map(),\n pathToSymlinkTarget: new Map(),\n truncated,\n };\n const symlinkSHAs: { path: string; sha: string }[] = [];\n for (const { path, type, sha, mode } of tree) {\n if (typeof path === \"string\" && typeof sha === \"string\") {\n if (type === \"tree\") {\n allTreesForCommit.pathToTreeSHA.set(path, sha);\n } else if (type === \"blob\" && mode === \"120000\") {\n // Symlinks have mode 120000. In the recursive tree API they show up\n // as type \"blob\" rather than \"symlink\", so we detect them by mode.\n symlinkSHAs.push({ path, sha });\n }\n }\n }\n // Fetch the content of each symlink blob to get its target path.\n for (const { path, sha } of symlinkSHAs) {\n this.logAPICall(\"git.getBlob\", `${owner} / ${repo} ${sha}`);\n const blobData = await this.octokit.rest.git.getBlob({\n owner,\n repo,\n file_sha: sha,\n });\n // Symlink target is stored as base64-encoded content.\n const target = Buffer.from(blobData.data.content, \"base64\").toString(\n \"utf-8\",\n );\n allTreesForCommit.pathToSymlinkTarget.set(path, target);\n }\n // Also set the root itself in case we're tracking the root of a repo for\n // some reason.\n allTreesForCommit.pathToTreeSHA.set(\"\", rootTreeSHA);\n return allTreesForCommit;\n },\n });\n\n async resolveRefToSHA({\n repoURL,\n ref,\n }: ResolveRefToSHAOptions): Promise {\n // If the ref already looks like a SHA, just return it.\n // This does not validate that the commit actually exists in the repo,\n // but in practice the next thing we're going to do is call getTreeSHAForPath\n // with the SHA and that will apply that validation.\n if (isSHA(ref)) {\n return ref;\n }\n const { owner, repo } = parseRepoURL(repoURL);\n const prNumber = ref.match(/^pr-([0-9]+)$/)?.[1];\n const refParameter = prNumber ? `pull/${prNumber}/head` : ref;\n this.logAPICall(\"repos.getCommit\", `${owner}/${repo} ${refParameter}`);\n const sha = (\n await this.octokit.rest.repos.getCommit({\n owner,\n repo,\n ref: refParameter,\n mediaType: {\n format: \"sha\",\n },\n })\n ).data as unknown;\n // The TS types don't understand that `mediaType: { format: 'sha' }` turns\n // `.data` into a string, so we have to cast to `unknown` and check\n // ourselves.\n if (typeof sha !== \"string\") {\n throw Error(\"Expected string response\");\n }\n return sha;\n }\n\n async getTreeSHAForPath({\n repoURL,\n commitSHA,\n path,\n }: GetTreeSHAForPathOptions): Promise {\n const allTreesForCommit = await this.allTreesForCommitCache.fetch(\n JSON.stringify({ repoURL, commitSHA }),\n { context: { repoURL, commitSHA } },\n );\n if (!allTreesForCommit) {\n // This shouldn't happen: errors should lead to an error being thrown from\n // the previous line, but the fetchMethod always returns an actual item.\n throw Error(`Unexpected missing entry in allTreesForCommitCache`);\n }\n const shaFromCache = allTreesForCommit.pathToTreeSHA.get(path);\n if (shaFromCache) {\n return shaFromCache;\n }\n // Check if the path is a symlink and follow it (one level only).\n const symlinkTarget = allTreesForCommit.pathToSymlinkTarget.get(path);\n if (symlinkTarget) {\n const resolvedPath = resolveSymlinkTarget(path, symlinkTarget);\n const resolvedSHA = allTreesForCommit.pathToTreeSHA.get(resolvedPath);\n if (resolvedSHA) {\n return resolvedSHA;\n }\n // If the resolved path wasn't in the cache, fall through to the truncated\n // check below.\n }\n if (!allTreesForCommit.truncated) {\n // The recursive listing we got from GitHub is complete, so if it doesn't\n // have the tree in question, then the path just doesn't exist (as a tree)\n // at the given commit.\n return null;\n }\n // Hmm, we haven't heard of this tree but our listing was truncated. Fall\n // back to the one-at-a-time API.\n return this.getTreeSHAForPathViaGetContent({ repoURL, commitSHA, path });\n }\n\n async getSymlinkTarget({\n repoURL,\n commitSHA,\n path,\n }: GetTreeSHAForPathOptions): Promise {\n const allTreesForCommit = await this.allTreesForCommitCache.fetch(\n JSON.stringify({ repoURL, commitSHA }),\n { context: { repoURL, commitSHA } },\n );\n if (!allTreesForCommit) {\n throw Error(`Unexpected missing entry in allTreesForCommitCache`);\n }\n return allTreesForCommit.pathToSymlinkTarget.get(path) ?? null;\n }\n\n // Fall back to asking the GitHub API for the tree hash directly if our cache\n // was truncated.\n private async getTreeSHAForPathViaGetContent({\n repoURL,\n commitSHA,\n path,\n }: GetTreeSHAForPathOptions): Promise {\n const { owner, repo } = parseRepoURL(repoURL);\n this.logAPICall(\"repos.getContent\", `${owner} / ${repo} ${commitSHA}`);\n let data;\n try {\n data = (\n await this.octokit.rest.repos.getContent({\n owner,\n repo,\n ref: commitSHA,\n path,\n mediaType: {\n format: \"object\",\n },\n })\n ).data as unknown;\n } catch (e: unknown) {\n // If it looks like \"not found\" just return null.\n if (typeof e === \"object\" && e && \"status\" in e && e.status === 404) {\n return null;\n }\n throw e;\n }\n // TS types seem confused here too; this works in practice.\n if (\n typeof data === \"object\" &&\n data !== null &&\n \"type\" in data &&\n data.type === \"dir\" &&\n \"sha\" in data &&\n typeof data.sha === \"string\"\n ) {\n return data.sha;\n }\n // If it's a symlink, follow it (one level only).\n if (\n typeof data === \"object\" &&\n data !== null &&\n \"type\" in data &&\n data.type === \"symlink\" &&\n \"target\" in data &&\n typeof data.target === \"string\"\n ) {\n const resolvedPath = resolveSymlinkTarget(path, data.target);\n return this.getTreeSHAForPathViaGetContent({\n repoURL,\n commitSHA,\n path: resolvedPath,\n });\n }\n throw Error(\"response does not appear to be a tree or symlink\");\n }\n\n async getCommitSHAsForPath({\n repoURL,\n ref,\n path,\n }: GetCommitSHAsForPathOptions): Promise {\n const { owner, repo } = parseRepoURL(repoURL);\n this.logAPICall(\"repos.listCommits\", `${owner}/${repo}@${ref} ${path}`);\n return (\n await this.octokit.rest.repos.listCommits({\n owner,\n repo,\n path,\n sha: ref,\n per_page: 100, // max allowed\n })\n ).data\n .map(({ sha }) => sha)\n .reverse(); // Chronological order\n }\n\n async getPullRequest({\n repoURL,\n prNumber,\n }: GetPullRequestForNumberOptions): Promise {\n const { owner, repo } = parseRepoURL(repoURL);\n this.logAPICall(\"pulls.get\", `${owner}/${repo} #${prNumber}`);\n const response = await this.octokit.rest.pulls.get({\n owner,\n repo,\n pull_number: prNumber,\n });\n return {\n state: response.data.state as PullRequestState,\n title: response.data.title,\n closedAt: response.data.closed_at,\n };\n }\n}\n\nexport class CachingGitHubClient {\n constructor(\n private wrapped: GitHubClient,\n dump?: CachingGitHubClientDump | null,\n ) {\n if (dump) {\n this.getTreeSHAForPathCache.load(dump.treeSHAs);\n // Support old cache files that don't have commitSHAs.\n if (dump.commitSHAs) {\n this.getCommitSHAsForPathCache.load(dump.commitSHAs);\n }\n }\n }\n\n private resolveRefToSHACache = new LRUCache<\n string,\n string,\n ResolveRefToSHAOptions\n >({\n max: 1024,\n fetchMethod: async (_key, _staleValue, { context }) => {\n return this.wrapped.resolveRefToSHA(context);\n },\n });\n\n private getTreeSHAForPathCache = new LRUCache<\n string,\n // LRUCache can't store null, so we box it.\n { boxed: string | null },\n GetTreeSHAForPathOptions\n >({\n max: 1024,\n fetchMethod: async (_key, _staleValue, { context }) => {\n return { boxed: await this.wrapped.getTreeSHAForPath(context) };\n },\n });\n\n private getCommitSHAsForPathCache = new LRUCache<\n string,\n string[],\n GetCommitSHAsForPathOptions\n >({\n max: 1024,\n fetchMethod: async (_key, _staleValue, { context }) => {\n return await this.wrapped.getCommitSHAsForPath(context);\n },\n });\n\n // We mainly care about the state of the PR, a very dynamic value, so this cache is only\n // for avoiding repeated lookups within a single action run; we don't save it to the Actions cache.\n private getPullRequestCache = new LRUCache<\n string,\n PullRequest,\n GetPullRequestForNumberOptions\n >({\n max: 512,\n ttl: 1 * 60 * 1000, // 1 minute\n fetchMethod: async (_key, _staleValue, { context }) => {\n return await this.wrapped.getPullRequest(context);\n },\n });\n\n async resolveRefToSHA(options: ResolveRefToSHAOptions): Promise {\n const sha = await this.resolveRefToSHACache.fetch(JSON.stringify(options), {\n context: options,\n });\n if (!sha) {\n throw Error(\n \"resolveRefToSHACache.fetch should never resolve without a real SHA\",\n );\n }\n return sha;\n }\n\n async getTreeSHAForPath(\n options: GetTreeSHAForPathOptions,\n ): Promise {\n const cached = await this.getTreeSHAForPathCache.fetch(\n JSON.stringify(options),\n {\n context: options,\n },\n );\n if (!cached) {\n throw Error(\n \"getTreeSHAForPathCache.fetch should never resolve without a boxed value\",\n );\n }\n return cached.boxed;\n }\n\n async getCommitSHAsForPath(\n options: GetCommitSHAsForPathOptions,\n ): Promise {\n const shas = await this.getCommitSHAsForPathCache.fetch(\n // Make it trivial to tell if a cache key corresponds to a SHA.\n (isSHA(options.ref) ? \"SHA!\" : \"\") + JSON.stringify(options),\n {\n context: options,\n },\n );\n if (!shas) {\n throw Error(\n \"getCommitSHAsForPathCache.fetch should never resolve without a real SHA list\",\n );\n }\n return shas;\n }\n\n async getSymlinkTarget(\n options: GetTreeSHAForPathOptions,\n ): Promise {\n // No caching for symlink targets - they're already cached in the wrapped\n // client's allTreesForCommitCache.\n return this.wrapped.getSymlinkTarget(options);\n }\n\n dump(): CachingGitHubClientDump {\n // We don't dump resolveRefToSHACache because it is not immutable (it tracks\n // the current commits on main, etc).\n return {\n treeSHAs: this.getTreeSHAForPathCache.dump(),\n // While it's fine for us to cache the result of getCommitSHAsForPath\n // in-memory for mutable refs to reduce duplicate API calls within a\n // single execution, we only want to save the cache across executions for\n // the immutable case where the ref is a SHA.\n commitSHAs: this.getCommitSHAsForPathCache\n .dump()\n .filter(([key]) => key.startsWith(\"SHA!\")),\n };\n }\n\n async getPullRequest(\n options: GetPullRequestForNumberOptions,\n ): Promise {\n const pr = await this.getPullRequestCache.fetch(JSON.stringify(options), {\n context: options,\n });\n if (!pr) {\n throw Error(\n \"getPullRequestCache.fetch should never resolve without a real PullRequest\",\n );\n }\n return pr;\n }\n}\n\nexport interface CachingGitHubClientDump {\n treeSHAs: [\n string,\n LRUCache.Entry<{\n boxed: string | null;\n }>,\n ][];\n commitSHAs?: [string, LRUCache.Entry][];\n}\n\nexport function isCachingGitHubClientDump(\n dump: unknown,\n): dump is CachingGitHubClientDump {\n if (!dump || typeof dump !== \"object\") {\n return false;\n }\n if (!(\"treeSHAs\" in dump)) {\n return false;\n }\n const { treeSHAs } = dump;\n if (!Array.isArray(treeSHAs)) {\n return false;\n }\n\n if (\"commitSHAs\" in dump) {\n const { commitSHAs } = dump;\n if (!Array.isArray(commitSHAs)) {\n return false;\n }\n }\n\n // XXX we could check the values further if we want to be more anal\n return true;\n}\n\nexport async function getGitConfigRefPromotionInfo(options: {\n oldRef: string;\n newRef: string;\n repoURL: string;\n path: string;\n gitHubClient: GitHubClient;\n logger: PrefixingLogger;\n}): Promise {\n const { oldRef, newRef, repoURL, path, gitHubClient, logger } = options;\n\n // Check if the path is a symlink at the new ref. If so, we can't reliably\n // determine which commits affected it, so return a message encouraging the\n // user to convert the symlink to a real directory.\n let newRefCommitSHA;\n try {\n newRefCommitSHA = await gitHubClient.resolveRefToSHA({\n repoURL,\n ref: newRef,\n });\n } catch (e) {\n logger.error(`Error resolving ref ${newRef} in ${repoURL}: ${e}`);\n return promotionInfoUnknown(`Error resolving ref ${newRef}`);\n }\n const symlinkTarget = await gitHubClient.getSymlinkTarget({\n repoURL,\n commitSHA: newRefCommitSHA,\n path,\n });\n if (symlinkTarget) {\n const resolvedPath = resolveSymlinkTarget(path, symlinkTarget);\n return promotionInfoUnknown(\n `Path \\`${path}\\` is a symlink to \\`${resolvedPath}\\`. ` +\n `Symlinks are useful during migrations but should be converted to regular directories.`,\n );\n }\n\n // Figure out what commits affect the path in the new version.\n let newCommitSHAs;\n try {\n newCommitSHAs = await gitHubClient.getCommitSHAsForPath({\n repoURL,\n path,\n ref: newRef,\n });\n } catch (e) {\n logger.error(\n `Error loading commit SHAs for path ${repoURL}@${newRef} ${path}: ${e}`,\n );\n return promotionInfoUnknown(`Error loading commit SHAs for ${newRef}`);\n }\n\n // Figure out what commits affect the path previously. We're only going to\n // care about the most recent one and look for it in the list we got from the\n // last call. We don't just want to look for `ref` itself in the list for two\n // reasons: first, ref might not be a SHA, but more importantly, ref might not\n // itself be a commit corresponding to a change in `path`.\n let oldCommitSHAs;\n try {\n oldCommitSHAs = await gitHubClient.getCommitSHAsForPath({\n repoURL,\n path,\n ref: oldRef,\n });\n } catch (e) {\n logger.error(\n `Error loading commit SHAs for path ${repoURL}@${oldRef} ${path}: ${e}`,\n );\n return promotionInfoUnknown(`Error loading commit SHAs for ${oldRef}`);\n }\n\n if (oldCommitSHAs.length === 0) {\n return promotionInfoUnknown(`No commits found under ${path} at ${oldRef}.`);\n }\n const oldCommitSHAAtPath = oldCommitSHAs[oldCommitSHAs.length - 1];\n const oldIndexInNew = newCommitSHAs.indexOf(oldCommitSHAAtPath);\n if (oldIndexInNew === -1) {\n return promotionInfoUnknown(\n `Old commit ${oldCommitSHAAtPath} not found in recent history of ${newRef} at ${path}.`,\n );\n }\n if (oldIndexInNew + 1 === newCommitSHAs.length) {\n return { type: \"no-commits\" };\n }\n // Return the commits later than the old ones.\n return promotionInfoCommits(newCommitSHAs.slice(oldIndexInNew + 1));\n}\n","/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.21';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function',\n INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading whitespace. */\n var reTrimStart = /^\\s+/;\n\n /** Used to match a single whitespace character. */\n var reWhitespace = /\\s/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\n var reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n 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',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** 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/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n 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 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\n function baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\n function trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '

' + func(text) + '

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

fred, barney, & pebbles

'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '